Worked on the dynamic column width of stats table (#5996)

This commit is contained in:
Ankit keshari 2022-09-22 22:08:56 +05:30 committed by GitHub
parent 904403941c
commit 4e5f22cf3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 22 deletions

View File

@ -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',
@ -122,7 +130,7 @@ export default function SchemaTable({
};
const termColumn = {
width: 125,
width: '13%',
title: 'Glossary Terms',
dataIndex: 'globalTags',
key: 'tag',
@ -130,25 +138,10 @@ export default function SchemaTable({
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: {
@ -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) {

View File

@ -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;
@ -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 && (