Skip to content

Commit e982cd8

Browse files
committed
Fix drilldown: disable click when no next level exists
Signed-off-by: Rahim <rahim-2004@mail.ru>
1 parent 67a3c9d commit e982cd8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components/allocationReport.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,16 @@ const AllocationReport = ({
171171
efficiency = "Inf";
172172
}
173173

174-
// Do not allow drill-down for idle, unallocated, unmounted, or container (last level)
174+
// Do not allow drill-down for idle, unallocated, unmounted, or if no next level exists
175+
const drilldownHierarchy = {
176+
namespace: "controllerKind",
177+
controllerKind: "controller",
178+
controller: "pod",
179+
pod: "container",
180+
};
181+
const hasNextLevel = drilldownHierarchy[aggregateBy] !== undefined;
175182
const isContainer = aggregateBy === "container";
176-
const canDrilldown = !isIdle && !isUnallocated && !isUnmounted && !isContainer && drilldown;
183+
const canDrilldown = !isIdle && !isUnallocated && !isUnmounted && !isContainer && hasNextLevel && drilldown;
177184

178185
const rowProps = canDrilldown
179186
? {

0 commit comments

Comments
 (0)