-
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
COG business rules: isPrimary
and isSubstrate
#5275
base: production
Are you sure you want to change the base?
Conversation
Triggered by c1e8978 on branch refs/heads/issue-5246
- frontend and backend fieldNames were out of sync
8175e07
to
58a2573
Compare
specifyweb/frontend/js_src/lib/components/DataModel/__tests__/businessRules.test.ts
Outdated
Show resolved
Hide resolved
@@ -468,6 +468,8 @@ export type FormCondition = | |||
| State<'Always'> | |||
| undefined; | |||
|
|||
export const EMPTY_VALUE_CONDITION = '_EMPTY'; |
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.
could you clarify why this is needed, and why having an empty string ""
isn't sufficient?
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.
Just so users have a clearer way of doing an empty value check. A condition like <rows condition="childcog=">
will work for an empty value check but it reads like an incomplete condition and on first glance doesn't seem like it would/should be doing anything at all. The _EMPTY
keyword should just make things clearer for users
Co-authored-by: Max Patiiuk <[email protected]>
The field that will contain the children of a COG is |
Fixes #5246
Business Logic:
isPrimary
andisSubstrate
can only be set toTrue
for a single CO.isPrimary
orisSubstrate
fields.IsPrimary
is set toTrue
for one CO in a COG. All other COJO records will haveIsPrimary
set toFalse
.IsPrimary
set toTrue
, it isNULL
for all COJO records in the COG.isPrimary
set toTrue
when the COG type is 'consolidated'NOTE:
This PR adds the possibility to do an empty value check in conditional rendering using the keyword
_EMPTY
. This was already possible if we use an incomplete condition like<rows condition="childcog=">
but it's an unintentional feature and may not seem very clear to users. Empty value checks can now be done with a condition like this:The condition will hold true whenever a relation is null or a field has a blank value.
Checklist
and self-explanatory (or properly documented)
Testing instructions
These viewdefs can be used for testing
COG viewdef
COJO viewdef