mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 19:28:17 +00:00
fix
This commit is contained in:
@@ -24,7 +24,7 @@ export const AppLayout = () => {
|
||||
|
||||
return (
|
||||
<div className="w-full flex flex-col min-h-screen bg-background text-foreground">
|
||||
<Top onToggleSidebar={toggleSidebar} showRecordManagementShortcut={!isSuperAdmin} />
|
||||
{/* <Top onToggleSidebar={toggleSidebar} showRecordManagementShortcut={!isSuperAdmin} /> */}
|
||||
<AppMenuTabs />
|
||||
<div className="px-2 pb-2 pt-8 sm:px-4 sm:pb-4 sm:pt-10 flex-1">
|
||||
<div className="w-full overflow-x-auto">
|
||||
|
||||
@@ -44,6 +44,30 @@ import SectorReportsPage from "@/record-management/pages/User/sectorReports";
|
||||
import ArchivedUnitsPositionsPage from "@/pages/ArchivedUnitsPositionsPage";
|
||||
import ConfigurationPage from "@/pages/ConfigurationPage";
|
||||
import { SidebarProvider } from "@/shared/common/ui/sidebar";
|
||||
import { AuthProvider as UmAuthProvider } from "@/shared/context/AuthContext";
|
||||
import { PermissionProvider } from "@/shared/context/PermissionContext";
|
||||
|
||||
/**
|
||||
* Provider shell for the vendored IAM UI. Feeds its Auth + Permission contexts
|
||||
* from the real freight session so AppMenuTabs / pages see the signed-in user
|
||||
* and their permission keys (otherwise both are null/empty). Wraps AppLayout in
|
||||
* SidebarProvider (its useSidebar dependency).
|
||||
*/
|
||||
function UmShell(): ReactElement {
|
||||
const { user } = useAuth();
|
||||
return (
|
||||
<UmAuthProvider>
|
||||
<PermissionProvider
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
permissions={(user?.permissions as any) ?? []}
|
||||
>
|
||||
<SidebarProvider>
|
||||
<AppLayout />
|
||||
</SidebarProvider>
|
||||
</PermissionProvider>
|
||||
</UmAuthProvider>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Layout wrapper for the user-management route subtree. Self-contained (the
|
||||
@@ -96,11 +120,7 @@ export const UserManagementRedirect = () => {
|
||||
export function UserManagementRoutes(): ReactElement {
|
||||
return (
|
||||
<Route
|
||||
element={
|
||||
<SidebarProvider>
|
||||
<AppLayout />
|
||||
</SidebarProvider>
|
||||
}
|
||||
element={<UmShell />}
|
||||
>
|
||||
<Route
|
||||
path="user-management"
|
||||
|
||||
Reference in New Issue
Block a user