diff --git a/ui/src/app/applications/components/application-details/application-resource-list.tsx b/ui/src/app/applications/components/application-details/application-resource-list.tsx index dba61c5135492..61c05df4a02f6 100644 --- a/ui/src/app/applications/components/application-details/application-resource-list.tsx +++ b/ui/src/app/applications/components/application-details/application-resource-list.tsx @@ -15,7 +15,7 @@ export const ApplicationResourceList = ({ resources, onNodeClick, nodeMenu, - tree + tree, }: { resources: models.ResourceStatus[]; onNodeClick?: (fullName: string) => any; @@ -30,36 +30,43 @@ export const ApplicationResourceList = ({ } return null; } - const parentNode = ((resources || []).length > 0 && (getResNode(tree.nodes, nodeKey(resources[0])) as ResourceNode)?.parentRefs?.[0]) || ({} as ResourceRef); + const parentNode = resources?.length > 0 && (getResNode(tree.nodes, nodeKey(resources[0]))?.parentRefs?.[0] || ({} as ResourceRef)); + const ParenRefDetails = () => { + return ( +
+
Parent Node Info
+
+
Name:
+
{parentNode?.name}
+
+
+
Kind:
+
{parentNode?.kind}
+
+
+ ); + }; return (
-
- {Object.keys(parentNode).length > 0 && ( -
-
Parent Node Info
-
-
Name:
-
{parentNode?.name}
-
-
-
Kind:
-
{parentNode?.kind}
-
-
- )} -
+ {/*Display only when the resource list is of the same type*/} + {resources.every(res => res.kind === resources[0].kind) && ( +
+ +
+ )} +
-
-
NAME
-
GROUP/KIND
-
SYNC ORDER
-
NAMESPACE
- {(parentNode.kind === 'Rollout' || parentNode.kind === 'Deployment') &&
REVISION
} -
CREATED AT
-
STATUS
+
+
NAME
+
GROUP/KIND
+
SYNC ORDER
+
NAMESPACE
+ {(parentNode.kind === 'Rollout' || parentNode.kind === 'Deployment') &&
REVISION
} +
CREATED AT
+
STATUS
{resources @@ -68,18 +75,18 @@ export const ApplicationResourceList = ({
onNodeClick(nodeKey(res))}>
-
+

{ResourceLabel({kind: res.kind})}
-
+
{res.name} {res.kind === 'Application' && ( @@ -93,22 +100,22 @@ export const ApplicationResourceList = ({ )}
-
{[res.group, res.kind].filter(item => !!item).join('/')}
-
{res.syncWave || '-'}
-
{res.namespace}
+
{[res.group, res.kind].filter(item => !!item).join('/')}
+
{res.syncWave || '-'}
+
{res.namespace}
{res.kind === 'ReplicaSet' && ((getResNode(tree.nodes, nodeKey(res)) as ResourceNode).info || []) .filter(tag => !tag.name.includes('Node')) .slice(0, 4) .map((tag, i) => { return ( -
+
{tag?.value?.split(':')[1] || '-'}
); })} -
+
{res.createdAt && ( @@ -118,7 +125,7 @@ export const ApplicationResourceList = ({ )}
-
+
{res.health && ( {res.health.status}   @@ -143,7 +150,7 @@ export const ApplicationResourceList = ({ info: null, uid: '', resourceVersion: null, - parentRefs: [] + parentRefs: [], })}