-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix: handle ADMIN_LEVEL > 2 #6809
Conversation
return ( | ||
Object.keys(NAME_TO_IDENTIFIER) | ||
.filter((fieldNameIdentifier) => field.name.includes(fieldNameIdentifier)) | ||
.map( | ||
(fieldNameIdentifier) => | ||
userDetails?.catchmentArea?.find((catchmentArea) => | ||
catchmentArea.identifier?.some( | ||
(identifier) => | ||
identifier.value === | ||
NAME_TO_IDENTIFIER[ | ||
fieldNameIdentifier as keyof typeof NAME_TO_IDENTIFIER | ||
] | ||
) | ||
)?.id ?? '' | ||
) | ||
.at(0) ?? | ||
field.initialValue ?? | ||
'' | ||
) |
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.
Note that you can read the user's details in country config form handler and set a default value for the select based on their primaryOffice. This was we can slowly retire these obscure rules from the client without it needing to be fixed in Uganda country config later on
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.
@rikukissa default address generation is now being done on country-config: opencrvs/opencrvs-farajaland#978
That said we still need the core changes to keep backwards compatibility I guess
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.
We can mark this as a breaking change in 1.5.0 especially if it only affects the input not properly getting a default value @Zangetsu101. Getting as much of this code out core as possible outweights such a minor breaking change / defect
These bug fixes came from Uganda PoC. So likely need to be cherry picked for 1.4.x
farajaland PR: opencrvs/opencrvs-farajaland#978