Commit c2ded9bd authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Matija Čupić

Updates CI/CD documentation link in MR widget

parent c40634d4
<script> <script>
/* eslint-disable vue/require-default-prop */ /* eslint-disable vue/require-default-prop */
import { sprintf, __ } from '~/locale';
import PipelineStage from '~/pipelines/components/stage.vue'; import PipelineStage from '~/pipelines/components/stage.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
...@@ -36,6 +37,11 @@ export default { ...@@ -36,6 +37,11 @@ export default {
type: String, type: String,
required: false, required: false,
}, },
troubleshootingDocsPath: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
hasPipeline() { hasPipeline() {
...@@ -57,6 +63,12 @@ export default { ...@@ -57,6 +63,12 @@ export default {
hasCommitInfo() { hasCommitInfo() {
return this.pipeline.commit && Object.keys(this.pipeline.commit).length > 0; return this.pipeline.commit && Object.keys(this.pipeline.commit).length > 0;
}, },
errorText() {
return sprintf(__('Could not retrieve the pipeline status. For troubleshooting steps, read the %{linkStart}documentation.%{linkEnd}'), {
linkStart: `<a href="${this.troubleshootingDocsPath}">`,
linkEnd: '</a>',
});
}
}, },
}; };
</script> </script>
...@@ -77,8 +89,10 @@ export default { ...@@ -77,8 +89,10 @@ export default {
name="status_failed_borderless" name="status_failed_borderless"
/> />
</div> </div>
<div class="media-body"> <div
Could not retrieve the pipeline status. For potential solutions please read the <a :href="mr.troubleshootingDocsPath">documentation</a>. class="media-body"
v-html="errorText"
>
</div> </div>
</template> </template>
<template v-else-if="hasPipeline"> <template v-else-if="hasPipeline">
......
...@@ -266,6 +266,7 @@ export default { ...@@ -266,6 +266,7 @@ export default {
:has-ci="mr.hasCI" :has-ci="mr.hasCI"
:source-branch="mr.sourceBranch" :source-branch="mr.sourceBranch"
:source-branch-link="mr.sourceBranchLink" :source-branch-link="mr.sourceBranchLink"
:troubleshooting-docs-path="mr.troubleshootingDocsPath"
/> />
<deployment <deployment
v-for="deployment in mr.deployments" v-for="deployment in mr.deployments"
......
...@@ -18,7 +18,7 @@ export default class MergeRequestStore { ...@@ -18,7 +18,7 @@ export default class MergeRequestStore {
this.squash = data.squash; this.squash = data.squash;
this.squashBeforeMergeHelpPath = this.squashBeforeMergeHelpPath =
this.squashBeforeMergeHelpPath || data.squash_before_merge_help_path; this.squashBeforeMergeHelpPath || data.squash_before_merge_help_path;
this.troubleshootingDocsPath = data.troubleshooting_docs_path this.troubleshootingDocsPath = data.troubleshooting_docs_path;
this.enableSquashBeforeMerge = this.enableSquashBeforeMerge || true; this.enableSquashBeforeMerge = this.enableSquashBeforeMerge || true;
this.iid = data.iid; this.iid = data.iid;
......
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