@atlassian/clientside-extensions-docs 2.2.0-rc-1 → 2.2.1-docs-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/server/framework/clientside-extensions/get-help.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/creating-an-extension-point.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/extension-point-documentation.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/index.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/providing-context.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/rendering-extensions.md +1 -1
- package/content/server/framework/clientside-extensions/guides/how-to/debugging-and-troubleshooting-an-extension/asd-finding-web-resource.png +0 -0
- package/content/server/framework/clientside-extensions/guides/how-to/debugging-and-troubleshooting-an-extension/plugin-troubleshooting.png +0 -0
- package/content/server/framework/clientside-extensions/guides/how-to/debugging-and-troubleshooting-an-extension/validation-error.png +0 -0
- package/content/server/framework/clientside-extensions/guides/how-to/debugging-and-troubleshooting-an-extension.md +169 -0
- package/content/server/framework/clientside-extensions/guides/how-to/setup-page-bootstrapper.md +2 -2
- package/content/server/framework/clientside-extensions/guides/how-to/setup-schema-loader.md +1 -1
- package/content/server/framework/clientside-extensions/guides/how-to/setup-webpack-plugin.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/creating-a-modal.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/creating-a-page.md +2 -2
- package/content/server/framework/clientside-extensions/guides/introduction/creating-an-extension.md +11 -1
- package/content/server/framework/clientside-extensions/guides/introduction/custom-HTML-content.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/discovering-extension-points.md +2 -2
- package/content/server/framework/clientside-extensions/guides/introduction/index.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/using-extension-api.md +1 -1
- package/content/server/framework/clientside-extensions/images/discovering-extension-points-information.png +0 -0
- package/content/server/framework/clientside-extensions/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-api/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-api/render-element-as-react.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/async-panel.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/button.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/link.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/modal.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/page.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/panel.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points/hooks-and-components.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points/schemas.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points-v1-deprecated.md +1 -1
- package/content/server/framework/clientside-extensions/reference/glossary/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/webpack-plugin/annotations.md +1 -1
- package/content/server/framework/clientside-extensions/reference/webpack-plugin/webpack-plugin.md +1 -1
- package/data/clientside-extensions.json +4 -0
- package/package.json +4 -4
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: null
|
|
3
|
+
platform: server
|
|
4
|
+
product: clientside-extensions
|
|
5
|
+
category: devguide
|
|
6
|
+
subcategory: how-to
|
|
7
|
+
date: '2021-05-24'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Debugging and troubleshooting an extension
|
|
11
|
+
|
|
12
|
+
Debugging an extension point can help you find out why your extension is not working as it should. This page describes how to debug a Client-Side Extension, including:
|
|
13
|
+
|
|
14
|
+
- How to identify if the extension was loaded on the page
|
|
15
|
+
- Why the extension didn't show up on the page
|
|
16
|
+
|
|
17
|
+
This guide assumes you are an extension developer (plugin developer), and you [created an extension](/server/framework/clientside-extensions/guides/introduction/creating-an-extension/) that doesn't work for some unknown reason.
|
|
18
|
+
|
|
19
|
+
This guide requires basic knowledge about the Atlassian plugin system and some experience with debugging HTML applications by using the browser DevTools. To troubleshoot an extension, you should know:
|
|
20
|
+
|
|
21
|
+
- How to turn on [browser DevTools](https://developer.chrome.com/docs/devtools/) and how to use the console panel.
|
|
22
|
+
- How to install browser extensions.
|
|
23
|
+
- How to use [`altas` CLI commands](/server/framework/atlassian-sdk/atlas-cli/).
|
|
24
|
+
|
|
25
|
+
You should also know:
|
|
26
|
+
|
|
27
|
+
- Your Atlassian **plugin key**, that can be found in the `atlassian-plugin.xml` file.
|
|
28
|
+
|
|
29
|
+
## How to check whether the extension loaded on the page
|
|
30
|
+
|
|
31
|
+
Before you start troubleshooting the extension code, first, you should first ensure that the Atlassian plugin system loaded your plugin and that your extension was loaded on the page.
|
|
32
|
+
|
|
33
|
+
### Check if your plugin was loaded
|
|
34
|
+
|
|
35
|
+
1. First, you need to start the application, open the web browser, and navigate to the administration panel.
|
|
36
|
+
2. Next, find and navigate to the **Manage Apps** page.
|
|
37
|
+
3. On the list of all installed plugins, locate your plugin using **App key** (**plugin key**), and check whether all the plugin's modules are enabled:
|
|
38
|
+
|
|
39
|
+

|
|
40
|
+
|
|
41
|
+
4. If your plugin is on the list and all the modules are enabled, you can proceed to the next step.
|
|
42
|
+
|
|
43
|
+
{{% tip %}}
|
|
44
|
+
|
|
45
|
+
If you haven't found the plugin on the list, you should try checking and inspecting the application log files. Depending on the application you are running the logs might be located in a different locations:
|
|
46
|
+
|
|
47
|
+
- [Logging and profiling Jira](https://confluence.atlassian.com/adminjiraserver/logging-and-profiling-938847671.html)
|
|
48
|
+
- [Working with Confluence Logs](https://confluence.atlassian.com/doc/working-with-confluence-logs-108364721.html)
|
|
49
|
+
- [Configure Bitbucket Server Logging](https://confluence.atlassian.com/bitbucketserverkb/configure-bitbucket-server-logging-779171678.html)
|
|
50
|
+
|
|
51
|
+
{{% /tip %}}
|
|
52
|
+
|
|
53
|
+
### Check if the extension was loaded
|
|
54
|
+
|
|
55
|
+
Now that you know your plugin was loaded, you can check if the extension was loaded on the page.
|
|
56
|
+
|
|
57
|
+
1. Install the **[ASD Chrome extension](https://chrome.google.com/webstore/detail/atlassian-server-devtools/ifdlelpkchpppgmhmidenfmlhdafbnke)**. Open a web browser, turn on the DevTools and select the **ASD** tab.
|
|
58
|
+
2. Navigate to the page where you should see the extension point.
|
|
59
|
+
3. If the extension point is located in a different tab, e.g. Diff tab, select this tab on the page.
|
|
60
|
+
4. Now, in the DevTools window, select the **ASD** tab and choose the **WRM Inspector** option.
|
|
61
|
+
5. The **WRM inspector** allows you to see a list of all the web-resources loaded on the page. To filter the list and find a web-resource with your extension code:
|
|
62
|
+
|
|
63
|
+
- Click on the **All context** option and select the name of the extension point
|
|
64
|
+
- In the **Filter** field, type in part of your plugin name
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
6. If you can find your web-resource on the list, it means that your extension was configured correctly, and it can be loaded on the page.
|
|
69
|
+
|
|
70
|
+
{{% warning %}}
|
|
71
|
+
|
|
72
|
+
If you can't find the **web-resource** with your extension, please check if the configuration of the webpack CSE plugin is correct. For more information refer to the guides:
|
|
73
|
+
|
|
74
|
+
- [Setting up the CSE webpack plugin](/server/framework/clientside-extensions/guides/how-to/setup-webpack-plugin)
|
|
75
|
+
- [Creating an Extension](/server/framework/clientside-extensions/guides/introduction/creating-an-extension)
|
|
76
|
+
|
|
77
|
+
{{% /warning %}}
|
|
78
|
+
|
|
79
|
+
## What to do when the extension did load but is not rendered on the page?
|
|
80
|
+
|
|
81
|
+
CSE includes a debug mode that is disabled by default. You can enable the debug mode programmatically using the APIs from the `@atlassian/clientside-extensions-debug` package.
|
|
82
|
+
|
|
83
|
+
To enable the runtime debug mode in your extension, follow these steps.
|
|
84
|
+
|
|
85
|
+
1. Install the `@atlassian/clientside-extensions-debug` package:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
yarn add -D @atlassian/clientside-extensions-debug
|
|
89
|
+
|
|
90
|
+
# or
|
|
91
|
+
|
|
92
|
+
npm install --save-dev @atlassian/clientside-extensions-debug
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
2. Next, import the debug module in your code and use debug functions:
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
// my-extension.js
|
|
99
|
+
import { ModalExtension } from '@atlassian/clientside-extensions';
|
|
100
|
+
// 1. Add package
|
|
101
|
+
import { setDebugEnabled, setLoggingEnabled } from '@atlassian/clientside-extensions-debug';
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @clientside-extension
|
|
105
|
+
* @extension-point bitbucket.ui.pullrequest.overview.summary
|
|
106
|
+
*/
|
|
107
|
+
export default ModalExtension.factory((extensionAPI, context) => {
|
|
108
|
+
// 2. Turn on the debug mode and enable logging
|
|
109
|
+
setDebugEnabled(true);
|
|
110
|
+
setLoggingEnabled(true);
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
label: 'Click to open a modal',
|
|
114
|
+
onAction: modalAPI => {
|
|
115
|
+
modalAPI.setTitle('Look, a Modal!');
|
|
116
|
+
modalAPI.onMount(container => {
|
|
117
|
+
container.innerHTML = '<p>Hello World!</p>';
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
3. If you are using webpack with watch mode, you should see the page reload after saving the changes.
|
|
125
|
+
If not, use the [`atlas-package -DskipTests`](/server/framework/atlassian-sdk/atlas-package) command to rebuild your plugin and once it's done, manually refresh the page.
|
|
126
|
+
4. Open the browser's developer tools and select the **Console** tab. In the same browser window, navigate to the page that should render your extension.
|
|
127
|
+
5. If your extension is causing any problems you should see relevant information in the console tab, .e.g.
|
|
128
|
+
|
|
129
|
+

|
|
130
|
+
|
|
131
|
+
6. Taking a look at the example image with the error:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Schema validation issue with extension "<<extension name>>":
|
|
135
|
+
"Schema" failed to validate. Attribute "`iconBefore`" of type `IconType`! is missing in "Schema".
|
|
136
|
+
|
|
137
|
+
Meta information:
|
|
138
|
+
|
|
139
|
+
- location: `bitbucket.ui.pullrequest.overview.summary`
|
|
140
|
+
- extension: <<extension name>>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The example validation error is showing information on what attributes are missing for the `bitbucket.ui.pullrequest.overview.summary` extension point. In this case, we need to provide the `iconBefore` attribute that is required.
|
|
144
|
+
|
|
145
|
+
{{% tip %}}
|
|
146
|
+
|
|
147
|
+
The above error is caused by missing required attributes.
|
|
148
|
+
|
|
149
|
+
To catch mistakes like this sooner in development, you can turn on the [discovery mode](/server/framework/clientside-extensions/guides/introduction/discovering-extension-points/#revealing-extension-points-on-the-page) which will reveal location of extension points, and the list of required attributes for a given extension point.
|
|
150
|
+
|
|
151
|
+
{{% /tip %}}
|
|
152
|
+
|
|
153
|
+
{{% warning %}}
|
|
154
|
+
|
|
155
|
+
Remember to include the `*-debug` package and turning the debug mode only in the **development** environment.
|
|
156
|
+
|
|
157
|
+
The extension code shouldn't include the, e.g. `setDebugEnabled(true)` calls when you create a **production** version of the plugin.
|
|
158
|
+
|
|
159
|
+
{{% /warning %}}
|
|
160
|
+
|
|
161
|
+
## Further help
|
|
162
|
+
|
|
163
|
+
If you followed the guide but are still not sure why the extension doesn't work, you can [report the issue in the Client-side Extensions project](https://ecosystem.atlassian.net/browse/CSE).
|
|
164
|
+
|
|
165
|
+
Click on the create button and provide the reproduction steps. Please include as much information as you can, including:
|
|
166
|
+
|
|
167
|
+
- Application name and version
|
|
168
|
+
- A version of CSE modules you are using
|
|
169
|
+
- Browser vendor name and version
|
package/content/server/framework/clientside-extensions/guides/how-to/setup-page-bootstrapper.md
CHANGED
|
@@ -4,7 +4,7 @@ platform: server
|
|
|
4
4
|
product: clientside-extensions
|
|
5
5
|
category: devguide
|
|
6
6
|
subcategory: how-to
|
|
7
|
-
date: '2021-
|
|
7
|
+
date: '2021-05-19'
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Setting up the CSE page bootstrapper
|
|
@@ -74,7 +74,7 @@ include the dependency when starting the project with AMPS.
|
|
|
74
74
|
If you want to learn more about this practice, read
|
|
75
75
|
[bundling extra dependencies in a OBR](https://developer.atlassian.com/server/framework/atlassian-sdk/bundling-extra-dependencies-in-an-obr/)
|
|
76
76
|
|
|
77
|
-
In your `pom.xml` file, find your declaration of the Maven plugin for the product you're targeting (e.g
|
|
77
|
+
In your `pom.xml` file, find your declaration of the Maven plugin for the product you're targeting (e.g.: `bitbucket-maven-plugin`), and:
|
|
78
78
|
|
|
79
79
|
- Import the `com.atlassian.plugin.clientsideextensions` package.
|
|
80
80
|
- Include the `atlassian-clientside-extensions-page-bootstrapper` as a plugin dependency.
|
package/content/server/framework/clientside-extensions/guides/introduction/creating-a-page.md
CHANGED
|
@@ -4,7 +4,7 @@ platform: server
|
|
|
4
4
|
product: clientside-extensions
|
|
5
5
|
category: devguide
|
|
6
6
|
subcategory: introduction
|
|
7
|
-
date: '2021-
|
|
7
|
+
date: '2021-05-19'
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Creating a page
|
|
@@ -155,7 +155,7 @@ Rebuild your plugin with `atlas-package -DskipTests`, refresh your browser and n
|
|
|
155
155
|
|
|
156
156
|
CSE provides a page extension factory to make it easier to create pages, especially when using TypeScript. This factory is a bit different than the others though.
|
|
157
157
|
|
|
158
|
-
You may have noticed that the callback it receives doesn't return any attributes (like e.g
|
|
158
|
+
You may have noticed that the callback it receives doesn't return any attributes (like e.g.: buttons or panels).
|
|
159
159
|
That's because pages don't need an API to interact with products since they control the whole page.
|
|
160
160
|
|
|
161
161
|
The callback only receives a container created by the CSE page bootstrapper where you can render your content, and
|
package/content/server/framework/clientside-extensions/guides/introduction/creating-an-extension.md
CHANGED
|
@@ -4,7 +4,7 @@ platform: server
|
|
|
4
4
|
product: clientside-extensions
|
|
5
5
|
category: devguide
|
|
6
6
|
subcategory: introduction
|
|
7
|
-
date: '2021-
|
|
7
|
+
date: '2021-05-19'
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Creating an Extension
|
|
@@ -78,6 +78,14 @@ Each factory receives a callback as an argument. This callback should always ret
|
|
|
78
78
|
Attributes will be picked up by products and used to render your extension. In this case, you're specifying a label for your
|
|
79
79
|
link and a URL where the user will be redirected when clicked. Bitbucket is using that information to render your link.
|
|
80
80
|
|
|
81
|
+
{{% tip %}}
|
|
82
|
+
|
|
83
|
+
Always remember to check the documentation of each product's extension point and supported attributes.
|
|
84
|
+
|
|
85
|
+
You will read more information about [revealing extension points on the page](/server/framework/clientside-extensions/guides/introduction/discovering-extension-points/#revealing-extension-points-on-the-page) in the next part of the guide.
|
|
86
|
+
|
|
87
|
+
{{% /tip %}}
|
|
88
|
+
|
|
81
89
|
## Comment annotations
|
|
82
90
|
|
|
83
91
|
After defining your extension as a link with LinkExtension, you need to register it as part of your Atlassian Plugin.
|
|
@@ -107,6 +115,7 @@ import { LinkExtension } from '@atlassian/clientside-extensions';
|
|
|
107
115
|
export default LinkExtension.factory(() => {
|
|
108
116
|
return {
|
|
109
117
|
label: 'Extensions are awesome!',
|
|
118
|
+
iconBefore: 'app-access',
|
|
110
119
|
url: 'https://go.atlassian.com/clientside-extensions',
|
|
111
120
|
};
|
|
112
121
|
});
|
|
@@ -164,6 +173,7 @@ import { ButtonExtension } from '@atlassian/clientside-extensions';
|
|
|
164
173
|
export default ButtonExtension.factory(() => {
|
|
165
174
|
return {
|
|
166
175
|
label: 'Extensions are awesome!',
|
|
176
|
+
iconBefore: 'app-access',
|
|
167
177
|
onAction: () => {
|
|
168
178
|
alert('They are awesome indeed!');
|
|
169
179
|
},
|
|
@@ -4,7 +4,7 @@ platform: server
|
|
|
4
4
|
product: clientside-extensions
|
|
5
5
|
category: devguide
|
|
6
6
|
subcategory: introduction
|
|
7
|
-
date: '2021-
|
|
7
|
+
date: '2021-05-19'
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Discovering extension points
|
|
@@ -25,7 +25,7 @@ Client-side Extensions (CSE) comes with some developer tools baked in to help yo
|
|
|
25
25
|
|
|
26
26
|
To activate it, you need to go to a page that you know is using CSE and set the query parameter `?clientside-extensions` in the URL.
|
|
27
27
|
|
|
28
|
-
1. Navigate to the PR you created for testing CSE (e.g
|
|
28
|
+
1. Navigate to the PR you created for testing CSE (e.g.: http://localhost:7990/bitbucket/projects/PROJECT_1/repos/rep_1/pull-requests/1/)
|
|
29
29
|
2. Add this query parameter to the URL: `?clientside-extensions`.
|
|
30
30
|
|
|
31
31
|
You should see a glowing blue circle icon in the places where extension points are available.
|
|
Binary file
|
|
@@ -88,6 +88,10 @@
|
|
|
88
88
|
{
|
|
89
89
|
"title": "Setup CSE schema-loader",
|
|
90
90
|
"url": "/server/framework/clientside-extensions/guides/how-to/setup-schema-loader"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"title": "Debugging and troubleshooting an extension",
|
|
94
|
+
"url": "/server/framework/clientside-extensions/guides/how-to/debugging-and-troubleshooting-an-extension"
|
|
91
95
|
}
|
|
92
96
|
]
|
|
93
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlassian/clientside-extensions-docs",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1-docs-1",
|
|
4
4
|
"description": "Holds the official documentation for Altassian Server client-side extensions API.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"homepage": "https://bitbucket.org/atlassian/atlassian-clientside-extensions#readme",
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"set-last-updated": "doc-scripts set-last-updated",
|
|
74
74
|
"version": "SKIP_VERSION_CHECK=true doc-scripts version",
|
|
75
75
|
"link-check": "doc-scripts link-check",
|
|
76
|
-
"
|
|
76
|
+
"prepublishOnly": "SKIP_VERSION_CHECK=true doc-scripts validate",
|
|
77
77
|
"prepack": "SKIP_VERSION_CHECK=true doc-scripts set-last-updated",
|
|
78
78
|
"doc-scripts": "doc-scripts"
|
|
79
79
|
},
|
|
80
80
|
"optionalDependencies": {
|
|
81
|
-
"@atlassian/doc-scripts": "^2.
|
|
81
|
+
"@atlassian/doc-scripts": "^2.7.5"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "39444df70a849f8b04de5768cae26d3b5de94cec"
|
|
84
84
|
}
|