From 4c250dd8112dd66cc2d76dd424a73c30f39b89e7 Mon Sep 17 00:00:00 2001 From: Keerat Kohli <100006952+KeeratKK@users.noreply.github.com> Date: Thu, 3 Oct 2024 11:17:45 -0400 Subject: [PATCH] Fixes #7220: Remove primary banner icon when only one value present (#7275) ## Changes - Added a check to make sure that we only indicate an entry is primary if there is more than one value. - The banner icon now only displays when there are either **2 or more emails, phone numbers, or domains.** ## Emails ![image](https://github.com/user-attachments/assets/54832aaf-a319-4b70-87bf-3621e05f1637) ![image](https://github.com/user-attachments/assets/44bb8909-9f34-426d-8942-2bb7974e9113) ## Phones ![image](https://github.com/user-attachments/assets/85ca4c36-c148-4d86-89d6-1c02a960f2f4) ![image](https://github.com/user-attachments/assets/f11b5c2e-4376-4bf6-8560-e4c956f2c2e5) ## Domains ![image](https://github.com/user-attachments/assets/ce324714-6bd7-45ac-9a2f-8a2671d080a0) ![image](https://github.com/user-attachments/assets/153883a3-782f-424b-abc4-d882ec969bc2) ## Notes This is my first time contributing so I am open to any feedback. Co-authored-by: Keerat Kohli --- .../meta-types/input/components/EmailsFieldInput.tsx | 4 +++- .../meta-types/input/components/LinksFieldInput.tsx | 4 +++- .../meta-types/input/components/PhonesFieldInput.tsx | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/EmailsFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/EmailsFieldInput.tsx index 02ce963192b0..32418cebc607 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/EmailsFieldInput.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/EmailsFieldInput.tsx @@ -29,6 +29,8 @@ export const EmailsFieldInput = ({ onCancel }: EmailsFieldInputProps) => { }); }; + const isPrimaryEmail = (index: number) => index === 0 && emails?.length > 1; + return ( { { }); }; + const isPrimaryLink = (index: number) => index === 0 && links?.length > 1; + return ( { { }); }; + const isPrimaryPhone = (index: number) => index === 0 && phones?.length > 1; + return ( {