Commit 8d9b0d04 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '229959-use-help_page_path-for-links-in-pipelinetoursuccessmodal' into 'master'

Use help_page_path for links in PipelineTourSuccessModal

See merge request gitlab-org/gitlab!47025
parents 1705f434 9b391b99
...@@ -9,8 +9,6 @@ const trackingMixin = Tracking.mixin(); ...@@ -9,8 +9,6 @@ const trackingMixin = Tracking.mixin();
export default { export default {
beginnerLink: beginnerLink:
'https://about.gitlab.com/blog/2018/01/22/a-beginners-guide-to-continuous-integration/', 'https://about.gitlab.com/blog/2018/01/22/a-beginners-guide-to-continuous-integration/',
exampleLink: 'https://docs.gitlab.com/ee/ci/examples/',
codeQualityLink: 'https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html',
goToTrackValuePipelines: 10, goToTrackValuePipelines: 10,
goToTrackValueMergeRequest: 20, goToTrackValueMergeRequest: 20,
trackEvent: 'click_button', trackEvent: 'click_button',
...@@ -39,6 +37,14 @@ export default { ...@@ -39,6 +37,14 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
exampleLink: {
type: String,
required: true,
},
codeQualityLink: {
type: String,
required: true,
},
}, },
data() { data() {
return { return {
...@@ -93,7 +99,7 @@ export default { ...@@ -93,7 +99,7 @@ export default {
<p> <p>
<gl-sprintf :message="$options.i18n.bodyMessage"> <gl-sprintf :message="$options.i18n.bodyMessage">
<template #codeQualityLink="{content}"> <template #codeQualityLink="{content}">
<gl-link :href="$options.codeQualityLink" target="_blank" class="font-size-inherit">{{ <gl-link :href="codeQualityLink" target="_blank" class="font-size-inherit">{{
content content
}}</gl-link> }}</gl-link>
</template> </template>
...@@ -106,7 +112,7 @@ export default { ...@@ -106,7 +112,7 @@ export default {
</gl-link> </gl-link>
</template> </template>
<template #exampleLink="{content}"> <template #exampleLink="{content}">
<gl-link :href="$options.exampleLink" target="_blank"> <gl-link :href="exampleLink" target="_blank">
{{ content }} {{ content }}
</gl-link> </gl-link>
</template> </template>
......
.js-success-pipeline-modal{ data: { 'commit-cookie': suggest_pipeline_commit_cookie_name, .js-success-pipeline-modal{ data: { 'commit-cookie': suggest_pipeline_commit_cookie_name,
'go-to-pipelines-path': project_pipelines_path(@project), 'go-to-pipelines-path': project_pipelines_path(@project),
'project-merge-requests-path': project_merge_requests_path(@project), 'project-merge-requests-path': project_merge_requests_path(@project),
'example-link': help_page_path('ci/examples/README.md', anchor: 'gitlab-cicd-examples'),
'code-quality-link': help_page_path('user/project/merge_requests/code_quality'),
'human-access': @project.team.human_max_access(current_user&.id) } } 'human-access': @project.team.human_max_access(current_user&.id) } }
...@@ -3,6 +3,8 @@ const modalProps = { ...@@ -3,6 +3,8 @@ const modalProps = {
projectMergeRequestsPath: 'some_mr_path', projectMergeRequestsPath: 'some_mr_path',
commitCookie: 'some_cookie', commitCookie: 'some_cookie',
humanAccess: 'maintainer', humanAccess: 'maintainer',
exampleLink: '/example',
codeQualityLink: '/code-quality-link',
}; };
export default modalProps; export default modalProps;
...@@ -75,7 +75,7 @@ describe('PipelineTourSuccessModal', () => { ...@@ -75,7 +75,7 @@ describe('PipelineTourSuccessModal', () => {
}); });
it('renders the link for codeQualityLink', () => { it('renders the link for codeQualityLink', () => {
expect(wrapper.find(GlLink).attributes('href')).toBe(wrapper.vm.$options.codeQualityLink); expect(wrapper.find(GlLink).attributes('href')).toBe('/code-quality-link');
}); });
it('calls to remove cookie', () => { it('calls to remove cookie', () => {
......
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