diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-09-19 01:06:47 +0300 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-09-20 07:48:40 +0300 |
commit | f7f9847b26fd9f401039908843de2b660473e73d (patch) | |
tree | a66ffe98c8e912a426de98470205a885da7d113a /app/assets/javascripts/vue_merge_request_widget | |
parent | ccdf687baa82dd0e0f809cfb24dc892db756bad7 (diff) |
Port fast-forward MR widget states from EE
See https://gitlab.com/gitlab-org/gitlab-ce/issues/20076
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget')
4 files changed, 41 insertions, 19 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_status_icon.js b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_status_icon.js index 703f3a56a34..3cbcbdd52c5 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_status_icon.js +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_status_icon.js @@ -26,6 +26,7 @@ export default { <ci-icon v-else :status="statusObj" /> <button v-if="showDisabledButton" + ref="mergeButton" type="button" class="btn btn-success btn-sm" disabled="true"> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.js b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.js index f9cb79a0bc1..f2245a532f4 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.js +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.js @@ -10,27 +10,40 @@ export default { }, template: ` <div class="mr-widget-body media"> - <status-icon status="failed" showDisabledButton /> + <status-icon + ref="statusIcon" + status="failed" + showDisabledButton /> <div class="media-body space-children"> - <span class="bold"> - There are merge conflicts<span v-if="!mr.canMerge">.</span> - <span v-if="!mr.canMerge"> - Resolve these conflicts or ask someone with write access to this repository to merge it locally + <template v-if="mr.ffOnlyEnabled"> + <span class="bold"> + Fast-forward merge is not possible. + To merge this request, first rebase locally </span> - </span> - <a - v-if="mr.canMerge && mr.conflictResolutionPath" - :href="mr.conflictResolutionPath" - class="btn btn-default btn-xs js-resolve-conflicts-button"> - Resolve conflicts - </a> - <a - v-if="mr.canMerge" - class="btn btn-default btn-xs js-merge-locally-button" - data-toggle="modal" - href="#modal_merge_info"> - Merge locally - </a> + </template> + <template v-else> + <span class="bold"> + There are merge conflicts<span v-if="!mr.canMerge">.</span> + <span v-if="!mr.canMerge"> + Resolve these conflicts or ask someone with write access to this repository to merge it locally + </span> + </span> + <a + v-if="mr.canMerge && mr.conflictResolutionPath" + ref="resolveConflictsButton" + :href="mr.conflictResolutionPath" + class="btn btn-default btn-xs"> + Resolve conflicts + </a> + <a + v-if="mr.canMerge" + ref="mergeLocallyButton" + class="btn btn-default btn-xs" + data-toggle="modal" + href="#modal_merge_info"> + Merge locally + </a> + </template> </div> </div> `, diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_ready_to_merge.js b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_ready_to_merge.js index ad709da51ee..e1c37add496 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_ready_to_merge.js +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_ready_to_merge.js @@ -284,7 +284,14 @@ export default { :mr="mr" :is-merge-button-disabled="isMergeButtonDisabled" /> + <span + v-if="mr.ffOnlyEnabled" + ref="fastForwardMessage"> + Fast-forward merge without a merge commit + </span> <button + v-else + ref="modifyCommitMessageButton" @click="toggleCommitMessageEditor" :disabled="isMergeButtonDisabled" class="btn btn-default btn-xs" diff --git a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js index 29464662578..03969e33e97 100644 --- a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js +++ b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js @@ -57,6 +57,7 @@ export default class MergeRequestStore { this.onlyAllowMergeIfPipelineSucceeds = data.only_allow_merge_if_pipeline_succeeds || false; this.mergeWhenPipelineSucceeds = data.merge_when_pipeline_succeeds || false; this.mergePath = data.merge_path; + this.ffOnlyEnabled = data.ff_only_enabled; this.statusPath = data.status_path; this.emailPatchesPath = data.email_patches_path; this.plainDiffPath = data.plain_diff_path; |