summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issue.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/issue.js')
-rw-r--r--app/assets/javascripts/issue.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/assets/javascripts/issue.js b/app/assets/javascripts/issue.js
index 4b53225e100..252e8e92f5e 100644
--- a/app/assets/javascripts/issue.js
+++ b/app/assets/javascripts/issue.js
@@ -6,6 +6,7 @@ import { addDelimiter } from './lib/utils/text_utility';
import flash from './flash';
import CreateMergeRequestDropdown from './create_merge_request_dropdown';
import IssuablesHelper from './helpers/issuables_helper';
+import { joinPaths } from '~/lib/utils/url_utility';
import { __ } from './locale';
export default class Issue {
@@ -14,6 +15,16 @@ export default class Issue {
if ($('.js-close-blocked-issue-warning').length) this.initIssueWarningBtnEventListener();
+ if ($('.js-alert-moved-from-service-desk-warning').length) {
+ const trimmedPathname = window.location.pathname.slice(1);
+ this.alertMovedFromServiceDeskDismissedKey = joinPaths(
+ trimmedPathname,
+ 'alert-issue-moved-from-service-desk-dismissed',
+ );
+
+ this.initIssueMovedFromServiceDeskDismissHandler();
+ }
+
Issue.$btnNewBranch = $('#new-branch');
Issue.createMrDropdownWrap = document.querySelector('.create-mr-dropdown-wrap');
@@ -169,6 +180,21 @@ export default class Issue {
});
}
+ initIssueMovedFromServiceDeskDismissHandler() {
+ const alertMovedFromServiceDeskWarning = $('.js-alert-moved-from-service-desk-warning');
+
+ if (!localStorage.getItem(this.alertMovedFromServiceDeskDismissedKey)) {
+ alertMovedFromServiceDeskWarning.show();
+ }
+
+ alertMovedFromServiceDeskWarning.on('click', '.js-close', e => {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ alertMovedFromServiceDeskWarning.remove();
+ localStorage.setItem(this.alertMovedFromServiceDeskDismissedKey, true);
+ });
+ }
+
static submitNoteForm(form) {
const noteText = form.find('textarea.js-note-text').val();
if (noteText && noteText.trim().length > 0) {