File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import {Connections} from '@/pages/automation/connections/Connections';
1313import ProjectDeployments from '@/pages/automation/project-deployments/ProjectDeployments' ;
1414import { AccessControl } from '@/shared/auth/AccessControl' ;
1515import PrivateRoute from '@/shared/auth/PrivateRoute' ;
16- import { AUTHORITIES } from '@/shared/constants' ;
16+ import { AUTHORITIES , DEVELOPMENT_ENVIRONMENT } from '@/shared/constants' ;
1717import EEVersion from '@/shared/edition/EEVersion' ;
1818import ErrorPage from '@/shared/error/ErrorPage' ;
1919import LazyLoadWrapper from '@/shared/error/LazyLoadWrapper' ;
@@ -429,6 +429,15 @@ export const getRouter = (queryClient: QueryClient) =>
429429 </ LazyLoadWrapper >
430430 </ PrivateRoute >
431431 ) ,
432+ loader : async ( ) => {
433+ const currentEnvironmentId = environmentStore . getState ( ) . currentEnvironmentId ;
434+
435+ if ( currentEnvironmentId != DEVELOPMENT_ENVIRONMENT ) {
436+ return redirect ( '/automation/deployments' ) ;
437+ }
438+
439+ return null ;
440+ } ,
432441 path : 'projects' ,
433442 } ,
434443 {
You can’t perform that action at this time.
0 commit comments