Commit bb67439b authored by Frédéric Caplette's avatar Frédéric Caplette Committed by Andrew Fontaine

Add name of the trigger job in title of downstream

parent 29a04635
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
}, },
computed: { computed: {
tooltipText() { tooltipText() {
return `${this.downstreamTitle} #${this.pipeline.id} - ${this.pipelineStatus.label} return `${this.downstreamTitle} #${this.pipeline.id} - ${this.pipelineStatus.label} -
${this.sourceJobInfo}`; ${this.sourceJobInfo}`;
}, },
buttonId() { buttonId() {
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
return this.pipeline.project.name; return this.pipeline.project.name;
}, },
downstreamTitle() { downstreamTitle() {
return this.childPipeline ? __('child-pipeline') : this.pipeline.project.name; return this.childPipeline ? this.sourceJobName : this.pipeline.project.name;
}, },
parentPipeline() { parentPipeline() {
return this.isUpstream && this.isSameProject; return this.isUpstream && this.isSameProject;
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
/> />
<div v-else class="gl-pr-2"><gl-loading-icon inline /></div> <div v-else class="gl-pr-2"><gl-loading-icon inline /></div>
<div class="gl-display-flex gl-flex-direction-column gl-w-13"> <div class="gl-display-flex gl-flex-direction-column gl-w-13">
<span class="gl-text-truncate"> <span class="gl-text-truncate" data-testid="downstream-title">
{{ downstreamTitle }} {{ downstreamTitle }}
</span> </span>
<div class="gl-text-truncate"> <div class="gl-text-truncate">
......
...@@ -38219,9 +38219,6 @@ msgstr "" ...@@ -38219,9 +38219,6 @@ msgstr ""
msgid "cannot merge" msgid "cannot merge"
msgstr "" msgstr ""
msgid "child-pipeline"
msgstr ""
msgid "ciReport|%{degradedNum} degraded" msgid "ciReport|%{degradedNum} degraded"
msgstr "" msgstr ""
......
...@@ -14,6 +14,7 @@ describe('Linked pipeline', () => { ...@@ -14,6 +14,7 @@ describe('Linked pipeline', () => {
let wrapper; let wrapper;
const findButton = () => wrapper.find(GlButton); const findButton = () => wrapper.find(GlButton);
const findDownstreamPipelineTitle = () => wrapper.find('[data-testid="downstream-title"]');
const findPipelineLabel = () => wrapper.find('[data-testid="downstream-pipeline-label"]'); const findPipelineLabel = () => wrapper.find('[data-testid="downstream-pipeline-label"]');
const findLinkedPipeline = () => wrapper.find({ ref: 'linkedPipeline' }); const findLinkedPipeline = () => wrapper.find({ ref: 'linkedPipeline' });
const findLoadingIcon = () => wrapper.find(GlLoadingIcon); const findLoadingIcon = () => wrapper.find(GlLoadingIcon);
...@@ -119,6 +120,11 @@ describe('Linked pipeline', () => { ...@@ -119,6 +120,11 @@ describe('Linked pipeline', () => {
expect(findPipelineLabel().exists()).toBe(true); expect(findPipelineLabel().exists()).toBe(true);
}); });
it('should have the name of the trigger job on the card when it is a child pipeline', () => {
createWrapper(downstreamProps);
expect(findDownstreamPipelineTitle().text()).toBe(mockPipeline.source_job.name);
});
it('should display parent label when pipeline project id is the same as triggered_by pipeline project id', () => { it('should display parent label when pipeline project id is the same as triggered_by pipeline project id', () => {
createWrapper(upstreamProps); createWrapper(upstreamProps);
expect(findPipelineLabel().exists()).toBe(true); expect(findPipelineLabel().exists()).toBe(true);
......
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