diff --git a/package.json b/package.json
index 3d357d2..c6d05c4 100644
--- a/package.json
+++ b/package.json
@@ -110,15 +110,15 @@
"node": "^10 || ^12"
},
"dependencies": {
- "@eeacms/volto-blocks-form": "github:eea/volto-blocks-form#0.5.2",
+ "@eeacms/volto-blocks-form": "github:eea/volto-blocks-form#1.0.0",
"@eeacms/volto-metadata-block": "github:eea/volto-metadata-block#1.0.1",
- "@eeacms/volto-object-widget": "github:eea/volto-object-widget#0.2.3",
- "@eeacms/volto-widget-toggle": "github:eea/volto-widget-toggle#0.1.0",
+ "@eeacms/volto-object-widget": "github:eea/volto-object-widget#1.0.0",
+ "@eeacms/volto-widget-toggle": "github:eea/volto-widget-toggle#1.0.0",
"@eeacms/volto-widgets-view": "github:eea/volto-widgets-view#1.0.1",
"@eeacms/volto-slate-metadata-mentions": "github:eea/volto-slate-metadata-mentions#0.4.2",
"@material/react-linear-progress": "^0.15.0",
"@plone/volto": "github:eea/volto#8.2.6-beta1",
- "volto-slate": "github:eea/volto-slate#0.9.0-beta.4",
+ "volto-slate": "github:eea/volto-slate#0.9.2",
"axios": "^0.20.0",
"jsonp": "^0.2.1",
"ol": "^6.4.3",
diff --git a/src/components/manage/Blocks/DiscodataOpenlayersMapBlock/Edit.jsx b/src/components/manage/Blocks/DiscodataOpenlayersMapBlock/Edit.jsx
index 87012db..637cd6c 100644
--- a/src/components/manage/Blocks/DiscodataOpenlayersMapBlock/Edit.jsx
+++ b/src/components/manage/Blocks/DiscodataOpenlayersMapBlock/Edit.jsx
@@ -28,6 +28,14 @@ const getSchema = (props) => {
title: 'Has regions features',
defaultValue: false,
},
+ privacy: {
+ type: 'array',
+ title: 'Privacy',
+ choices: [
+ ['small', 'Small'],
+ ['big', 'Big'],
+ ],
+ },
filterSource: {
type: 'array',
title: 'Filter source',
diff --git a/src/components/manage/Blocks/DiscodataOpenlayersMapBlock/PrivacyProtection.jsx b/src/components/manage/Blocks/DiscodataOpenlayersMapBlock/PrivacyProtection.jsx
new file mode 100644
index 0000000..8c6d358
--- /dev/null
+++ b/src/components/manage/Blocks/DiscodataOpenlayersMapBlock/PrivacyProtection.jsx
@@ -0,0 +1,131 @@
+import React, { useState } from 'react';
+import VisibilitySensor from 'react-visibility-sensor';
+import { Placeholder } from 'semantic-ui-react';
+import cookie from 'react-cookie';
+import ReactTooltip from 'react-tooltip';
+import { Button, Checkbox, Message, Image } from 'semantic-ui-react';
+import Icon from '@plone/volto/components/theme/Icon/Icon';
+import infoSVG from '@plone/volto/icons/info.svg';
+import { settings } from '~/config';
+
+import 'volto-embed/css/embed-styles.css';
+
+const key = (domain_key) => `accept-${domain_key}`;
+
+const getExpDays = () =>
+ typeof settings.embedCookieExpirationDays !== 'undefined'
+ ? settings.embedCookieExpirationDays
+ : 90;
+
+function saveCookie(domain_key) {
+ const date = new Date();
+ date.setDate(date.getDate() + getExpDays());
+
+ cookie.save(key(domain_key), 'true', {
+ path: '/',
+ expires: date,
+ });
+}
+
+function canShow(domain_key) {
+ return cookie.load(key(domain_key)) === 'true';
+}
+
+export default ({ children, data = {}, block, onShow, ...rest }) => {
+ const { dataprotection = {} } = data;
+ const [visible, setVisibility] = useState(false);
+ const defaultShow = canShow(dataprotection.privacy_cookie_key);
+ const [show, setShow] = useState(defaultShow);
+ const [remember, setRemember] = useState(defaultShow);
+
+ return (
+
+ Your choice will be saved in a cookie managed by{' '}
+ {settings.ownDomain || '.eea.europa.eu'} that will expire in{' '}
+ {getExpDays()} days.
+
Openlayer map
: ''} - -
- Number of sites:{' '}
- {state.popup.properties.num_sites}
-
The location you are viewing is:
-{state.popup.properties.hdms}
- >
+ - - {state.popupDetails.properties.nFacilities || 0}{' '} - Facilities - -
-- - {state.popupDetails.properties.nInstallations || 0}{' '} - Installations - -
-- - {state.popupDetails.properties.nLCP || 0} Large - combustion plants - -
-- {state.popupDetails.properties.pollutants} - {/* {state.popupDetails.properties.pollutants.substring( +
+ Number of sites:{' '}
+ {state.popup.properties.num_sites}
+
+ The location you are viewing is: +
+{state.popup.properties.hdms}
+ >
+ ) : (
+ ''
+ )}
+ + + {state.popupDetails.properties.nFacilities || 0}{' '} + Facilities + +
++ + {state.popupDetails.properties.nInstallations || 0}{' '} + Installations + +
++ + {state.popupDetails.properties.nLCP || 0} Large + combustion plants + +
++ {state.popupDetails.properties.pollutants} + {/* {state.popupDetails.properties.pollutants.substring( 0, 256, )} {state.popupDetails.properties.pollutants.length > 256 ? '...' : ''} */} -
- ) : ( -There are no data regarding the pollutants
- )} + + ) : ( +There are no data regarding the pollutants
+ )} ++ Inspections in{' '} + {state.popupDetails.properties.Site_reporting_year}:{' '} + {state.popupDetails.properties.numInspections || 0} +
+ ) : ( + '' + )} +- Inspections in{' '} - {state.popupDetails.properties.Site_reporting_year}:{' '} - {state.popupDetails.properties.numInspections || 0} -
- ) : ( - '' - )} -