Skip to content

Commit

Permalink
Remove Eng suffix for the firstName in user form
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Siyasanga committed Oct 16, 2024
1 parent ef222b2 commit 1a3a654
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/client/src/forms/user/fieldDefinitions/createUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ export function userSectionFormType(): ISerializedFormSection {
}
},
{
name: 'firstNamesEng',
name: 'firstName',
type: TEXT,
label: userFormMessages.firstNameEn,
label: userFormMessages.firstName,
required: true,
initialValue: '',
validator: [{ operation: 'englishOnlyNameFormat' }],
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/i18n/messages/views/userForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ export const messages = {
description: 'User details section',
id: 'form.section.userDetails'
},
firstNameEn: {
firstName: {
defaultMessage: "User's first name",
description: "User's English first name",
id: 'form.field.label.firstNameEN'
id: 'form.field.label.userFirstName'
},
lastName: {
defaultMessage: "User's surname",
description: "User's English surname",
id: 'form.field.label.lastName'
id: 'form.field.label.userSurname'
},
phoneNumber: {
defaultMessage: 'Phone number',
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/tests/forms.json
Original file line number Diff line number Diff line change
Expand Up @@ -12203,7 +12203,7 @@
"label": {
"defaultMessage": "Last name",
"description": "English last name",
"id": "form.field.label.lastNameEN"
"id": "form.field.label.userSurname"
},
"required": true,
"initialValue": "",
Expand Down Expand Up @@ -12528,7 +12528,7 @@
"label": {
"defaultMessage": "Last name",
"description": "English last name",
"id": "form.field.label.lastNameEN"
"id": "form.field.label.userSurname"
},
"required": true,
"initialValue": "",
Expand Down
12 changes: 5 additions & 7 deletions packages/client/src/tests/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,7 @@ export const mockCompleteFormData = {
assignedRegistrationOffice: '',
device: '',
familyName: 'Hossain',
firstNames: 'Jeff',
firstNamesEng: 'Jeff',
firstName: 'Jeff',
nid: '123456789',
phoneNumber: '01662132132',
email: '[email protected]',
Expand Down Expand Up @@ -1599,7 +1598,7 @@ export const mockUserGraphqlOperation = {
}
},
{
name: 'firstNamesEng',
name: 'firstNames',
type: 'TEXT',
label: {
defaultMessage: 'English first name',
Expand All @@ -1621,12 +1620,12 @@ export const mockUserGraphqlOperation = {
}
},
{
name: 'familyNameEng',
name: 'familyName',
type: 'TEXT',
label: {
defaultMessage: 'English last name',
description: 'English last name',
id: 'form.field.label.lastNameEN'
id: 'form.field.label.userSurname'
},
required: true,
initialValue: '',
Expand Down Expand Up @@ -1795,8 +1794,7 @@ export const mockDataWithRegistarRoleSelected = {
assignedRegistrationOffice: '',
device: '',
familyName: 'Hossain',
firstNames: 'Jeff',
firstNamesEng: 'Jeff',
firstName: 'Jeff',
email: '[email protected]',
nid: '101488192',
phoneNumber: '01662132132',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ describe('create new user tests', () => {

it('clicking change button on a field takes user back to form', async () => {
testComponent
.find('#btn_change_firstNamesEng')
.find('#btn_change_firstName')
.hostNodes()
.first()
.simulate('click')
await flushPromises()
expect(history.location.pathname).toBe('/createUser/user/user-view-group')
expect(history.location.hash).toBe('#firstNamesEng')
expect(history.location.hash).toBe('#firstName')
})

it('clicking submit button submits the form data', async () => {
Expand Down

0 comments on commit 1a3a654

Please sign in to comment.