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

Configurable human name formatting #6830

Open
4 of 6 tasks
euanmillar opened this issue Apr 19, 2024 · 5 comments · Fixed by #7697 or opencrvs/opencrvs-countryconfig#289 · May be fixed by opencrvs/opencrvs-countryconfig#298 or #7812
Open
4 of 6 tasks

Configurable human name formatting #6830

euanmillar opened this issue Apr 19, 2024 · 5 comments · Fixed by #7697 or opencrvs/opencrvs-countryconfig#289 · May be fixed by opencrvs/opencrvs-countryconfig#298 or #7812
Assignees
Labels
Milestone

Comments

@euanmillar
Copy link
Collaborator

euanmillar commented Apr 19, 2024

OpenCRVS is hardcoded to display names with family name appearing last in many places: {firstName} {middleName} {lastName}.

This ticket describes 2 changes that we need to make.

Tech tasks

National System Admin – Create user form

Image

  1. When logged in as a national system administrator user you can create new users in offices. The create new user form is not currently configurable and we have no plans to make it configurable. However, as we often receive requests from countries to have the surname first in this form, we have decided to satisfy that requirement by putting surname first for ALL countries.

We also want to remove the question that asks the user for a national ID number in this form as it is not required.

  • Change name field ordering in user creation and edit flows to [Surname] [Firstname]. Rename the labels to be "User's surname" and "User's firstname".
  • Remove the NID question from user creation / edit flow. Ensure possible NIDs are removed from user-mgnt.users collection. Write a migration to remove the field from existing users.

How citizen data appears in the team user list, work queues and record audit

Image

Image

  1. If we create a content management key called constants.humanName with a default value {firstName} {lastName}, then the client could read this content key and dynamically choose to represent names in work queues and record audit according to it. If the content key was like this: {lastName} {middleName} {firstName} then the names could be rendered appropriately
  • Create new copy item constants.humanName with a default value {firstName} {lastName} and start using it in the admin view's user listing. Keep in mind that this same constant is to be used for rendering record subject names so for instance a country might want to have this as {lastName} {middleName} {firstName}
  • Refactor generateName in packages/client/src/utils/data-formatting.ts so that it respects the name format defined in the team user list view

Other applications

  • Go through the app and test for instance {lastName} {middleName} {firstName} properly applies everywhere such as work-queues and record audit.

  • In release notes: Add a few examples of different ways to configure this e.g. middle name doesn't exist OR

@euanmillar euanmillar changed the title user creation form surname should come first User creation form surname should come first Apr 19, 2024
@euanmillar euanmillar added this to the v1.6.0 milestone Apr 22, 2024
@euanmillar
Copy link
Collaborator Author

Decision needs to be made if name configuration is decoupled from the rest of registration form configuration.

@euanmillar euanmillar modified the milestones: v1.6.0, 1.7.0 Apr 29, 2024
@rikukissa
Copy link
Member

rikukissa commented Jun 10, 2024

@euanmillar ticket updated. Can be unblocked and moved to Ready to build

@rikukissa rikukissa changed the title User creation form surname should come first Configurable human name formatting Jun 17, 2024
@rikukissa
Copy link
Member

Updated task description to include configurable name formatting elsewhere in the app as Burkina Faso needs this

@euanmillar
Copy link
Collaborator Author

@rikukissa if we are doing this: "Ensure possible NIDs are removed from user-mgnt.users collection" wont we need a database migration? I wonder if it is worth the effort. It might be acceptable to just leave the national id prop in the database than maintain the migration file. Just an idea

@rikukissa
Copy link
Member

Good point, I'll update the task description. Long-term it's best if we aim to always have the database and data integrity in tip-top shape, so definitely worth writing a migration

@Siyasanga Siyasanga self-assigned this Sep 18, 2024
Siyasanga added a commit that referenced this issue Oct 1, 2024
we often receive requests from countries to have the surname first in this form, we have decided to satisfy that requirement by putting surname first for ALL countries.

#6830
Siyasanga added a commit that referenced this issue Oct 1, 2024
A request came for the clients to change the labels for "First name(s)" to "User's first name". Also change "Last name" to "User's surname" for clarity and less confussion.

#6830
Siyasanga added a commit to opencrvs/opencrvs-countryconfig that referenced this issue Oct 1, 2024
A request came for the clients to change the labels for "First name(s)" to "User's first name". Also change "Last name" to "User's surname" for clarity and less confussion.

