diff --git a/frontend/src/app/[organisation]/prognose/layout.tsx b/frontend/src/app/[organisation]/prognose/layout.tsx new file mode 100644 index 00000000..ecebf567 --- /dev/null +++ b/frontend/src/app/[organisation]/prognose/layout.tsx @@ -0,0 +1,7 @@ +export default function BemanningLayout({ + children, +}: { + children: React.ReactNode; +}) { + return children; +} diff --git a/frontend/src/app/[organisation]/prognose/page.tsx b/frontend/src/app/[organisation]/prognose/page.tsx new file mode 100644 index 00000000..295d223d --- /dev/null +++ b/frontend/src/app/[organisation]/prognose/page.tsx @@ -0,0 +1,64 @@ +import { + CompetenceReadModel, + DepartmentReadModel, + EngagementPerCustomerReadModel, +} from "@/api-types"; +import { ConsultantFilterProvider } from "@/hooks/ConsultantFilterProvider"; +import { parseYearWeekFromUrlString } from "@/data/urlUtils"; +import React from "react"; +import { StaffingContent } from "@/pagecontent/StaffingContent"; +import { + fetchEmployeesWithImageAndToken, + fetchWithToken, +} from "@/data/apiCallsWithToken"; +import { Metadata } from "next"; +import { ForecastContent } from "@/pagecontent/ForecastContent"; +export const metadata: Metadata = { + title: "Prognose | VIBES", +}; + +export default async function Prognose({ + params, + searchParams, +}: { + params: { organisation: string }; + searchParams: { selectedWeek?: string; weekSpan?: string }; +}) { + const selectedWeek = parseYearWeekFromUrlString( + searchParams.selectedWeek || undefined, + ); + const weekSpan = searchParams.weekSpan || undefined; + + const consultants = + (await fetchEmployeesWithImageAndToken( + `${params.organisation}/staffings${ + selectedWeek + ? `?Year=${selectedWeek.year}&Week=${selectedWeek.weekNumber}` + : "" + }${weekSpan ? `${selectedWeek ? "&" : "?"}WeekSpan=${weekSpan}` : ""}`, + )) ?? []; + + const departments = + (await fetchWithToken( + `organisations/${params.organisation}/departments`, + )) ?? []; + + const competences = + (await fetchWithToken(`competences`)) ?? []; + + const customers = + (await fetchWithToken( + `${params.organisation}/projects`, + )) ?? []; + + return ( + + + + ); +} diff --git a/frontend/src/components/FilteredConsultantsList.tsx b/frontend/src/components/FilteredConsultantsList.tsx index 9963a37b..1ea0a01d 100644 --- a/frontend/src/components/FilteredConsultantsList.tsx +++ b/frontend/src/components/FilteredConsultantsList.tsx @@ -18,7 +18,6 @@ export default function StaffingTable() { } = useConsultantsFilter(); const { weekSpan } = useContext(FilteredContext).activeFilters; - console.log(filteredConsultants); return ( (false); + + return ( + <> + setIsSidebarOpen(false)} + /> + +
+

Prognose

+ +
+
+ } + onClick={() => setIsSidebarOpen((wasOpen) => !wasOpen)} + /> + +
+ + +
+ +
+ + ); +}