Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit d9e2479

Browse files
committed
Removing deprecated dependency on AJS.contextPath() #347
1 parent 1797236 commit d9e2479

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ Changelog of Pull Request Notifier for Bitbucket.
44

55
## Unreleased
66
### No issue
7+
Removing deprecated dependency on AJS.contextPath()
8+
9+
[1ed35c86b06ea32](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/1ed35c86b06ea32) Tomas Bjerre *2019-10-03 14:19:07*
10+
11+
Correcting custom keystore
12+
13+
Using custom keystore even if "Accept Any Certificate" is disabled.
14+
15+
[17972362e075e99](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/17972362e075e99) Tomas Bjerre *2019-10-03 14:09:30*
16+
717
doc
818

919
[0965b48f845c45b](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/0965b48f845c45b) Tomas Bjerre *2019-10-01 14:37:09*

src/main/resources/admin.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
define('plugin/prnfb/admin', [
22
'jquery',
33
'@atlassian/aui',
4-
'plugin/prnfb/utils'
5-
], function($, AJS, utils) {
6-
var settingsAdminUrlPostUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings";
4+
'plugin/prnfb/utils',
5+
'wrm/context-path'
6+
], function($, AJS, utils, contextPath) {
7+
var settingsAdminUrlPostUrl = contextPath + "/rest/prnfb-admin/1.0/settings";
78
var settingsAdminUrl = settingsAdminUrlPostUrl;
89

9-
var notificationsAdminUrlPostUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings/notifications";
10+
var notificationsAdminUrlPostUrl = contextPath + "/rest/prnfb-admin/1.0/settings/notifications";
1011
var notificationsAdminUrl = notificationsAdminUrlPostUrl;
1112

12-
var buttonsAdminUrlPostUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings/buttons";
13+
var buttonsAdminUrlPostUrl = contextPath + "/rest/prnfb-admin/1.0/settings/buttons";
1314
var buttonsAdminUrl = buttonsAdminUrlPostUrl;
1415

1516
var projectKey;

src/main/resources/atlassian-plugin.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
<web-resource name="Admin Web Resources" key="resources">
3535
<dependency>com.atlassian.auiplugin:ajs</dependency>
36+
<dependency>com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path</dependency>
3637
<resource type="download" name="3rdparty.js" location="3rdparty.js" />
3738
<resource type="download" name="utils.js" location="utils.js" />
3839
<resource type="download" name="admin.js" location="admin.js" />
@@ -67,6 +68,7 @@
6768
<resource type="download" name="pr-triggerbutton.js" location="/pr-triggerbutton.js" />
6869
<dependency>com.atlassian.bitbucket.bitbucket-web-plugin:global</dependency>
6970
<dependency>com.atlassian.auiplugin:ajs</dependency>
71+
<dependency>com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path</dependency>
7072
<context>bitbucket.page.pullRequest.view</context>
7173
</web-resource>
7274
</atlassian-plugin>

src/main/resources/pr-triggerbutton.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ define('plugin/prnfb/pr-triggerbutton', [
33
'@atlassian/aui',
44
'bitbucket/util/state',
55
'underscore',
6-
'plugin/prnfb/3rdparty'
7-
], function($, AJS, pageState, _, thirdParty) {
8-
var buttonsAdminUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings/buttons";
6+
'plugin/prnfb/3rdparty',
7+
'wrm/context-path'
8+
], function($, AJS, pageState, _, thirdParty, contextPath) {
9+
var buttonsAdminUrl = contextPath + "/rest/prnfb-admin/1.0/settings/buttons";
910

1011
var waiting = '<span class="aui-icon aui-icon-wait aui-icon-small">Wait</span>';
1112
var $buttonArea = $('#pull-request-header-more').find('.aui-button').first().closest('ul');

src/main/resources/utils.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
define('plugin/prnfb/utils', [
22
'jquery',
3-
'plugin/prnfb/3rdparty'
4-
], function($, trdparty) {
3+
'plugin/prnfb/3rdparty',
4+
'wrm/context-path'
5+
], function($, trdparty, contextPath) {
56

67
function postForm(url, formSelector, whenDone) {
78
$('.statusresponse').empty();
@@ -59,7 +60,7 @@ define('plugin/prnfb/utils', [
5960
}
6061

6162
function getProjects(whenDone) {
62-
var projectsUrl = AJS.contextPath() + "/rest/api/1.0/projects?limit=999999";
63+
var projectsUrl = contextPath + "/rest/api/1.0/projects?limit=999999";
6364
$.getJSON(projectsUrl, function(data) {
6465
whenDone(data);
6566
});
@@ -90,7 +91,7 @@ define('plugin/prnfb/utils', [
9091
whenDone();
9192
return;
9293
}
93-
var reposUrl = AJS.contextPath() + "/rest/api/1.0/projects/" + projectKey + "/repos?limit=999999";
94+
var reposUrl = contextPath + "/rest/api/1.0/projects/" + projectKey + "/repos?limit=999999";
9495
$.getJSON(reposUrl, function(data) {
9596
whenDone(data);
9697
});

0 commit comments

Comments
 (0)