diff --git a/src/app/stacks/page.tsx b/src/app/stacks/page.tsx
index 04d78b86..e4cd08c9 100644
--- a/src/app/stacks/page.tsx
+++ b/src/app/stacks/page.tsx
@@ -1,12 +1,8 @@
import { useTourContext } from "@/components/tour/TourContext";
import { useEffect } from "react";
import { StackList } from "./StackList";
-import { useBreadcrumbsContext } from "@/layouts/AuthenticatedLayout/BreadcrumbsContext";
-import { PageHeader } from "@/components/PageHeader";
export default function StacksPage() {
- const { setCurrentBreadcrumbData } = useBreadcrumbsContext();
-
const {
setTourState,
tourState: { tourActive }
@@ -18,22 +14,5 @@ export default function StacksPage() {
}
}, [tourActive]);
- useEffect(() => {
- setCurrentBreadcrumbData({ segment: "stacks", data: null });
- }, []);
-
- return (
-
-
-
-
- );
-}
-
-function StacksHeader() {
- return (
-
- Stacks
-
- );
+ return
;
}
diff --git a/src/components/breadcrumbs/Breadcrumbs.tsx b/src/components/breadcrumbs/Breadcrumbs.tsx
index a3e83a96..c0437651 100644
--- a/src/components/breadcrumbs/Breadcrumbs.tsx
+++ b/src/components/breadcrumbs/Breadcrumbs.tsx
@@ -27,7 +27,7 @@ export function Breadcrumbs() {
useEffect(() => {
let matchedData: BreadcrumbData = {};
const pathSegments = pathname.split("/").filter((segment: string) => segment !== "");
- const segmentsToCheck: string[] = ["pipelines", "runs", "stacks", "secrets"];
+ const segmentsToCheck: string[] = ["pipelines", "runs", "stacks", "secrets", "components"];
const mainPaths = segmentsToCheck.some((segment) => pathSegments.includes(segment));
if (!mainPaths) {
const currentSegment =
diff --git a/src/components/breadcrumbs/SegmentsBreadcrumbs.tsx b/src/components/breadcrumbs/SegmentsBreadcrumbs.tsx
index af52ef75..2cc160f1 100644
--- a/src/components/breadcrumbs/SegmentsBreadcrumbs.tsx
+++ b/src/components/breadcrumbs/SegmentsBreadcrumbs.tsx
@@ -25,6 +25,9 @@ export const matchSegmentWithRequest = ({ segment, data }: { segment: string; da
stacks: { name: "Stacks" },
create: { name: "New Stack" }
},
+ components: {
+ components: { name: "Components" }
+ },
secrets: {
secrets: { name: "Secrets" }
},
@@ -92,7 +95,9 @@ export const matchSegmentWithURL = (segment: string, id: string) => {
stacks: routes.stacks.overview,
createStack: routes.stacks.create.index,
//Secrets
- secrets: routes.settings.secrets.overview
+ secrets: routes.settings.secrets.overview,
+ //components
+ components: routes.components.overview
};
return routeMap[segment] || "#";
diff --git a/src/data/components/index.ts b/src/data/components/index.ts
index c72215f3..e8e2bb77 100644
--- a/src/data/components/index.ts
+++ b/src/data/components/index.ts
@@ -1,4 +1,4 @@
-import { infiniteQueryOptions } from "@tanstack/react-query";
+import { infiniteQueryOptions, queryOptions } from "@tanstack/react-query";
import { fetchComponents } from "./components-list";
import { StackComponentListParams } from "@/types/components";
@@ -11,13 +11,10 @@ export const componentQueries = {
getNextPageParam: (lastPage) =>
lastPage.index < lastPage.total_pages ? lastPage.index + 1 : null,
initialPageParam: 1
+ }),
+ componentList: (queryParams: StackComponentListParams) =>
+ queryOptions({
+ queryKey: [...componentQueries.all, queryParams],
+ queryFn: async () => fetchComponents(queryParams)
})
-
- // This is not used for now, in case we need the infinite query, and the regular one, the queryKeys should not be the same
-
- // componentList: (backendUrl: string, queryParams: StackComponentListParams) =>
- // queryOptions({
- // queryKey: [backendUrl, ...componentQueries.all, queryParams],
- // queryFn: async () => fetchComponents(backendUrl, queryParams)
- // })
};
diff --git a/src/layouts/AuthenticatedLayout/Sidebar.tsx b/src/layouts/AuthenticatedLayout/Sidebar.tsx
index 92e0ba53..33068d2e 100644
--- a/src/layouts/AuthenticatedLayout/Sidebar.tsx
+++ b/src/layouts/AuthenticatedLayout/Sidebar.tsx
@@ -98,6 +98,7 @@ export function Sidebar() {