mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-12 10:35:51 +00:00
feat(ui) Show Glossary and Domains header links to everyone (#5506)
Co-authored-by: Chris Collins <chriscollins@Chriss-MBP-2.lan>
This commit is contained in:
parent
64e7da8a68
commit
be296d69a5
@ -14,7 +14,7 @@ import {
|
||||
} from '../../graphql/search.generated';
|
||||
import { EntityType } from '../../types.generated';
|
||||
import analytics, { EventType } from '../analytics';
|
||||
import { AdminHeaderLinks } from '../shared/admin/AdminHeaderLinks';
|
||||
import { HeaderLinks } from '../shared/admin/HeaderLinks';
|
||||
import { ANTD_GRAY } from '../entity/shared/constants';
|
||||
import { useAppConfig } from '../useAppConfig';
|
||||
import { DEFAULT_APP_CONFIG } from '../../appConfigContext';
|
||||
@ -188,7 +188,7 @@ export const HomePageHeader = () => {
|
||||
)}
|
||||
</WelcomeText>
|
||||
<NavGroup>
|
||||
<AdminHeaderLinks />
|
||||
<HeaderLinks />
|
||||
<ManageAccount
|
||||
urn={user?.urn || ''}
|
||||
pictureLink={user?.editableProperties?.pictureLink || ''}
|
||||
|
||||
@ -8,7 +8,7 @@ import { ManageAccount } from '../shared/ManageAccount';
|
||||
import { AutoCompleteResultForEntity, EntityType } from '../../types.generated';
|
||||
import EntityRegistry from '../entity/EntityRegistry';
|
||||
import { ANTD_GRAY } from '../entity/shared/constants';
|
||||
import { AdminHeaderLinks } from '../shared/admin/AdminHeaderLinks';
|
||||
import { HeaderLinks } from '../shared/admin/HeaderLinks';
|
||||
import { useAppConfig } from '../useAppConfig';
|
||||
import { DEFAULT_APP_CONFIG } from '../../appConfigContext';
|
||||
|
||||
@ -104,7 +104,7 @@ export const SearchHeader = ({
|
||||
/>
|
||||
</LogoSearchContainer>
|
||||
<NavGroup>
|
||||
<AdminHeaderLinks areLinksHidden={isSearchBarFocused} />
|
||||
<HeaderLinks areLinksHidden={isSearchBarFocused} />
|
||||
<ManageAccount urn={authenticatedUserUrn} pictureLink={authenticatedUserPictureLink || ''} />
|
||||
</NavGroup>
|
||||
</Header>
|
||||
|
||||
@ -14,7 +14,7 @@ import { Button, Dropdown, Menu } from 'antd';
|
||||
import { useAppConfig } from '../../useAppConfig';
|
||||
import { useGetAuthenticatedUser } from '../../useGetAuthenticatedUser';
|
||||
|
||||
const AdminLink = styled.span`
|
||||
const LinkWrapper = styled.span`
|
||||
margin-right: 0px;
|
||||
`;
|
||||
|
||||
@ -40,7 +40,7 @@ interface Props {
|
||||
areLinksHidden?: boolean;
|
||||
}
|
||||
|
||||
export function AdminHeaderLinks(props: Props) {
|
||||
export function HeaderLinks(props: Props) {
|
||||
const { areLinksHidden } = props;
|
||||
const me = useGetAuthenticatedUser();
|
||||
const { config } = useAppConfig();
|
||||
@ -52,66 +52,58 @@ export function AdminHeaderLinks(props: Props) {
|
||||
const showSettings = true;
|
||||
const showIngestion =
|
||||
isIngestionEnabled && me && me.platformPrivileges.manageIngestion && me.platformPrivileges.manageSecrets;
|
||||
const showDomains = me?.platformPrivileges?.manageDomains || false;
|
||||
const showGlossary = me?.platformPrivileges?.manageGlossaries || false;
|
||||
|
||||
return (
|
||||
<LinksWrapper areLinksHidden={areLinksHidden}>
|
||||
{showAnalytics && (
|
||||
<AdminLink>
|
||||
<LinkWrapper>
|
||||
<Link to="/analytics">
|
||||
<Button type="text">
|
||||
<BarChartOutlined /> Analytics
|
||||
</Button>
|
||||
</Link>
|
||||
</AdminLink>
|
||||
</LinkWrapper>
|
||||
)}
|
||||
{showIngestion && (
|
||||
<AdminLink>
|
||||
<LinkWrapper>
|
||||
<Link to="/ingestion">
|
||||
<Button type="text">
|
||||
<ApiOutlined /> Ingestion
|
||||
</Button>
|
||||
</Link>
|
||||
</AdminLink>
|
||||
)}
|
||||
{(showGlossary || showDomains) && (
|
||||
<Dropdown
|
||||
trigger={['click']}
|
||||
overlay={
|
||||
<Menu>
|
||||
{showGlossary && (
|
||||
<MenuItem key="0">
|
||||
<Link to="/glossary">
|
||||
<BookOutlined style={{ fontSize: '14px', fontWeight: 'bold' }} /> Glossary
|
||||
</Link>
|
||||
</MenuItem>
|
||||
)}
|
||||
{showDomains && (
|
||||
<MenuItem key="1">
|
||||
<Link to="/domains">
|
||||
<FolderOutlined style={{ fontSize: '14px', fontWeight: 'bold' }} /> Domains
|
||||
</Link>
|
||||
</MenuItem>
|
||||
)}
|
||||
</Menu>
|
||||
}
|
||||
>
|
||||
<AdminLink>
|
||||
<Button type="text">
|
||||
<SolutionOutlined /> Govern <DownOutlined style={{ fontSize: '6px' }} />
|
||||
</Button>
|
||||
</AdminLink>
|
||||
</Dropdown>
|
||||
</LinkWrapper>
|
||||
)}
|
||||
<Dropdown
|
||||
trigger={['click']}
|
||||
overlay={
|
||||
<Menu>
|
||||
<MenuItem key="0">
|
||||
<Link to="/glossary">
|
||||
<BookOutlined style={{ fontSize: '14px', fontWeight: 'bold' }} /> Glossary
|
||||
</Link>
|
||||
</MenuItem>
|
||||
<MenuItem key="1">
|
||||
<Link to="/domains">
|
||||
<FolderOutlined style={{ fontSize: '14px', fontWeight: 'bold' }} /> Domains
|
||||
</Link>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
}
|
||||
>
|
||||
<LinkWrapper>
|
||||
<Button type="text">
|
||||
<SolutionOutlined /> Govern <DownOutlined style={{ fontSize: '6px' }} />
|
||||
</Button>
|
||||
</LinkWrapper>
|
||||
</Dropdown>
|
||||
{showSettings && (
|
||||
<AdminLink style={{ marginRight: 12 }}>
|
||||
<LinkWrapper style={{ marginRight: 12 }}>
|
||||
<Link to="/settings">
|
||||
<Button type="text">
|
||||
<SettingOutlined />
|
||||
</Button>
|
||||
</Link>
|
||||
</AdminLink>
|
||||
</LinkWrapper>
|
||||
)}
|
||||
</LinksWrapper>
|
||||
);
|
||||
Loading…
x
Reference in New Issue
Block a user