From 4c248f706de671345760757d995a66441c7d1cb5 Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Wed, 16 Oct 2024 20:24:26 +0300 Subject: [PATCH] fix: fix missing breadcrumbs for catalog changes tab Fixes #2350 --- .../ConfigChangesFilters.tsx | 4 +-- src/components/Configs/ConfigPageTabs.tsx | 10 +++---- src/pages/config/ConfigChangesPage.tsx | 27 +++++++++++++++++-- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/components/Configs/Changes/ConfigChangesFilters/ConfigChangesFilters.tsx b/src/components/Configs/Changes/ConfigChangesFilters/ConfigChangesFilters.tsx index baf3def80..d5b8f39af 100644 --- a/src/components/Configs/Changes/ConfigChangesFilters/ConfigChangesFilters.tsx +++ b/src/components/Configs/Changes/ConfigChangesFilters/ConfigChangesFilters.tsx @@ -77,7 +77,7 @@ export function ConfigChangeFilters({ const arbitraryFilters = useConfigChangesArbitraryFilters(); - const configType = params.get("configTypes") ?? undefined; + const configType = params.get("configType") ?? undefined; const defaultConfigType = useMemo(() => { return configType ? `${configType?.replaceAll("::", "__")}:1` : undefined; @@ -86,7 +86,7 @@ export function ConfigChangeFilters({ return (
{ const query = type ? `?configType=${type}` : ""; return [ diff --git a/src/pages/config/ConfigChangesPage.tsx b/src/pages/config/ConfigChangesPage.tsx index 9e731efb4..0d5fbf31d 100644 --- a/src/pages/config/ConfigChangesPage.tsx +++ b/src/pages/config/ConfigChangesPage.tsx @@ -2,6 +2,7 @@ import { useGetAllConfigsChangesQuery } from "@flanksource-ui/api/query-hooks/us import { ConfigChangeTable } from "@flanksource-ui/components/Configs/Changes/ConfigChangeTable"; import { ConfigChangeFilters } from "@flanksource-ui/components/Configs/Changes/ConfigChangesFilters/ConfigChangesFilters"; import ConfigPageTabs from "@flanksource-ui/components/Configs/ConfigPageTabs"; +import ConfigsTypeIcon from "@flanksource-ui/components/Configs/ConfigsTypeIcon"; import { InfoMessage } from "@flanksource-ui/components/InfoMessage"; import { BreadcrumbChild, @@ -20,6 +21,14 @@ export function ConfigChangesPage() { ); const [params] = useSearchParams({}); + const configTypes = params.get("configTypes") ?? undefined; + const configType = + // we want to show breadcrumb only if there is only one config type selected + // in the filter dropdown and not multiple + configTypes?.split(",").length === 1 + ? configTypes.split(",")[0]?.split(":")?.[0].split("__").join("::") + : undefined; + const pageSize = params.get("pageSize") ?? "200"; const { data, isLoading, error, isRefetching, refetch } = @@ -59,7 +68,21 @@ export function ConfigChangesPage() { key="config-catalog-changes" > Changes - + , + ...(configType + ? [ + + + + ] + : []) ]} /> } @@ -70,7 +93,7 @@ export function ConfigChangesPage() { loading={isLoading || isRefetching} contentClass="p-0 h-full flex flex-col flex-1" > - + {error ? ( ) : (