File tree Expand file tree Collapse file tree 4 files changed +23
-13
lines changed
Expand file tree Collapse file tree 4 files changed +23
-13
lines changed Original file line number Diff line number Diff line change 55 H2 ,
66 Hr ,
77 Logo ,
8- ModalService ,
98 Outline ,
109 Select ,
1110} from "@maykin-ui/admin-ui" ;
@@ -172,15 +171,13 @@ function App() {
172171 sidebarItems = { sidebarItems }
173172 grid = { ! hideUi }
174173 >
175- < ModalService >
176- < ConfigContext . Provider
177- value = { { templatesContentOnly : true , templatesGrid : false } }
178- >
179- < OBContext . Provider value = { { catalogiChoices } } >
180- < Outlet />
181- </ OBContext . Provider >
182- </ ConfigContext . Provider >
183- </ ModalService >
174+ < ConfigContext . Provider
175+ value = { { templatesContentOnly : true , templatesGrid : false } }
176+ >
177+ < OBContext . Provider value = { { catalogiChoices } } >
178+ < Outlet />
179+ </ OBContext . Provider >
180+ </ ConfigContext . Provider >
184181 </ BaseTemplate >
185182 ) ;
186183}
Original file line number Diff line number Diff line change 11export * from "./useBreadcrumbItems" ;
2- export * from "./useCatalogi" ;
2+ export * from "./useCatalogi.tsx " ;
33export * from "./useChildRoutes" ;
44export * from "./useCombinedSearchParams" ;
55export * from "./useCurrentMatch" ;
Original file line number Diff line number Diff line change 1+ import { Errors , useAlert } from "@maykin-ui/admin-ui" ;
12import { cacheGet , cacheSet } from "@maykin-ui/client-common" ;
23import { useEffect , useState } from "react" ;
34import { useNavigate , useParams } from "react-router" ;
@@ -19,6 +20,7 @@ export function useCatalogi(
1920 const [ catalogiChoices , setCatalogiChoices ] = useState <
2021 components [ "schemas" ] [ "OBOption_str_" ] [ ]
2122 > ( [ ] ) ;
23+ const alert = useAlert ( ) ;
2224
2325 const handleCatalogusChange = ( newCatalogusId : string ) => {
2426 if ( newCatalogusId ) {
@@ -57,7 +59,15 @@ export function useCatalogi(
5759 }
5860 }
5961 } catch ( error ) {
60- console . error ( "Failed to fetch catalogi choices:" , error ) ;
62+ const messages : string [ ] = [ "Failed to fetch catalogi choices." ] ;
63+ if ( error instanceof Response ) {
64+ messages . push ( `Status: ${ error . status } , ${ error . statusText } ` ) ;
65+ }
66+ alert (
67+ "Foutmelding" ,
68+ ( < Errors errors = { messages } /> ) as unknown as string , // TODO: Fix in admin-ui
69+ "Ok" ,
70+ ) ;
6171 }
6272 } ;
6373
Original file line number Diff line number Diff line change 1+ import { ModalService } from "@maykin-ui/admin-ui" ;
12import { StrictMode } from "react" ;
23import { createRoot } from "react-dom/client" ;
34import { RouterProvider , createBrowserRouter } from "react-router" ;
@@ -11,6 +12,8 @@ const root = document.getElementById("root") as HTMLElement;
1112
1213createRoot ( root ) . render (
1314 < StrictMode >
14- < RouterProvider router = { router } />
15+ < ModalService >
16+ < RouterProvider router = { router } />
17+ </ ModalService >
1518 </ StrictMode > ,
1619) ;
You can’t perform that action at this time.
0 commit comments