This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
fix: LEAP-640: Don't save empty draft on View All #1689
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We should save draft when user clicks on View All, but we should save it only if there are changes made to annotation.
PR fulfills these requirements
Describe the reason for change
Draft is created/updated every time user click on View All, even if that's fresh new task, if there are no changes, if draft was saved a second ago.
What alternative approaches were there?
We could add checks for actual changes to
saveDraftImmediatelyWithResults()
, but the whole approach should be revisited. So current fix is a quick patch for the actual problem.Also the main reason for draft not being saved is the check for
editable
insaveDraft()
— at this moment View All is already displayed and all annotations are not editable. Most probably it will be enough just to rewrite this check to check for annotation explicitly.This change affects (describe how if yes)
Does this PR introduce a breaking change?
What level of testing was included in the change?