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 {
<history-element icon="commit" data-testid="commit">
<gl-sprintf :message="$options.i18n.commitText">
<template #link>
<gl-link :href="`../../commit/${packagePipeline.sha}`">{{
<gl-link :href="packagePipeline.project.commit_url">{{
packagePipeline.sha
}}</gl-link>
</template>
......@@ -88,7 +88,7 @@ export default {
<history-element icon="pipeline" data-testid="pipeline">
<gl-sprintf :message="$options.i18n.pipelineText">
<template #link>
<gl-link :href="`../../pipelines/${packagePipeline.id}`"
<gl-link :href="packagePipeline.project.pipeline_url"
>#{{ packagePipeline.id }}</gl-link
>
</template>
......
......@@ -57,8 +57,8 @@ describe('Package History', () => {
name | icon | text | timeAgoTooltip | link
${'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}
${'commit'} | ${'commit'} | ${'Commit sha-baz on branch branch-name'} | ${null} | ${'../../commit/sha-baz'}
${'pipeline'} | ${'pipeline'} | ${'Pipeline #1 triggered by foo'} | ${mockPipelineInfo.created_at} | ${'../../pipelines/1'}
${'commit'} | ${'commit'} | ${'Commit sha-baz on branch branch-name'} | ${null} | ${mockPipelineInfo.project.commit_url}
${'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}
`('history element $name', ({ name, icon, text, timeAgoTooltip, link }) => {
let element;
......
......@@ -13,6 +13,8 @@ export const mockPipelineInfo = {
project: {
name: 'foo-project',
web_url: 'foo-project-link',
commit_url: 'foo-commit-link',
pipeline_url: 'foo-pipeline-link',
},
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