-
Notifications
You must be signed in to change notification settings - Fork 39
Feature/drilldown namespace 2942 #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ameijer
merged 24 commits into
opencost:main
from
CrazyCapislav:feature/drilldown-namespace-2942
Dec 4, 2025
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
201f0f2
Implement drilldown functionality for namespace and resource costs
CrazyCapislav 67a3c9d
Update recharts to 3.4.1 and fix breaking changes
CrazyCapislav 11b0d02
Fix drilldown: disable click when no next level exists
CrazyCapislav 3166177
Fix filter parsing: use '+' instead of encodeURIComponent to avoid do…
CrazyCapislav d995809
Fix filter parsing: escape quotes in values and validate filter values
CrazyCapislav 483e292
Fix filter property: use controllerName instead of controller for bac…
CrazyCapislav de4b0d2
Remove dead code: commented out isAnimationActive prop
CrazyCapislav 7b43cc6
Add URL-based filter management for drilldown functionality
CrazyCapislav 7765020
Require explicit flag to enable mock data usage
CrazyCapislav d443ad6
Merge branch 'main' into feature/drilldown-namespace-2942
CrazyCapislav e8a6506
Restore ResponsiveContainer wrappers for charts
CrazyCapislav 7381f7d
Revert "Restore ResponsiveContainer wrappers for charts"
CrazyCapislav 88ebf55
Normalize controller filters during drilldown
CrazyCapislav f9fbfa5
Fix indentation for responsive, height, and width props in BarChart
CrazyCapislav 4fa48eb
Remove redundant isContainer check - hasNextLevel already implies !is…
CrazyCapislav 243241d
Merge branch 'main' into feature/drilldown-namespace-2942
CrazyCapislav 00ee55d
Simplify filters state management - use URL as single source of truth
CrazyCapislav 2f2330c
Move getMockData to separate file for better code organization
CrazyCapislav 82f133d
Regenerate package-lock.json to remove unused dependencies
CrazyCapislav 58421c7
Add breadcrumb navigation to show applied filters in drilldown
CrazyCapislav 078b6a0
Fix filter hierarchy mismatch between FilterBreadcrumb and Allocation…
CrazyCapislav ad963da
Fix React error #185: optimize useEffect dependencies and memoize fil…
CrazyCapislav 461dceb
Merge branch 'main' into feature/drilldown-namespace-2942
CrazyCapislav 8472e8d
Regenerate package-lock.json
CrazyCapislav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| import * as React from "react"; | ||
| import Breadcrumbs from "@mui/material/Breadcrumbs"; | ||
| import Link from "@mui/material/Link"; | ||
| import Typography from "@mui/material/Typography"; | ||
| import NavigateNextIcon from "@mui/icons-material/NavigateNext"; | ||
|
|
||
| const FilterBreadcrumb = ({ filters, onNavigate }) => { | ||
| if (!filters || filters.length === 0) { | ||
| return null; | ||
| } | ||
|
|
||
| const hierarchy = ["namespace", "controllerKind", "controllerName", "pod", "container"]; | ||
| const hierarchyLabels = { | ||
| namespace: "Namespace", | ||
| controllerKind: "Controller Kind", | ||
| controllerName: "Controller", | ||
| pod: "Pod", | ||
| container: "Container", | ||
| }; | ||
|
|
||
| const breadcrumbItems = [ | ||
| { | ||
| label: "All Results", | ||
| level: -1, | ||
| isClickable: true, | ||
| }, | ||
| ]; | ||
|
|
||
| // Build breadcrumb items from filters | ||
| filters.forEach((filter, index) => { | ||
| const property = filter.property; | ||
| const value = filter.value; | ||
| const level = hierarchy.indexOf(property); | ||
|
|
||
| if (level >= 0) { | ||
| breadcrumbItems.push({ | ||
| label: value, | ||
| level: index, | ||
| property: property, | ||
| isClickable: index < filters.length - 1, // Last item is not clickable | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| const handleClick = (event, item) => { | ||
| event.preventDefault(); | ||
| if (item.isClickable && onNavigate) { | ||
| onNavigate(item.level); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <Breadcrumbs | ||
| separator={<NavigateNextIcon fontSize="small" />} | ||
| aria-label="filter breadcrumb" | ||
| sx={{ marginTop: 1, marginBottom: 1 }} | ||
| > | ||
| {breadcrumbItems.map((item, index) => { | ||
| const key = `${item.level}-${item.label}-${index}`; | ||
| if (item.isClickable) { | ||
| return ( | ||
| <Link | ||
| key={key} | ||
| component="button" | ||
| variant="body2" | ||
| onClick={(e) => handleClick(e, item)} | ||
| sx={{ | ||
| cursor: "pointer", | ||
| textDecoration: "none", | ||
| "&:hover": { | ||
| textDecoration: "underline", | ||
| }, | ||
| }} | ||
| > | ||
| {item.label} | ||
| </Link> | ||
| ); | ||
| } else { | ||
| return ( | ||
| <Typography key={key} variant="body2" color="text.primary"> | ||
| {item.label} | ||
| </Typography> | ||
| ); | ||
| } | ||
| })} | ||
| </Breadcrumbs> | ||
| ); | ||
| }; | ||
|
|
||
| export default React.memo(FilterBreadcrumb); | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.