Skip to content
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

Merged
merged 12 commits into from
May 3, 2024
Merged

fix: handle ADMIN_LEVEL > 2 #6809

merged 12 commits into from
May 3, 2024

Conversation

Zangetsu101
Copy link
Collaborator

@Zangetsu101 Zangetsu101 commented Apr 18, 2024

These bug fixes came from Uganda PoC. So likely need to be cherry picked for 1.4.x

farajaland PR: opencrvs/opencrvs-farajaland#978

Comment on lines 682 to 700
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 ??
''
)
Copy link
Member

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

Copy link
Collaborator Author

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

Copy link
Member

@rikukissa rikukissa Apr 25, 2024

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

@naftis naftis merged commit a58a81d into develop May 3, 2024
21 checks passed
@naftis naftis deleted the uganda-bugfixes branch May 3, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants