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 Usage column & Lineage Drawer #6290

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 @@ -155,12 +155,23 @@ export default function SchemaTable({
},
};

// Function to get the count of each usageStats fieldPath
function getCount(fieldPath: any) {
const data: any =
usageStats?.aggregations?.fields &&
usageStats?.aggregations?.fields.find((field) => {
return field?.fieldName === fieldPath;
});
return data && data.count;
}

const usageColumn = {
width: '10%',
title: 'Usage',
dataIndex: 'fieldPath',
key: 'usage',
render: usageStatsRenderer,
sorter: (sourceA, sourceB) => getCount(sourceA.fieldPath) - getCount(sourceB.fieldPath),
};

let allColumns: ColumnsType<ExtendedSchemaFields> = [fieldColumn, descriptionColumn, tagColumn, termColumn];
Expand Down
3 changes: 1 addition & 2 deletions datahub-web-react/src/app/lineage/LineageExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { EntityAndType, EntitySelectParams, FetchedEntities } from './types';
import LineageViz from './LineageViz';
import extendAsyncEntities from './utils/extendAsyncEntities';
import { EntityType } from '../../types.generated';
import { capitalizeFirstLetter } from '../shared/textUtil';
import { ANTD_GRAY } from '../entity/shared/constants';
import { GetEntityLineageQuery, useGetEntityLineageQuery } from '../../graphql/lineage.generated';
import { useIsSeparateSiblingsMode } from '../entity/shared/siblingUtils';
Expand Down Expand Up @@ -184,7 +183,7 @@ export default function LineageExplorer({ urn, type }: Props) {
Close
</Button>
<Button href={entityRegistry.getEntityUrl(selectedEntity.type, selectedEntity.urn)}>
<InfoCircleOutlined /> {capitalizeFirstLetter(selectedEntity.type)} Details
<InfoCircleOutlined /> {entityRegistry.getEntityName(selectedEntity.type)} Details
</Button>
</FooterButtonGroup>
)
Expand Down