diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-28 06:10:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-28 06:10:23 +0300 |
commit | 8cc2cd21ee55fb162ef9313886cfe92ed3be0a6b (patch) | |
tree | 5165e20aa2d91977a86dc7de39982d5c9f718be4 /app/assets/javascripts/vue_shared | |
parent | f5c36b6806c772f70a7e8d714d10f5b3b2249eb0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared')
-rw-r--r-- | app/assets/javascripts/vue_shared/security_reports/components/security_report_download_dropdown.vue | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/app/assets/javascripts/vue_shared/security_reports/components/security_report_download_dropdown.vue b/app/assets/javascripts/vue_shared/security_reports/components/security_report_download_dropdown.vue index 28618cb96a3..61bca18b050 100644 --- a/app/assets/javascripts/vue_shared/security_reports/components/security_report_download_dropdown.vue +++ b/app/assets/javascripts/vue_shared/security_reports/components/security_report_download_dropdown.vue @@ -1,15 +1,11 @@ <script> -import { GlDropdown, GlDropdownItem, GlTooltipDirective as GlTooltip } from '@gitlab/ui'; +import { GlDisclosureDropdown } from '@gitlab/ui'; import { s__, sprintf } from '~/locale'; export default { name: 'SecurityReportDownloadDropdown', components: { - GlDropdown, - GlDropdownItem, - }, - directives: { - GlTooltip, + GlDisclosureDropdown, }, props: { artifacts: { @@ -26,19 +22,23 @@ export default { required: false, default: '', }, - title: { - type: String, - required: false, - default: '', - }, }, computed: { showDropdown() { return this.loading || this.artifacts.length > 0; }, + items() { + return this.artifacts.map(({ name, path }) => ({ + text: this.artifactText(name), + href: path, + extraAttrs: { + download: '', + }, + })); + }, }, methods: { - artifactText({ name }) { + artifactText(name) { return sprintf(s__('SecurityReports|Download %{artifactName}'), { artifactName: name, }); @@ -48,23 +48,13 @@ export default { </script> <template> - <gl-dropdown + <gl-disclosure-dropdown v-if="showDropdown" - v-gl-tooltip - :text="text" - :title="title" + :items="items" + :toggle-text="text" :loading="loading" icon="download" size="small" - right - > - <gl-dropdown-item - v-for="artifact in artifacts" - :key="artifact.path" - :href="artifact.path" - download - > - {{ artifactText(artifact) }} - </gl-dropdown-item> - </gl-dropdown> + placement="right" + /> </template> |