mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 17:08:29 +00:00
fix(react): ownership rendering (#2373)
Co-authored-by: shubham.garg <shubham.garg@thoughtworks.com>
This commit is contained in:
parent
a19085094a
commit
0b01c7d9dc
@ -44,7 +44,7 @@ export default ({ ownerships, entityPath }: Props) => {
|
||||
renderItem={(item) => {
|
||||
return (
|
||||
<ListItem>
|
||||
{entityRegistry.renderPreview(entityType, PreviewType.PREVIEW, item)}
|
||||
{entityRegistry.renderPreview(entityType, PreviewType.PREVIEW, item.entity)}
|
||||
<Divider />
|
||||
</ListItem>
|
||||
);
|
||||
|
||||
@ -35,12 +35,12 @@ export default function UserProfile() {
|
||||
|
||||
const ownershipForDetails = useMemo(() => {
|
||||
Object.keys(ownershipResult).forEach((type) => {
|
||||
const entities = ownershipResult[type].data?.search?.entities;
|
||||
const entities = ownershipResult[type].data?.search?.searchResults;
|
||||
|
||||
if (!entities || entities.length === 0) {
|
||||
delete ownershipResult[type];
|
||||
} else {
|
||||
ownershipResult[type] = ownershipResult[type].data?.search?.entities;
|
||||
ownershipResult[type] = ownershipResult[type].data?.search?.searchResults;
|
||||
}
|
||||
});
|
||||
return ownershipResult;
|
||||
|
||||
@ -8,24 +8,28 @@ import { Subview } from '../Subview';
|
||||
const ownerships = {
|
||||
[EntityType.Dataset]: [
|
||||
{
|
||||
name: 'HiveDataset',
|
||||
origin: 'PROD',
|
||||
description: 'this is a dataset',
|
||||
platformNativeType: PlatformNativeType.Table,
|
||||
platform: {
|
||||
name: 'hive',
|
||||
entity: {
|
||||
name: 'HiveDataset',
|
||||
origin: 'PROD',
|
||||
description: 'this is a dataset',
|
||||
platformNativeType: PlatformNativeType.Table,
|
||||
platform: {
|
||||
name: 'hive',
|
||||
},
|
||||
tags: [],
|
||||
},
|
||||
tags: [],
|
||||
},
|
||||
{
|
||||
name: 'KafkaDataset',
|
||||
origin: 'PROD',
|
||||
description: 'this is also a dataset',
|
||||
platformNativeType: PlatformNativeType.Table,
|
||||
platform: {
|
||||
name: 'kafka',
|
||||
entity: {
|
||||
name: 'KafkaDataset',
|
||||
origin: 'PROD',
|
||||
description: 'this is also a dataset',
|
||||
platformNativeType: PlatformNativeType.Table,
|
||||
platform: {
|
||||
name: 'kafka',
|
||||
},
|
||||
tags: [],
|
||||
},
|
||||
tags: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@ -7,24 +7,28 @@ import TestPageContainer from '../../../../utils/test-utils/TestPageContainer';
|
||||
const ownerships = {
|
||||
[EntityType.Dataset]: [
|
||||
{
|
||||
name: 'HiveDataset',
|
||||
origin: 'PROD',
|
||||
description: 'this is a dataset',
|
||||
platformNativeType: PlatformNativeType.Table,
|
||||
platform: {
|
||||
name: 'hive',
|
||||
entity: {
|
||||
name: 'HiveDataset',
|
||||
origin: 'PROD',
|
||||
description: 'this is a dataset',
|
||||
platformNativeType: PlatformNativeType.Table,
|
||||
platform: {
|
||||
name: 'hive',
|
||||
},
|
||||
tags: [],
|
||||
},
|
||||
tags: [],
|
||||
},
|
||||
{
|
||||
name: 'KafkaDataset',
|
||||
origin: 'PROD',
|
||||
description: 'this is also a dataset',
|
||||
platformNativeType: PlatformNativeType.Table,
|
||||
platform: {
|
||||
name: 'kafka',
|
||||
entity: {
|
||||
name: 'KafkaDataset',
|
||||
origin: 'PROD',
|
||||
description: 'this is also a dataset',
|
||||
platformNativeType: PlatformNativeType.Table,
|
||||
platform: {
|
||||
name: 'kafka',
|
||||
},
|
||||
tags: [],
|
||||
},
|
||||
tags: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user