diff options
Diffstat (limited to 'app/assets/javascripts/issues/index.js')
-rw-r--r-- | app/assets/javascripts/issues/index.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/app/assets/javascripts/issues/index.js b/app/assets/javascripts/issues/index.js index 5b5f1d273d0..4d2df9e3602 100644 --- a/app/assets/javascripts/issues/index.js +++ b/app/assets/javascripts/issues/index.js @@ -3,12 +3,10 @@ import IssuableForm from 'ee_else_ce/issuable/issuable_form'; import IssuableLabelSelector from '~/issuable/issuable_label_selector'; import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; -import GLForm from '~/gl_form'; import { initIssuableHeaderWarnings, initIssuableSidebar } from '~/issuable'; -import IssuableTemplateSelectors from '~/issuable/issuable_template_selectors'; -import { IssueType } from '~/issues/constants'; +import { TYPE_INCIDENT } from '~/issues/constants'; import Issue from '~/issues/issue'; -import { initTitleSuggestions, initTypePopover } from '~/issues/new'; +import { initTitleSuggestions, initTypePopover, initTypeSelect } from '~/issues/new'; import { initRelatedMergeRequests } from '~/issues/related_merge_requests'; import { initRelatedIssues } from '~/related_issues'; import { @@ -38,19 +36,18 @@ export function initFilteredSearchServiceDesk() { } export function initForm() { - new GLForm($('.issue-form')); // eslint-disable-line no-new new IssuableForm($('.issue-form')); // eslint-disable-line no-new IssuableLabelSelector(); - new IssuableTemplateSelectors({ warnTemplateOverride: true }); // eslint-disable-line no-new new LabelsSelect(); // eslint-disable-line no-new new ShortcutsNavigation(); // eslint-disable-line no-new initTitleSuggestions(); initTypePopover(); + initTypeSelect(); mountMilestoneDropdown(); } -export function initShow() { +export function initShow({ notesParams } = {}) { const el = document.getElementById('js-issuable-app'); if (!el) { @@ -59,11 +56,11 @@ export function initShow() { const { issueType, ...issuableData } = parseIssuableData(el); - if (issueType === IssueType.Incident) { + if (issueType === TYPE_INCIDENT) { initIncidentApp({ ...issuableData, issuableId: el.dataset.issuableId }, store); - initHeaderActions(store, IssueType.Incident); + initHeaderActions(store, TYPE_INCIDENT); initLinkedResources(); - initRelatedIssues(IssueType.Incident); + initRelatedIssues(TYPE_INCIDENT); } else { initIssueApp(issuableData, store); initHeaderActions(store); @@ -74,7 +71,7 @@ export function initShow() { new ZenMode(); // eslint-disable-line no-new initIssuableHeaderWarnings(store); initIssuableSidebar(); - initNotesApp(); + initNotesApp(notesParams); initRelatedMergeRequests(); initSentryErrorStackTrace(); |