mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-31 04:25:29 +00:00
feat(ui/summary): add the new summary tab to glossary node entity (#14541)
This commit is contained in:
parent
8234cbec8f
commit
5dd2a3633a
@ -17,6 +17,9 @@ import SidebarNotesSection from '@app/entityV2/shared/sidebarSection/SidebarNote
|
||||
import SidebarStructuredProperties from '@app/entityV2/shared/sidebarSection/SidebarStructuredProperties';
|
||||
import { DocumentationTab } from '@app/entityV2/shared/tabs/Documentation/DocumentationTab';
|
||||
import { PropertiesTab } from '@app/entityV2/shared/tabs/Properties/PropertiesTab';
|
||||
import { EntityTab } from '@app/entityV2/shared/types';
|
||||
import SummaryTab from '@app/entityV2/summary/SummaryTab';
|
||||
import { useShowAssetSummaryPage } from '@app/entityV2/summary/useShowAssetSummaryPage';
|
||||
import { FetchedEntity } from '@app/lineage/types';
|
||||
|
||||
import { useGetGlossaryNodeQuery } from '@graphql/glossaryNode.generated';
|
||||
@ -85,26 +88,7 @@ class GlossaryNodeEntity implements Entity<GlossaryNode> {
|
||||
useEntityQuery={useGetGlossaryNodeQuery}
|
||||
getOverrideProperties={this.getOverridePropertiesFromEntity}
|
||||
isNameEditable
|
||||
tabs={[
|
||||
{
|
||||
name: 'Contents',
|
||||
component: ChildrenTab,
|
||||
icon: AppstoreOutlined,
|
||||
},
|
||||
{
|
||||
name: 'Documentation',
|
||||
component: DocumentationTab,
|
||||
icon: FileOutlined,
|
||||
properties: {
|
||||
hideLinksButton: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Properties',
|
||||
component: PropertiesTab,
|
||||
icon: UnorderedListOutlined,
|
||||
},
|
||||
]}
|
||||
tabs={this.getProfileTabs()}
|
||||
sidebarSections={this.getSidebarSections()}
|
||||
// NOTE: Hiding this for now as we've moved the actions to the content of ChildrenTab.tsx
|
||||
// The buttons are too big and causes other actions to overflow.
|
||||
@ -142,6 +126,43 @@ class GlossaryNodeEntity implements Entity<GlossaryNode> {
|
||||
},
|
||||
];
|
||||
|
||||
getProfileTabs = (): EntityTab[] => {
|
||||
const showSummaryTab = useShowAssetSummaryPage();
|
||||
|
||||
return [
|
||||
...(showSummaryTab
|
||||
? [
|
||||
{
|
||||
name: 'Summary',
|
||||
component: SummaryTab,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
name: 'Contents',
|
||||
component: ChildrenTab,
|
||||
icon: AppstoreOutlined,
|
||||
},
|
||||
...(!showSummaryTab
|
||||
? [
|
||||
{
|
||||
name: 'Documentation',
|
||||
component: DocumentationTab,
|
||||
icon: FileOutlined,
|
||||
properties: {
|
||||
hideLinksButton: true,
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
name: 'Properties',
|
||||
component: PropertiesTab,
|
||||
icon: UnorderedListOutlined,
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
getSidebarTabs = () => [
|
||||
{
|
||||
name: 'Properties',
|
||||
|
Loading…
x
Reference in New Issue
Block a user