MINOR: update lineage column with new design (#18862)

* update lineage column with new design

* added border when showAllColumn button is there

* minor fix around scroll for large lineage screen

* reset the column color back to old black color
This commit is contained in:
Ashish Gupta 2024-12-02 10:35:25 +05:30 committed by GitHub
parent 811feea515
commit 1ea52d7bdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 47 additions and 36 deletions

View File

@ -21,7 +21,7 @@ import { EntityLineageNodeType } from '../../../enums/entity.enum';
import { Column } from '../../../generated/entity/data/table'; import { Column } from '../../../generated/entity/data/table';
import { encodeLineageHandles } from '../../../utils/EntityLineageUtils'; import { encodeLineageHandles } from '../../../utils/EntityLineageUtils';
import { getEntityName } from '../../../utils/EntityUtils'; import { getEntityName } from '../../../utils/EntityUtils';
import { getConstraintIcon } from '../../../utils/TableUtils'; import { getColumnDataTypeIcon } from '../../../utils/TableUtils';
import { EdgeTypeEnum } from './EntityLineage.interface'; import { EdgeTypeEnum } from './EntityLineage.interface';
export const getHandleByType = ( export const getHandleByType = (
@ -133,9 +133,7 @@ export const getColumnContent = (
<div <div
className={classNames( className={classNames(
'custom-node-column-container', 'custom-node-column-container',
isColumnTraced isColumnTraced && 'custom-node-header-tracing'
? 'custom-node-header-tracing'
: 'custom-node-column-lineage-normal bg-white'
)} )}
data-testid={`column-${fullyQualifiedName}`} data-testid={`column-${fullyQualifiedName}`}
key={fullyQualifiedName} key={fullyQualifiedName}
@ -150,15 +148,20 @@ export const getColumnContent = (
encodeLineageHandles(fullyQualifiedName ?? '') encodeLineageHandles(fullyQualifiedName ?? '')
)} )}
<Typography.Text <span className="custom-node-name-container">
className="p-xss p-x-lg" <div className="custom-node-name-icon">
ellipsis={{ tooltip: true }} {getColumnDataTypeIcon({
style={{ maxWidth: NODE_WIDTH }}> dataType: column.dataType,
{getConstraintIcon({ width: '14px',
constraint: column.constraint, })}
})} </div>
{getEntityName(column)} <Typography.Text
</Typography.Text> ellipsis={{ tooltip: true }}
style={{ maxWidth: NODE_WIDTH, color: 'inherit' }}>
{getEntityName(column)}
</Typography.Text>
</span>
<span className="custom-node-constraint">{column.constraint}</span>
</div> </div>
); );
}; };

View File

@ -12,6 +12,7 @@
*/ */
import { DownOutlined, SearchOutlined, UpOutlined } from '@ant-design/icons'; import { DownOutlined, SearchOutlined, UpOutlined } from '@ant-design/icons';
import { Button, Collapse, Input, Space } from 'antd'; import { Button, Collapse, Input, Space } from 'antd';
import classNames from 'classnames';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import React, { useCallback, useEffect, useMemo, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@ -200,7 +201,7 @@ const NodeChildren = ({ node, isConnectable }: NodeChildrenProps) => {
if (supportsColumns && (showColumns || showDataObservability)) { if (supportsColumns && (showColumns || showDataObservability)) {
return ( return (
<div className="column-container bg-grey-1 p-sm p-y-xs"> <div className="column-container">
<div className="d-flex justify-between items-center"> <div className="d-flex justify-between items-center">
<div> <div>
{showColumns && ( {showColumns && (
@ -247,7 +248,10 @@ const NodeChildren = ({ node, isConnectable }: NodeChildrenProps) => {
</div> </div>
<section className="m-t-md" id="table-columns"> <section className="m-t-md" id="table-columns">
<div className="border rounded-4 overflow-hidden"> <div
className={classNames('rounded-4 overflow-hidden', {
border: !showAllColumns,
})}>
{filteredColumns.map((column) => {filteredColumns.map((column) =>
renderColumnsData(column as Column) renderColumnsData(column as Column)
)} )}

View File

@ -62,14 +62,12 @@
} }
.column-container { .column-container {
min-height: 48px; min-height: 48px;
padding: 6px 12px; padding: 12px;
background-color: @grey-1;
.lineage-collapse-column { .lineage-collapse-column.ant-collapse {
.ant-collapse { border: none;
border-radius: 0; border-radius: 0;
border: 1px solid @border-color;
border-color: @border-color;
}
.ant-collapse-header { .ant-collapse-header {
padding: 0; padding: 0;
font-size: 12px; font-size: 12px;
@ -253,11 +251,27 @@
.custom-node-column-container { .custom-node-column-container {
display: flex; display: flex;
align-items: center; justify-content: space-between;
justify-content: center; padding: 6px 12px;
background: @white;
position: relative; position: relative;
background-color: @white;
font-size: 12px; font-size: 12px;
font-weight: 400;
.custom-node-name-container {
display: flex;
align-items: center;
padding-left: 12px;
gap: 4px;
.custom-node-name-icon {
width: 14px;
}
}
.custom-node-constraint {
padding-right: 12px;
}
} }
.custom-node-deleted-icon { .custom-node-deleted-icon {

View File

@ -85,17 +85,6 @@
} }
} }
} }
.custom-node-column-lineage-normal {
border-top: 1px solid @border-color;
display: flex;
justify-content: center;
align-items: center;
position: relative;
font-size: 12px;
&:first-child {
border-top: none;
}
}
.custom-node { .custom-node {
.custom-node-header-active { .custom-node-header-active {
@ -228,6 +217,7 @@
height: calc(100vh - @om-navbar-height); height: calc(100vh - @om-navbar-height);
.lineage-card { .lineage-card {
height: calc(100vh - @om-navbar-height); height: calc(100vh - @om-navbar-height);
overflow-y: scroll;
} }
.entity-lineage.sidebar { .entity-lineage.sidebar {
top: @lineage-breadcrumb-panel; top: @lineage-breadcrumb-panel;