taggit-tacc / taggit

2 stars 1 forks source link

Task/DES-2429: Tag saving issue #112

Closed duckonomy closed 1 year ago

duckonomy commented 1 year ago

Overview:

Fixes tag state race conditions.

Problems

  1. Because the state related to tag/group data is parsed and re-rendered on getting features, the local UI was slow to change and the user sometimes saw incorrect tag states (on saving). Ideally, server would persist changes on input events if additional state parsing isn't needed...
  2. Also, because the changes to state weren't adjusted properly, the UI of tags didn't reflect the changes made by the user.

    Fixes

  3. To fix this, I've adjusted the input events of tags to make adjustments to local features, which now persist when jumping between groups/images.
  4. In addition, to fix the inconvenience of saving per tag, I've introduced a state (updatedTagFeatures) to keep track of features that have been changed and added a global save tags button (only shown when there are changes).
  5. And I've added a loader to indicate that values are getting saved.

Related Jira tickets:

Testing Steps:

Deployed branch to https://taggit-tacc.github.io/

  1. Create a tag in the Taggit view.
  2. Change tag values.
  3. Ensure local inputs persist when switching between images/groups
  4. Ensure that the save button appears on making changes.
  5. Click on save.
  6. Ensure that correct tag values have persisted after refresh for all the tags.

Image

Screen Shot 2023-02-17 at 11 46 32 PM