diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-13 12:10:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-13 12:10:22 +0300 |
commit | 10e15ac3c2798956ff6a43d7b36bdf86c68aa817 (patch) | |
tree | 491a448439d1c2f43258d0418c53e8cc00b51039 /app/assets/javascripts/issuable | |
parent | 1cd5d53f92b07b0be71b6c2d9fdfa7cf07221890 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/issuable')
-rw-r--r-- | app/assets/javascripts/issuable/components/csv_import_export_buttons.vue | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/app/assets/javascripts/issuable/components/csv_import_export_buttons.vue b/app/assets/javascripts/issuable/components/csv_import_export_buttons.vue index b492194d1cf..872e1d4269d 100644 --- a/app/assets/javascripts/issuable/components/csv_import_export_buttons.vue +++ b/app/assets/javascripts/issuable/components/csv_import_export_buttons.vue @@ -1,18 +1,13 @@ <script> -import { GlDropdownItem, GlModalDirective } from '@gitlab/ui'; +import { GlDisclosureDropdownItem, GlModalDirective } from '@gitlab/ui'; import { TYPE_ISSUE } from '~/issues/constants'; import { __ } from '~/locale'; import CsvExportModal from './csv_export_modal.vue'; import CsvImportModal from './csv_import_modal.vue'; export default { - i18n: { - exportAsCsvButtonText: __('Export as CSV'), - importCsvText: __('Import CSV'), - importFromJiraText: __('Import from Jira'), - }, components: { - GlDropdownItem, + GlDisclosureDropdownItem, CsvExportModal, CsvImportModal, }, @@ -48,6 +43,22 @@ export default { default: undefined, }, }, + data() { + return { + dropdownItems: { + exportAsCSV: { + text: __('Export as CSV'), + }, + importCSV: { + text: __('Import CSV'), + }, + importFromJIRA: { + text: __('Import from Jira'), + href: this.projectImportJiraPath, + }, + }, + }; + }, computed: { exportModalId() { return `${this.issuableType}-export-modal`; @@ -61,23 +72,25 @@ export default { <template> <ul class="gl-display-contents"> - <gl-dropdown-item + <gl-disclosure-dropdown-item v-if="showExportButton" v-gl-modal="exportModalId" + data-testid="export-as-csv-button" data-qa-selector="export_as_csv_button" - > - {{ $options.i18n.exportAsCsvButtonText }} - </gl-dropdown-item> - <gl-dropdown-item v-if="showImportButton" v-gl-modal="importModalId"> - {{ $options.i18n.importCsvText }} - </gl-dropdown-item> - <gl-dropdown-item + :item="dropdownItems.exportAsCSV" + /> + <gl-disclosure-dropdown-item + v-if="showImportButton" + v-gl-modal="importModalId" + data-testid="import-from-csv-button" + :item="dropdownItems.importCSV" + /> + <gl-disclosure-dropdown-item v-if="showImportButton && canEdit" - :href="projectImportJiraPath" + data-testid="import-from-jira-link" data-qa-selector="import_from_jira_link" - > - {{ $options.i18n.importFromJiraText }} - </gl-dropdown-item> + :item="dropdownItems.importFromJIRA" + /> <csv-export-modal v-if="showExportButton" |