From 17dd0ee4b956690e18466ecc3abc7502f0b47eaf Mon Sep 17 00:00:00 2001 From: Sweta Agarwalla <105535990+sweta1308@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:42:19 +0530 Subject: [PATCH] update to reorder domain and owner tags (#18872) --- .../ExploreSearchCard/ExploreSearchCard.tsx | 82 ++++++++++--------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx index 99259365e8a..2a61c7a3815 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx @@ -78,54 +78,56 @@ const ExploreSearchCard: React.FC = 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: ( - + ), }, - ]; - 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]);