diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-05-12 12:03:20 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-05-12 12:03:20 +0000 |
commit | 2a8686353a507d52c3d0c04da66bd05f62e43226 (patch) | |
tree | 6239c6eabdef26b8ea140eb0309101cc0b7a2e00 /app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js | |
parent | e012427cf32f0fb36aa80c89442e4731d0939e65 (diff) | |
parent | b6122aa9c7f370a6565649e6f5eb0c735210d64b (diff) | |
download | gitlab-ce-2a8686353a507d52c3d0c04da66bd05f62e43226.tar.gz |
Merge branch '32178-prevent-merge-on-sha-change' into 'master'
Add "SHA mismatch" state to the MR widget
Closes #32178
See merge request !11316
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js | 2 |
1 files changed, 2 insertions, 0 deletions
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 faafeae5c5b..05e67706983 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 @@ -4,6 +4,7 @@ import { getStateKey } from '../dependencies'; export default class MergeRequestStore { constructor(data) { + this.startingSha = data.diff_head_sha; this.setData(data); } @@ -67,6 +68,7 @@ export default class MergeRequestStore { this.canMerge = !!data.merge_path; this.canCreateIssue = currentUser.can_create_issue || false; this.canCancelAutomaticMerge = !!data.cancel_merge_when_pipeline_succeeds_path; + this.hasSHAChanged = this.sha !== this.startingSha; this.canBeMerged = data.can_be_merged || false; // Cherry-pick and Revert actions related |