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
- Go to Group > Project > Issues
- Create a Issue
- Upload an design image
- Click on the image
- Click on the image to comment on the design
- Reply to the same comment and use ctrl/cmd + enter to submit the comment
- Try replying again using the text box
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #388314 (closed)