@@ -2,6 +2,7 @@ import { useGetAllConfigsChangesQuery } from "@flanksource-ui/api/query-hooks/us
22import { ConfigChangeTable } from "@flanksource-ui/components/Configs/Changes/ConfigChangeTable" ;
33import { ConfigChangeFilters } from "@flanksource-ui/components/Configs/Changes/ConfigChangesFilters/ConfigChangesFilters" ;
44import ConfigPageTabs from "@flanksource-ui/components/Configs/ConfigPageTabs" ;
5+ import ConfigsTypeIcon from "@flanksource-ui/components/Configs/ConfigsTypeIcon" ;
56import { InfoMessage } from "@flanksource-ui/components/InfoMessage" ;
67import {
78 BreadcrumbChild ,
@@ -20,6 +21,14 @@ export function ConfigChangesPage() {
2021 ) ;
2122 const [ params ] = useSearchParams ( { } ) ;
2223
24+ const configTypes = params . get ( "configTypes" ) ?? undefined ;
25+ const configType =
26+ // we want to show breadcrumb only if there is only one config type selected
27+ // in the filter dropdown and not multiple
28+ configTypes ?. split ( "," ) . length === 1
29+ ? configTypes . split ( "," ) [ 0 ] ?. split ( ":" ) ?. [ 0 ] . split ( "__" ) . join ( "::" )
30+ : undefined ;
31+
2332 const pageSize = params . get ( "pageSize" ) ?? "200" ;
2433
2534 const { data, isLoading, error, isRefetching, refetch } =
@@ -59,7 +68,21 @@ export function ConfigChangesPage() {
5968 key = "config-catalog-changes"
6069 >
6170 Changes
62- </ BreadcrumbChild >
71+ </ BreadcrumbChild > ,
72+ ...( configType
73+ ? [
74+ < BreadcrumbChild
75+ link = { `/catalog?configType=${ configType } ` }
76+ key = { configType }
77+ >
78+ < ConfigsTypeIcon
79+ config = { { type : configType } }
80+ showSecondaryIcon
81+ showLabel
82+ />
83+ </ BreadcrumbChild >
84+ ]
85+ : [ ] )
6386 ] }
6487 />
6588 }
@@ -70,7 +93,7 @@ export function ConfigChangesPage() {
7093 loading = { isLoading || isRefetching }
7194 contentClass = "p-0 h-full flex flex-col flex-1"
7295 >
73- < ConfigPageTabs activeTab = "Changes" >
96+ < ConfigPageTabs activeTab = "Changes" configType = { configType } >
7497 { error ? (
7598 < InfoMessage message = { errorMessage } />
7699 ) : (
0 commit comments