Fixed #1206 Tier tag is not showing up on assets cards. (#1207)

This commit is contained in:
Sachin Chaurasiya 2021-11-16 16:17:32 +05:30 committed by GitHub
parent 3494a12647
commit 3179680d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ const TableDataCard: FunctionComponent<Props> = ({
name, name,
owner = '--', owner = '--',
description, description,
tier = 'No Tier', tier = '',
usage, usage,
serviceType, serviceType,
fullyQualifiedName, fullyQualifiedName,
@ -66,9 +66,18 @@ const TableDataCard: FunctionComponent<Props> = ({
? getUsagePercentile(usage) ? getUsagePercentile(usage)
: undefined, : undefined,
}, },
{ key: 'Tier', value: tier }, { key: 'Tier', value: tier ? tier : 'No Tier' },
]; ];
const getAssetTags = () => {
const assetTags = [...(tags as Array<string>)];
if (tier) {
assetTags.unshift(tier);
}
return [...new Set(assetTags)];
};
return ( return (
<div <div
className="tw-bg-white tw-p-3 tw-border tw-border-main tw-rounded-md" className="tw-bg-white tw-p-3 tw-border tw-border-main tw-rounded-md"
@ -91,7 +100,7 @@ const TableDataCard: FunctionComponent<Props> = ({
<TableDataCardBody <TableDataCardBody
description={description || ''} description={description || ''}
extraInfo={OtherDetails} extraInfo={OtherDetails}
tags={[...new Set(tags)]} tags={getAssetTags()}
/> />
</div> </div>
{matches && matches.length > 0 ? ( {matches && matches.length > 0 ? (