Skip to content

Commit 4c5533d

Browse files
committed
ui: search - fix render issue for non strings
Signed-off-by: Pamfilos Fokianos <[email protected]>
1 parent 1c30b18 commit 4c5533d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ui/cap-react/src/antd/search/components/FacetItem.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const FacetItem = ({
2929
onChange={e => onChange(category, e)}
3030
checked={isAggSelected(
3131
selectedAggs[category],
32-
item.get("key")
32+
`${item.get("key")}`
3333
)}
3434
>
3535
<EllipsisText
@@ -39,8 +39,8 @@ const FacetItem = ({
3939
type="secondary"
4040
>
4141
{item.has("__display_name__")
42-
? item.get("__display_name__")
43-
: item.get("key")}
42+
? `${item.get("__display_name__")}`
43+
: `${item.get("key")}`}
4444
</EllipsisText>
4545
</Checkbox>
4646
<Tag>

ui/cap-react/src/antd/search/components/Results.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ const Results = ({ results, loading }) => {
5353

5454
<Space size="small" style={{ marginBottom: "10px", flexWrap: "wrap" }}>
5555
{[
56-
item.getIn(["schema", "name"]),
57-
new Date(item.get("created")).toLocaleString("en-GB", timeOptions),
58-
...item.get("labels"),
56+
...(item.getIn(["schema", "name"]) ? [item.getIn(["schema", "name"])] : []),
57+
...(item.get("created") ? [new Date(item.get("created")).toLocaleString("en-GB", timeOptions)] : []),
58+
...(item.get("labels") || []),
5959
].map(label => (
6060
<Tag key={label}>{label}</Tag>
6161
))}

0 commit comments

Comments
 (0)