-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into profiler-allow-specific-override
- Loading branch information
Showing
111 changed files
with
6,067 additions
and
9,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
datahub-web-react/src/app/entity/shared/components/styled/StyledTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
...react/src/app/entity/shared/containers/profile/header/PlatformContent/ParentNodesView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { Typography, Tooltip } from 'antd'; | ||
import { FolderOutlined, RightOutlined } from '@ant-design/icons'; | ||
import { ANTD_GRAY } from '../../../../constants'; | ||
import { EntityType, GlossaryNode } from '../../../../../../../types.generated'; | ||
import useContentTruncation from '../../../../../../shared/useContentTruncation'; | ||
import { useEntityRegistry } from '../../../../../../useEntityRegistry'; | ||
|
||
export const StyledRightOutlined = styled(RightOutlined)` | ||
color: ${ANTD_GRAY[7]}; | ||
font-size: 8px; | ||
margin: 0 10px; | ||
`; | ||
|
||
// must display content in reverse to have ellipses at the beginning of content | ||
export const ParentNodesWrapper = styled.div` | ||
align-items: center; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
flex-direction: row-reverse; | ||
display: flex; | ||
`; | ||
|
||
export const Ellipsis = styled.span` | ||
color: ${ANTD_GRAY[7]}; | ||
margin-right: 2px; | ||
`; | ||
|
||
export const StyledTooltip = styled(Tooltip)` | ||
display: flex; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
`; | ||
|
||
const GlossaryNodeText = styled(Typography.Text)<{ color: string }>` | ||
font-size: 12px; | ||
line-height: 20px; | ||
color: ${(props) => props.color}; | ||
`; | ||
|
||
const GlossaryNodeIcon = styled(FolderOutlined)<{ color: string }>` | ||
color: ${(props) => props.color}; | ||
&&& { | ||
font-size: 12px; | ||
margin-right: 4px; | ||
} | ||
`; | ||
|
||
interface Props { | ||
parentNodes?: GlossaryNode[] | null; | ||
} | ||
|
||
export default function ParentNodesView({ parentNodes }: Props) { | ||
const entityRegistry = useEntityRegistry(); | ||
const { contentRef, isContentTruncated } = useContentTruncation(parentNodes); | ||
|
||
return ( | ||
<StyledTooltip | ||
title={ | ||
<> | ||
{[...(parentNodes || [])]?.reverse()?.map((parentNode, idx) => ( | ||
<> | ||
<GlossaryNodeIcon color="white" /> | ||
<GlossaryNodeText color="white"> | ||
{entityRegistry.getDisplayName(EntityType.GlossaryNode, parentNode)} | ||
</GlossaryNodeText> | ||
{idx + 1 !== parentNodes?.length && <StyledRightOutlined data-testid="right-arrow" />} | ||
</> | ||
))} | ||
</> | ||
} | ||
overlayStyle={isContentTruncated ? {} : { display: 'none' }} | ||
> | ||
{isContentTruncated && <Ellipsis>...</Ellipsis>} | ||
<ParentNodesWrapper ref={contentRef}> | ||
{[...(parentNodes || [])]?.map((parentNode, idx) => ( | ||
<> | ||
<GlossaryNodeText color={ANTD_GRAY[7]}> | ||
{entityRegistry.getDisplayName(EntityType.GlossaryNode, parentNode)} | ||
</GlossaryNodeText> | ||
<GlossaryNodeIcon color={ANTD_GRAY[7]} /> | ||
{idx + 1 !== parentNodes?.length && <StyledRightOutlined data-testid="right-arrow" />} | ||
</> | ||
))} | ||
</ParentNodesWrapper> | ||
</StyledTooltip> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.