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

Fixes: Able to save empty display first name #44375

Merged
merged 5 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,7 @@ export default {
error: {
containsReservedWord: 'Name cannot contain the words Expensify or Concierge.',
hasInvalidCharacter: 'Name cannot contain a comma or semicolon.',
requiredFirstName: 'First name cannot be empty.',
},
},
privatePersonalDetails: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@ export default {
error: {
containsReservedWord: 'El nombre no puede contener las palabras Expensify o Concierge.',
hasInvalidCharacter: 'El nombre no puede contener una coma o un punto y coma.',
requiredFirstName: 'El nombre no puede estar vacío.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asked on slack (internal) for the correct translation, i will complete the review in the meantime but approve after the translations are confirmed

},
},
privatePersonalDetails: {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/settings/Profile/DisplayNamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ function DisplayNamePage({isLoadingApp = true, currentUserPersonalDetails}: Disp
ErrorUtils.addErrorMessage(errors, 'firstName', translate('personalDetails.error.hasInvalidCharacter'));
} else if (values.firstName.length > CONST.TITLE_CHARACTER_LIMIT) {
ErrorUtils.addErrorMessage(errors, 'firstName', translate('common.error.characterLimitExceedCounter', {length: values.firstName.length, limit: CONST.TITLE_CHARACTER_LIMIT}));
} else if (values.firstName.length === 0) {
ErrorUtils.addErrorMessage(errors, 'firstName', translate('personalDetails.error.requiredFirstName'));
}
if (ValidationUtils.doesContainReservedWord(values.firstName, CONST.DISPLAY_NAME.RESERVED_NAMES)) {
ErrorUtils.addErrorMessage(errors, 'firstName', translate('personalDetails.error.containsReservedWord'));
Expand Down
Loading