@eeacms/volto-cca-policy 0.1.26 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [0.1.27](https://github.com/eea/volto-cca-policy/compare/0.1.26...0.1.27) - 14 June 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Better env [Tiberiu Ichim - [`bca1e73`](https://github.com/eea/volto-cca-policy/commit/bca1e73a033f0ba950505087ad36baf0250f98e8)]
7
12
  ### [0.1.26](https://github.com/eea/volto-cca-policy/compare/0.1.25...0.1.26) - 13 June 2023
8
13
 
9
14
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "@eeacms/volto-cca-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
package/src/index.js CHANGED
@@ -23,15 +23,15 @@ import installSearchEngine from './search';
23
23
  import GeocharsWidget from './components/theme/Widgets/GeocharsWidget';
24
24
  import GeolocationWidget from './components/theme/Widgets/GeolocationWidget';
25
25
 
26
+ const getEnv = () => (typeof window !== 'undefined' ? window.env : process.env);
27
+
26
28
  const applyConfig = (config) => {
27
29
  const notInEnMission = /^(?!(\/en\/mission)).*$/;
28
- if (
29
- !(
30
- __DEVELOPMENT__ ||
31
- (process.env.RAZZLE_DISABLE_EXTERNAL_ROUTES &&
32
- process.env.RAZZLE_DISABLE_EXTERNAL_ROUTES === 'True')
33
- )
34
- ) {
30
+ const env = getEnv();
31
+ const isStaging = !!env.RAZZLE_IS_STAGING;
32
+ const enableMissionIsExternal = !isStaging && !__DEVELOPMENT__;
33
+
34
+ if (enableMissionIsExternal) {
35
35
  config.settings.externalRoutes = [
36
36
  ...(config.settings.externalRoutes || []),
37
37
  {