@eeacms/volto-embed 2.0.9 → 3.0.1

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,10 +4,50 @@ 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
+ #### [3.0.1](https://github.com/eea/volto-embed/compare/3.0.0...3.0.1)
8
+
9
+ - fix query case [`a4dbd50`](https://github.com/eea/volto-embed/commit/a4dbd50ca703efe31dd8a9deb386f668581aa136)
10
+
11
+ #### [3.0.0](https://github.com/eea/volto-embed/compare/3.0.0-beta.0...3.0.0)
12
+
13
+ > 7 February 2022
14
+
15
+ - Make this compatible with volto-datablocks@3.x [`#19`](https://github.com/eea/volto-embed/pull/19)
16
+
17
+ #### [3.0.0-beta.0](https://github.com/eea/volto-embed/compare/2.0.11...3.0.0-beta.0)
18
+
19
+ > 7 February 2022
20
+
21
+ - Release 3.0.0-beta.0 [`c9af803`](https://github.com/eea/volto-embed/commit/c9af80319bc89b1a579d14538ac5509e71db813f)
22
+ - Updated cypress [`9112bee`](https://github.com/eea/volto-embed/commit/9112bee538e457e9f19a687c3442d222129eb95c)
23
+ - Update [`c5c1251`](https://github.com/eea/volto-embed/commit/c5c1251a69c76c341c8deb28e0f2ccc940b2411b)
24
+ - Make this compatible with volto-datablocks@3.x [`3457ee9`](https://github.com/eea/volto-embed/commit/3457ee9e3f5c78cf483525a274f03e6941d06f6f)
25
+
26
+ #### [2.0.11](https://github.com/eea/volto-embed/compare/2.0.10...2.0.11)
27
+
28
+ > 11 January 2022
29
+
30
+ - use latest volto-slate [`#17`](https://github.com/eea/volto-embed/pull/17)
31
+ - add cy tests [`#16`](https://github.com/eea/volto-embed/pull/16)
32
+ - improve arcgis map view [`#14`](https://github.com/eea/volto-embed/pull/14)
33
+ - Update package.json [`0ec673a`](https://github.com/eea/volto-embed/commit/0ec673a8178731b8c1e010101caee2a3c9fafaca)
34
+ - Update package.json [`b8b94ec`](https://github.com/eea/volto-embed/commit/b8b94ec64672229f464b9108b4ac01a848827c00)
35
+ - Refs #142010 - Optimize Volto-addons gitflow pipelines [`bf197dd`](https://github.com/eea/volto-embed/commit/bf197dd6516f9c18994add19b1141e061a96e2b6)
36
+ - no hardcoded text [`4001bb4`](https://github.com/eea/volto-embed/commit/4001bb414df05c1516f95e4dcec4a328406dc63f)
37
+ - fix [`a41ca9a`](https://github.com/eea/volto-embed/commit/a41ca9a2795a59f2633fb97938244e335dca8c43)
38
+ - Update package.json [`a95b014`](https://github.com/eea/volto-embed/commit/a95b014a26651e11224b2f6531add7a599812d2a)
39
+
40
+ #### [2.0.10](https://github.com/eea/volto-embed/compare/2.0.9...2.0.10)
41
+
42
+ > 23 November 2021
43
+
44
+ - Develop [`#15`](https://github.com/eea/volto-embed/pull/15)
45
+
7
46
  #### [2.0.9](https://github.com/eea/volto-embed/compare/2.0.8...2.0.9)
8
47
 
9
- - Update package.json [`6e7344d`](https://github.com/eea/volto-embed/commit/6e7344d2bb9ce89de68cd4d1044a665814ad3b54)
10
- - Update package.json [`e618b5d`](https://github.com/eea/volto-embed/commit/e618b5db3f564f67563c0b7cd9aa5a3200ae1734)
48
+ > 11 November 2021
49
+
50
+ - Update package.json [`#13`](https://github.com/eea/volto-embed/pull/13)
11
51
 
12
52
  #### [2.0.8](https://github.com/eea/volto-embed/compare/2.0.7...2.0.8)
13
53
 
package/Jenkinsfile CHANGED
@@ -4,13 +4,37 @@ pipeline {
4
4
  environment {
5
5
  GIT_NAME = "volto-embed"
6
6
  NAMESPACE = "@eeacms"
7
- SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu"
7
+ SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,water.europa.eu-freshwater"
8
8
  DEPENDENCIES = "volto-slate"
9
9
  }
10
10
 
11
11
  stages {
12
12
 
13
+ stage('Release') {
14
+ when {
15
+ allOf {
16
+ environment name: 'CHANGE_ID', value: ''
17
+ branch 'master'
18
+ }
19
+ }
20
+ steps {
21
+ node(label: 'docker') {
22
+ withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
23
+ sh '''docker pull eeacms/gitflow'''
24
+ sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
25
+ }
26
+ }
27
+ }
28
+ }
29
+
13
30
  stage('Code') {
31
+ when {
32
+ allOf {
33
+ environment name: 'CHANGE_ID', value: ''
34
+ not { changelog '.*^Automated release [0-9\\.]+$' }
35
+ not { branch 'master' }
36
+ }
37
+ }
14
38
  steps {
15
39
  parallel(
16
40
 
@@ -36,6 +60,15 @@ pipeline {
36
60
  }
37
61
 
38
62
  stage('Tests') {
63
+ when {
64
+ allOf {
65
+ environment name: 'CHANGE_ID', value: ''
66
+ anyOf {
67
+ not { changelog '.*^Automated release [0-9\\.]+$' }
68
+ branch 'master'
69
+ }
70
+ }
71
+ }
39
72
  steps {
40
73
  parallel(
41
74
 
@@ -75,6 +108,15 @@ pipeline {
75
108
  }
76
109
 
77
110
  stage('Integration tests') {
111
+ when {
112
+ allOf {
113
+ environment name: 'CHANGE_ID', value: ''
114
+ anyOf {
115
+ not { changelog '.*^Automated release [0-9\\.]+$' }
116
+ branch 'master'
117
+ }
118
+ }
119
+ }
78
120
  steps {
79
121
  parallel(
80
122
 
@@ -82,7 +124,7 @@ pipeline {
82
124
  node(label: 'docker') {
83
125
  script {
84
126
  try {
85
- sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
127
+ sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
86
128
  sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress'''
87
129
  } finally {
88
130
  try {
@@ -100,7 +142,8 @@ pipeline {
100
142
  reportName: 'CypressCoverage',
101
143
  reportTitles: 'Integration Tests Code Coverage'])
102
144
  }
103
- archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true
145
+ sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
146
+ archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
104
147
  stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
105
148
  }
106
149
  finally {
@@ -122,10 +165,16 @@ pipeline {
122
165
  }
123
166
 
124
167
  stage('Report to SonarQube') {
125
- // Exclude Pull-Requests
126
168
  when {
127
169
  allOf {
128
170
  environment name: 'CHANGE_ID', value: ''
171
+ anyOf {
172
+ branch 'master'
173
+ allOf {
174
+ branch 'develop'
175
+ not { changelog '.*^Automated release [0-9\\.]+$' }
176
+ }
177
+ }
129
178
  }
130
179
  }
131
180
  steps {
@@ -156,8 +205,8 @@ pipeline {
156
205
  steps {
157
206
  node(label: 'docker') {
158
207
  script {
159
- if ( env.CHANGE_BRANCH != "develop" && !( env.CHANGE_BRANCH.startsWith("hotfix")) ) {
160
- error "Pipeline aborted due to PR not made from develop or hotfix branch"
208
+ if ( env.CHANGE_BRANCH != "develop" ) {
209
+ error "Pipeline aborted due to PR not made from develop branch"
161
210
  }
162
211
  withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
163
212
  sh '''docker pull eeacms/gitflow'''
@@ -168,23 +217,6 @@ pipeline {
168
217
  }
169
218
  }
170
219
 
171
- stage('Release') {
172
- when {
173
- allOf {
174
- environment name: 'CHANGE_ID', value: ''
175
- branch 'master'
176
- }
177
- }
178
- steps {
179
- node(label: 'docker') {
180
- withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
181
- sh '''docker pull eeacms/gitflow'''
182
- sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
183
- }
184
- }
185
- }
186
- }
187
-
188
220
  }
189
221
 
190
222
  post {
package/README.md CHANGED
@@ -1,7 +1,18 @@
1
1
  # volto-embed
2
+
2
3
  [![Releases](https://img.shields.io/github/v/release/eea/volto-embed)](https://github.com/eea/volto-embed/releases)
4
+
3
5
  [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-embed%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-embed/job/master/display/redirect)
6
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-embed-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-embed-master)
7
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-embed-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-embed-master)
8
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-embed-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-embed-master)
9
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-embed-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-embed-master)
10
+
4
11
  [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-embed%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-embed/job/develop/display/redirect)
12
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-embed-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-embed-develop)
13
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-embed-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-embed-develop)
14
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-embed-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-embed-develop)
15
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-embed-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-embed-develop)
5
16
 
6
17
  GDPR-compliant external resource embedding components for Volto.
7
18
 
@@ -51,6 +62,81 @@ See `src/Iframe/ViewIframe` for details on how to implement.
51
62
 
52
63
  1. Happy editing!
53
64
 
65
+ ## Release
66
+
67
+ ### Automatic release using Jenkins
68
+
69
+ * The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
70
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
71
+ * The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
72
+ * Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
73
+ * As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
74
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
75
+ * You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
76
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
77
+
78
+ ### Manual release from the develop branch ( beta release )
79
+
80
+ #### Installation and configuration of release-it
81
+
82
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
83
+
84
+ ```
85
+ npm install -g release-it
86
+ ```
87
+
88
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
89
+
90
+ Release-it is a tool that automates 4 important steps in the release process:
91
+
92
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
93
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
94
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
95
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
96
+
97
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
98
+
99
+ ```
100
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
101
+ ```
102
+
103
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
104
+
105
+ ```
106
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
107
+ ```
108
+
109
+ #### Using release-it tool
110
+
111
+ There are 3 yarn scripts that can be run to do the release
112
+
113
+ ##### yarn release-beta
114
+
115
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
116
+
117
+ ```
118
+ ? Select increment (next version):
119
+ ❯ prepatch (0.1.1-beta.0)
120
+ preminor (0.2.0-beta.0)
121
+ premajor (1.0.0-beta.0)
122
+ Other, please specify...
123
+ ```
124
+
125
+ ##### yarn release-major-beta
126
+
127
+ Same as `yarn release-beta`, but with premajor version pre-selected.
128
+
129
+ ##### yarn release
130
+
131
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
132
+
133
+ #### Important notes
134
+
135
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
136
+
137
+ > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
138
+
139
+
54
140
  ## How to contribute
55
141
 
56
142
  See [DEVELOP.md](https://github.com/eea/volto-embed/blob/master/DEVELOP.md).
Binary file
@@ -1,6 +1,7 @@
1
1
  import { setupBeforeEach, tearDownAfterEach } from '../support';
2
2
  import { changePageTitle, addBlock, selectBlock } from '../helpers';
3
3
  import { openSidebarTab } from '../helpers';
4
+ import 'cypress-file-upload';
4
5
 
5
6
  const group = {
6
7
  title: 'Common',
@@ -22,6 +23,42 @@ describe('Blocks Tests', () => {
22
23
  cy.get('#sidebar-properties header > h2')
23
24
  .first()
24
25
  .contains('Embed external content');
26
+
27
+ cy.get('.field-wrapper-privacy_statement-0-dataprotection p')
28
+ .first()
29
+ .clear()
30
+ .type('Test text for privacy protection');
31
+ cy.get('.field-wrapper-privacy_cookie_key-1-dataprotection');
32
+ cy.get('.field-wrapper-enabled-2-dataprotection .checkbox').click();
33
+
34
+ const imageFile = 'cat.jpg';
35
+ cy.get(
36
+ '.field-wrapper-background_image-3-dataprotection .dropzone-placeholder',
37
+ ).attachFile(imageFile);
38
+ const embed_url =
39
+ '<div class="mapouter"><div class="gmap_canvas"><iframe width="600" height="500" id="gmap_canvas" src="https://maps.google.com/maps?q=2880%20Broadway,%20New%20York&t=&z=13&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe><a href="https://www.embedgooglemap.net/blog/divi-discount-code-elegant-themes-coupon/"></a><br></div></div>';
40
+ cy.get('.block.maps input').click().type(embed_url, { force: true });
41
+
42
+ cy.get('.block-editor-text').last().click();
43
+ cy.get('.block-add-button').first().click();
44
+ cy.get('.blocks-chooser .title').contains('Common').click();
45
+ cy.get('.ui.basic.icon.button.maps').contains('Maps').click();
46
+
47
+ cy.get('.align-widget.field-wrapper-align button').first().click();
48
+ cy.get('.block.maps input')
49
+ .last()
50
+ .click()
51
+ .type(embed_url, { force: true });
52
+ cy.get(
53
+ '.field-wrapper-background_image-3-dataprotection .dropzone-placeholder',
54
+ ).attachFile(imageFile);
55
+
56
+ // Save
57
+ cy.get('#toolbar-save').click();
58
+ cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');
59
+
60
+ // then the page view should contain our changes
61
+ // cy.get('.ui.loader');
25
62
  });
26
63
  });
27
64
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-embed",
3
- "version": "2.0.9",
3
+ "version": "3.0.1",
4
4
  "description": "Embed external content",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -31,6 +31,8 @@
31
31
  },
32
32
  "scripts": {
33
33
  "release": "release-it",
34
+ "release-major-beta": "release-it major --preRelease=beta",
35
+ "release-beta": "release-it --preRelease=beta",
34
36
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
35
37
  "stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
36
38
  "stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
@@ -11,13 +11,15 @@ import { defineMessages, injectIntl } from 'react-intl';
11
11
  import { useDispatch } from 'react-redux';
12
12
  import { toast } from 'react-toastify';
13
13
  import config from '@plone/volto/registry';
14
- import '../css/embed-styles.css';
15
- import { createImageUrl } from './helpers';
16
-
17
14
  import { getBaseUrl } from '@plone/volto/helpers';
18
15
  import { Toast } from '@plone/volto/components';
19
16
  import { getConnectedDataParametersForContext } from '@eeacms/volto-datablocks/helpers';
20
17
 
18
+ import { createImageUrl } from './helpers';
19
+ import { ProtectionSchema } from './schema';
20
+
21
+ import './styles.less';
22
+
21
23
  const messages = defineMessages({
22
24
  success: {
23
25
  id: 'Success',
@@ -67,6 +69,27 @@ const CookieWatcher = (cookie, pollingRate = 250) => {
67
69
  return exist;
68
70
  };
69
71
 
72
+ const getFilteredURL = (url, connected_data_parameters = []) => {
73
+ if (!connected_data_parameters?.length) return url;
74
+ let decodedURL = decodeURIComponent(url);
75
+ const queries = decodedURL.match(/(?<=(<<))(.*?)(?=(>>))/g);
76
+ if (!queries?.length) return url;
77
+ const keys = connected_data_parameters.map((param) => param.i);
78
+ for (let poz in queries) {
79
+ const key = queries[poz];
80
+ const paramPoz = keys.indexOf(key);
81
+ if (paramPoz > -1) {
82
+ decodedURL = decodedURL.replace(
83
+ `<<${key}>>`,
84
+ connected_data_parameters[paramPoz].v[0],
85
+ );
86
+
87
+ continue;
88
+ }
89
+ }
90
+ return decodedURL;
91
+ };
92
+
70
93
  export default injectIntl(
71
94
  ({
72
95
  children,
@@ -85,33 +108,24 @@ export default injectIntl(
85
108
  const [visible, setVisibility] = useState(false);
86
109
  const defaultShow = canShow(dataprotection.privacy_cookie_key);
87
110
  const [show, setShow] = useState(defaultShow);
88
- const [remember, setRemember] = useState(defaultShow);
111
+ const [remember, setRemember] = useState(
112
+ cookieExist(dataprotection.privacy_cookie_key) ? defaultShow : true,
113
+ );
89
114
  const dispatch = useDispatch();
90
115
  const checkExistance = CookieWatcher(dataprotection.privacy_cookie_key);
91
- const queryParam = useSelector((state) => {
92
- return {
93
- connected_data_parameters: getConnectedDataParametersForContext(
94
- state?.connected_data_parameters,
95
- state.router?.location?.pathname,
96
- ),
97
- };
116
+ const connected_data_parameters = useSelector((state) => {
117
+ return getConnectedDataParametersForContext(
118
+ state?.connected_data_parameters,
119
+ state.router?.location?.pathname,
120
+ );
98
121
  });
99
- const param = queryParam
100
- ? queryParam.connected_data_parameters?.[0]?.query?.[0]?.v?.[0] ||
101
- queryParam.connected_data_parameters?.[0]?.v?.[0]
102
- : null;
103
122
 
104
- // create a url with params
105
- const url =
106
- param && data.url
107
- ? decodeURIComponent(data.url).replace('<<NUTS_CODE>>', param)
108
- : data.url;
123
+ const url = getFilteredURL(data.url, connected_data_parameters);
109
124
 
110
125
  const styles = {
111
- height: `${height}px`,
126
+ minHeight: `${height || 200}px`,
112
127
  position: 'relative',
113
128
  };
114
-
115
129
  React.useEffect(() => {
116
130
  if (bgImg) {
117
131
  setImage(createImageUrl(bgImg)); //create imageUrl from uploaded image
@@ -151,6 +165,12 @@ export default injectIntl(
151
165
  />,
152
166
  );
153
167
  }
168
+ })
169
+ .catch(() => {
170
+ if (__DEVELOPMENT__) {
171
+ /* eslint-disable-next-line */
172
+ console.log('Please enable your VPN!');
173
+ }
154
174
  });
155
175
  }
156
176
  }, [enabled, url, path, dispatch, bgImg, show, intl, isEditMode]);
@@ -164,10 +184,10 @@ export default injectIntl(
164
184
  offset={{ bottom: 200 }}
165
185
  >
166
186
  {visible ? (
167
- <div style={height ? styles : {}}>
187
+ <div className="privacy-protection-wrapper" style={styles}>
168
188
  {!dataprotection.enabled || show ? (
169
189
  children
170
- ) : !image ? (
190
+ ) : !__DEVELOPMENT__ && !image ? (
171
191
  <Dimmer active>
172
192
  <Loader />
173
193
  </Dimmer>
@@ -180,17 +200,14 @@ export default injectIntl(
180
200
  ? {
181
201
  backgroundImage: `url(${image})`,
182
202
  backgroundRepeat: 'no-repeat',
183
- backgroundPosition: 'center',
184
203
  backgroundSize: 'cover',
204
+ backgroundPosition: 'center -70px',
185
205
  }
186
206
  : {}
187
207
  }
188
208
  >
189
209
  <div className="overlay">
190
210
  <div className="wrapped">
191
- <div className="privacy-statement">
192
- {serializeNodes(dataprotection.privacy_statement || [])}
193
- </div>
194
211
  <div className="privacy-button">
195
212
  <Button
196
213
  primary
@@ -224,6 +241,13 @@ export default injectIntl(
224
241
  {config.settings.ownDomain || '.eea.europa.eu'} that will
225
242
  expire in {getExpDays()} days.
226
243
  </p>
244
+ <p className="discreet">
245
+ {serializeNodes(
246
+ dataprotection.privacy_statement ||
247
+ ProtectionSchema().properties.privacy_statement
248
+ .defaultValue,
249
+ )}
250
+ </p>
227
251
  </div>
228
252
  </div>
229
253
  </div>
@@ -20,6 +20,29 @@ export const ProtectionSchema = () => ({
20
20
  description: 'Defined in template. Change only if necessary',
21
21
  widget: 'slate_richtext',
22
22
  className: 'slate-Widget',
23
+ defaultValue: [
24
+ {
25
+ children: [
26
+ {
27
+ text:
28
+ 'This map is hosted by a third party, Environmental Systems Research Institute. By showing the external content you accept the terms and conditions of ',
29
+ },
30
+ {
31
+ type: 'a',
32
+ url: 'https://www.esri.com',
33
+ children: [
34
+ {
35
+ text: 'esri.com',
36
+ },
37
+ ],
38
+ },
39
+ {
40
+ text:
41
+ '. This includes their cookie policies, which we have no control over.',
42
+ },
43
+ ],
44
+ },
45
+ ],
23
46
  },
24
47
  privacy_cookie_key: {
25
48
  title: 'Privacy cookie key',
@@ -1,3 +1,13 @@
1
+ .privacy-protection-wrapper {
2
+ .ui.dimmer {
3
+ z-index: 9;
4
+
5
+ .ui.loader {
6
+ padding: 0;
7
+ }
8
+ }
9
+ }
10
+
1
11
  .privacy-protection {
2
12
  display: flex;
3
13
  height: 100%;
@@ -16,20 +26,21 @@
16
26
  }
17
27
 
18
28
  .wrapped {
19
- position: absolute;
20
- top: 50%;
21
- left: 50%;
29
+ // position: absolute;
30
+ // top: 50%;
31
+ // left: 50%;
22
32
  width: 300px;
23
33
  padding: 1.4rem;
24
34
  margin: 0 auto;
25
35
  background: white;
26
36
  border-radius: 5px;
27
- opacity: 0.6;
28
- -ms-transform: translate(-50%, -50%);
29
- transform: translate(-50%, -50%);
37
+ opacity: 1;
38
+ // -ms-transform: translate(-50%, -50%);
39
+ // transform: translate(-50%, -50%);
30
40
  }
31
41
 
32
- .discreet {
42
+ .discreet,
43
+ .discreet > p {
33
44
  color: grey;
34
45
  font-size: 14px;
35
46
  }