Fix #4016 UI Support updated EntityReference for dataset details page. (#4018)

This commit is contained in:
Sachin Chaurasiya 2022-04-11 14:45:20 +05:30 committed by GitHub
parent 863641797b
commit 9c92424f74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 67 additions and 40 deletions

View File

@ -57,7 +57,7 @@ const EntityInfoDrawer = ({
switch (selectedNode.type) {
case EntityType.TABLE: {
setIsLoading(true);
getTableDetailsByFQN(selectedNode.name, [
getTableDetailsByFQN(selectedNode.fqn, [
'tags',
'owner',
'columns',
@ -80,7 +80,7 @@ const EntityInfoDrawer = ({
}
case EntityType.PIPELINE: {
setIsLoading(true);
getPipelineByFqn(selectedNode.name, ['tags', 'owner'])
getPipelineByFqn(selectedNode.fqn, ['tags', 'owner'])
.then((res: AxiosResponse) => {
getServiceById('pipelineServices', res.data.service?.id)
.then((serviceRes: AxiosResponse) => {
@ -106,7 +106,7 @@ const EntityInfoDrawer = ({
}
case EntityType.DASHBOARD: {
setIsLoading(true);
getDashboardByFqn(selectedNode.name, ['tags', 'owner'])
getDashboardByFqn(selectedNode.fqn, ['tags', 'owner'])
.then((res: AxiosResponse) => {
getServiceById('dashboardServices', res.data.service?.id)
.then((serviceRes: AxiosResponse) => {
@ -147,7 +147,7 @@ const EntityInfoDrawer = ({
<span className="tw-mr-2">{getEntityIcon(selectedNode.type)}</span>
{getHeaderLabel(
selectedNode.displayName ?? selectedNode.name,
selectedNode.name,
selectedNode.fqn,
selectedNode.type,
isMainNode
)}

View File

@ -190,7 +190,12 @@ const Entitylineage: FunctionComponent<EntityLineageProp> = ({
) : null}
<p className="tw-flex">
<span className="tw-mr-2">{getEntityIcon(node.type)}</span>
{getDataLabel(node.displayName, node.name, false, node.type)}
{getDataLabel(
node.displayName,
node.fullyQualifiedName,
false,
node.type
)}
</p>
</Fragment>
);
@ -480,6 +485,7 @@ const Entitylineage: FunctionComponent<EntityLineageProp> = ({
if (!expandButton.current) {
selectNodeHandler(true, {
name: node?.name as string,
fqn: node?.fullyQualifiedName as string,
id: el.id,
displayName: node?.displayName,
type: node?.type as string,
@ -846,12 +852,14 @@ const Entitylineage: FunctionComponent<EntityLineageProp> = ({
</ReactFlow>
</ReactFlowProvider>
</div>
<EntityInfoDrawer
isMainNode={selectedNode.name === lineageData.entity?.name}
selectedNode={selectedNode}
show={isDrawerOpen && !isEditMode}
onCancel={closeDrawer}
/>
{!isEmpty(selectedNode) ? (
<EntityInfoDrawer
isMainNode={selectedNode.name === lineageData.entity?.name}
selectedNode={selectedNode}
show={isDrawerOpen && !isEditMode}
onCancel={closeDrawer}
/>
) : null}
<EntityLineageSidebar newAddedNode={newAddedNode} show={isEditMode} />
{showdeleteModal ? (
<ConfirmationModal

View File

@ -20,6 +20,7 @@ import {
export interface SelectedNode {
name: string;
type: string;
fqn: string;
displayName?: string;
id?: string;
entityId: string;

View File

@ -466,7 +466,7 @@ const Explore: React.FC<ExploreProps> = ({
const handleFilterChange = (filtersObj: FilterObject) => {
const params = prepareQueryParams(filtersObj);
const explorePath = getExplorePathWithSearch(searchQuery);
const explorePath = getExplorePathWithSearch(searchQuery, tab);
history.push({
pathname: explorePath,

View File

@ -257,8 +257,10 @@ const DatabaseSchemaPage: FunctionComponent = () => {
imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
},
{
name: getPartialNameFromTableFQN(database.name, ['database']),
url: getDatabaseDetailsPath(database.name),
name: getPartialNameFromTableFQN(database.fullyQualifiedName, [
'database',
]),
url: getDatabaseDetailsPath(database.fullyQualifiedName),
},
{
name: name,

View File

@ -313,12 +313,19 @@ const DatasetDetailsPage: FunctionComponent = () => {
imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
},
{
name: getPartialNameFromTableFQN(database.name, ['database']),
url: getDatabaseDetailsPath(database.name),
name: getPartialNameFromTableFQN(database.fullyQualifiedName, [
'database',
]),
url: getDatabaseDetailsPath(database.fullyQualifiedName),
},
{
name: getPartialNameFromTableFQN(databaseSchema.name, ['schema']),
url: getDatabaseSchemaDetailsPath(databaseSchema.name),
name: getPartialNameFromTableFQN(
databaseSchema.fullyQualifiedName,
['schema']
),
url: getDatabaseSchemaDetailsPath(
databaseSchema.fullyQualifiedName
),
},
{
name: name,

View File

@ -173,14 +173,19 @@ const EntityVersionPage: FunctionComponent = () => {
imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
},
{
name: getPartialNameFromTableFQN(database.name, ['database']),
url: getDatabaseDetailsPath(database.name),
name: getPartialNameFromTableFQN(database.fullyQualifiedName, [
'database',
]),
url: getDatabaseDetailsPath(database.fullyQualifiedName),
},
{
name: getPartialNameFromTableFQN(databaseSchema.name, [
'schema',
]),
url: getDatabaseSchemaDetailsPath(databaseSchema.name),
name: getPartialNameFromTableFQN(
databaseSchema.fullyQualifiedName,
['schema']
),
url: getDatabaseSchemaDetailsPath(
databaseSchema.fullyQualifiedName
),
},
{
name: name,
@ -387,16 +392,20 @@ const EntityVersionPage: FunctionComponent = () => {
: undefined,
},
{
name: getPartialNameFromTableFQN(database.name, [
'database',
]),
url: getDatabaseDetailsPath(database.name),
name: getPartialNameFromTableFQN(
database.fullyQualifiedName,
['database']
),
url: getDatabaseDetailsPath(database.fullyQualifiedName),
},
{
name: getPartialNameFromTableFQN(databaseSchema.name, [
'schema',
]),
url: getDatabaseSchemaDetailsPath(databaseSchema.name),
name: getPartialNameFromTableFQN(
databaseSchema.fullyQualifiedName,
['schema']
),
url: getDatabaseSchemaDetailsPath(
databaseSchema.fullyQualifiedName
),
},
{
name: name,

View File

@ -58,8 +58,8 @@ import { isLeafNode } from './EntityUtils';
import { getEntityLink } from './TableUtils';
export const getHeaderLabel = (
v = '',
fqn: string,
name = '',
fqn = '',
type: string,
isMainNode: boolean
) => {
@ -69,14 +69,14 @@ export const getHeaderLabel = (
<span
className="tw-break-words description-text tw-self-center tw-font-medium"
data-testid="lineage-entity">
{prepareLabel(type, v, false)}
{name || prepareLabel(type, fqn, false)}
</span>
) : (
<span
className="tw-break-words description-text tw-self-center link-text tw-font-medium"
data-testid="lineage-entity">
<Link to={getEntityLink(type, fqn)}>
{prepareLabel(type, v, false)}
{name || prepareLabel(type, fqn, false)}
</Link>
</span>
)}
@ -421,18 +421,18 @@ export const getLineageData = (
export const getDataLabel = (
displayName?: string,
name = '',
fqn = '',
isTextOnly = false,
type?: string
) => {
const databaseName = getPartialNameFromTableFQN(name, ['database']);
const schemaName = getPartialNameFromTableFQN(name, ['schema']);
const databaseName = getPartialNameFromTableFQN(fqn, ['database']);
const schemaName = getPartialNameFromTableFQN(fqn, ['schema']);
let label = '';
if (displayName) {
label = displayName;
} else {
label = prepareLabel(type as string, name);
label = prepareLabel(type as string, fqn);
}
if (isTextOnly) {