mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-11 00:48:39 +00:00
fixing tag color in recs (#4274)
This commit is contained in:
parent
77a27359f2
commit
dd370798ae
@ -2,9 +2,10 @@ import { Button } from 'antd';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { RecommendationContent, Tag } from '../../../../types.generated';
|
import { EntityType, RecommendationContent, Tag } from '../../../../types.generated';
|
||||||
import { StyledTag } from '../../../entity/shared/components/styled/StyledTag';
|
import { StyledTag } from '../../../entity/shared/components/styled/StyledTag';
|
||||||
import { navigateToSearchUrl } from '../../../search/utils/navigateToSearchUrl';
|
import { navigateToSearchUrl } from '../../../search/utils/navigateToSearchUrl';
|
||||||
|
import { useEntityRegistry } from '../../../useEntityRegistry';
|
||||||
|
|
||||||
const TagSearchListContainer = styled.div`
|
const TagSearchListContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -30,6 +31,7 @@ type Props = {
|
|||||||
|
|
||||||
export const TagSearchList = ({ content, onClick }: Props) => {
|
export const TagSearchList = ({ content, onClick }: Props) => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
const entityRegistry = useEntityRegistry();
|
||||||
|
|
||||||
const tags: Array<Tag> = content
|
const tags: Array<Tag> = content
|
||||||
.map((cnt) => cnt.entity)
|
.map((cnt) => cnt.entity)
|
||||||
@ -55,7 +57,7 @@ export const TagSearchList = ({ content, onClick }: Props) => {
|
|||||||
<TagContainer>
|
<TagContainer>
|
||||||
<TagButton type="link" key={tag.urn} onClick={() => onClickTag(tag, index)}>
|
<TagButton type="link" key={tag.urn} onClick={() => onClickTag(tag, index)}>
|
||||||
<StyledTag $colorHash={tag?.urn} $color={tag?.properties?.colorHex} closable={false}>
|
<StyledTag $colorHash={tag?.urn} $color={tag?.properties?.colorHex} closable={false}>
|
||||||
{tag?.name}
|
{entityRegistry.getDisplayName(EntityType.Tag, tag)}
|
||||||
</StyledTag>
|
</StyledTag>
|
||||||
</TagButton>
|
</TagButton>
|
||||||
</TagContainer>
|
</TagContainer>
|
||||||
|
@ -247,6 +247,11 @@ fragment entityPreview on Entity {
|
|||||||
... on Tag {
|
... on Tag {
|
||||||
name
|
name
|
||||||
description
|
description
|
||||||
|
properties {
|
||||||
|
name
|
||||||
|
description
|
||||||
|
colorHex
|
||||||
|
}
|
||||||
}
|
}
|
||||||
... on DataPlatform {
|
... on DataPlatform {
|
||||||
...nonConflictingPlatformFields
|
...nonConflictingPlatformFields
|
||||||
|
Loading…
x
Reference in New Issue
Block a user