diff --git a/ui/src/app/applications/components/application-details/application-resource-filter.tsx b/ui/src/app/applications/components/application-details/application-resource-filter.tsx index 24e364d37237b..1d845c7e18948 100644 --- a/ui/src/app/applications/components/application-details/application-resource-filter.tsx +++ b/ui/src/app/applications/components/application-details/application-resource-filter.tsx @@ -114,7 +114,7 @@ export const Filters = (props: FiltersProps) => { case 'Health': return props.resourceNodes.filter(res => res.health?.status === HealthStatuses[label]).length; case 'Kind': - return props.resourceNodes.filter(res => res.kind === label).length; + return props.resourceNodes.reduce((count, res) => (res.group && label === 'Pod' ? res.group.length : res.kind === label ? count + 1 : count), 0); default: return 0; } diff --git a/ui/src/app/applications/components/application-resource-tree/application-resource-tree.tsx b/ui/src/app/applications/components/application-resource-tree/application-resource-tree.tsx index c32e100927d82..9dfd5d19a27b2 100644 --- a/ui/src/app/applications/components/application-resource-tree/application-resource-tree.tsx +++ b/ui/src/app/applications/components/application-resource-tree/application-resource-tree.tsx @@ -926,7 +926,16 @@ export const ApplicationResourceTree = (props: ApplicationResourceTreeProps) => graphNodesFilter.nodes().forEach(nodeId => { const node: ResourceTreeNode = graphNodesFilter.node(nodeId) as any; const parentIds = graphNodesFilter.predecessors(nodeId); - if (node.root != null && !predicate(node) && appKey !== nodeId) { + + const shouldKeepNode = () => { + //case for podgroup in group node view + if (node.podGroup) { + return predicate(node) || node.podGroup.pods.some(pod => predicate({...node, kind: 'Pod', name: pod.name})); + } + return predicate(node); + }; + + if (node.root != null && !shouldKeepNode() && appKey !== nodeId) { const childIds = graphNodesFilter.successors(nodeId); graphNodesFilter.removeNode(nodeId); filtered++; @@ -939,8 +948,14 @@ export const ApplicationResourceTree = (props: ApplicationResourceTreeProps) => if (node.root != null) filteredNodes.push(node); } }); + if (filtered) { - graphNodesFilter.setNode(FILTERED_INDICATOR_NODE, {height: NODE_HEIGHT, width: NODE_WIDTH, count: filtered, type: NODE_TYPES.filteredIndicator}); + graphNodesFilter.setNode(FILTERED_INDICATOR_NODE, { + height: NODE_HEIGHT, + width: NODE_WIDTH, + count: filtered, + type: NODE_TYPES.filteredIndicator + }); graphNodesFilter.setEdge(filteredIndicatorParent, FILTERED_INDICATOR_NODE); } }