Skip to content

Commit 11b0d02

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

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/allocationReport.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,18 @@ 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+
// According to issue #2942, drilldown should work from namespace level
176+
const drilldownHierarchy = {
177+
namespace: "controllerKind",
178+
controllerKind: "controller",
179+
controller: "pod",
180+
pod: "container",
181+
};
182+
const hasNextLevel = drilldownHierarchy[aggregateBy] !== undefined;
175183
const isContainer = aggregateBy === "container";
176-
const canDrilldown = !isIdle && !isUnallocated && !isUnmounted && !isContainer && drilldown;
184+
// Only allow drilldown if there's a next level and we're not at container level
185+
const canDrilldown = !isIdle && !isUnallocated && !isUnmounted && !isContainer && hasNextLevel && drilldown;
177186

178187
const rowProps = canDrilldown
179188
? {

0 commit comments

Comments
 (0)