Skip to content

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

GDGT-2515: Fix FK field name crop in Schema Viewer info popup (#75017)

Stas Gavrylovdf4e8ecfa48f
diff --git a/enterprise/frontend/src/metabase-enterprise/schema_viewer/components/SchemaViewer/components/SelectedNodeInfoPanel/InfoPanelField.tsx b/enterprise/frontend/src/metabase-enterprise/schema_viewer/components/SchemaViewer/components/SelectedNodeInfoPanel/InfoPanelField.tsx
index eb31071f8da..8e7c7cc5b0e 100644
--- a/enterprise/frontend/src/metabase-enterprise/schema_viewer/components/SchemaViewer/components/SelectedNodeInfoPanel/InfoPanelField.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/schema_viewer/components/SchemaViewer/components/SelectedNodeInfoPanel/InfoPanelField.tsx
@@ -46,23 +46,27 @@ export function InfoPanelField({
const isExternalFk = field.fk_target_table_id != null && targetNode == null;
const fieldName = (
- <Ellipsified className={S.fieldName}>{field.name}</Ellipsified>
+ <Ellipsified className={S.fieldName} maw={targetNode ? "50%" : "100%"}>
+ {field.name}
+ </Ellipsified>
);
return (
<Group className={cx(S.fieldRow, CS.textWrap)} gap="sm" wrap="nowrap">
<FixedSizeIcon name={fieldIcon} c="text-secondary" />
{isExternalFk ? (
- <Tooltip label={t`Fetch external table`} disabled={isExpanding}>
+ <Tooltip
+ label={t`Fetch external table`}
+ disabled={isExpanding}
+ position="left"
+ >
<UnstyledButton
className={S.fkLink}
c="brand"
disabled={isExpanding}
onClick={onFetchExternal}
- flex="1 1 auto"
- lh={1}
+ flex="0 1 auto"
h="100%"
- style={{ overflow: "visible" }}
>
{fieldName}
</UnstyledButton>
diff --git a/enterprise/frontend/src/metabase-enterprise/schema_viewer/components/SchemaViewer/components/SelectedNodeInfoPanel/SelectedNodeInfoPanel.module.css b/enterprise/frontend/src/metabase-enterprise/schema_viewer/components/SchemaViewer/components/SelectedNodeInfoPanel/SelectedNodeInfoPanel.module.css
index 0b98ebcc442..a9e09bb2811 100644
--- a/enterprise/frontend/src/metabase-enterprise/schema_viewer/components/SchemaViewer/components/SelectedNodeInfoPanel/SelectedNodeInfoPanel.module.css
+++ b/enterprise/frontend/src/metabase-enterprise/schema_viewer/components/SchemaViewer/components/SelectedNodeInfoPanel/SelectedNodeInfoPanel.module.css
@@ -1,8 +1,10 @@
.infoPanel {
+ --max-content-height: calc(100vh - 2rem - var(--minimap-height));
+
position: absolute;
top: 1rem;
- bottom: 1rem;
- max-height: calc(100% - var(--minimap-height));
+ height: auto;
+ max-height: var(--max-content-height);
z-index: var(--canvas-element-z-index);
.card {
@@ -10,7 +12,8 @@
flex-direction: column;
padding: 0;
width: 32rem;
- max-height: 100%;
+ min-height: 0;
+ max-height: var(--max-content-height);
pointer-events: all;
}
@@ -20,22 +23,14 @@
.fkLink {
overflow: hidden;
- line-height: 1;
&:hover span {
text-decoration: underline;
}
}
- .fieldName,
- .targetName {
- flex: 0 1 auto;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
.fieldName {
- max-width: 50%;
+ flex: 0 1 auto;
+ display: inline-block;
}
}