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