@@ -6,7 +6,14 @@ import SellOutlinedIcon from '@mui/icons-material/SellOutlined';
6
6
import styled from 'styled-components' ;
7
7
import { BookmarkSimple } from '@phosphor-icons/react' ;
8
8
import { useMatchedFieldsForList } from '../search/context/SearchResultContext' ;
9
- import { EntityPath , EntityType , GlobalTags , GlossaryTerms , LineageDirection , Owner } from '../../types.generated' ;
9
+ import {
10
+ EntityPath ,
11
+ EntityType ,
12
+ GlossaryTermAssociation ,
13
+ LineageDirection ,
14
+ Owner ,
15
+ TagAssociation ,
16
+ } from '../../types.generated' ;
10
17
import { EntityCapabilityType } from '../entityV2/Entity' ;
11
18
import MatchesContext , { PreviewSection } from '../shared/MatchesContext' ;
12
19
import SearchPill from './SearchPill' ;
@@ -22,9 +29,9 @@ const PillsContainer = styled.div`
22
29
` ;
23
30
24
31
interface Props {
25
- glossaryTerms ?: GlossaryTerms ;
26
- tags ?: GlobalTags ;
27
- owners ?: Array < Owner > | null ;
32
+ glossaryTerms : GlossaryTermAssociation [ ] ;
33
+ tags : TagAssociation [ ] ;
34
+ owners : Owner [ ] ;
28
35
entityCapabilities : Set < EntityCapabilityType > ;
29
36
paths ?: EntityPath [ ] ;
30
37
entityType : EntityType ;
@@ -49,34 +56,34 @@ const Pills = ({ glossaryTerms, tags, owners, entityCapabilities, paths, entityT
49
56
50
57
return (
51
58
< PillsContainer >
52
- { showGlossaryTermsBadge && glossaryTerms && (
59
+ { showGlossaryTermsBadge && ! ! glossaryTerms . length && (
53
60
< SearchPill
54
61
icon = { < BookmarkSimple /> }
55
- count = { glossaryTerms . terms ?. length || 0 }
56
- enabled = { ! ! glossaryTerms . terms ?. length }
62
+ count = { glossaryTerms . length || 0 }
63
+ enabled = { ! ! glossaryTerms . length }
57
64
active = { expandedSection === PreviewSection . GLOSSARY_TERMS }
58
65
label = ""
59
66
countLabel = "term"
60
- onClick = { handlePillClick ( PreviewSection . GLOSSARY_TERMS , glossaryTerms . terms ) }
61
- highlightedText = { glossaryTerms . terms ?. length ? glossaryTerms ?. terms [ 0 ] ?. term ?. properties ?. name : '' }
67
+ onClick = { handlePillClick ( PreviewSection . GLOSSARY_TERMS , glossaryTerms ) }
68
+ highlightedText = { glossaryTerms . length ? glossaryTerms [ 0 ] ?. term ?. properties ?. name : '' }
62
69
/>
63
70
) }
64
- { showTagsBadge && tags && (
71
+ { showTagsBadge && ! ! tags . length && (
65
72
< SearchPill
66
73
icon = { < SellOutlinedIcon /> }
67
- count = { tags . tags ?. length || 0 }
68
- enabled = { ! ! tags . tags ?. length }
74
+ count = { tags . length }
75
+ enabled = { ! ! tags . length }
69
76
active = { expandedSection === PreviewSection . TAGS }
70
77
label = ""
71
78
countLabel = "tag"
72
- onClick = { handlePillClick ( PreviewSection . TAGS , tags . tags ) }
79
+ onClick = { handlePillClick ( PreviewSection . TAGS , tags ) }
73
80
highlightedText = { highlightedTag }
74
81
/>
75
82
) }
76
- { showOwnersBadge && owners && (
83
+ { showOwnersBadge && ! ! owners . length && (
77
84
< SearchPill
78
85
icon = { < AccountCircleOutlinedIcon /> }
79
- count = { owners . length || 0 }
86
+ count = { owners . length }
80
87
enabled = { ! ! owners . length }
81
88
active = { expandedSection === PreviewSection . OWNERS }
82
89
label = ""
0 commit comments