Remove duplicate plus sign for phone numbers (#8871)
Fixes #8838 1. Summary It seems [this PR](https://github.com/twentyhq/twenty/pull/8614) caused the issue. We added a plus sign on front-end when the [callingCode](https://github.com/twentyhq/twenty/blob/c735026f6c4f011e82e80713f1554b5cdb4fda5b/packages/twenty-front/src/modules/ui/field/display/components/PhonesDisplay.tsx#L70) retrieved from back-end already has a plus sign. 2. Solution @guillim Please let me know if I missed a case where the plus sign is not there for the `callingCode`. If so, I think we should check whether or not `callingCode` has a leading plus sign on front-end before adding it. For now, I just removed the code that appends a plus sign on front-end. 3. Screenshots  --------- Co-authored-by: guillim <guigloo@msn.com> Co-authored-by: Guillim <guillim@users.noreply.github.com> Co-authored-by: Weiko <deniaud.corentin@gmail.com>
This commit is contained in:
co-authored by
guillim
Guillim
Weiko
parent
4623b6127b
commit
50af41f170
@@ -67,7 +67,7 @@ export const PhonesDisplay = ({ value, isFocused }: PhonesDisplayProps) => {
|
||||
<ExpandableList isChipCountDisplayed>
|
||||
{phones.map(({ number, callingCode }, index) => {
|
||||
const { parsedPhone, invalidPhone } =
|
||||
parsePhoneNumberOrReturnInvalidValue(`+${callingCode}` + number);
|
||||
parsePhoneNumberOrReturnInvalidValue(callingCode + number);
|
||||
const URI = parsedPhone?.getURI();
|
||||
return (
|
||||
<RoundedLink
|
||||
@@ -84,7 +84,7 @@ export const PhonesDisplay = ({ value, isFocused }: PhonesDisplayProps) => {
|
||||
<StyledContainer>
|
||||
{phones.map(({ number, callingCode }, index) => {
|
||||
const { parsedPhone, invalidPhone } =
|
||||
parsePhoneNumberOrReturnInvalidValue(`+${callingCode}` + number);
|
||||
parsePhoneNumberOrReturnInvalidValue(callingCode + number);
|
||||
const URI = parsedPhone?.getURI();
|
||||
return (
|
||||
<RoundedLink
|
||||
|
||||
Reference in New Issue
Block a user