From d9e2479b08e69f759a3ea07832b1f36782c497c5 Mon Sep 17 00:00:00 2001 From: Tomas Bjerre Date: Thu, 3 Oct 2019 16:19:07 +0200 Subject: [PATCH] Removing deprecated dependency on AJS.contextPath() #347 --- CHANGELOG.md | 10 ++++++++++ src/main/resources/admin.js | 11 ++++++----- src/main/resources/atlassian-plugin.xml | 2 ++ src/main/resources/pr-triggerbutton.js | 7 ++++--- src/main/resources/utils.js | 9 +++++---- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15a8c681..c1e2e2af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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* diff --git a/src/main/resources/admin.js b/src/main/resources/admin.js index 5f258880..ff50077e 100644 --- a/src/main/resources/admin.js +++ b/src/main/resources/admin.js @@ -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; diff --git a/src/main/resources/atlassian-plugin.xml b/src/main/resources/atlassian-plugin.xml index b5a55ea5..199a23e3 100644 --- a/src/main/resources/atlassian-plugin.xml +++ b/src/main/resources/atlassian-plugin.xml @@ -33,6 +33,7 @@ com.atlassian.auiplugin:ajs + com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path @@ -67,6 +68,7 @@ com.atlassian.bitbucket.bitbucket-web-plugin:global com.atlassian.auiplugin:ajs + com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path bitbucket.page.pullRequest.view \ No newline at end of file diff --git a/src/main/resources/pr-triggerbutton.js b/src/main/resources/pr-triggerbutton.js index 136894b3..42be4fd1 100644 --- a/src/main/resources/pr-triggerbutton.js +++ b/src/main/resources/pr-triggerbutton.js @@ -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 = 'Wait'; var $buttonArea = $('#pull-request-header-more').find('.aui-button').first().closest('ul'); diff --git a/src/main/resources/utils.js b/src/main/resources/utils.js index 7988cc56..74dfc402 100644 --- a/src/main/resources/utils.js +++ b/src/main/resources/utils.js @@ -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(); @@ -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); }); @@ -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); });