Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worked on the dynamic column width of stats table #5996

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,24 @@ export default function SchemaTable({
});

const fieldColumn = {
width: '22%',
title: 'Field',
dataIndex: 'fieldPath',
key: 'fieldPath',
width: 300,
render: schemaTitleRenderer,
filtered: true,
};

const descriptionColumn = {
width: '22%',
title: 'Description',
dataIndex: 'description',
key: 'description',
render: descriptionRender,
};

const tagColumn = {
width: 125,
width: '13%',
title: 'Tags',
dataIndex: 'globalTags',
key: 'tag',
Expand All @@ -122,33 +130,18 @@ export default function SchemaTable({
};

const termColumn = {
width: 125,
width: '13%',
title: 'Glossary Terms',
dataIndex: 'globalTags',
key: 'tag',
render: termRenderer,
onCell: onTagTermCell,
};

const usageColumn = {
width: 50,
title: 'Usage',
dataIndex: 'fieldPath',
key: 'usage',
render: usageStatsRenderer,
};
const descriptionColumn = {
title: 'Description',
dataIndex: 'description',
key: 'description',
render: descriptionRender,
width: 300,
};

const blameColumn = {
width: '10%',
dataIndex: 'fieldPath',
key: 'fieldPath',
width: 75,
render(record: SchemaField) {
return {
props: {
Expand All @@ -159,6 +152,14 @@ export default function SchemaTable({
},
};

const usageColumn = {
width: '10%',
title: 'Usage',
dataIndex: 'fieldPath',
key: 'usage',
render: usageStatsRenderer,
};

let allColumns: ColumnsType<ExtendedSchemaFields> = [fieldColumn, descriptionColumn, tagColumn, termColumn];

if (hasUsageStats) {
Expand Down
19 changes: 16 additions & 3 deletions datahub-web-react/src/app/preview/DefaultPreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ const EntityTitle = styled(Typography.Text)<{ $titleSizePx?: number }>`
}
`;

const CardEntityTitle = styled(EntityTitle)`
max-width: 350px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
`;

const PlatformText = styled(Typography.Text)`
font-size: 12px;
line-height: 20px;
Expand Down Expand Up @@ -271,9 +278,15 @@ export default function DefaultPreviewCard({
/>
<EntityTitleContainer>
<Link to={url}>
<EntityTitle onClick={onClick} $titleSizePx={titleSizePx}>
{name || ' '}
</EntityTitle>
{previewType === PreviewType.HOVER_CARD ? (
<CardEntityTitle onClick={onClick} $titleSizePx={titleSizePx}>
{name || ' '}
</CardEntityTitle>
) : (
<EntityTitle onClick={onClick} $titleSizePx={titleSizePx}>
{name || ' '}
</EntityTitle>
)}
</Link>
{deprecation?.deprecated && <DeprecationPill deprecation={deprecation} preview />}
{externalUrl && (
Expand Down