Skip to content

Commit

Permalink
Merge pull request #475 from InseeFr/hotfix/disable-vizu
Browse files Browse the repository at this point in the history
V2 - Hotfix disable vizu
  • Loading branch information
laurentC35 authored Nov 9, 2023
2 parents a6d8b2c + 3865801 commit 8803fed
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
13 changes: 7 additions & 6 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ REACT_APP_SAVING_TIME=
REACT_APP_SAVING_STRATEGY=
# default: recensement
REACT_APP_DEFAULT_SURVEY=
REACT_APP_VIZUALIZE_ENABLED=
# REACT_APP_AUTH_TYPE: oidc / none, default: none
REACT_APP_AUTH_TYPE=oidc
REACT_APP_AUTH_URL=https://auth.insee.net/auth
REACT_APP_CLIENT_ID=localhost-frontend
REACT_APP_AUTH_REALM=questionnaire-particuliers
REACT_APP_PORTAIL_URL=https://enquetes.beta.stat-publique.fr
REACT_APP_IDENTITY_PROVIDER=insee-ssp
REACT_APP_AUTH_TYPE=none
REACT_APP_AUTH_URL=
REACT_APP_CLIENT_ID=
REACT_APP_AUTH_REALM=
REACT_APP_PORTAIL_URL=
REACT_APP_IDENTITY_PROVIDER=
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ echo "window._env_['REACT_APP_LUNATIC_LABEL_WORKER_PATH'] = '$REACT_APP_LUNATIC_
echo "window._env_['REACT_APP_SAVING_TIME'] = '$REACT_APP_SAVING_TIME';" >> /usr/share/nginx/html/env-config.js
echo "window._env_['REACT_APP_SAVING_STRATEGY'] = '$REACT_APP_SAVING_STRATEGY';" >> /usr/share/nginx/html/env-config.js
echo "window._env_['REACT_APP_DEFAULT_SURVEY'] = '$REACT_APP_DEFAULT_SURVEY';" >> /usr/share/nginx/html/env-config.js
echo "window._env_['REACT_APP_VIZUALIZE_ENABLED'] = '$REACT_APP_VIZUALIZE_ENABLED';" >> /usr/share/nginx/html/env-config.js
echo "window._env_['REACT_APP_AUTH_TYPE'] = '$REACT_APP_AUTH_TYPE';" >> /usr/share/nginx/html/env-config.js
echo "window._env_['REACT_APP_AUTH_URL'] = '$REACT_APP_AUTH_URL';" >> /usr/share/nginx/html/env-config.js
echo "window._env_['REACT_APP_CLIENT_ID'] = '$REACT_APP_CLIENT_ID';" >> /usr/share/nginx/html/env-config.js
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stromae",
"version": "2.4.13",
"version": "2.4.14",
"description": "Web application for the management of questionnaires powered by Lunatic",
"repository": {
"type": "git",
Expand Down
5 changes: 4 additions & 1 deletion src/components/router/router.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { Redirect, Route, Switch } from 'react-router-dom';
import { environment } from 'utils/read-env-vars';
import { READ_ONLY } from '../../utils/constants';
import secure from '../auth/hoc/hoc';
import { OrchestratorManager } from '../orchestrator/manager';
import { Visualizer } from '../orchestrator/visualizer';
import { NotFound } from '../pages';

const { VIZUALIZE_ENABLED } = environment;

const Router = () => {
return (
<Switch>
<Route
path={`/:${READ_ONLY}?/questionnaire/:idQ/unite-enquetee/:idSU`}
component={secure(OrchestratorManager)}
/>
<Route path='/visualize' component={Visualizer} />
{VIZUALIZE_ENABLED && <Route path='/visualize' component={Visualizer} />}
<Route path='/404' component={NotFound} />
<Redirect to='/404' />
</Switch>
Expand Down
2 changes: 2 additions & 0 deletions src/utils/read-env-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const environment = {
PORTAIL_URL:
getEnvVar('REACT_APP_PORTAIL_URL') || `${window.location.origin}`,
IDENTITY_PROVIDER: getEnvVar('REACT_APP_IDENTITY_PROVIDER'),
// VISUALIZE is disabled by default, so if value is not present and not set to true in env-config.js, VISUALIZE page is disabled
VIZUALIZE_ENABLED: getEnvVar('REACT_APP_VIZUALIZE_ENABLED') || false,
};

export const oidcConf = {
Expand Down

0 comments on commit 8803fed

Please sign in to comment.