Extension Factories
Extension API
Extension Points

Rate this page:

Panel

A panel extension allows the creation of custom HTML content in a container provided by the plugin system.

Supported attributes

NameTypeDescription
weightnumber

Determines the order in which this extension appears respect to others in the same location.

Extensions are displayed top to bottom or left to right in order of ascending weight.

onAction *function

signature: (panelAPI) => void

Method to be called when the product is ready to render the panel. The plugin system will provide an API with lifecycles to render/clean up any current content into a provided container.

Refer to Panel API documentation for more info.

* required

Always remember to check the documentation of each product's extension point and supported attributes.

Read more information about Revealing extension points on the page.

Supported annotations

NameTypeDescription
@clientside-extension *-Indicates that the next function is an extension factory to be consumed by the webpack plugin.
@extension-point *stringDefines the location where the extension will be rendered.
@conditionstring | Conditions

Defines one or multiple conditions that must be satisfied for the extension to be displayed.

The conditions are evaluated on the server, and created with Java.

If one of the conditions is not met, the code of the extension won't be loaded in the client.

For more information about the conditions please refer to the examples of Web items documentation.

* required

Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { PanelExtension } from '@atlassian/clientside-extensions';

/**
 * @clientside-extension
 * @extension-point reff.plugins-example-location
 */
export default PanelExtension.factory(() => {
    return {
        onAction: (panelApi) => {
            panelApi
                .onMount((container) => {
                    // use the container to render your content in it
                })
                .onUnmount((container) => {
                    // run your clean up code. e.g. stop listening to events, unmount your component from the container.
                });
        },
    };
});

With context definition

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { PanelExtension } from '@atlassian/clientside-extensions';

interface ExampleContext {
    issueId: string;
    title: string;
}

/**
 * @clientside-extension
 * @extension-point reff.plugins-example-location
 */
export default PanelExtension.factory<ExampleContext>((extensionAPI, context) => {
    return {
        onAction(panelApi) {
            panelApi.onMount((container) => {
                container.innerHTML = `
                  <h1>${context.title}</h1>
                  <p>Jira issue id: ${context.issueId}</p>
                `;
            });
        },
    };
});

Rate this page: