Skip to content

Commit

Permalink
Remove lang suffix for FamilyName field
Browse files Browse the repository at this point in the history
We no longer need the suffixes for the FamilyName field since we not really using it anywhere

#6830
  • Loading branch information
Siyasanga Mtshokotsha authored and Siyasanga Mtshokotsha committed Oct 9, 2024
1 parent f6d446e commit ec80100
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 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 @@ -78,9 +78,9 @@ export function userSectionFormType(): ISerializedFormSection {
title: userFormMessages.userDetails,
fields: [
{
name: 'familyNameEng',
name: 'familyName',
type: TEXT,
label: userFormMessages.lastNameEn,
label: userFormMessages.lastName,
required: true,
initialValue: '',
validator: [{ operation: 'englishOnlyNameFormat' }],
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/i18n/messages/views/userForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export const messages = {
description: "User's English first name",
id: 'form.field.label.firstNameEN'
},
lastNameEn: {
lastName: {
defaultMessage: "User's surname",
description: "User's English surname",
id: 'form.field.label.lastNameEN'
id: 'form.field.label.lastName'
},
phoneNumber: {
defaultMessage: 'Phone number',
Expand Down
6 changes: 2 additions & 4 deletions packages/client/src/tests/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1446,8 +1446,7 @@ export const mockCompleteFormData = {
accountDetails: '',
assignedRegistrationOffice: '',
device: '',
familyName: 'হোসেন',
familyNameEng: 'Hossain',
familyName: 'Hossain',
firstNames: 'Jeff',
firstNamesEng: 'Jeff',
nid: '123456789',
Expand Down Expand Up @@ -1795,8 +1794,7 @@ export const mockDataWithRegistarRoleSelected = {
accountDetails: '',
assignedRegistrationOffice: '',
device: '',
familyName: 'হোসেন',
familyNameEng: 'Hossain',
familyName: 'Hossain',
firstNames: 'Jeff',
firstNamesEng: 'Jeff',
email: '[email protected]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe('create new user tests', () => {
expect(
testComponent
.find(FormFieldGenerator)
.find('#familyNameEng_error')
.find('#familyName_error')
.hostNodes()
.text()
).toBe('Required to register a new user')
Expand Down Expand Up @@ -339,11 +339,6 @@ describe('edit user tests', () => {
username: 'shakib1',
mobile: '+8801662132163',
email: '[email protected]',
identifier: {
system: 'NATIONAL_ID',
value: '101488192',
__typename: 'Identifier'
},
systemRole: 'NATIONAL_REGISTRAR',
role: { _id: '63ef9466f708ea080777c27a' },
status: 'active',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class UserReviewFormComponent extends React.Component<
(field) => field.name === 'firstNamesEng'
) as IFormField
const familyNameEngField = fields.find(
(field) => field.name === 'familyNameEng'
(field) => field.name === 'familyName'
) as IFormField

return `${this.getValue(firstNamesEngField)} ${this.getValue(
Expand Down

0 comments on commit ec80100

Please sign in to comment.