Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,466,071
Community Members
 
Community Events
176
Community Groups

Custom wiki renderer collapsed by default?! and how to get Preview and Undo buttons?

Edited

After upgrading from Jira 8.5 to 8.20.11, my custom wiki-style renderer (which extends the AtlassianWikiRenderer) is not shown properly any more.

This is how the description is rendered with my renderer on the regular issue page:

image.png

When opening the quick-edit popup via the "Edit" button, the description is shown like this - the text is not visible:

image.png

I can pull down the text field with the highlighted control, then the text is properly displayed and I can edit it. Checking the html code reveals that the textarea-tag has the following attribute, which is probably why the text is not visible:

style="overflow: hidden; height: 0px;"

This is how the field looks like with the Jira "Wiki Style Renderer":

image.png

It is properly sized and it has additional buttons for preview and for undo/redo.

Question 1: how can I fix my own renderer to be shown properly again in the Quick-edit dialog?

Question 2: how can I get the Preview and undo/redo buttons into my custom renderer?


This is how I implemented my renderer:

package com.example.renderer;

import com.atlassian.event.api.EventPublisher;
import com.atlassian.jira.component.pico.ComponentManager;
import com.atlassian.jira.config.FeatureManager;
import com.atlassian.jira.config.properties.ApplicationProperties;
import com.atlassian.jira.issue.fields.renderer.IssueRenderContext;
import com.atlassian.jira.issue.fields.renderer.wiki.AtlassianWikiRenderer;
import com.atlassian.jira.util.velocity.VelocityRequestContextFactory;
import com.atlassian.plugin.spring.scanner.annotation.component.JiraComponent;
import com.atlassian.plugin.spring.scanner.annotation.imports.JiraImport;
import javax.inject.Inject;

@JiraComponent
public class MyWikiRenderer extends AtlassianWikiRenderer {

private static final String TYPE = "my-wiki-renderer";

@Inject
public MyWikiRenderer( // @JiraImport EventPublisher eventPlublisher,
@JiraImport ApplicationProperties applicationProperties,
@JiraImport VelocityRequestContextFactory velocityRequestContextFactory,
@JiraImport FeatureManager featureManager) {
// Using EventPublisher with import annotation yields an exception in the log:
// "No qualifying bean of type 'com.atlassian.event.api.EventPublisher' available"
// but getting it via ComponentManager works fine:
super(ComponentManager.getInstance().getComponentInstanceOfType(EventPublisher.class),
applicationProperties, velocityRequestContextFactory, featureManager);
}

@Override
public String getRendererType() {
return TYPE;
}

@Override
public String render(String string, IssueRenderContext issueRenderContext) {
final String renderedString = super.render(string, issueRenderContext);
// custom code...
return renderedString;
}
}

This is how it's registered in atlassian-plugin.xml:

<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}"
plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
</plugin-info>

<jira-renderer system="true" key="custom-renderer"
name="My Wiki Style Renderer" class="com.example.renderer.MyWikiRenderer">
<description>My extended wiki style renderer.</description>
<resource type="velocity" name="edit"
location="templates/plugins/renderers/wiki/wiki-renderer-edit.vm" />
</jira-renderer>
</atlassian-plugin>

 

0 answers

Suggest an answer

Log in or Sign up to answer