mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix: redirect to booking issue fixed
This commit is contained in:
@@ -117,6 +117,20 @@ import {
|
||||
findActiveSidebarLabel,
|
||||
} from "@/components/layout/sidebar-sections";
|
||||
|
||||
/**
|
||||
* The per-shipment clearance detail page is the shared destination of three
|
||||
* hubs (Operations → Clearance, Clearance Documents, Self-Clearance Review),
|
||||
* none of which are gated on `bookings:clearance_view`. Gating the detail on
|
||||
* that key alone bounced reviewers back to their landing page (Bookings) the
|
||||
* moment they opened a row, so accept any key that can reach a hub.
|
||||
*/
|
||||
const CLEARANCE_DETAIL_PERMS = [
|
||||
FREIGHT_PERMS.bookings.clearanceView,
|
||||
FREIGHT_PERMS.contracts.clearanceReview,
|
||||
FREIGHT_PERMS.contracts.clearanceEtActions,
|
||||
FREIGHT_PERMS.contracts.opsClearanceReview,
|
||||
];
|
||||
|
||||
const DashboardShell = () => {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
@@ -285,9 +299,7 @@ const App = () => {
|
||||
<Route
|
||||
path="clearance/:id"
|
||||
element={
|
||||
<RequirePermission
|
||||
permission={FREIGHT_PERMS.bookings.clearanceView}
|
||||
>
|
||||
<RequirePermission permission={CLEARANCE_DETAIL_PERMS}>
|
||||
<DocumentClearanceDetailPage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -321,9 +333,7 @@ const App = () => {
|
||||
<Route
|
||||
path="bookings/:bookingId/clearance"
|
||||
element={
|
||||
<RequirePermission
|
||||
permission={FREIGHT_PERMS.bookings.clearanceView}
|
||||
>
|
||||
<RequirePermission permission={CLEARANCE_DETAIL_PERMS}>
|
||||
<DocumentClearanceDetailPage />
|
||||
</RequirePermission>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user