Commit 35326d84 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '195928-change-dependency-list-pipeline-message' into 'master'

Tweak Dependency List pipeline subheading text

See merge request gitlab-org/gitlab!28665
parents 1ff0baec d255e9e2
...@@ -4,12 +4,13 @@ import { ...@@ -4,12 +4,13 @@ import {
GlBadge, GlBadge,
GlEmptyState, GlEmptyState,
GlLoadingIcon, GlLoadingIcon,
GlSprintf,
GlTab, GlTab,
GlTabs, GlTabs,
GlLink, GlLink,
GlDeprecatedButton, GlDeprecatedButton,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import DependenciesActions from './dependencies_actions.vue'; import DependenciesActions from './dependencies_actions.vue';
import DependencyListIncompleteAlert from './dependency_list_incomplete_alert.vue'; import DependencyListIncompleteAlert from './dependency_list_incomplete_alert.vue';
...@@ -25,6 +26,7 @@ export default { ...@@ -25,6 +26,7 @@ export default {
GlBadge, GlBadge,
GlEmptyState, GlEmptyState,
GlLoadingIcon, GlLoadingIcon,
GlSprintf,
GlTab, GlTab,
GlTabs, GlTabs,
GlLink, GlLink,
...@@ -80,18 +82,6 @@ export default { ...@@ -80,18 +82,6 @@ export default {
this.setCurrentList(namespace); this.setCurrentList(namespace);
}, },
}, },
subHeadingText() {
const { jobPath } = this.reportInfo;
const body = __(
'Displays dependencies and known vulnerabilities, based on the %{linkStart}latest successful%{linkEnd} scan',
);
const linkStart = jobPath ? `<a href="${jobPath}">` : '';
const linkEnd = jobPath ? '</a>' : '';
return sprintf(body, { linkStart, linkEnd }, false);
},
showEmptyState() { showEmptyState() {
return this.isJobNotSetUp || this.hasNoDependencies; return this.isJobNotSetUp || this.hasNoDependencies;
}, },
...@@ -179,7 +169,16 @@ export default { ...@@ -179,7 +169,16 @@ export default {
</gl-link> </gl-link>
</h2> </h2>
<p class="mb-0"> <p class="mb-0">
<span v-html="subHeadingText"></span> <gl-sprintf
:message="s__('Dependencies|Based on the %{linkStart}latest successful%{linkEnd} scan')"
>
<template #link="{ content }">
<gl-link v-if="reportInfo.jobPath" ref="jobLink" :href="reportInfo.jobPath">{{
content
}}</gl-link>
<template v-else>{{ content }}</template>
</template>
</gl-sprintf>
<span v-if="generatedAtTimeAgo"> <span v-if="generatedAtTimeAgo">
<span aria-hidden="true">&bull;</span> <span aria-hidden="true">&bull;</span>
<span class="text-secondary">{{ generatedAtTimeAgo }}</span> <span class="text-secondary">{{ generatedAtTimeAgo }}</span>
......
---
title: Make Dependency List pipeline subheading more succinct
merge_request: 28665
author:
type: changed
...@@ -30,7 +30,7 @@ describe('DependenciesApp component', () => { ...@@ -30,7 +30,7 @@ describe('DependenciesApp component', () => {
addListType(store, DEPENDENCY_LIST_TYPES.vulnerable); addListType(store, DEPENDENCY_LIST_TYPES.vulnerable);
jest.spyOn(store, 'dispatch').mockImplementation(); jest.spyOn(store, 'dispatch').mockImplementation();
const canBeStubbed = component => !['GlTab', 'GlTabs'].includes(component); const canBeStubbed = component => !['GlSprintf', 'GlTab', 'GlTabs'].includes(component);
const stubs = Object.keys(DependenciesApp.components).filter(canBeStubbed); const stubs = Object.keys(DependenciesApp.components).filter(canBeStubbed);
wrapper = mount(DependenciesApp, { wrapper = mount(DependenciesApp, {
...@@ -107,7 +107,7 @@ describe('DependenciesApp component', () => { ...@@ -107,7 +107,7 @@ describe('DependenciesApp component', () => {
const findHeader = () => wrapper.find('section > header'); const findHeader = () => wrapper.find('section > header');
const findHeaderHelpLink = () => findHeader().find(GlLink); const findHeaderHelpLink = () => findHeader().find(GlLink);
const findHeaderJobLink = () => findHeader().find('a'); const findHeaderJobLink = () => wrapper.find({ ref: 'jobLink' });
const expectComponentWithProps = (Component, props = {}) => { const expectComponentWithProps = (Component, props = {}) => {
const componentWrapper = wrapper.find(Component); const componentWrapper = wrapper.find(Component);
......
...@@ -6567,6 +6567,9 @@ msgstr "" ...@@ -6567,6 +6567,9 @@ msgstr ""
msgid "Dependencies|All" msgid "Dependencies|All"
msgstr "" msgstr ""
msgid "Dependencies|Based on the %{linkStart}latest successful%{linkEnd} scan"
msgstr ""
msgid "Dependencies|Component" msgid "Dependencies|Component"
msgstr "" msgstr ""
...@@ -7124,9 +7127,6 @@ msgstr "" ...@@ -7124,9 +7127,6 @@ msgstr ""
msgid "Display source" msgid "Display source"
msgstr "" msgstr ""
msgid "Displays dependencies and known vulnerabilities, based on the %{linkStart}latest successful%{linkEnd} scan"
msgstr ""
msgid "Do not display offers from third parties within GitLab" msgid "Do not display offers from third parties within GitLab"
msgstr "" msgstr ""
......
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