Skip to content

Commit

Permalink
fix: Database selector overflow (apache#17369)
Browse files Browse the repository at this point in the history
* fix: Database selector overflow

* Fix TImezoneSelector test

* Removes unused imports
  • Loading branch information
michael-s-molina authored Nov 8, 2021
1 parent ee87b01 commit ed4a628
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 14 additions & 2 deletions superset-frontend/src/components/DatabaseSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const DatabaseSelectorWrapper = styled.div`
}
.select {
width: calc(100% - 30px - ${theme.gridUnit}px);
flex: 1;
}
Expand All @@ -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 = {
Expand Down Expand Up @@ -97,8 +107,10 @@ const SelectLabel = ({
databaseName: string;
}) => (
<LabelStyle>
<Label>{backend}</Label>
{databaseName}
<Label className="backend">{backend}</Label>
<span className="name" title={databaseName}>
{databaseName}
</span>
</LabelStyle>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ed4a628

Please sign in to comment.