Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Keep the remove-table button in the row when table names are long (#79760)

Oleh K0a42bfbac2b3
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms-python/components/PythonTransformEditor/PythonDataPicker/TableSelector/TableSelector.tsx b/enterprise/frontend/src/metabase-enterprise/transforms-python/components/PythonTransformEditor/PythonDataPicker/TableSelector/TableSelector.tsx
index 248c341c88f..042e4315985 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms-python/components/PythonTransformEditor/PythonDataPicker/TableSelector/TableSelector.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms-python/components/PythonTransformEditor/PythonDataPicker/TableSelector/TableSelector.tsx
@@ -10,6 +10,7 @@ import {
ActionIcon,
Box,
Button,
+ Ellipsified,
Group,
Icon,
Stack,
@@ -61,9 +62,16 @@ export function TableSelector({
return (
<>
- <Group w="100%" bdrs="xs" gap="xs" className={S.tableSelector}>
+ <Group
+ w="100%"
+ bdrs="xs"
+ gap="xs"
+ wrap="nowrap"
+ className={S.tableSelector}
+ >
<Button
flex="1 1 auto"
+ miw={0}
onClick={open}
disabled={disabled}
classNames={{ inner: S.tableSelectorButtonInner }}
@@ -71,13 +79,15 @@ export function TableSelector({
py="lg"
variant="subtle"
>
- <Stack gap={0} align="start" justify="center">
+ <Stack gap="xs">
{table ? (
<>
- <Box fz="sm" c="text-secondary" fw="normal">
- {table?.db?.name} / {table?.schema}
- </Box>
- <Box c="text-primary">{table?.display_name}</Box>
+ <Ellipsified fz="sm" c="text-secondary" fw="normal" ta="left">
+ {`${table?.db?.name} / ${table?.schema}`}
+ </Ellipsified>
+ <Ellipsified c="text-primary" ta="left">
+ {table?.display_name}
+ </Ellipsified>
</>
) : (
<Box c="text-primary">{t`Select a table…`}</Box>
@@ -89,7 +99,7 @@ export function TableSelector({
<Tooltip label={t`Remove this table`}>
<ActionIcon
onClick={onRemove}
- pr="sm"
+ mr="sm"
aria-label={t`Remove this table`}
>
<Icon name="close" c="text-primary" />