@eeacms/volto-marine-policy 1.0.0
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/.coverage.babel.config.js +9 -0
- package/.eslintrc.js +65 -0
- package/.husky/pre-commit +2 -0
- package/.release-it.json +17 -0
- package/CHANGELOG.md +5 -0
- package/DEVELOP.md +53 -0
- package/DEVELOP.md.tpl +106 -0
- package/Jenkinsfile.tpl +416 -0
- package/LICENSE.md +9 -0
- package/Makefile.tpl +165 -0
- package/README.md +172 -0
- package/README.md.tpl +93 -0
- package/RELEASE.md +74 -0
- package/babel.config.js +17 -0
- package/bootstrap +41 -0
- package/cypress.config.js +24 -0
- package/docker-compose.yml +32 -0
- package/jest-addon.config.js +35 -0
- package/jest-addon.config.js.tpl +51 -0
- package/jest.setup.js +65 -0
- package/locales/de/LC_MESSAGES/volto.po +14 -0
- package/locales/en/LC_MESSAGES/volto.po +14 -0
- package/locales/it/LC_MESSAGES/volto.po +14 -0
- package/locales/ro/LC_MESSAGES/volto.po +14 -0
- package/locales/volto.pot +16 -0
- package/package.json +68 -0
- package/package.json.tpl +70 -0
- package/razzle.extend.js +29 -0
- package/src/components/Blocks/CustomBlockTemplates/customBlockTemplates.js +25 -0
- package/src/components/Blocks/MsfdDataExplorerBlock/Edit.jsx +29 -0
- package/src/components/Blocks/MsfdDataExplorerBlock/View.jsx +105 -0
- package/src/components/Blocks/MsfdDataExplorerBlock/index.js +23 -0
- package/src/components/Blocks/MsfdDataExplorerBlock/schema.jsx +30 -0
- package/src/components/Result/MarineMeasureItem.jsx +83 -0
- package/src/components/Widgets/MeasureViewWidget.jsx +233 -0
- package/src/components/Widgets/String.jsx +15 -0
- package/src/components/Widgets/TextAlign.jsx +41 -0
- package/src/components/Widgets/measure.css +101 -0
- package/src/components/index.js +15 -0
- package/src/components/theme/AppExtras/PrintPage/PrintPage.jsx +61 -0
- package/src/components/theme/AppExtras/PrintPage/css/printpage.less +29 -0
- package/src/components/theme/AppExtras/PrintPage/index.js +3 -0
- package/src/components/theme/AppExtras/ScrollToTop/ScrollToTop.jsx +61 -0
- package/src/components/theme/AppExtras/ScrollToTop/css/scrolltop.less +19 -0
- package/src/components/theme/AppExtras/ScrollToTop/index.js +3 -0
- package/src/components/theme/AppExtras/index.js +18 -0
- package/src/components/theme/DatabaseItemView/DatabaseItemView.jsx +39 -0
- package/src/components/theme/DatabaseItemView/style.less +87 -0
- package/src/components/theme/Header/HeroSection.jsx +45 -0
- package/src/components/theme/Header/StickyHeader.jsx +51 -0
- package/src/components/theme/Header/less/globals.less +18 -0
- package/src/components/theme/Header/less/herosection.less +64 -0
- package/src/components/theme/Header/less/herosection.variables +18 -0
- package/src/components/theme/ItemMetadata/ItemMetadata.jsx +217 -0
- package/src/components/theme/ItemMetadata/ItemMetadataSnippet.jsx +69 -0
- package/src/components/theme/ItemMetadata/ItemTitle.jsx +29 -0
- package/src/components/theme/MetadataListingView/MapPreview.jsx +105 -0
- package/src/components/theme/MetadataListingView/MetadataHeader.jsx +66 -0
- package/src/components/theme/MetadataListingView/MetadataListingView.jsx +36 -0
- package/src/components/theme/MetadataListingView/style.less +219 -0
- package/src/components/theme/SimpleListingView/SimpleListingView.jsx +97 -0
- package/src/components/theme/SimpleListingView/style.less +33 -0
- package/src/components/theme/Tableau/TableauDownload.jsx +86 -0
- package/src/components/theme/Tableau/TableauFullscreen.jsx +78 -0
- package/src/components/theme/Tableau/TableauShare.jsx +128 -0
- package/src/components/theme/View/FullwidthView.jsx +102 -0
- package/src/components/theme/View/HeroSectionView.jsx +125 -0
- package/src/constants/ActionTypes.js +12 -0
- package/src/constants/measureFields.js +56 -0
- package/src/customizations/@eeacms/volto-block-style/StyleWrapper/schema.js +217 -0
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +358 -0
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +403 -0
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +131 -0
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/Logo.jsx +32 -0
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/marine_logo.svg +63 -0
- package/src/customizations/volto/components/manage/Contents/ContentsBreadcrumbs.jsx +81 -0
- package/src/customizations/volto/components/manage/Contents/README.md +1 -0
- package/src/customizations/volto/components/manage/Toolbar/PersonalTools.jsx +205 -0
- package/src/customizations/volto/components/manage/Toolbar/Toolbar.jsx +624 -0
- package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.jsx +49 -0
- package/src/customizations/volto/components/theme/Breadcrumbs/README.md +1 -0
- package/src/customizations/volto/components/theme/Header/Header.jsx +272 -0
- package/src/helpers/index.js +2 -0
- package/src/helpers/useCopyToClipboard.js +25 -0
- package/src/helpers/useOutsideClick.js +20 -0
- package/src/icons/arrow.svg +3 -0
- package/src/icons/basket.svg +3 -0
- package/src/icons/newspaper.svg +3 -0
- package/src/icons/popup.svg +3 -0
- package/src/icons/search.svg +3 -0
- package/src/icons/star-full.svg +3 -0
- package/src/icons/user.svg +3 -0
- package/src/index.js +466 -0
- package/src/reducers/breadcrumb/breadcrumb.js +59 -0
- package/src/reducers/index.js +2 -0
- package/src/reducers/localnavigation/localnavigation.js +69 -0
- package/src/search/config.js +98 -0
- package/src/search/facets.js +85 -0
- package/src/search/index.js +48 -0
- package/src/search/views.js +15 -0
- package/src/slate-styles.less +43 -0
- package/src/static/bise_logo.svg +1 -0
- package/src/static/cca_logo.svg +20 -0
- package/src/static/ec_logo.svg +343 -0
- package/src/static/ec_logo_white.svg +10 -0
- package/src/static/eea_logo.svg +14 -0
- package/src/static/footer-fishes.svg +21 -0
- package/src/static/forest_logo.svg +30 -0
- package/src/static/freshwater_logo.svg +12 -0
- package/src/static/marine_logo.svg +63 -0
- package/src/static/marine_logo_white.svg +44 -0
- package/src/utils.js +38 -0
- package/theme/assets/fonts/Poppins/Poppins-Bold.ttf +0 -0
- package/theme/assets/fonts/Poppins/Poppins-Bold.woff +0 -0
- package/theme/assets/fonts/Poppins/Poppins-Bold.woff2 +0 -0
- package/theme/assets/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
- package/theme/assets/fonts/Poppins/Poppins-Light.ttf +0 -0
- package/theme/assets/fonts/Poppins/Poppins-Light.woff +0 -0
- package/theme/assets/fonts/Poppins/Poppins-Light.woff2 +0 -0
- package/theme/assets/fonts/Poppins/Poppins-Regular.ttf +0 -0
- package/theme/assets/fonts/Poppins/Poppins-Regular.woff +0 -0
- package/theme/assets/fonts/Poppins/Poppins-Regular.woff2 +0 -0
- package/theme/assets/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
- package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff +0 -0
- package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff2 +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Light.woff +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Light.woff2 +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Medium.woff +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Medium.woff2 +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Regular.woff +0 -0
- package/theme/assets/fonts/Roboto/Roboto-Regular.woff2 +0 -0
- package/theme/assets/images/Footer/ec_logo.svg +10 -0
- package/theme/assets/images/Header/climate-adapt-logo-1.svg +20 -0
- package/theme/assets/images/Header/climate-adapt-logo.svg +22 -0
- package/theme/assets/images/spinner.svg +1 -0
- package/theme/collections/table.variables +17 -0
- package/theme/elements/button.overrides +22 -0
- package/theme/extras/banner.variables +5 -0
- package/theme/extras/contextNavigation.overrides +60 -0
- package/theme/extras/contextNavigation.variables +32 -0
- package/theme/extras/footer.variables +6 -0
- package/theme/extras/header.overrides +20 -0
- package/theme/extras/header.variables +7 -0
- package/theme/extras/hero.overrides +4 -0
- package/theme/extras/inpageNavigation.variables +5 -0
- package/theme/extras/mixins.less +8 -0
- package/theme/globals/site.overrides +349 -0
- package/theme/globals/site.variables +997 -0
- package/theme/theme.config +136 -0
- package/theme/tokens/colors.less +9 -0
- package/theme/tokens/tokens.less +1 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, Button } from 'semantic-ui-react';
|
|
3
|
+
import { Icon } from '@plone/volto/components';
|
|
4
|
+
import { useHistory, useLocation } from 'react-router-dom';
|
|
5
|
+
import fullscreenSVG from '@plone/volto/icons/fullscreen.svg';
|
|
6
|
+
|
|
7
|
+
import config from '@plone/volto/registry';
|
|
8
|
+
|
|
9
|
+
const TableauFullscreen = (props) => {
|
|
10
|
+
const tableau_url = props.data.url;
|
|
11
|
+
const modalHash = props?.item.getId + '_preview';
|
|
12
|
+
const [open, setOpen] = React.useState(false);
|
|
13
|
+
const history = useHistory();
|
|
14
|
+
const location = useLocation();
|
|
15
|
+
const {
|
|
16
|
+
blocks: { blocksConfig },
|
|
17
|
+
} = config;
|
|
18
|
+
const TableauBlockView = blocksConfig.tableau_block.view;
|
|
19
|
+
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (location.hash.includes(modalHash)) {
|
|
22
|
+
setOpen(true);
|
|
23
|
+
} else {
|
|
24
|
+
setOpen(false);
|
|
25
|
+
}
|
|
26
|
+
}, [location, modalHash]);
|
|
27
|
+
|
|
28
|
+
const closeModal = () => {
|
|
29
|
+
history.push({
|
|
30
|
+
hash: '',
|
|
31
|
+
});
|
|
32
|
+
setOpen(false);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<div className="toolbar-button-wrapper">
|
|
38
|
+
<Button
|
|
39
|
+
className="toolbar-button"
|
|
40
|
+
title="Full Screen"
|
|
41
|
+
onClick={() => {
|
|
42
|
+
setOpen(true);
|
|
43
|
+
if (props.item) {
|
|
44
|
+
history.push({
|
|
45
|
+
hash: props.item.getId + '_preview',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<Icon name={fullscreenSVG} size="23px" />
|
|
51
|
+
</Button>
|
|
52
|
+
<span className="btn-text">Enlarge</span>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<Modal
|
|
56
|
+
className="tableau-fullscreen"
|
|
57
|
+
onClose={closeModal}
|
|
58
|
+
onOpen={() => setOpen(true)}
|
|
59
|
+
open={open}
|
|
60
|
+
>
|
|
61
|
+
<Modal.Content>
|
|
62
|
+
<TableauBlockView
|
|
63
|
+
{...props}
|
|
64
|
+
data={{ url: tableau_url, hideToolbar: true }}
|
|
65
|
+
></TableauBlockView>
|
|
66
|
+
</Modal.Content>
|
|
67
|
+
|
|
68
|
+
<Modal.Actions>
|
|
69
|
+
<Button primary onClick={closeModal}>
|
|
70
|
+
Close
|
|
71
|
+
</Button>
|
|
72
|
+
</Modal.Actions>
|
|
73
|
+
</Modal>
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default TableauFullscreen;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Popup, Tab, Button, Menu, Input } from 'semantic-ui-react';
|
|
3
|
+
import { Icon } from '@plone/volto/components';
|
|
4
|
+
import { useCopyToClipboard } from '@eeacms/volto-marine-policy/helpers';
|
|
5
|
+
|
|
6
|
+
import shareSVG from '@plone/volto/icons/share.svg';
|
|
7
|
+
import codeSVG from '@plone/volto/icons/code.svg';
|
|
8
|
+
import linkSVG from '@plone/volto/icons/link.svg';
|
|
9
|
+
|
|
10
|
+
import cx from 'classnames';
|
|
11
|
+
|
|
12
|
+
const TableauShare = (props) => {
|
|
13
|
+
const tableau_url = props.data.url;
|
|
14
|
+
|
|
15
|
+
const embedContent = () => {
|
|
16
|
+
var pathArray = tableau_url.split('/');
|
|
17
|
+
var t_siteRoot = '/' + pathArray[3] + '/' + pathArray[4];
|
|
18
|
+
var t_name = pathArray[6] + '/' + pathArray[7].split('?')[0];
|
|
19
|
+
var t_filter = pathArray[7].split('?')[1];
|
|
20
|
+
t_filter = t_filter.split('&:')[0];
|
|
21
|
+
|
|
22
|
+
var embed =
|
|
23
|
+
"<script type='text/javascript'" +
|
|
24
|
+
"src='https://tableau.discomap.eea.europa.eu/javascripts/api/viz_v1.js'></script>" +
|
|
25
|
+
"<div class='tableauPlaceholder' style='width: 100%; height: 850px;'>" +
|
|
26
|
+
"<object class='tableauViz' width='100%' height='850' style='display:none;'>" +
|
|
27
|
+
"<param name='host_url' value='https%3A%2F%2Ftableau.discomap.eea.europa.eu%2F' />" +
|
|
28
|
+
"<param name='site_root' value='" +
|
|
29
|
+
t_siteRoot +
|
|
30
|
+
"' />" +
|
|
31
|
+
"<param name='name' value='" +
|
|
32
|
+
t_name +
|
|
33
|
+
"' />" +
|
|
34
|
+
"<param name='filter' value='" +
|
|
35
|
+
t_filter +
|
|
36
|
+
"'/>" +
|
|
37
|
+
"<param name='toolbar' value='no' />" +
|
|
38
|
+
"<param name='isGuestRedirectFromVizportal' value='y' />" +
|
|
39
|
+
'</object>' +
|
|
40
|
+
'</div>';
|
|
41
|
+
|
|
42
|
+
return embed;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const CopyUrlButton = ({ url, buttonText }) => {
|
|
46
|
+
const [copyUrlStatus, copyUrl] = useCopyToClipboard(url);
|
|
47
|
+
|
|
48
|
+
if (copyUrlStatus === 'copied') {
|
|
49
|
+
buttonText = 'Copied!';
|
|
50
|
+
} else if (copyUrlStatus === 'failed') {
|
|
51
|
+
buttonText = 'Copy failed. Please try again.';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Button
|
|
56
|
+
primary
|
|
57
|
+
onClick={copyUrl}
|
|
58
|
+
className={cx('copy-button', {
|
|
59
|
+
'green-button': copyUrlStatus === 'copied',
|
|
60
|
+
})}
|
|
61
|
+
>
|
|
62
|
+
{buttonText}
|
|
63
|
+
</Button>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const panes = [
|
|
68
|
+
{
|
|
69
|
+
menuItem: (
|
|
70
|
+
<Menu.Item key="location">
|
|
71
|
+
<span className="nav-dot">
|
|
72
|
+
<Icon name={linkSVG} size="24px" />
|
|
73
|
+
</span>
|
|
74
|
+
<span className="nav-dot-title">URL</span>
|
|
75
|
+
</Menu.Item>
|
|
76
|
+
),
|
|
77
|
+
render: () => (
|
|
78
|
+
<Tab.Pane>
|
|
79
|
+
<Input defaultValue={tableau_url} />
|
|
80
|
+
<CopyUrlButton url={tableau_url} buttonText="Copy sharing URL" />
|
|
81
|
+
</Tab.Pane>
|
|
82
|
+
),
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
menuItem: (
|
|
86
|
+
<Menu.Item key="messages">
|
|
87
|
+
<span className="nav-dot">
|
|
88
|
+
<Icon name={codeSVG} size="24px" />
|
|
89
|
+
</span>
|
|
90
|
+
<span className="nav-dot-title">Embed</span>
|
|
91
|
+
</Menu.Item>
|
|
92
|
+
),
|
|
93
|
+
render: () => (
|
|
94
|
+
<Tab.Pane>
|
|
95
|
+
<textarea defaultValue={embedContent()} />
|
|
96
|
+
<CopyUrlButton url={embedContent()} buttonText="Copy embed code" />
|
|
97
|
+
</Tab.Pane>
|
|
98
|
+
),
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<Popup
|
|
104
|
+
basic
|
|
105
|
+
className="tableau-share-dialog"
|
|
106
|
+
position="top center"
|
|
107
|
+
on="click"
|
|
108
|
+
trigger={
|
|
109
|
+
<div className="toolbar-button-wrapper">
|
|
110
|
+
<Button className="toolbar-button" title="Share">
|
|
111
|
+
<Icon name={shareSVG} size="26px" />
|
|
112
|
+
</Button>
|
|
113
|
+
<span className="btn-text">Share</span>
|
|
114
|
+
</div>
|
|
115
|
+
}
|
|
116
|
+
>
|
|
117
|
+
<Popup.Header>Share Dashboard</Popup.Header>
|
|
118
|
+
<Popup.Content>
|
|
119
|
+
<Tab
|
|
120
|
+
menu={{ secondary: true, pointing: true, fluid: true }}
|
|
121
|
+
panes={panes}
|
|
122
|
+
/>
|
|
123
|
+
</Popup.Content>
|
|
124
|
+
</Popup>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default TableauShare;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document view component.
|
|
3
|
+
* @module components/theme/View/FullwidthView
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { defineMessages, injectIntl } from 'react-intl';
|
|
9
|
+
import { Container } from 'semantic-ui-react';
|
|
10
|
+
import { map } from 'lodash';
|
|
11
|
+
import {
|
|
12
|
+
BodyClass,
|
|
13
|
+
getBlocksFieldname,
|
|
14
|
+
getBlocksLayoutFieldname,
|
|
15
|
+
hasBlocksData,
|
|
16
|
+
getBaseUrl,
|
|
17
|
+
} from '@plone/volto/helpers';
|
|
18
|
+
import config from '@plone/volto/registry';
|
|
19
|
+
|
|
20
|
+
const messages = defineMessages({
|
|
21
|
+
unknownBlock: {
|
|
22
|
+
id: 'Unknown Block',
|
|
23
|
+
defaultMessage: 'Unknown Block {block}',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Component to display the default view.
|
|
29
|
+
* @function FullwidthView
|
|
30
|
+
* @param {Object} content Content object.
|
|
31
|
+
* @returns {string} Markup of the component.
|
|
32
|
+
*/
|
|
33
|
+
const FullwidthView = ({ content, intl, location }) => {
|
|
34
|
+
const blocksFieldName = getBlocksFieldname(content);
|
|
35
|
+
const hasContentImage = content.image;
|
|
36
|
+
const blocksLayoutFieldName = getBlocksLayoutFieldname(content);
|
|
37
|
+
|
|
38
|
+
return hasBlocksData(content) ? (
|
|
39
|
+
<div id="page-document" className="ui container">
|
|
40
|
+
<BodyClass className="fullwidth-view" />
|
|
41
|
+
|
|
42
|
+
{map(content[blocksLayoutFieldName].items, (block) => {
|
|
43
|
+
const block_data = content[blocksFieldName]?.[block];
|
|
44
|
+
const block_type = block_data?.['@type'];
|
|
45
|
+
const Block = config.blocks?.blocksConfig[block_type]?.['view'] || null;
|
|
46
|
+
return Block !== null ? (
|
|
47
|
+
<React.Fragment key={block}>
|
|
48
|
+
{(block_type !== 'title' || !hasContentImage) && (
|
|
49
|
+
<Block
|
|
50
|
+
key={block}
|
|
51
|
+
id={block}
|
|
52
|
+
properties={content}
|
|
53
|
+
data={block_data}
|
|
54
|
+
path={getBaseUrl(location?.pathname || '')}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
</React.Fragment>
|
|
58
|
+
) : (
|
|
59
|
+
<div key={block}>
|
|
60
|
+
{intl.formatMessage(messages.unknownBlock, {
|
|
61
|
+
block: block_type,
|
|
62
|
+
})}
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
})}
|
|
66
|
+
</div>
|
|
67
|
+
) : (
|
|
68
|
+
<Container id="page-document" />
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Property types.
|
|
74
|
+
* @property {Object} propTypes Property types.
|
|
75
|
+
* @static
|
|
76
|
+
*/
|
|
77
|
+
FullwidthView.propTypes = {
|
|
78
|
+
/**
|
|
79
|
+
* Content of the object
|
|
80
|
+
*/
|
|
81
|
+
content: PropTypes.shape({
|
|
82
|
+
/**
|
|
83
|
+
* Title of the object
|
|
84
|
+
*/
|
|
85
|
+
title: PropTypes.string,
|
|
86
|
+
/**
|
|
87
|
+
* Description of the object
|
|
88
|
+
*/
|
|
89
|
+
description: PropTypes.string,
|
|
90
|
+
/**
|
|
91
|
+
* Text of the object
|
|
92
|
+
*/
|
|
93
|
+
text: PropTypes.shape({
|
|
94
|
+
/**
|
|
95
|
+
* Data of the text of the object
|
|
96
|
+
*/
|
|
97
|
+
data: PropTypes.string,
|
|
98
|
+
}),
|
|
99
|
+
}).isRequired,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export default injectIntl(FullwidthView);
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document view component.
|
|
3
|
+
* @module components/theme/View/HeroSectionView
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { defineMessages, injectIntl } from 'react-intl';
|
|
9
|
+
|
|
10
|
+
import { Container } from 'semantic-ui-react';
|
|
11
|
+
import { map } from 'lodash';
|
|
12
|
+
|
|
13
|
+
import config from '@plone/volto/registry';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
getBlocksFieldname,
|
|
17
|
+
getBlocksLayoutFieldname,
|
|
18
|
+
hasBlocksData,
|
|
19
|
+
getBaseUrl,
|
|
20
|
+
} from '@plone/volto/helpers';
|
|
21
|
+
|
|
22
|
+
const messages = defineMessages({
|
|
23
|
+
unknownBlock: {
|
|
24
|
+
id: 'Unknown Block',
|
|
25
|
+
defaultMessage: 'Unknown Block {block}',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Component to display the default view.
|
|
31
|
+
* @function HeroSectionView
|
|
32
|
+
* @param {Object} content Content object.
|
|
33
|
+
* @returns {string} Markup of the component.
|
|
34
|
+
*/
|
|
35
|
+
const HeroSectionView = ({ content, intl, location }) => {
|
|
36
|
+
const blocksFieldName = getBlocksFieldname(content);
|
|
37
|
+
const hasContentImage = content.image;
|
|
38
|
+
const blocksLayoutFieldName = getBlocksLayoutFieldname(content);
|
|
39
|
+
|
|
40
|
+
return hasBlocksData(content) ? (
|
|
41
|
+
<div id="page-document" className="ui container">
|
|
42
|
+
{content.description && (
|
|
43
|
+
<p className="documentDescription">{content.description}</p>
|
|
44
|
+
)}
|
|
45
|
+
|
|
46
|
+
{content.text && (
|
|
47
|
+
<div
|
|
48
|
+
dangerouslySetInnerHTML={{
|
|
49
|
+
__html: content.text.data,
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
53
|
+
|
|
54
|
+
{map(content[blocksLayoutFieldName].items, (block) => {
|
|
55
|
+
const block_data = content[blocksFieldName]?.[block];
|
|
56
|
+
const block_type = block_data?.['@type'];
|
|
57
|
+
const Block = config.blocks?.blocksConfig[block_type]?.['view'] || null;
|
|
58
|
+
return Block !== null ? (
|
|
59
|
+
<React.Fragment key={block}>
|
|
60
|
+
{(block_type !== 'title' || !hasContentImage) && (
|
|
61
|
+
<Block
|
|
62
|
+
key={block}
|
|
63
|
+
id={block}
|
|
64
|
+
properties={content}
|
|
65
|
+
data={block_data}
|
|
66
|
+
path={getBaseUrl(location?.pathname || '')}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
</React.Fragment>
|
|
70
|
+
) : (
|
|
71
|
+
<div key={block}>
|
|
72
|
+
{intl.formatMessage(messages.unknownBlock, {
|
|
73
|
+
block: block_type,
|
|
74
|
+
})}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
})}
|
|
78
|
+
</div>
|
|
79
|
+
) : (
|
|
80
|
+
<Container id="page-document">
|
|
81
|
+
{content.description && (
|
|
82
|
+
<p className="documentDescription">{content.description}</p>
|
|
83
|
+
)}
|
|
84
|
+
{content.text && (
|
|
85
|
+
<div
|
|
86
|
+
dangerouslySetInnerHTML={{
|
|
87
|
+
__html: content.text.data,
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
)}
|
|
91
|
+
</Container>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Property types.
|
|
97
|
+
* @property {Object} propTypes Property types.
|
|
98
|
+
* @static
|
|
99
|
+
*/
|
|
100
|
+
HeroSectionView.propTypes = {
|
|
101
|
+
/**
|
|
102
|
+
* Content of the object
|
|
103
|
+
*/
|
|
104
|
+
content: PropTypes.shape({
|
|
105
|
+
/**
|
|
106
|
+
* Title of the object
|
|
107
|
+
*/
|
|
108
|
+
title: PropTypes.string,
|
|
109
|
+
/**
|
|
110
|
+
* Description of the object
|
|
111
|
+
*/
|
|
112
|
+
description: PropTypes.string,
|
|
113
|
+
/**
|
|
114
|
+
* Text of the object
|
|
115
|
+
*/
|
|
116
|
+
text: PropTypes.shape({
|
|
117
|
+
/**
|
|
118
|
+
* Data of the text of the object
|
|
119
|
+
*/
|
|
120
|
+
data: PropTypes.string,
|
|
121
|
+
}),
|
|
122
|
+
}).isRequired,
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default injectIntl(HeroSectionView);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action types.
|
|
3
|
+
* @module constants/ActionTypes
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const ADD_TO_BASKET = 'ADD_TO_BASKET';
|
|
7
|
+
export const REMOVE_FROM_BASKET = 'REMOVE_FROM_BASKET';
|
|
8
|
+
export const GET_BOOKMARK = 'GET_BOOKMARK';
|
|
9
|
+
export const ADD_BOOKMARK = 'ADD_BOOKMARK';
|
|
10
|
+
export const PUT_BOOKMARK = 'PUT_BOOKMARK';
|
|
11
|
+
export const DELETE_BOOKMARK = 'DELETE_BOOKMARK';
|
|
12
|
+
export const GET_ALL_BOOKMARKS = 'GET_ALL_BOOKMARKS';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const fields = [
|
|
2
|
+
{ field: 'sector', title: 'Sector' },
|
|
3
|
+
{ field: 'origin', title: 'Origin of the measure' },
|
|
4
|
+
{ field: 'use', title: 'Use or activity' },
|
|
5
|
+
{ field: 'nature', title: 'Nature of the measure' },
|
|
6
|
+
{ field: 'status', title: 'Status' },
|
|
7
|
+
{ field: 'impacts', title: 'Measure impacts to' },
|
|
8
|
+
{
|
|
9
|
+
field: 'impacts_further_details',
|
|
10
|
+
title: 'Measure Impacts to (further details)',
|
|
11
|
+
},
|
|
12
|
+
{ field: 'water_body_cat', title: 'Water body category' },
|
|
13
|
+
{ field: 'spatial_scope', title: 'Spatial scope' },
|
|
14
|
+
{ field: 'country_coverage', title: 'Country' },
|
|
15
|
+
{ field: 'descriptors', title: 'Descriptors' },
|
|
16
|
+
{
|
|
17
|
+
field: 'nature_of_physical_modification',
|
|
18
|
+
title: 'Nature of physical modification',
|
|
19
|
+
},
|
|
20
|
+
{ field: 'effect_on_hydromorphology', title: 'Effect on hydromorphology' },
|
|
21
|
+
{ field: 'ecological_impacts', title: 'Ecological impacts' },
|
|
22
|
+
{ field: 'links_to_existing_policies', title: 'Link to existing policies' },
|
|
23
|
+
{ field: 'ktms_it_links_to', title: 'KTMs it links to' },
|
|
24
|
+
{ field: 'relevant_targets', title: 'Relevant targets' },
|
|
25
|
+
{
|
|
26
|
+
field: 'relevant_features_from_msfd_annex_iii',
|
|
27
|
+
title: 'Relevant features from MSFD Annex III',
|
|
28
|
+
},
|
|
29
|
+
{ field: 'msfd_spatial_scope', title: 'MSFD Spatial scope' },
|
|
30
|
+
{ field: 'measure_purpose', title: 'Measure purpose' },
|
|
31
|
+
{ field: 'measure_location', title: 'Measure location' },
|
|
32
|
+
{ field: 'measure_response', title: 'Measure response' },
|
|
33
|
+
{ field: 'measure_additional_info', title: 'Measure additional info' },
|
|
34
|
+
{ field: 'pressure_type', title: 'Type of pressure' },
|
|
35
|
+
{ field: 'pressure_name', title: 'Pressure name' },
|
|
36
|
+
{ field: 'ranking', title: 'Ranking' },
|
|
37
|
+
{ field: 'region', title: 'Region' },
|
|
38
|
+
{ field: 'mspd_implementation_status', title: 'MSPD implementation status' },
|
|
39
|
+
{ field: 'shipping_tackled', title: 'Shipping Tackled' },
|
|
40
|
+
{ field: 'traffic_separation_scheme', title: 'Traffic separation scheme' },
|
|
41
|
+
{ field: 'priority_areas', title: 'Priority Areas' },
|
|
42
|
+
{ field: 'approaching_areas', title: 'Approaching Areas' },
|
|
43
|
+
{ field: 'precautionary_areas', title: 'Precautionary areas' },
|
|
44
|
+
{ field: 'areas_to_be_avoided', title: 'Areas to be avoided' },
|
|
45
|
+
{ field: 'future_scenarios', title: 'Future Scenarios' },
|
|
46
|
+
{ field: 'source', title: 'Source' },
|
|
47
|
+
{ field: 'authority', title: 'Authority' },
|
|
48
|
+
{ field: 'general_view', title: 'General View' },
|
|
49
|
+
{ field: 'ports', title: 'Ports' },
|
|
50
|
+
{ field: 'future_expectations', title: 'Future Expectations' },
|
|
51
|
+
{ field: 'safety_manner', title: 'Safety manner' },
|
|
52
|
+
{ field: 'objective', title: 'Objective' },
|
|
53
|
+
{ field: 'categories', title: 'Categories' },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export { fields };
|