Integrate decision archiving with GraphQL mutation
What does this MR do?
This MR changes how a user removes a decision from the decision log. Before, the menu said "Remove decision" and only updated the browser. The change did not reach the server.
Now the menu says "Archive decision". Selecting it calls the workItemDecisionArchive GraphQL mutation. The mutation returns the updated decision. Apollo then updates the cached record by its id. The decision stays in the list with an "Archived" badge. The archive option then disappears from that card, so a user cannot archive the same decision twice.
A successful archive shows a "Decision archived" toast. If the mutation fails, the user sees an alert. The decision stays unchanged.
The state field lives on the shared Decision GraphQL fragment. The decision log query, the create mutation, and the archive mutation all select it. This is how the frontend reads the real archived state, and why the "Archived" badge survives a page reload.
The feature sits behind the decision_log feature flag.
Screenshots
| Recording |
|---|
How to test
- Check out this branch.
- Enable the
decision_logfeature flag. - Open a work item that has decisions.
- Open the decision log panel.
- Open the three dots menu on a decision card.
- Select "Archive decision".
- Confirm you see a "Decision archived" toast. The card stays in the list, shows an "Archived" badge, and no longer offers the archive option.
- Reload the page. Confirm the "Archived" badge is still there.
Related
- Backend MR (merged): !255174 (merged)
- Issue: #627780 (closed)