Commit bf49a7a3 authored by Stan Hu's avatar Stan Hu

Clean up refresh fix for cancel automatic merge

In https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26232, we fixed
the merge request widget not updating properly when clicking the `Cancel
automatic merge` button.

This fix was a bit of hack: it would force the frontend to refresh the
merge request widget instead of relying on the output of the
`/cancel_auto_merge` response. This response returned incomplete
information when we split the widget information in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/15045 to return
cached and uncached data.

In https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29757, we fixed
the `/cancel_auto_merge` response to return all the relevant data, so we
can remove this workaround.
parent a95830ab
......@@ -52,7 +52,6 @@ export default {
.then(res => res.data)
.then(data => {
eventHub.$emit('UpdateWidgetData', data);
eventHub.$emit('MRWidgetUpdateRequested');
})
.catch(() => {
this.isCancellingAutoMerge = false;
......
......@@ -123,7 +123,6 @@ export default class MergeRequestStore {
const currentUser = data.current_user;
if (currentUser) {
this.cherryPickInForkPath = currentUser.cherry_pick_in_fork_path;
this.revertInForkPath = currentUser.revert_in_fork_path;
......@@ -131,7 +130,6 @@ export default class MergeRequestStore {
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: Clean up refresh fix for cancel automatic merge
merge_request: 29844
author:
type: other
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