Fix draft not clearing after submitting description

What does this MR do and why?

Fix draft not clearing after submitting description (#491264 (closed))

When editing the description of a work item, a draft is saved on every key press. When editing is cancelled by the user, the draft is deleted. However, when editing is saved, the draft is not deleted. This means, in some cases, this old draft is used when the user starts editing. The solution is to clear the draft when editing is saved.

Changelog: fixed

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screen_Recording_2024-09-24_at_5.54.02_PM Screen_Recording_2024-09-24_at_5.55.02_PM

How to set up and validate locally

  1. In rails console
    Feature.enable(:work_item_epics)
    Feature.enable(:work_item_epics_rollout)
    Feature.enable(:namespace_level_work_items)
  2. Visit any work items list page for a group such as http://127.0.0.1:3000/groups/flightjs/-/work_items
  3. Create an epic
  4. Open epic in new tab
  5. Update description to contain checklist items, then save
  6. Check some of the checklist items
  7. Edit the description, and notice that the checklist items in the markdown match the state of the clicked checklist items

Related to #491264 (closed)

Edited by Coung Ngo

Merge request reports

Loading