From ed4a628861728a6366bc165b291759986c843b76 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Mon, 8 Nov 2021 11:25:16 -0300 Subject: [PATCH] fix: Database selector overflow (#17369) * fix: Database selector overflow * Fix TImezoneSelector test * Removes unused imports --- .../src/components/DatabaseSelector/index.tsx | 16 ++++++++++++++-- .../TimezoneSelector/TimezoneSelector.test.tsx | 4 +--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/components/DatabaseSelector/index.tsx b/superset-frontend/src/components/DatabaseSelector/index.tsx index 45d91f1c97662..7569f6585569c 100644 --- a/superset-frontend/src/components/DatabaseSelector/index.tsx +++ b/superset-frontend/src/components/DatabaseSelector/index.tsx @@ -41,6 +41,7 @@ const DatabaseSelectorWrapper = styled.div` } .select { + width: calc(100% - 30px - ${theme.gridUnit}px); flex: 1; } @@ -55,6 +56,15 @@ const LabelStyle = styled.div` flex-direction: row; align-items: center; margin-left: ${({ theme }) => theme.gridUnit - 2}px; + + .backend { + overflow: visible; + } + + .name { + overflow: hidden; + text-overflow: ellipsis; + } `; type DatabaseValue = { @@ -97,8 +107,10 @@ const SelectLabel = ({ databaseName: string; }) => ( - - {databaseName} + + + {databaseName} + ); diff --git a/superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx b/superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx index faa38b02b1ebe..7d9d5d714b8f3 100644 --- a/superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx +++ b/superset-frontend/src/components/TimezoneSelector/TimezoneSelector.test.tsx @@ -54,9 +54,7 @@ describe('TimezoneSelector', () => { }); expect(select).toBeInTheDocument(); userEvent.click(select); - const selection = await screen.findByTitle( - 'GMT -06:00 (Mountain Daylight Time)', - ); + const selection = await screen.findByTitle('GMT -06:00 (America/Belize)'); expect(selection).toBeInTheDocument(); userEvent.click(selection); expect(selection).toBeVisible();