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

Commit

Permalink
Removing deprecated dependency on AJS.contextPath() #347
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Oct 3, 2019
1 parent 1797236 commit d9e2479
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Changelog of Pull Request Notifier for Bitbucket.

## Unreleased
### No issue
Removing deprecated dependency on AJS.contextPath()

[1ed35c86b06ea32](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/1ed35c86b06ea32) Tomas Bjerre *2019-10-03 14:19:07*

Correcting custom keystore

Using custom keystore even if "Accept Any Certificate" is disabled.

[17972362e075e99](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/17972362e075e99) Tomas Bjerre *2019-10-03 14:09:30*

doc

[0965b48f845c45b](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/0965b48f845c45b) Tomas Bjerre *2019-10-01 14:37:09*
Expand Down
11 changes: 6 additions & 5 deletions src/main/resources/admin.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
define('plugin/prnfb/admin', [
'jquery',
'@atlassian/aui',
'plugin/prnfb/utils'
], function($, AJS, utils) {
var settingsAdminUrlPostUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings";
'plugin/prnfb/utils',
'wrm/context-path'
], function($, AJS, utils, contextPath) {
var settingsAdminUrlPostUrl = contextPath + "/rest/prnfb-admin/1.0/settings";
var settingsAdminUrl = settingsAdminUrlPostUrl;

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

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

var projectKey;
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/atlassian-plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<web-resource name="Admin Web Resources" key="resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<dependency>com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path</dependency>
<resource type="download" name="3rdparty.js" location="3rdparty.js" />
<resource type="download" name="utils.js" location="utils.js" />
<resource type="download" name="admin.js" location="admin.js" />
Expand Down Expand Up @@ -67,6 +68,7 @@
<resource type="download" name="pr-triggerbutton.js" location="/pr-triggerbutton.js" />
<dependency>com.atlassian.bitbucket.bitbucket-web-plugin:global</dependency>
<dependency>com.atlassian.auiplugin:ajs</dependency>
<dependency>com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path</dependency>
<context>bitbucket.page.pullRequest.view</context>
</web-resource>
</atlassian-plugin>
7 changes: 4 additions & 3 deletions src/main/resources/pr-triggerbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ define('plugin/prnfb/pr-triggerbutton', [
'@atlassian/aui',
'bitbucket/util/state',
'underscore',
'plugin/prnfb/3rdparty'
], function($, AJS, pageState, _, thirdParty) {
var buttonsAdminUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings/buttons";
'plugin/prnfb/3rdparty',
'wrm/context-path'
], function($, AJS, pageState, _, thirdParty, contextPath) {
var buttonsAdminUrl = contextPath + "/rest/prnfb-admin/1.0/settings/buttons";

var waiting = '<span class="aui-icon aui-icon-wait aui-icon-small">Wait</span>';
var $buttonArea = $('#pull-request-header-more').find('.aui-button').first().closest('ul');
Expand Down
9 changes: 5 additions & 4 deletions src/main/resources/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
define('plugin/prnfb/utils', [
'jquery',
'plugin/prnfb/3rdparty'
], function($, trdparty) {
'plugin/prnfb/3rdparty',
'wrm/context-path'
], function($, trdparty, contextPath) {

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

function getProjects(whenDone) {
var projectsUrl = AJS.contextPath() + "/rest/api/1.0/projects?limit=999999";
var projectsUrl = contextPath + "/rest/api/1.0/projects?limit=999999";
$.getJSON(projectsUrl, function(data) {
whenDone(data);
});
Expand Down Expand Up @@ -90,7 +91,7 @@ define('plugin/prnfb/utils', [
whenDone();
return;
}
var reposUrl = AJS.contextPath() + "/rest/api/1.0/projects/" + projectKey + "/repos?limit=999999";
var reposUrl = contextPath + "/rest/api/1.0/projects/" + projectKey + "/repos?limit=999999";
$.getJSON(reposUrl, function(data) {
whenDone(data);
});
Expand Down

0 comments on commit d9e2479

Please sign in to comment.