From 6183806c21e7ffdd1d1d5e29af2c1e3641080806 Mon Sep 17 00:00:00 2001 From: api Date: Mon, 22 Jan 2024 11:19:06 +0100 Subject: [PATCH] Issue #305: revert changes for preventing REST calls as they may have unindented impact on other functionality --- .../js/banner/update-slack-link-banner.js | 13 +------------ .../src/main/resources/token/token-status.js | 19 ++----------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/jira-slack-server-integration/jira-slack-server-integration-plugin/src/main/resources/js/banner/update-slack-link-banner.js b/jira-slack-server-integration/jira-slack-server-integration-plugin/src/main/resources/js/banner/update-slack-link-banner.js index 6c296f28..5f7e12d1 100644 --- a/jira-slack-server-integration/jira-slack-server-integration-plugin/src/main/resources/js/banner/update-slack-link-banner.js +++ b/jira-slack-server-integration/jira-slack-server-integration-plugin/src/main/resources/js/banner/update-slack-link-banner.js @@ -12,12 +12,8 @@ require([ jsCookies ) { var SLACK_ADMIN_BANNER_COOKIE_KEY = "SLACK_ADMIN_BANNER_DISMISS_2"; - AJS.toInit(function () { - - - if (!isSlackConfigurationPage() && loggedInUser.isAdmin() && !isAlreadyDismissed() - && (isInIssueView() && isSlackPanelVisible())) { + if (!isSlackConfigurationPage() && loggedInUser.isAdmin() && !isAlreadyDismissed()) { $.ajax({ url: wrmContextPath() + '/slack/configuration/status', dataType: 'json', @@ -50,12 +46,5 @@ require([ function isAlreadyDismissed() { return jsCookies.get(SLACK_ADMIN_BANNER_COOKIE_KEY) === "true"; } - - function isInIssueView() { - return $('#issue-content').length > 0; - } - function isSlackPanelVisible() { - return $("#slack-issue-panel").length > 0; - } }); }); diff --git a/slack-server-integration-common/src/main/resources/token/token-status.js b/slack-server-integration-common/src/main/resources/token/token-status.js index e48a856a..a4bec293 100644 --- a/slack-server-integration-common/src/main/resources/token/token-status.js +++ b/slack-server-integration-common/src/main/resources/token/token-status.js @@ -11,10 +11,9 @@ require([ var flag = null; $(function () { - // skip if user is already in configuration view or edit pages or in issue view and slack panel isn't shown + // skip if user is already in configuration view or edit pages if (contains(window.location.pathname, CONFIGURE_PAGE_URL) - || contains(window.location.pathname, OAUTH_SESSIONS_PAGE_URL) - || (isInIssueView() && !isSlackPanelVisible())) { + || contains(window.location.pathname, OAUTH_SESSIONS_PAGE_URL)) { return; } @@ -65,20 +64,6 @@ require([ }); } - /** - * @returns {boolean} true when using the Slack app in Jira and the content of an issue is shown - */ - function isInIssueView() { - return $('#issue-content').length > 0; - } - - /** - * @returns {boolean} true when using the Slack app in Jira and the slack issue panel is shown - */ - function isSlackPanelVisible() { - return $("#slack-issue-panel").length > 0; - } - function contains(str, substr) { return str.indexOf(substr) !== -1; }