update to reorder domain and owner tags (#18872)

This commit is contained in:
Sweta Agarwalla 2024-12-02 15:42:19 +05:30 committed by GitHub
parent bb15331340
commit 17dd0ee4b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,54 +78,56 @@ const ExploreSearchCard: React.FC<ExploreSearchCardProps> = forwardRef<
);
const _otherDetails: ExtraInfo[] = [
...(source?.domain
? [
{
key: 'Domain',
value: getDomainPath(source.domain.fullyQualifiedName),
placeholderText: getEntityName(source.domain),
isLink: true,
openInNewTab: false,
},
]
: !searchClassBase
.getListOfEntitiesWithoutDomain()
.includes(source?.entityType ?? '')
? [
{
key: 'Domain',
value: '',
},
]
: []),
{
key: 'Owner',
value: (
<OwnerLabel owners={(source.owners as EntityReference[]) ?? []} />
<OwnerLabel owners={(source?.owners as EntityReference[]) ?? []} />
),
},
];
if (source?.domain) {
const domain = getEntityName(source.domain);
const domainLink = getDomainPath(source.domain.fullyQualifiedName);
_otherDetails.push({
key: 'Domain',
value: domainLink,
placeholderText: domain,
isLink: true,
openInNewTab: false,
});
} else {
const entitiesWithoutDomain =
searchClassBase.getListOfEntitiesWithoutDomain();
if (!entitiesWithoutDomain.includes(source.entityType ?? '')) {
_otherDetails.push({
key: 'Domain',
value: '',
});
}
}
if (
!searchClassBase
...(!searchClassBase
.getListOfEntitiesWithoutTier()
.includes((source.entityType ?? '') as EntityType)
) {
_otherDetails.push({
key: 'Tier',
value: tierValue,
});
}
.includes((source?.entityType ?? '') as EntityType)
? [
{
key: 'Tier',
value: tierValue,
},
]
: []),
if ('usageSummary' in source) {
_otherDetails.push({
value: getUsagePercentile(
source.usageSummary?.weeklyStats?.percentileRank ?? 0,
true
),
});
}
...('usageSummary' in source
? [
{
value: getUsagePercentile(
source.usageSummary?.weeklyStats?.percentileRank ?? 0,
true
),
},
]
: []),
];
return _otherDetails;
}, [source]);