Commit 68629297 authored by Phil Hughes's avatar Phil Hughes

Fixed toggling draft state showing wrong state

Fixes the wrong state being shown after toggling the draft state
from inside the widget.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/323688
parent 01c2af91
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
data: { data: {
mergeRequestSetWip: { mergeRequestSetWip: {
errors, errors,
mergeRequest: { workInProgress, title }, mergeRequest: { mergeableDiscussionsState, workInProgress, title },
}, },
}, },
}, },
...@@ -87,6 +87,8 @@ export default { ...@@ -87,6 +87,8 @@ export default {
}); });
const data = produce(sourceData, (draftState) => { const data = produce(sourceData, (draftState) => {
// eslint-disable-next-line no-param-reassign
draftState.project.mergeRequest.mergeableDiscussionsState = mergeableDiscussionsState;
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
draftState.project.mergeRequest.workInProgress = workInProgress; draftState.project.mergeRequest.workInProgress = workInProgress;
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
...@@ -107,6 +109,7 @@ export default { ...@@ -107,6 +109,7 @@ export default {
errors: [], errors: [],
mergeRequest: { mergeRequest: {
__typename: 'MergeRequest', __typename: 'MergeRequest',
mergeableDiscussionsState: true,
title: this.mr.title, title: this.mr.title,
workInProgress: false, workInProgress: false,
}, },
......
mutation toggleWIPStatus($projectPath: ID!, $iid: String!, $wip: Boolean!) { mutation toggleWIPStatus($projectPath: ID!, $iid: String!, $wip: Boolean!) {
mergeRequestSetWip(input: { projectPath: $projectPath, iid: $iid, wip: $wip }) { mergeRequestSetWip(input: { projectPath: $projectPath, iid: $iid, wip: $wip }) {
mergeRequest { mergeRequest {
mergeableDiscussionsState
title title
workInProgress workInProgress
} }
......
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