Commit 7efa414b authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'sh-refresh-mr-widget-upon-cancel' into 'master'

Refresh widget after canceling "Merge When Pipeline Succeeds"

Closes #197487

See merge request gitlab-org/gitlab!26232
parents 8d8e2173 c6691259
......@@ -53,6 +53,7 @@ export default {
.then(res => res.data)
.then(data => {
eventHub.$emit('UpdateWidgetData', data);
eventHub.$emit('MRWidgetUpdateRequested');
})
.catch(() => {
this.isCancellingAutoMerge = false;
......
......@@ -123,13 +123,15 @@ export default class MergeRequestStore {
const currentUser = data.current_user;
this.cherryPickInForkPath = currentUser.cherry_pick_in_fork_path;
this.revertInForkPath = currentUser.revert_in_fork_path;
this.canRemoveSourceBranch = currentUser.can_remove_source_branch || false;
this.canCreateIssue = currentUser.can_create_issue || false;
this.canCherryPickInCurrentMR = currentUser.can_cherry_pick_on_current_merge_request || false;
this.canRevertInCurrentMR = currentUser.can_revert_on_current_merge_request || false;
if (currentUser) {
this.cherryPickInForkPath = currentUser.cherry_pick_in_fork_path;
this.revertInForkPath = currentUser.revert_in_fork_path;
this.canRemoveSourceBranch = currentUser.can_remove_source_branch || false;
this.canCreateIssue = currentUser.can_create_issue || false;
this.canCherryPickInCurrentMR = currentUser.can_cherry_pick_on_current_merge_request || false;
this.canRevertInCurrentMR = currentUser.can_revert_on_current_merge_request || false;
}
this.setState(data);
}
......
---
title: Refresh widget after canceling "Merge When Pipeline Succeeds"
merge_request: 26232
author:
type: fixed
......@@ -64,6 +64,10 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
before do
click_button "Merge when pipeline succeeds"
click_link "Cancel automatic merge"
wait_for_requests
expect(page).to have_content 'Merge when pipeline succeeds', wait: 0
end
it_behaves_like 'Merge when pipeline succeeds activator'
......
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