opencrvs/opencrvs-core#6830
Siyasanga added a commit to opencrvs/opencrvs-countryconfig that referenced this issue Oct 1, 2024
A request came for the clients to change the labels for "First name(s)" to "User's first name". Also change "Last name" to "User's surname" for clarity and less confussion.

opencrvs/opencrvs-core#6830
Siyasanga added a commit that referenced this issue Oct 3, 2024
Remove the question that asks the user for a national ID number in this form as it is not required

#6830
Siyasanga added a commit to opencrvs/opencrvs-countryconfig that referenced this issue Oct 3, 2024
Remove the question that asks the user for a national ID number in the User details form as it is not required

opencrvs/opencrvs-core#6830
Siyasanga added a commit that referenced this issue Oct 4, 2024
Remove the question that asks the user for a national ID number in this form as it is not required

#6830
Siyasanga pushed a commit that referenced this issue Oct 8, 2024
We no longer need the suffixes for the FamilyName field since we not really using it anywhere

#6830
Siyasanga pushed a commit that referenced this issue Oct 8, 2024
A requirement from client to remove the NID field since most of the contries are not really using it.

#6830
Siyasanga pushed a commit to opencrvs/opencrvs-countryconfig that referenced this issue Oct 8, 2024
We no longer need the suffixes for the FamilyName field since we not really using it anywhere

opencrvs/opencrvs-core#6830
Siyasanga pushed a commit to opencrvs/opencrvs-countryconfig that referenced this issue Oct 9, 2024
The tranlation also get used views/form.ts file which is a different form config file

opencrvs/opencrvs-core#6830
Siyasanga added a commit that referenced this issue Oct 9, 2024
Remove the question that asks the user for a national ID number in this form as it is not required

#6830
Siyasanga pushed a commit that referenced this issue Oct 9, 2024
We no longer need the suffixes for the FamilyName field since we not really using it anywhere

