-
Notifications
You must be signed in to change notification settings - Fork 38
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
Prevent user from saving CO without current determination #4901
base: production
Are you sure you want to change the base?
Conversation
Triggered by c560078 on branch refs/heads/issue-4819
This reverts commit bb4470c.
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.
This approach is fine for now given how businessRules and saveBlockers are currently implemented 😅
Still is a mess with how verbose and complicated it is to add 'simple' behavior such as this.
Thus most of these comments are just related to refactoring and nothing functional.
specifyweb/frontend/js_src/lib/components/DataModel/businessRuleDefs.ts
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/DataModel/businessRuleDefs.ts
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/DataModel/businessRuleDefs.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Jason Melton <64045831+melton-jason@users.noreply.github.com>
- uses onAdded instead - setting isCurrent to true in onAdded triggers the isCurrent fieldCheck which unchecks other determinations
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.
Much simpler, thanks for refactoring this!
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.
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.
- Go to Data Entry->Collection Object
- Add multiple determinations
- Play around with deleting, unchecking and adding a current determination
- Verify save is blocked when no current determinations exist
- Verify save is enabled when a current determination is added
Looks good! Worked with unchecking and deleting, as well as newly added determinations. No unexpected behavior during my checks.
Fixes #4819
Checklist
and self-explanatory (or properly documented)
Testing instructions