From 1b541ff2149e68ecc6f51611649cb9108f8020b1 Mon Sep 17 00:00:00 2001 From: alannnc Date: Wed, 24 Aug 2022 19:44:14 -0600 Subject: [PATCH] Fix/connected calendar component (#3956) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix for displaying connected calendars alert with test * Fix default calendar display string when externalId its too long * Update apps/web/components/ui/LinkText.tsx Co-authored-by: Omar López Co-authored-by: Omar López --- .../DestinationCalendarSelector.tsx | 13 +++- apps/web/components/ui/LinkText.tsx | 19 +++++ .../NoCalendarConnectedAlert.test.tsx | 40 ++++++++++ .../ui/NoCalendarConnectedAlert/index.tsx | 44 +++++++++++ apps/web/jest.config.ts | 2 +- apps/web/package.json | 1 + apps/web/pages/event-types/index.tsx | 75 +++---------------- yarn.lock | 56 +++++++++++++- 8 files changed, 177 insertions(+), 73 deletions(-) create mode 100644 apps/web/components/ui/LinkText.tsx create mode 100644 apps/web/components/ui/NoCalendarConnectedAlert/__tests__/NoCalendarConnectedAlert.test.tsx create mode 100644 apps/web/components/ui/NoCalendarConnectedAlert/index.tsx diff --git a/apps/web/components/DestinationCalendarSelector.tsx b/apps/web/components/DestinationCalendarSelector.tsx index 3b917cf023..33fe386e80 100644 --- a/apps/web/components/DestinationCalendarSelector.tsx +++ b/apps/web/components/DestinationCalendarSelector.tsx @@ -70,7 +70,13 @@ const DestinationCalendarSelector = ({ value: `${cal.integration}:${cal.externalId}`, })), })) ?? []; - + const defaultCalendarSelectedString = destinationCalendar?.externalId + ? `(${ + destinationCalendar.externalId.length > 15 + ? destinationCalendar.externalId.substring(0, 15) + "..." + : destinationCalendar.externalId + })` + : ""; return (