#6830
Siyasanga added a commit that referenced this issue Oct 17, 2024
… and remove NID field (#7697)

* Ask surname first in the User details form

we often receive requests from countries to have the surname first in this form, we have decided to satisfy that requirement by putting surname first for ALL countries.

#6830

* Change name and surname labels for User Details form

A request came for the clients to change the labels for "First name(s)" to "User's first name". Also change "Last name" to "User's surname" for clarity and less confussion.

#6830

* Remove NID field from the user details form

Remove the question that asks the user for a national ID number in this form as it is not required

#6830

* Remove lang suffix for FamilyName field

We no longer need the suffixes for the FamilyName field since we not really using it anywhere

#6830

* Add migration to remove NID field from user

A requirement from client to remove the NID field since most of the contries are not really using it.

#6830

* Record changes in the CHANGELOG

To keep track of changes done on this PR

#6830

* Remove Eng suffix for the firstName in user form

We currently don't support milti language support for both surname and
first names so the ENG/EN suffixes are not needed. Also remove EN bits
that were left for the surname field

#6830

---------

Co-authored-by: Siyasanga Mtshokotsha <[email protected]>
Co-authored-by: Siyasanga Mtshokotsha <[email protected]>
Siyasanga added a commit to opencrvs/opencrvs-countryconfig that referenced this issue Oct 17, 2024
* Remove NID field from the user details form

Remove the question that asks the user for a national ID number in the User details form as it is not required

opencrvs/opencrvs-core#6830

* Add back the NID field translations

The tranlation also get used views/form.ts file which is a different form config file

opencrvs/opencrvs-core#6830

* Record changes for this PR in the CHANGELOG

opencrvs/opencrvs-core#6830

* Rename firstNameEN to userFirstName in client.csv

Since the object was to remove the EN suffix, doing that for this key
would conflict with the already existing 'form.field.label.firstName' so
to differentiate, I opted to use 'form.field.label.userFirstName' to
associate it with the user form

opencrvs/opencrvs-core#6830

---------

Co-authored-by: Siyasanga Mtshokotsha <[email protected]>
Co-authored-by: Siyasanga Mtshokotsha <[email protected]>
Siyasanga added a commit that referenced this issue Oct 22, 2024
To allow countries to have custom ordering for full names

#6830
Siyasanga added a commit that referenced this issue Oct 22, 2024
To ensure that we get the format from the country-config

#6830
@Zangetsu101 Zangetsu101 reopened this Oct 22, 2024
Siyasanga added a commit that referenced this issue Oct 24, 2024
To make the name more usable we had to extract the name formatting logic into it's own function.

#6830
Siyasanga added a commit that referenced this issue Oct 24, 2024
Replace older logic to get the name which was based on an assumption that we support names in multiple languages

#6830
Siyasanga added a commit that referenced this issue Oct 24, 2024
Replace older logic to get the name which was based on an assumption that we support names in multiple languages

#6830
Nil20 added a commit that referenced this issue Oct 29, 2024
* /sendVerifyCode moved to gateway/config/routes.ts; dead code removed (#7763)

* /sendVerifyCode removed to gateway/config/routes.ts; dead code removed

* docs: mention email in description

---------

Co-authored-by: Tameem Bin Haider <[email protected]>

* fix: find office location from current task (#7765)

* fix: hide signature for duplicate record (#7773)

* feat: Update the order of system user add/edit form fields and labels and remove NID field  (#7697)

* Ask surname first in the User details form

we often receive requests from countries to have the surname first in this form, we have decided to satisfy that requirement by putting surname first for ALL countries.

#6830

* Change name and surname labels for User Details form

A request came for the clients to change the labels for "First name(s)" to "User's first name". Also change "Last name" to "User's surname" for clarity and less confussion.

#6830

* Remove NID field from the user details form

Remove the question that asks the user for a national ID number in this form as it is not required

#6830

* Remove lang suffix for FamilyName field

We no longer need the suffixes for the FamilyName field since we not really using it anywhere

#6830

* Add migration to remove NID field from user

A requirement from client to remove the NID field since most of the contries are not really using it.

#6830

* Record changes in the CHANGELOG

To keep track of changes done on this PR

#6830

* Remove Eng suffix for the firstName in user form

We currently don't support milti language support for both surname and
first names so the ENG/EN suffixes are not needed. Also remove EN bits
that were left for the surname field

#6830

---------

Co-authored-by: Siyasanga Mtshokotsha <[email protected]>
Co-authored-by: Siyasanga Mtshokotsha <[email protected]>

* fix: make all triggers which are pointing to the same http request touched on change request state

* chore: add a comment explaining the reason of the change that finds multiple buttons with the same trigger

* chore: show displayName of styled components in devtools (#7830)

* feat(auth): allow issuing single record specific tokens (#7728)

* refactor: move metrics out of authenticate

* feat: initial token exchange endpoint

* chore: update comment to be more specific

* fix: issue with calling metrics environment

* chore: amend changelog

* refactor: improve clarity

* fix: unused import

* chore: add missing schema inputs

* revert: revert mosip code removal to keep PR contained

* chore: add comment about more fine-grained control

* chore: fix test on gateway

* feat: actually check if the record id matches to confirm record

* revert: the confirm registration changes - lets do inanother pr

* refactor: update error messages

* fix: make the no-op simpler

* fix: the query params not passing properly via gateway

* refactor: remove unnecessary gql inputs

* fix: update audiences to include minimum

* fix: update the todo comment

* fix: disable `google translate` extension (#7842)

* chore(deps): update dependency eslint-plugin-import to v2.31.0

* chore(security): add pipeline to mirror trivy dbs

* fix(security): add missing script

* fix: add missing license

* Change security scanning so PR pipelines only error on vulnerabilities introduced in the PR (#7845)

* feat: Action Menu (#7633)

* feat: implement action menu

* chore: export `IProps`

* feat: enable keyboard navigation

* feat: implement `Dropdown` component

* feat: make dropdownMenu keyboard accessible

* feat: make dropdownMenu close on click outside and esc

* fix: make some props optional

* fix: close menu on ouside click

* feat: create actionMenu

* feat: add `Update`, `Print`, `Issue`, `Delete` items

* feat: implement delete declaration

* feat: redirect to home after deleting draft

* feat: add label for assigned to someone else

* refactor: move actionItems

* amend: add missing props

* feat: add scope and other checks for: correct record

* feat: add scope and other checks for: archive declaration

* feat: add scope and other checks for: reinstate declaration

* refactor: restructure types

* feat: add scope and other checks for: review

* chore: add todo

* feat: add scope and other checks for: update declaration

* feat: add scope and other checks for: print declaration

* chore: remove console.log

* feat: add scope and other checks for: issue certificate

* feat: add scope and other checks for: delete declaration

* refactor: change order of items

* wip

* Revert "wip"

This reverts commit b25bfa1.

* feat: implement unassign button

* fix: font and color

* fix: keyDown behaviour

* chore: remove record audit buttons

* refactor: use dropdownMenu to refactor toggleMenu

* chore: remove action from component

* chore: deprecate toggleMenu

* feat: move self unassign to actionMenu

* chore: dont unassign from download button

* chore: remove unused imports

* chore: update changelog

* fix: RA will see "correct record" button

* fix: add id in dropdown menu

* refactor: `isDownloadable` logic

* refactor: remove types from actionMessages

* refactor: use `useIntl` and `useDispatch` hooks instead of props drilling

* refactor: dont pass assignment to unassign comp

* refactor: use `offsetX` and `offsetY` instead of `offset_x` and `offset_y`

* refactor: use `<Button>` instead of `<PrimaryButton>`

* refactor: remove unnecessary `<div>`s

* feat: use `anchor` and `popover` api to toggle the dropdown visivility

* fix: focus

* chore: remove as string

* refactor: early return if condition fails

* refactor: move declaration status logic into declarations/utils

* refactor: change type of status to `SUBMISSION_STATUS`

* fix: handle multiple dropdown

* fix: styles

* fix: position options and story

* fix: close dropdown on action click

* refactor: align EVENT in common with Event in client

* refactor: pass id directly to provider

* test: add unit test for view action

* test: cover all statuses for view action

* test: add tests for review action

* test: add tests for update action

* test: add tests for archive action

* test: add tests for reinstate action

* test: add tests for print action

* test: add tests for issue action

* test: refactor:  centralize scoeps

* test: add test for not having scope

* test: add tests for correct action

* test: add tests for delete action

* test: add tests for unassign action

* test: add tests for assignment text

* fix: unhandled errors

* chore: remove old tests

* fix: use EVENT.Birth instead of "Birth"

* fix: use EVENT.Birth instead of "Birth"

* fix: eventToggle id in test

* fix: eventToggle id in test

* fix: ids in UserList.test

* fix: ids in UserAudit.test

* fix: import Event

* fix: remove unassign test from download button

* fix: ids in ProfileMenu.test

* fix: import Event

* fix: import Event

---------

Co-authored-by: Riku Rouvila <[email protected]>

* remove all fields from trivy result json that are dependent on file paths or image hashes

* fix(build): fix how base branch is resolved for PRs

* chore(renovate): never rebase PR branches automatically, keep only 3 PRs open at one time

* chore(renovate): keep only 3 PRs open at one time

* fix(trivy): fixes to trivy config syntax

* fix: update action menu scopes and role type of user

---------

Co-authored-by: Muhammed Tareq Aziz <[email protected]>
Co-authored-by: Tameem Bin Haider <[email protected]>
Co-authored-by: Siyasanga Mtshokotsha <[email protected]>
Co-authored-by: Siyasanga Mtshokotsha <[email protected]>
Co-authored-by: Siyasanga Mtshokotsha <[email protected]>
Co-authored-by: tahmidrahman-dsi <[email protected]>
Co-authored-by: Tahmid Rahman <[email protected]>
Co-authored-by: Jamil <[email protected]>
Co-authored-by: Pyry Rouvila <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Barry Dwyer <[email protected]>
Co-authored-by: Riku Rouvila <[email protected]>
Siyasanga added a commit that referenced this issue Oct 30, 2024
We've found cleaner way to make the rendered name customizable for each country through client copy from country-config

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
We need to update all the places where a citizen's name is being referenced to show it in the format that the country chooses

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
To allow countries to have custom ordering for full names

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
To ensure that we get the format from the country-config

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
To make the name more usable we had to extract the name formatting logic into it's own function.

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
Replace older logic to get the name which was based on an assumption that we support names in multiple languages

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
We've found cleaner way to make the rendered name customizable for each country through client copy from country-config

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
We need to update all the places where a citizen's name is being referenced to show it in the format that the country chooses

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
To allow countries to have custom ordering for full names

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
To ensure that we get the format from the country-config

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
To make the name more usable we had to extract the name formatting logic into it's own function.

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
Replace older logic to get the name which was based on an assumption that we support names in multiple languages

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
We've found cleaner way to make the rendered name customizable for each country through client copy from country-config

#6830
Siyasanga added a commit that referenced this issue Oct 30, 2024
We need to update all the places where a citizen's name is being referenced to show it in the format that the country chooses

#6830
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment