diff options
Diffstat (limited to 'app/assets/javascripts/issuable/bulk_update_sidebar')
4 files changed, 30 insertions, 44 deletions
diff --git a/app/assets/javascripts/issuable/bulk_update_sidebar/index.js b/app/assets/javascripts/issuable/bulk_update_sidebar/index.js new file mode 100644 index 00000000000..dca606556d0 --- /dev/null +++ b/app/assets/javascripts/issuable/bulk_update_sidebar/index.js @@ -0,0 +1,28 @@ +import Vue from 'vue'; +import StatusSelect from './components/status_select.vue'; +import issuableBulkUpdateActions from './issuable_bulk_update_actions'; +import IssuableBulkUpdateSidebar from './issuable_bulk_update_sidebar'; + +export function initBulkUpdateSidebar(prefixId) { + const el = document.querySelector('.issues-bulk-update'); + + if (!el) { + return; + } + + issuableBulkUpdateActions.init({ prefixId }); + new IssuableBulkUpdateSidebar(); // eslint-disable-line no-new +} + +export function initIssueStatusSelect() { + const el = document.querySelector('.js-issue-status'); + + if (!el) { + return null; + } + + return new Vue({ + el, + render: (createElement) => createElement(StatusSelect), + }); +} diff --git a/app/assets/javascripts/issuable/bulk_update_sidebar/init_issue_status_select.js b/app/assets/javascripts/issuable/bulk_update_sidebar/init_issue_status_select.js deleted file mode 100644 index 43179a86d70..00000000000 --- a/app/assets/javascripts/issuable/bulk_update_sidebar/init_issue_status_select.js +++ /dev/null @@ -1,17 +0,0 @@ -import Vue from 'vue'; -import StatusSelect from './components/status_select.vue'; - -export default function initIssueStatusSelect() { - const el = document.querySelector('.js-issue-status'); - - if (!el) { - return null; - } - - return new Vue({ - el, - render(h) { - return h(StatusSelect); - }, - }); -} diff --git a/app/assets/javascripts/issuable/bulk_update_sidebar/issuable_bulk_update_sidebar.js b/app/assets/javascripts/issuable/bulk_update_sidebar/issuable_bulk_update_sidebar.js index 1eb3ffc9808..d46354e240a 100644 --- a/app/assets/javascripts/issuable/bulk_update_sidebar/issuable_bulk_update_sidebar.js +++ b/app/assets/javascripts/issuable/bulk_update_sidebar/issuable_bulk_update_sidebar.js @@ -1,12 +1,9 @@ /* eslint-disable class-methods-use-this, no-new */ import $ from 'jquery'; -import { property } from 'lodash'; - -import issuableEventHub from '~/issues_list/eventhub'; +import issuableEventHub from '~/issues/list/eventhub'; import LabelsSelect from '~/labels/labels_select'; import MilestoneSelect from '~/milestones/milestone_select'; -import initIssueStatusSelect from './init_issue_status_select'; import IssuableBulkUpdateActions from './issuable_bulk_update_actions'; import subscriptionSelect from './subscription_select'; @@ -17,8 +14,6 @@ const SIDEBAR_COLLAPSED_CLASS = 'right-sidebar-collapsed issuable-bulk-update-si export default class IssuableBulkUpdateSidebar { constructor() { - this.vueIssuablesListFeature = property(['gon', 'features', 'vueIssuablesList'])(window); - this.initDomElements(); this.bindEvents(); this.initDropdowns(); @@ -57,7 +52,6 @@ export default class IssuableBulkUpdateSidebar { initDropdowns() { new LabelsSelect(); new MilestoneSelect(); - initIssueStatusSelect(); subscriptionSelect(); if (IS_EE) { @@ -145,7 +139,7 @@ export default class IssuableBulkUpdateSidebar { } toggleCheckboxDisplay(show) { - this.$checkAllContainer.toggleClass(HIDDEN_CLASS, !show || this.vueIssuablesListFeature); + this.$checkAllContainer.toggleClass(HIDDEN_CLASS, !show); this.$issueChecks.toggleClass(HIDDEN_CLASS, !show); } diff --git a/app/assets/javascripts/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar.js b/app/assets/javascripts/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar.js deleted file mode 100644 index 179c2b83c6c..00000000000 --- a/app/assets/javascripts/issuable/bulk_update_sidebar/issuable_init_bulk_update_sidebar.js +++ /dev/null @@ -1,19 +0,0 @@ -import issuableBulkUpdateActions from './issuable_bulk_update_actions'; -import IssuableBulkUpdateSidebar from './issuable_bulk_update_sidebar'; - -export default { - bulkUpdateSidebar: null, - - init(prefixId) { - const bulkUpdateEl = document.querySelector('.issues-bulk-update'); - const alreadyInitialized = Boolean(this.bulkUpdateSidebar); - - if (bulkUpdateEl && !alreadyInitialized) { - issuableBulkUpdateActions.init({ prefixId }); - - this.bulkUpdateSidebar = new IssuableBulkUpdateSidebar(); - } - - return this.bulkUpdateSidebar; - }, -}; |