-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): show browse paths for business attributes related ent…
…ities - schema fields (#11585)
- Loading branch information
1 parent
a8af347
commit 25a4eef
Showing
6 changed files
with
111 additions
and
6 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
46 changes: 46 additions & 0 deletions
46
...web-react/src/app/entity/shared/containers/profile/header/PlatformContent/DatasetLink.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,46 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { Link } from 'react-router-dom'; | ||
import { Typography } from 'antd'; | ||
import { Dataset, EntityType } from '../../../../../../../types.generated'; | ||
import { ANTD_GRAY } from '../../../../constants'; | ||
import { useEntityRegistry } from '../../../../../../useEntityRegistry'; | ||
import { IconStyleType } from '../../../../../Entity'; | ||
|
||
const DatasetText = styled(Typography.Text)` | ||
font-size: 12px; | ||
line-height: 20px; | ||
color: ${ANTD_GRAY[7]}; | ||
`; | ||
|
||
export const DatasetIcon = styled.span` | ||
color: ${ANTD_GRAY[7]}; | ||
margin-right: 4px; | ||
font-size: 12px; | ||
`; | ||
|
||
const StyledLink = styled(Link)` | ||
white-space: nowrap; | ||
`; | ||
|
||
interface Props { | ||
parentDataset: Dataset; | ||
} | ||
|
||
function DatasetLink(props: Props) { | ||
const { parentDataset } = props; | ||
const entityRegistry = useEntityRegistry(); | ||
if (!parentDataset) return null; | ||
|
||
const datasetUrl = entityRegistry.getEntityUrl(EntityType.Dataset, parentDataset.urn); | ||
const datasetName = entityRegistry.getDisplayName(EntityType.Dataset, parentDataset); | ||
|
||
return ( | ||
<StyledLink to={datasetUrl} data-testid="dataset"> | ||
<DatasetIcon>{entityRegistry.getIcon(EntityType.Dataset, 14, IconStyleType.ACCENT)}</DatasetIcon> | ||
<DatasetText>{datasetName}</DatasetText> | ||
</StyledLink> | ||
); | ||
} | ||
|
||
export default DatasetLink; |
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