Commit 31bad576 authored by David O'Regan's avatar David O'Regan Committed by Jacques Erasmus

Migrate merge train when docs path

parent acaa798d
...@@ -590,13 +590,7 @@ export default { ...@@ -590,13 +590,7 @@ export default {
:class="{ 'gl-w-full gl-order-n1 gl-mb-5': glFeatures.restructuredMrWidget }" :class="{ 'gl-w-full gl-order-n1 gl-mb-5': glFeatures.restructuredMrWidget }"
class="gl-display-flex gl-align-items-center gl-flex-wrap" class="gl-display-flex gl-align-items-center gl-flex-wrap"
> >
<merge-train-helper-icon <merge-train-helper-icon v-if="shouldRenderMergeTrainHelperIcon" class="gl-mx-3" />
v-if="shouldRenderMergeTrainHelperIcon"
:merge-train-when-pipeline-succeeds-docs-path="
mr.mergeTrainWhenPipelineSucceedsDocsPath
"
class="gl-mx-3"
/>
<gl-form-checkbox <gl-form-checkbox
v-if="canRemoveSourceBranch" v-if="canRemoveSourceBranch"
......
...@@ -59,7 +59,6 @@ export default class MergeRequestStore { ...@@ -59,7 +59,6 @@ export default class MergeRequestStore {
this.sourceBranch = data.source_branch; this.sourceBranch = data.source_branch;
this.sourceBranchProtected = data.source_branch_protected; this.sourceBranchProtected = data.source_branch_protected;
this.conflictsDocsPath = data.conflicts_docs_path; this.conflictsDocsPath = data.conflicts_docs_path;
this.mergeTrainWhenPipelineSucceedsDocsPath = data.merge_train_when_pipeline_succeeds_docs_path;
this.commitMessage = data.default_merge_commit_message; this.commitMessage = data.default_merge_commit_message;
this.shortMergeCommitSha = data.short_merged_commit_sha; this.shortMergeCommitSha = data.short_merged_commit_sha;
this.mergeCommitSha = data.merged_commit_sha; this.mergeCommitSha = data.merged_commit_sha;
......
<script> <script>
import { GlIcon, GlLink, GlPopover } from '@gitlab/ui'; import { GlIcon, GlLink, GlPopover } from '@gitlab/ui';
import { helpPagePath } from '~/helpers/help_page_helper';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
export default { export default {
...@@ -9,13 +10,6 @@ export default { ...@@ -9,13 +10,6 @@ export default {
GlLink, GlLink,
GlPopover, GlPopover,
}, },
props: {
mergeTrainWhenPipelineSucceedsDocsPath: {
type: String,
required: true,
},
},
i18n: { i18n: {
popoverTitle: s__('mrWidget|What is a merge train?'), popoverTitle: s__('mrWidget|What is a merge train?'),
popoverContent: s__( popoverContent: s__(
...@@ -28,6 +22,13 @@ export default { ...@@ -28,6 +22,13 @@ export default {
target: 'merge-train-help', target: 'merge-train-help',
container: 'merge-train-help-container', container: 'merge-train-help-container',
}, },
computed: {
mergeTrainWhenPipelineSucceedsDocsPath() {
return helpPagePath('ci/pipelines/merge_trains.md', {
anchor: 'add-a-merge-request-to-a-merge-train',
});
},
},
}; };
</script> </script>
......
...@@ -28,10 +28,6 @@ module EE ...@@ -28,10 +28,6 @@ module EE
end end
end end
def merge_train_when_pipeline_succeeds_docs_path
help_page_path('ci/pipelines/merge_trains.md', anchor: 'add-a-merge-request-to-a-merge-train')
end
def merge_immediately_docs_path def merge_immediately_docs_path
help_page_path('ci/pipelines/merge_trains.md', anchor: 'immediately-merge-a-merge-request-with-a-merge-train') help_page_path('ci/pipelines/merge_trains.md', anchor: 'immediately-merge-a-merge-request-with-a-merge-train')
end end
......
...@@ -5,10 +5,6 @@ module EE ...@@ -5,10 +5,6 @@ module EE
extend ActiveSupport::Concern extend ActiveSupport::Concern
prepended do prepended do
expose :merge_train_when_pipeline_succeeds_docs_path do |merge_request|
presenter(merge_request).merge_train_when_pipeline_succeeds_docs_path
end
expose :policy_violation do |merge_request| expose :policy_violation do |merge_request|
presenter(merge_request).has_denied_policies? presenter(merge_request).has_denied_policies?
end end
......
...@@ -97,10 +97,6 @@ module EE ...@@ -97,10 +97,6 @@ module EE
presenter(merge_request).api_approval_settings_path presenter(merge_request).api_approval_settings_path
end end
expose :merge_train_when_pipeline_succeeds_docs_path do |merge_request|
presenter(merge_request).merge_train_when_pipeline_succeeds_docs_path
end
expose :merge_immediately_docs_path do |merge_request| expose :merge_immediately_docs_path do |merge_request|
presenter(merge_request).merge_immediately_docs_path presenter(merge_request).merge_immediately_docs_path
end end
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
{ "$ref": "../../../../../../spec/fixtures/api/schemas/entities/merge_request_poll_cached_widget.json" }, { "$ref": "../../../../../../spec/fixtures/api/schemas/entities/merge_request_poll_cached_widget.json" },
{ {
"properties" : { "properties" : {
"merge_train_when_pipeline_succeeds_docs_path": { "type": "string" },
"policy_violation": { "type": "boolean" } "policy_violation": { "type": "boolean" }
} }
} }
......
...@@ -5,18 +5,14 @@ import MergeTrainHelperIcon from 'ee/vue_merge_request_widget/components/merge_t ...@@ -5,18 +5,14 @@ import MergeTrainHelperIcon from 'ee/vue_merge_request_widget/components/merge_t
describe('MergeTrainHelperIcon', () => { describe('MergeTrainHelperIcon', () => {
let wrapper; let wrapper;
const helpLink = 'path/to/help'; const helpLink = '/help/ci/pipelines/merge_trains.md#add-a-merge-request-to-a-merge-train';
const findIcon = () => wrapper.findComponent(GlIcon); const findIcon = () => wrapper.findComponent(GlIcon);
const findPopover = () => wrapper.findComponent(GlPopover); const findPopover = () => wrapper.findComponent(GlPopover);
const findLink = () => wrapper.findComponent(GlLink); const findLink = () => wrapper.findComponent(GlLink);
const createComponent = () => { const createComponent = () => {
wrapper = shallowMount(MergeTrainHelperIcon, { wrapper = shallowMount(MergeTrainHelperIcon);
propsData: {
mergeTrainWhenPipelineSucceedsDocsPath: helpLink,
},
});
}; };
beforeEach(() => { beforeEach(() => {
......
...@@ -56,7 +56,6 @@ describe('ReadyToMerge', () => { ...@@ -56,7 +56,6 @@ describe('ReadyToMerge', () => {
preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY, preferredAutoMergeStrategy: MWPS_MERGE_STRATEGY,
availableAutoMergeStrategies: [MWPS_MERGE_STRATEGY], availableAutoMergeStrategies: [MWPS_MERGE_STRATEGY],
mergeImmediatelyDocsPath: 'path/to/merge/immediately/docs', mergeImmediatelyDocsPath: 'path/to/merge/immediately/docs',
mergeTrainWhenPipelineSucceedsDocsPath: '/merge-train/docs',
mergeTrainsCount: 0, mergeTrainsCount: 0,
}; };
......
...@@ -11,10 +11,6 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do ...@@ -11,10 +11,6 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do
subject { described_class.new(resource, request: request).as_json } subject { described_class.new(resource, request: request).as_json }
it 'includes docs path for merge trains' do
is_expected.to include(:merge_train_when_pipeline_succeeds_docs_path)
end
it 'includes policy violation status' do it 'includes policy violation status' do
is_expected.to include(:policy_violation) is_expected.to include(:policy_violation)
end end
......
...@@ -271,8 +271,6 @@ export default { ...@@ -271,8 +271,6 @@ export default {
mr_troubleshooting_docs_path: 'help', mr_troubleshooting_docs_path: 'help',
ci_troubleshooting_docs_path: 'help2', ci_troubleshooting_docs_path: 'help2',
merge_request_pipelines_docs_path: '/help/ci/pipelines/merge_request_pipelines.md', merge_request_pipelines_docs_path: '/help/ci/pipelines/merge_request_pipelines.md',
merge_train_when_pipeline_succeeds_docs_path:
'/help/ci/pipelines/merge_trains.md#startadd-to-merge-train-when-pipeline-succeeds',
squash: true, squash: true,
visual_review_app_available: true, visual_review_app_available: true,
merge_trains_enabled: true, merge_trains_enabled: true,
......
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