Skip to content

Commit

Permalink
base usecases
Browse files Browse the repository at this point in the history
  • Loading branch information
ddecrulle committed Nov 10, 2023
1 parent 3d792e7 commit 5429697
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 39 deletions.
33 changes: 0 additions & 33 deletions drama-queen/src/App.tsx

This file was deleted.

19 changes: 15 additions & 4 deletions drama-queen/src/bootstrap.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { createRoot } from "react-dom/client";
import { type RoutingStrategy, createRouter } from "ui/routing/createRouter";
import { injectLegacyEntryQueens } from "core/injectLegacyQueens";
import App from "App";

import CircularProgress from "@mui/material/CircularProgress"
import { createCoreProvider } from "core";
import { RouterProvider } from "react-router-dom";

const { CoreProvider } = createCoreProvider({
"apiUrl": import.meta.env.VITE_API_URL,
"publicUrl": import.meta.env.BASE_URL,
"oidcParams": {
"issuerUri": import.meta.env.VITE_OIDC_ISSUER,
"clientId": import.meta.env.VITE_OIDC_CLIENT_ID,
},
});

const mount = ({
mountPoint,
Expand All @@ -20,8 +30,9 @@ const mount = ({
const router = createRouter({ strategy: routingStrategy, initialPathname });
const root = createRoot(mountPoint);
root.render(
<App />
);
<CoreProvider fallback={<CircularProgress />} >
<RouterProvider router={router} />
</CoreProvider>);

return () => queueMicrotask(() => root.unmount());
};
Expand Down
2 changes: 1 addition & 1 deletion drama-queen/src/ui/auth.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactNode } from "react";
import { useCoreFunctions, useCoreState } from "core";
import { useCoreFunctions } from "core";


export function RequiresAuthentication(props:
Expand Down
7 changes: 6 additions & 1 deletion drama-queen/src/ui/routing/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { RouteObject } from "react-router-dom";
import { SynchronizePage } from "ui/pages/synchronize/SynchronizePage";
import { SurveyMapping } from "ui/pages/queenMapping/SuryveyMapping";
import { RequiresAuthentication } from "ui/auth";
import { LoadingData } from "ui/pages/LoadingData";

//ReadOnly path is a bad pattern must be change (affects pearl,moog,queen)
export const routes: RouteObject[] = [
Expand All @@ -25,7 +26,11 @@ export const routes: RouteObject[] = [
element: <VisualisationMapping />
},
{
path: "/synchronize",
path: "/synchronize-old",
element: <RequiresAuthentication><SynchronizePage /></RequiresAuthentication>
},
{
path: "/synchronize",
element: <RequiresAuthentication><LoadingData /></RequiresAuthentication>
}
]

0 comments on commit 5429697

Please sign in to comment.