feat(react): add null state indicator in user profile when no entities (#2377)

This commit is contained in:
Brian 2021-04-10 07:55:05 +08:00 committed by GitHub
parent fefcdd949c
commit a19085094a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -69,7 +69,9 @@ export const BrowseResults = ({
</>
)}
bordered
locale={{ emptyText: <Empty description="No Entities" /> }}
locale={{
emptyText: <Empty description="No Entities" image={Empty.PRESENTED_IMAGE_SIMPLE} />,
}}
/>
)}
<Col span={24}>

View File

@ -1,4 +1,4 @@
import { Menu } from 'antd';
import { Menu, Empty } from 'antd';
import { MenuProps } from 'antd/lib/menu';
import React from 'react';
import { useHistory } from 'react-router-dom';
@ -75,7 +75,11 @@ export default function UserDetails({ ownerships, subview, item, urn }: Props) {
</Menu>
</MenuWrapper>
<Content>
{subview === Subview.Ownership && <UserOwnership ownerships={ownerships} entityPath={item} />}
{ownershipMenuOptions && ownershipMenuOptions.length > 0 ? (
subview === Subview.Ownership && <UserOwnership ownerships={ownerships} entityPath={item} />
) : (
<Empty description="Looks like you don't own any datasets" image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</Content>
</DetailWrapper>
);