-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear only determination when COType is changing #5201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions
- Open CO from
- Add COType
- Add Determination
- Add other fields
- Save
- Change the COType
- Verify Determination as been erased but other fields have kept their value
Looks good, only determinations are removed when COType is changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions
- Open CO from
- Add COType
- Add Determination
- Add other fields
- Save
- Change the COType
- Verify Determination as been erased but other fields have kept their value
Looks good! Only fields from the Determination table are cleared.
Screen.Recording.2024-08-07.at.11.58.12.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions
Fixes #5199
- Open CO from
- Add COType
- Add Determination
- Add other fields
- Save
- Change the COType
- Verify Determination as been erased but other fields have kept their value
Fixes #5198
- Go to a record with a 'Collection Object Type'
- Add a determination if not present
- Save
- Add a dependent Collecting Event via the subview
- See the determination(s) are not deleted
Issue #5199 is fixed but #5198 is still happening to me.
Seems to only happen after a refresh, not when immediately adding a CE after saving.
chrome_O8urjoLJ6v.mp4
EDIT: #5198 is no longer in the scope of this PR, so its working as expected 👍
specifyweb/frontend/js_src/lib/components/DataModel/businessRuleDefs.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally, this is fine as long as this is acceptable for the requirements. I'd love to see a test for the clearing functionality! 😃
Building a little more on the requirements, I will caution that if it is never acceptable to have determinations on a CollectionObject which are associated to taxon records from a different taxon tree, then this is not a complete solution.
Whether intentional or not, a user can still have determinations which have taxons that do not exist on the collectionObjectType -> taxontreedef.
specifyweb/frontend/js_src/lib/components/DataModel/businessRuleDefs.ts
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/DataModel/__tests__/businessRules.test.ts
Outdated
Show resolved
Hide resolved
…leDefs.ts Co-authored-by: Jason Melton <64045831+melton-jason@users.noreply.github.com>
Triggered by 149dd15 on branch refs/heads/issue-5199
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing instructions
Fixes #5199
- Open CO from
- Add COType
- Add Determination
- Add other fields
- Save
- Change the COType
- Verify Determination has been erased but other fields have kept their value
14_funnyturtles.mp4
Fixes #5198
- Open CO from
- Add COType
- Add Determination
- Save
- Add CE
- Verify Determination has not been erased
14_addevent.mp4
Looks good, is working!
Fixes #5199
Fixes #5198
Checklist
and self-explanatory (or properly documented)
Testing instructions
Fixes #5199
Fixes #5198