Skip to content
Snippets Groups Projects

Disable "Remove source branch" in MR Widget for users who can't remove, and re-add checkbox to MR form

All threads resolved!
@@ -11,7 +11,6 @@ export default class MergeRequestStore {
setData(data) {
const currentUser = data.current_user;
const pipelineStatus = data.pipeline ? data.pipeline.details.status : null;
const mergeParams = data.merge_params || {};
this.title = data.title;
this.targetBranch = data.target_branch;
@@ -52,8 +51,7 @@ export default class MergeRequestStore {
this.cancelAutoMergePath = data.cancel_merge_when_pipeline_succeeds_path;
this.removeWIPPath = data.remove_wip_path;
this.sourceBranchRemoved = !data.source_branch_exists;
this.shouldRemoveSourceBranch = mergeParams.should_remove_source_branch ||
mergeParams.force_remove_source_branch === '1' || false;
this.shouldRemoveSourceBranch = data.remove_source_branch || false;
this.onlyAllowMergeIfPipelineSucceeds = data.only_allow_merge_if_pipeline_succeeds || false;
this.mergeWhenPipelineSucceeds = data.merge_when_pipeline_succeeds || false;
this.mergePath = data.merge_path;
Loading