Commit 51714d1d authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '232828-wire-new-url-to-frontend' into 'master'

Wire backend provided URL in package history

Closes #232828

See merge request gitlab-org/gitlab!38787
parents 19368f19 67acd0f0
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
<history-element icon="commit" data-testid="commit"> <history-element icon="commit" data-testid="commit">
<gl-sprintf :message="$options.i18n.commitText"> <gl-sprintf :message="$options.i18n.commitText">
<template #link> <template #link>
<gl-link :href="`../../commit/${packagePipeline.sha}`">{{ <gl-link :href="packagePipeline.project.commit_url">{{
packagePipeline.sha packagePipeline.sha
}}</gl-link> }}</gl-link>
</template> </template>
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
<history-element icon="pipeline" data-testid="pipeline"> <history-element icon="pipeline" data-testid="pipeline">
<gl-sprintf :message="$options.i18n.pipelineText"> <gl-sprintf :message="$options.i18n.pipelineText">
<template #link> <template #link>
<gl-link :href="`../../pipelines/${packagePipeline.id}`" <gl-link :href="packagePipeline.project.pipeline_url"
>#{{ packagePipeline.id }}</gl-link >#{{ packagePipeline.id }}</gl-link
> >
</template> </template>
......
...@@ -57,8 +57,8 @@ describe('Package History', () => { ...@@ -57,8 +57,8 @@ describe('Package History', () => {
name | icon | text | timeAgoTooltip | link name | icon | text | timeAgoTooltip | link
${'created-on'} | ${'clock'} | ${'Test package version 1.0.0 was created'} | ${mavenPackage.created_at} | ${null} ${'created-on'} | ${'clock'} | ${'Test package version 1.0.0 was created'} | ${mavenPackage.created_at} | ${null}
${'updated-at'} | ${'pencil'} | ${'Test package version 1.0.0 was updated'} | ${mavenPackage.updated_at} | ${null} ${'updated-at'} | ${'pencil'} | ${'Test package version 1.0.0 was updated'} | ${mavenPackage.updated_at} | ${null}
${'commit'} | ${'commit'} | ${'Commit sha-baz on branch branch-name'} | ${null} | ${'../../commit/sha-baz'} ${'commit'} | ${'commit'} | ${'Commit sha-baz on branch branch-name'} | ${null} | ${mockPipelineInfo.project.commit_url}
${'pipeline'} | ${'pipeline'} | ${'Pipeline #1 triggered by foo'} | ${mockPipelineInfo.created_at} | ${'../../pipelines/1'} ${'pipeline'} | ${'pipeline'} | ${'Pipeline #1 triggered by foo'} | ${mockPipelineInfo.created_at} | ${mockPipelineInfo.project.pipeline_url}
${'published'} | ${'package'} | ${'Published to the baz project Package Registry'} | ${mavenPackage.created_at} | ${null} ${'published'} | ${'package'} | ${'Published to the baz project Package Registry'} | ${mavenPackage.created_at} | ${null}
`('history element $name', ({ name, icon, text, timeAgoTooltip, link }) => { `('history element $name', ({ name, icon, text, timeAgoTooltip, link }) => {
let element; let element;
......
...@@ -13,6 +13,8 @@ export const mockPipelineInfo = { ...@@ -13,6 +13,8 @@ export const mockPipelineInfo = {
project: { project: {
name: 'foo-project', name: 'foo-project',
web_url: 'foo-project-link', web_url: 'foo-project-link',
commit_url: 'foo-commit-link',
pipeline_url: 'foo-pipeline-link',
}, },
created_at: '2015-12-10', created_at: '2015-12-10',
}; };
......
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