mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 11:55:42 +00:00
feat: better navigation in backoffice
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
} from "lucide-react";
|
||||
|
||||
import { useAuth } from "@/auth/useAuth";
|
||||
import { resolveLandingPath } from "@/lib/landing";
|
||||
import { canAccessRuleEngineResource } from "@/lib/permissions";
|
||||
import RuleEngineFormDialog from "@/components/ruleEngine/RuleEngineFormDialog";
|
||||
import {
|
||||
@@ -239,8 +240,8 @@ const CargoTypesPage = () => {
|
||||
[levelNodes, term],
|
||||
);
|
||||
|
||||
if (!config) return <Navigate to="/dashboard/overview" replace />;
|
||||
if (!canView) return <Navigate to="/dashboard/overview" replace />;
|
||||
if (!config) return <Navigate to={resolveLandingPath(user)} replace />;
|
||||
if (!canView) return <Navigate to={resolveLandingPath(user)} replace />;
|
||||
// A bad/stale :id (after data loads) → fall back to the root list.
|
||||
if (!isLoading && currentId && !current) return <Navigate to={BASE_PATH} replace />;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useAuth } from "@/auth/useAuth";
|
||||
import { resolveLandingPath } from "@/lib/landing";
|
||||
import {
|
||||
canAccessRuleEngineResource,
|
||||
canApproveRuleEngineChange,
|
||||
@@ -584,7 +585,7 @@ const RuleEngineResourcePage = () => {
|
||||
}
|
||||
|
||||
if (!canView) {
|
||||
return <Navigate to="/dashboard/overview" replace />;
|
||||
return <Navigate to={resolveLandingPath(user)} replace />;
|
||||
}
|
||||
|
||||
const openCreate = () => {
|
||||
|
||||
Reference in New Issue
Block a user