Skip to content

Commit

Permalink
Merge pull request #35 from eea/develop
Browse files Browse the repository at this point in the history
Better env
  • Loading branch information
GhitaB authored Jun 14, 2023
2 parents 3f45f30 + 28ac819 commit d6c6951
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [0.1.27](https://github.com/eea/volto-cca-policy/compare/0.1.26...0.1.27) - 14 June 2023

#### :hammer_and_wrench: Others

- Better env [Tiberiu Ichim - [`bca1e73`](https://github.com/eea/volto-cca-policy/commit/bca1e73a033f0ba950505087ad36baf0250f98e8)]
### [0.1.26](https://github.com/eea/volto-cca-policy/compare/0.1.25...0.1.26) - 13 June 2023

#### :hammer_and_wrench: Others
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": "@eeacms/volto-cca-policy",
"version": "0.1.26",
"version": "0.1.27",
"description": "@eeacms/volto-cca-policy: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
14 changes: 7 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import installSearchEngine from './search';
import GeocharsWidget from './components/theme/Widgets/GeocharsWidget';
import GeolocationWidget from './components/theme/Widgets/GeolocationWidget';

const getEnv = () => (typeof window !== 'undefined' ? window.env : process.env);

const applyConfig = (config) => {
const notInEnMission = /^(?!(\/en\/mission)).*$/;
if (
!(
__DEVELOPMENT__ ||
(process.env.RAZZLE_DISABLE_EXTERNAL_ROUTES &&
process.env.RAZZLE_DISABLE_EXTERNAL_ROUTES === 'True')
)
) {
const env = getEnv();
const isStaging = !!env.RAZZLE_IS_STAGING;
const enableMissionIsExternal = !isStaging && !__DEVELOPMENT__;

if (enableMissionIsExternal) {
config.settings.externalRoutes = [
...(config.settings.externalRoutes || []),
{
Expand Down

0 comments on commit d6c6951

Please sign in to comment.