Skip to content

Commit

Permalink
feat: add the possibility to disable visualize
Browse files Browse the repository at this point in the history
  • Loading branch information
ddecrulle committed Apr 18, 2024
1 parent eb8c407 commit 0c90abc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
VITE_OIDC_ISSUER=
# When VITE_OIDC_ENABLED equals "false" we switch on mocked implem
# When VITE_OIDC_ENABLED equals false we switch on mocked implem, so by default OIDC is ENABLED
VITE_OIDC_ENABLED=
VITE_OIDC_CLIENT_ID=
VITE_PORTAIL_URL=
VITE_API_URL=
# When VITE_VISUALIZE_DISABLED equals true we disable visualize route.
VITE_VISUALIZE_DISABLED=
6 changes: 5 additions & 1 deletion src/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ export const rootRoute = createRootRouteWithContext<{
),
})

console.log(import.meta.env.VITE_VISUALIZE_DISABLED)

export const routeTree = rootRoute.addChildren([
visualizeRoute,
...(import.meta.env.VITE_VISUALIZE_DISABLED === 'true'
? []
: [visualizeRoute]),
accessibilityRoute,
securityRoute,
siteMapRoute,
Expand Down
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type ImportMetaEnv = {
VITE_OIDC_CLIENT_ID: string
VITE_PORTAIL_URL: string
VITE_API_URL: string
VITE_VISUALIZE_DISABLED: string
BASE_URL: string
MODE: string
DEV: boolean
Expand Down

0 comments on commit 0c90abc

Please sign in to comment.