Commit 0c7e4c55 authored by Scott Hampton's avatar Scott Hampton

Merge branch '339113-remove-download-text' into 'master'

Remove download text from pipeline artifact dropdown items

See merge request gitlab-org/gitlab!70982
parents 664586f7 466b1125
...@@ -5,7 +5,6 @@ import { ...@@ -5,7 +5,6 @@ import {
GlDropdownItem, GlDropdownItem,
GlDropdownSectionHeader, GlDropdownSectionHeader,
GlLoadingIcon, GlLoadingIcon,
GlSprintf,
GlTooltipDirective, GlTooltipDirective,
} from '@gitlab/ui'; } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -13,7 +12,6 @@ import { __, s__ } from '~/locale'; ...@@ -13,7 +12,6 @@ import { __, s__ } from '~/locale';
export const i18n = { export const i18n = {
artifacts: __('Artifacts'), artifacts: __('Artifacts'),
downloadArtifact: __('Download %{name} artifact'),
artifactSectionHeader: __('Download artifacts'), artifactSectionHeader: __('Download artifacts'),
artifactsFetchErrorMessage: s__('Pipelines|Could not load artifacts.'), artifactsFetchErrorMessage: s__('Pipelines|Could not load artifacts.'),
emptyArtifactsMessage: __('No artifacts found'), emptyArtifactsMessage: __('No artifacts found'),
...@@ -30,7 +28,6 @@ export default { ...@@ -30,7 +28,6 @@ export default {
GlDropdownItem, GlDropdownItem,
GlDropdownSectionHeader, GlDropdownSectionHeader,
GlLoadingIcon, GlLoadingIcon,
GlSprintf,
}, },
inject: { inject: {
artifactsEndpoint: { artifactsEndpoint: {
...@@ -113,9 +110,7 @@ export default { ...@@ -113,9 +110,7 @@ export default {
class="gl-word-break-word" class="gl-word-break-word"
data-testid="artifact-item" data-testid="artifact-item"
> >
<gl-sprintf :message="$options.i18n.downloadArtifact"> {{ artifact.name }}
<template #name>{{ artifact.name }}</template>
</gl-sprintf>
</gl-dropdown-item> </gl-dropdown-item>
</gl-dropdown> </gl-dropdown>
</template> </template>
...@@ -3,8 +3,8 @@ import { ...@@ -3,8 +3,8 @@ import {
GlAlert, GlAlert,
GlDropdown, GlDropdown,
GlDropdownItem, GlDropdownItem,
GlDropdownSectionHeader,
GlLoadingIcon, GlLoadingIcon,
GlSprintf,
GlTooltipDirective, GlTooltipDirective,
} from '@gitlab/ui'; } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -12,7 +12,6 @@ import { __, s__ } from '~/locale'; ...@@ -12,7 +12,6 @@ import { __, s__ } from '~/locale';
export const i18n = { export const i18n = {
artifacts: __('Artifacts'), artifacts: __('Artifacts'),
downloadArtifact: __('Download %{name} artifact'),
artifactSectionHeader: __('Download artifacts'), artifactSectionHeader: __('Download artifacts'),
artifactsFetchErrorMessage: s__('Pipelines|Could not load artifacts.'), artifactsFetchErrorMessage: s__('Pipelines|Could not load artifacts.'),
noArtifacts: s__('Pipelines|No artifacts available'), noArtifacts: s__('Pipelines|No artifacts available'),
...@@ -27,8 +26,8 @@ export default { ...@@ -27,8 +26,8 @@ export default {
GlAlert, GlAlert,
GlDropdown, GlDropdown,
GlDropdownItem, GlDropdownItem,
GlDropdownSectionHeader,
GlLoadingIcon, GlLoadingIcon,
GlSprintf,
}, },
inject: { inject: {
artifactsEndpoint: { artifactsEndpoint: {
...@@ -92,6 +91,10 @@ export default { ...@@ -92,6 +91,10 @@ export default {
text-sr-only text-sr-only
@show.once="fetchArtifacts" @show.once="fetchArtifacts"
> >
<gl-dropdown-section-header>{{
$options.i18n.artifactSectionHeader
}}</gl-dropdown-section-header>
<gl-alert v-if="hasError" variant="danger" :dismissible="false"> <gl-alert v-if="hasError" variant="danger" :dismissible="false">
{{ $options.i18n.artifactsFetchErrorMessage }} {{ $options.i18n.artifactsFetchErrorMessage }}
</gl-alert> </gl-alert>
...@@ -108,10 +111,9 @@ export default { ...@@ -108,10 +111,9 @@ export default {
:href="artifact.path" :href="artifact.path"
rel="nofollow" rel="nofollow"
download download
class="gl-word-break-word"
> >
<gl-sprintf :message="$options.i18n.downloadArtifact"> {{ artifact.name }}
<template #name>{{ artifact.name }}</template>
</gl-sprintf>
</gl-dropdown-item> </gl-dropdown-item>
</gl-dropdown> </gl-dropdown>
</template> </template>
...@@ -12132,9 +12132,6 @@ msgstr "" ...@@ -12132,9 +12132,6 @@ msgstr ""
msgid "Download %{format}:" msgid "Download %{format}:"
msgstr "" msgstr ""
msgid "Download %{name} artifact"
msgstr ""
msgid "Download (%{fileSizeReadable})" msgid "Download (%{fileSizeReadable})"
msgstr "" msgstr ""
......
...@@ -95,7 +95,7 @@ describe('Pipeline Multi Actions Dropdown', () => { ...@@ -95,7 +95,7 @@ describe('Pipeline Multi Actions Dropdown', () => {
createComponent({ mockData: { artifacts } }); createComponent({ mockData: { artifacts } });
expect(findFirstArtifactItem().attributes('href')).toBe(artifacts[0].path); expect(findFirstArtifactItem().attributes('href')).toBe(artifacts[0].path);
expect(findFirstArtifactItem().text()).toBe(`Download ${artifacts[0].name} artifact`); expect(findFirstArtifactItem().text()).toBe(artifacts[0].name);
}); });
it('should render empty message when no artifacts are found', () => { it('should render empty message when no artifacts are found', () => {
......
...@@ -87,8 +87,7 @@ describe('Pipelines Artifacts dropdown', () => { ...@@ -87,8 +87,7 @@ describe('Pipelines Artifacts dropdown', () => {
createComponent({ mockData: { artifacts } }); createComponent({ mockData: { artifacts } });
expect(findFirstGlDropdownItem().attributes('href')).toBe(artifacts[0].path); expect(findFirstGlDropdownItem().attributes('href')).toBe(artifacts[0].path);
expect(findFirstGlDropdownItem().text()).toBe(artifacts[0].name);
expect(findFirstGlDropdownItem().text()).toBe(`Download ${artifacts[0].name} artifact`);
}); });
describe('with a failing request', () => { describe('with a failing request', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment