diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-15 18:09:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-15 18:09:07 +0300 |
commit | f5c3f32975addd56fe8659f1c346d0e56f0b23d9 (patch) | |
tree | 9d6594793e656c52341a98d22d882d96d240433f /app/assets/javascripts/issuable | |
parent | c8b7a349bc50cff1e8ef18204042978476527b0b (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 | 24 | ||||
-rw-r--r-- | app/assets/javascripts/issuable/init_csv_import_export_buttons.js | 2 |
2 files changed, 24 insertions, 2 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 d75fa1e8323..bbf4160ce35 100644 --- a/app/assets/javascripts/issuable/components/csv_import_export_buttons.vue +++ b/app/assets/javascripts/issuable/components/csv_import_export_buttons.vue @@ -7,6 +7,8 @@ import { GlTooltipDirective, GlModalDirective, } from '@gitlab/ui'; +import { __ } from '~/locale'; +import { ISSUABLE_TYPE } from '../constants'; import CsvExportModal from './csv_export_modal.vue'; import CsvImportModal from './csv_import_modal.vue'; @@ -25,6 +27,9 @@ export default { GlModal: GlModalDirective, }, inject: { + issuableType: { + default: ISSUABLE_TYPE.issues, + }, showExportButton: { default: false, }, @@ -40,6 +45,9 @@ export default { projectImportJiraPath: { default: null, }, + showLabel: { + default: false, + }, }, computed: { exportModalId() { @@ -48,7 +56,17 @@ export default { importModalId() { return `${this.issuableType}-import-modal`; }, + importButtonText() { + return this.showLabel ? this.$options.importIssuesText : null; + }, + importButtonTooltipText() { + return this.showLabel ? null : this.$options.importIssuesText; + }, + importButtonIcon() { + return this.showLabel ? null : 'import'; + }, }, + importIssuesText: __('Import issues'), }; </script> @@ -65,9 +83,11 @@ export default { /> <gl-dropdown v-if="showImportButton" - v-gl-tooltip.hover="__('Import issues')" + v-gl-tooltip.hover="importButtonTooltipText" + data-qa-selector="import_issues_dropdown" data-testid="import-csv-dropdown" - icon="import" + :text="importButtonText" + :icon="importButtonIcon" > <gl-dropdown-item v-gl-modal="importModalId" data-testid="import-csv-link">{{ __('Import CSV') diff --git a/app/assets/javascripts/issuable/init_csv_import_export_buttons.js b/app/assets/javascripts/issuable/init_csv_import_export_buttons.js index e8df44fa52b..5a720b89d33 100644 --- a/app/assets/javascripts/issuable/init_csv_import_export_buttons.js +++ b/app/assets/javascripts/issuable/init_csv_import_export_buttons.js @@ -19,6 +19,7 @@ export default () => { canEdit, projectImportJiraPath, maxAttachmentSize, + showLabel, } = el.dataset; return new Vue({ @@ -35,6 +36,7 @@ export default () => { canEdit: parseBoolean(canEdit), projectImportJiraPath, maxAttachmentSize, + showLabel, }, render(h) { return h(ImportExportButtons); |