Skip to content

Commit

Permalink
Merge pull request #6178 from Santhosh-Sellavel/request_call_copy_cha…
Browse files Browse the repository at this point in the history
…nges

Request Call placeholder & messages updated
  • Loading branch information
chiragsalian authored Nov 16, 2021
2 parents e0be29d + f56b9dd commit 9541bb1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ export default {
},
cameraPermissionsNotGranted: 'Camera permissions not granted',
messages: {
noPhoneNumber: 'Please enter a phone number including the country code e.g +447814266907.',
errorMessageInvalidPhone: 'That doesn’t look like a valid phone number. Try again with the country code. e.g. +15005550006',
errorMessageInvalidPhone: 'Please enter a valid phone number without brackets or dashes. If you\'re outside the US please include your country code, eg. +447782339811',
maxParticipantsReached: 'You\'ve reached the maximum number of participants for a group chat.',
},
onfidoStep: {
Expand Down
3 changes: 1 addition & 2 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,7 @@ export default {
},
cameraPermissionsNotGranted: 'No has habilitado los permisos para acceder a la cámara',
messages: {
noPhoneNumber: 'Por favor escribe un número de teléfono que incluya el código de país e.g +447814266907.',
errorMessageInvalidPhone: 'El teléfono no es valido. Inténtalo de nuevo agregando el código de país. P. ej.: +15005550006',
errorMessageInvalidPhone: 'Por favor, introduce un número de teléfono válido sin paréntesis o guiones. Si reside fuera de Estados Unidos, por favor incluye el prefijo internacional. P. ej. +447782339811',
maxParticipantsReached: 'Has llegado al número máximo de participantes para un grupo.',
},
onfidoStep: {
Expand Down
4 changes: 2 additions & 2 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,14 +707,14 @@ function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, ma
}

if (searchValue && CONST.REGEX.DIGITS_AND_PLUS.test(searchValue) && !Str.isValidPhone(searchValue)) {
return translate(preferredLocale, 'messages.noPhoneNumber');
return translate(preferredLocale, 'messages.errorMessageInvalidPhone');
}

// Without a search value, it would be very confusing to see a search validation message.
// Therefore, this skips the validation when there is no search value.
if (searchValue && !hasSelectableOptions && !hasUserToInvite) {
if (/^\d+$/.test(searchValue)) {
return translate(preferredLocale, 'messages.noPhoneNumber');
return translate(preferredLocale, 'messages.errorMessageInvalidPhone');
}

return translate(preferredLocale, 'common.noResultsFound');
Expand Down
7 changes: 2 additions & 5 deletions src/pages/RequestCallPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ class RequestCallPage extends Component {
* @returns {String}
*/
getPhoneNumberError() {
if (_.isEmpty(this.state.phoneNumber.trim())) {
return this.props.translate('messages.noPhoneNumber');
}
if (!Str.isValidPhone(this.state.phoneNumber)) {
if (_.isEmpty(this.state.phoneNumber.trim()) || !Str.isValidPhone(this.state.phoneNumber)) {
return this.props.translate('messages.errorMessageInvalidPhone');
}
return '';
Expand Down Expand Up @@ -236,7 +233,7 @@ class RequestCallPage extends Component {
autoCompleteType="off"
autoCorrect={false}
value={this.state.phoneNumber}
placeholder="+14158675309"
placeholder="2109400803"
errorText={this.state.phoneNumberError}
onBlur={this.validatePhoneInput}
onChangeText={phoneNumber => this.setState({phoneNumber})}
Expand Down

0 comments on commit 9541bb1

Please sign in to comment.