mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-10 08:26: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 { useHistory } from 'react-router-dom';
|
||||
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 { navigateToSearchUrl } from '../../../search/utils/navigateToSearchUrl';
|
||||
import { useEntityRegistry } from '../../../useEntityRegistry';
|
||||
|
||||
const TagSearchListContainer = styled.div`
|
||||
display: flex;
|
||||
@ -30,6 +31,7 @@ type Props = {
|
||||
|
||||
export const TagSearchList = ({ content, onClick }: Props) => {
|
||||
const history = useHistory();
|
||||
const entityRegistry = useEntityRegistry();
|
||||
|
||||
const tags: Array<Tag> = content
|
||||
.map((cnt) => cnt.entity)
|
||||
@ -55,7 +57,7 @@ export const TagSearchList = ({ content, onClick }: Props) => {
|
||||
<TagContainer>
|
||||
<TagButton type="link" key={tag.urn} onClick={() => onClickTag(tag, index)}>
|
||||
<StyledTag $colorHash={tag?.urn} $color={tag?.properties?.colorHex} closable={false}>
|
||||
{tag?.name}
|
||||
{entityRegistry.getDisplayName(EntityType.Tag, tag)}
|
||||
</StyledTag>
|
||||
</TagButton>
|
||||
</TagContainer>
|
||||
|
@ -247,6 +247,11 @@ fragment entityPreview on Entity {
|
||||
... on Tag {
|
||||
name
|
||||
description
|
||||
properties {
|
||||
name
|
||||
description
|
||||
colorHex
|
||||
}
|
||||
}
|
||||
... on DataPlatform {
|
||||
...nonConflictingPlatformFields
|
||||
|
Loading…
x
Reference in New Issue
Block a user