-
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
Add frontend businessrules for Address isPrimary
#4443
Conversation
Triggered by 09dfaa6 on branch refs/heads/issue-4440
I might be missing it, but I don't see back-end having business rules for either of these fields in Address table Though, in
isPrimary field (since 4861b7d)
(the form has both isCurrent and isPrimary though) Determiner has isPrimary field too |
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.
Looks good and is working as expected!
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.
👏👏👏
you are setting the next level for Specify with all those tests you add all the time
@specify/ux-testing |
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.
Looks good, is primary
can only be selected for one address.
Fixes #4440
Addresses part of #672
#672 can additionally be closed if this Pull Request resolves that as well.
However, there still may be cases where Agent's can have multiple primary addresses: this change only handles the case where the
isPrimary
field is manually altered on one of the Agent's addresses, or a new Address is added.The case of an Agent having multiple primary addresses before these changes is not one that I think should be handled or resolved automatically by way of a migration or business rule.
Because of this, I would reccomend closing #672, and instead open a new Issue which implements @maxpatiiuk's suggestion in #672 (comment)
@specify/ux-testing
There is a similar field on Address titled
isCurrent
.Should the field also have a businessrule with the same behavior as
isPrimary
?Checklist
and self-explanatory (or properly documented)
Testing instructions
On the
Agent
form, ensure the AddressisPrimary
field behaves the same as DeterminationisCurrent
does.More specifically:
isPrimary
for all other Addresses and set the new AddressisPrimary
to true.isPrimary
should be unchecked for all other addresses on the Agent.