Skip to content

Fix inconsistent behaviour in design comments

What does this MR do and why?

The main issue is related to the use of the shortcut ctrl/cmd + enter while saving the comment. The comment is not reseting in local storage and gets filled again when comment form is reopened.

The child component DesignReplyForm is wrapped by ApolloMutation and then used in the parent components(pages/index.vue, DesignNotes, DesignDiscussion). The comment value is handled separately in each parent components and synchronised using v-model and apollo-mutation. But autosave and this setup was not working as expected.

It is resolved by changing the setup in following way

  • handling the comment value and the add/update mutations in the DesignReplyForm component itself. This basically resolves the synchronisation issue.
  • reseting the local storage value when mutation is completed and the component is destroyed by the parent.

Screenshots or screen recordings

Before After
Screen_Recording_2023-02-14_at_1.18.42_PM Screen_Recording_2023-02-14_at_1.10.36_PM

How to set up and validate locally

  1. Go to Group > Project > Issues
  2. Create a Issue
  3. Upload an design image
  4. Click on the image
  5. Click on the image to comment on the design
  6. Reply to the same comment and use ctrl/cmd + enter to submit the comment
  7. Try replying again using the text box
  8. Check if the last commented value is still there in the text area

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #388314 (closed)

Edited by Rajan Mistry

Merge request reports