diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /app/assets/javascripts/issuable | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'app/assets/javascripts/issuable')
6 files changed, 54 insertions, 63 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; - }, -}; diff --git a/app/assets/javascripts/issuable/components/csv_import_modal.vue b/app/assets/javascripts/issuable/components/csv_import_modal.vue index b72abe14ee1..7e2cbf03801 100644 --- a/app/assets/javascripts/issuable/components/csv_import_modal.vue +++ b/app/assets/javascripts/issuable/components/csv_import_modal.vue @@ -60,7 +60,11 @@ export default { <form ref="form" :action="importCsvIssuesPath" enctype="multipart/form-data" method="post"> <input :value="$options.csrf.token" type="hidden" name="authenticity_token" /> <p>{{ $options.i18n.mainText }}</p> - <gl-form-group :label="$options.i18n.uploadCsvFileText" label-for="file"> + <gl-form-group + :label="$options.i18n.uploadCsvFileText" + class="gl-text-truncate" + label-for="file" + > <input id="file" type="file" name="file" accept=".csv,text/csv" /> </gl-form-group> <p class="text-secondary"> diff --git a/app/assets/javascripts/issuable/index.js b/app/assets/javascripts/issuable/index.js index 072422944f5..57bad5182e7 100644 --- a/app/assets/javascripts/issuable/index.js +++ b/app/assets/javascripts/issuable/index.js @@ -11,7 +11,9 @@ import IssuableHeaderWarnings from './components/issuable_header_warnings.vue'; export function initCsvImportExportButtons() { const el = document.querySelector('.js-csv-import-export-buttons'); - if (!el) return null; + if (!el) { + return null; + } const { showExportButton, @@ -42,23 +44,24 @@ export function initCsvImportExportButtons() { maxAttachmentSize, showLabel, }, - render(h) { - return h(CsvImportExportButtons, { + render: (createElement) => + createElement(CsvImportExportButtons, { props: { exportCsvPath, issuableCount: parseInt(issuableCount, 10), }, - }); - }, + }), }); } export function initIssuableByEmail() { - Vue.use(GlToast); - const el = document.querySelector('.js-issuable-by-email'); - if (!el) return null; + if (!el) { + return null; + } + + Vue.use(GlToast); const { initialEmail, @@ -79,9 +82,7 @@ export function initIssuableByEmail() { markdownHelpPath, resetPath, }, - render(h) { - return h(IssuableByEmail); - }, + render: (createElement) => createElement(IssuableByEmail), }); } @@ -89,7 +90,7 @@ export function initIssuableHeaderWarnings(store) { const el = document.getElementById('js-issuable-header-warnings'); if (!el) { - return false; + return null; } const { hidden } = el.dataset; @@ -98,18 +99,18 @@ export function initIssuableHeaderWarnings(store) { el, store, provide: { hidden: parseBoolean(hidden) }, - render(createElement) { - return createElement(IssuableHeaderWarnings); - }, + render: (createElement) => createElement(IssuableHeaderWarnings), }); } export function initIssuableSidebar() { - const sidebarOptEl = document.querySelector('.js-sidebar-options'); + const el = document.querySelector('.js-sidebar-options'); - if (!sidebarOptEl) return; + if (!el) { + return; + } - const sidebarOptions = getSidebarOptions(sidebarOptEl); + const sidebarOptions = getSidebarOptions(el); new IssuableContext(sidebarOptions.currentUser); // eslint-disable-line no-new Sidebar.initialize(); |