@eeacms/volto-marine-policy 0.1.20
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/LICENSE.md +9 -0
- package/README.md +172 -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 +50 -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 +69 -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 +467 -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 +93 -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/Header/wise-marine-logo-white.svg +143 -0
- package/theme/assets/images/Header/wise-marine-logo.svg +143 -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,14 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: Plone\n"
|
|
4
|
+
"POT-Creation-Date: 2023-06-28T10:48:22.678Z\n"
|
|
5
|
+
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
|
+
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
|
+
"MIME-Version: 1.0\n"
|
|
8
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
|
9
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
10
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
11
|
+
"Language-Code: en\n"
|
|
12
|
+
"Language-Name: English\n"
|
|
13
|
+
"Preferred-Encodings: utf-8\n"
|
|
14
|
+
"Domain: volto\n"
|
|
15
|
+
|
|
16
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eeacms/volto-marine-policy",
|
|
3
|
+
"version": "0.1.20",
|
|
4
|
+
"description": "@eeacms/volto-marine-policy: Volto add-on",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"author": "European Environment Agency: IDM2 A-Team",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/eea/volto-marine-policy",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"volto-addon",
|
|
11
|
+
"volto",
|
|
12
|
+
"plone",
|
|
13
|
+
"react"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git@github.com:eea/volto-marine-policy.git"
|
|
18
|
+
},
|
|
19
|
+
"resolutions": {
|
|
20
|
+
"react-countup/countup.js": "2.5.0",
|
|
21
|
+
"d3-array": "^2.12.1"
|
|
22
|
+
},
|
|
23
|
+
"addons": [
|
|
24
|
+
"@eeacms/volto-tabs-block",
|
|
25
|
+
"@eeacms/volto-embed",
|
|
26
|
+
"@eeacms/volto-slots",
|
|
27
|
+
"@eeacms/volto-eea-design-system",
|
|
28
|
+
"@eeacms/volto-eea-website-theme",
|
|
29
|
+
"@eeacms/volto-globalsearch",
|
|
30
|
+
"@eeacms/volto-searchlib"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@eeacms/volto-eea-design-system": "*",
|
|
34
|
+
"@eeacms/volto-eea-website-theme": "*",
|
|
35
|
+
"@eeacms/volto-embed": "*",
|
|
36
|
+
"@eeacms/volto-globalsearch": "^1.0.20",
|
|
37
|
+
"@eeacms/volto-searchlib": "^0.6.3",
|
|
38
|
+
"@eeacms/volto-slots": "*",
|
|
39
|
+
"@eeacms/volto-tabs-block": "*",
|
|
40
|
+
"axios": "0.25.0",
|
|
41
|
+
"jquery": "3.6.0",
|
|
42
|
+
"razzle-plugin-scss": "^4.2.18",
|
|
43
|
+
"react-lazy-load-image-component": "^1.4.0",
|
|
44
|
+
"react-slick": "^0.24.0",
|
|
45
|
+
"slick-carousel": "^1.8.1"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
|
49
|
+
"@cypress/code-coverage": "^3.9.5",
|
|
50
|
+
"@plone/scripts": "2.1.1",
|
|
51
|
+
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
52
|
+
"dotenv": "^16.3.2"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"release": "release-it",
|
|
56
|
+
"release-major-beta": "release-it major --preRelease=beta",
|
|
57
|
+
"release-beta": "release-it --preRelease=beta",
|
|
58
|
+
"bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
|
|
59
|
+
"stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
|
|
60
|
+
"stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
|
|
61
|
+
"stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
|
|
62
|
+
"prettier": "../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'",
|
|
63
|
+
"prettier:fix": "../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'",
|
|
64
|
+
"lint": "../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'",
|
|
65
|
+
"lint:fix": "../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'",
|
|
66
|
+
"cypress:run": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress run; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress run; fi",
|
|
67
|
+
"cypress:open": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress open; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress open; fi"
|
|
68
|
+
}
|
|
69
|
+
}
|
package/razzle.extend.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const plugins = (defaultPlugins) => {
|
|
3
|
+
return defaultPlugins;
|
|
4
|
+
};
|
|
5
|
+
const modify = (config, { target, dev }, webpack) => {
|
|
6
|
+
const themeConfigPath = `${__dirname}/theme/theme.config`;
|
|
7
|
+
config.resolve.alias['../../theme.config$'] = themeConfigPath;
|
|
8
|
+
config.resolve.alias['../../theme.config'] = themeConfigPath;
|
|
9
|
+
config.resolve.alias['../../theme'] = `${__dirname}/theme`;
|
|
10
|
+
const projectRootPath = path.resolve('.');
|
|
11
|
+
const themeLessPath = `${projectRootPath}/node_modules/@eeacms/volto-eea-design-system/theme`;
|
|
12
|
+
|
|
13
|
+
config.resolve.alias['eea-design-system-theme'] = dev
|
|
14
|
+
? `${projectRootPath}/src/addons/volto-eea-design-system/theme/themes/eea`
|
|
15
|
+
: `${themeLessPath}/themes/eea`;
|
|
16
|
+
|
|
17
|
+
const semanticLessPath = `${projectRootPath}/node_modules/semantic-ui-less`;
|
|
18
|
+
const hasDesignSystemInstalled = config.resolve.alias['eea-volto-themes'];
|
|
19
|
+
config.resolve.alias['eea-volto-theme-folder'] = hasDesignSystemInstalled
|
|
20
|
+
? themeLessPath
|
|
21
|
+
: semanticLessPath;
|
|
22
|
+
|
|
23
|
+
return config;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
module.exports = {
|
|
27
|
+
plugins,
|
|
28
|
+
modify,
|
|
29
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockStyleWrapperEdit,
|
|
3
|
+
BlockStyleWrapperView,
|
|
4
|
+
} from '@eeacms/volto-block-style/BlockStyleWrapper';
|
|
5
|
+
import EditIframe from '@eeacms/volto-embed/Blocks/Maps/Edit';
|
|
6
|
+
import ViewIframe from '@eeacms/volto-embed/Blocks/Maps/View';
|
|
7
|
+
|
|
8
|
+
const customBlockTemplates = (config) => ({
|
|
9
|
+
...config.blocks.blocksConfig,
|
|
10
|
+
|
|
11
|
+
maps: {
|
|
12
|
+
...config.blocks.blocksConfig.maps,
|
|
13
|
+
view: (props) => (
|
|
14
|
+
<BlockStyleWrapperView {...props}>
|
|
15
|
+
<ViewIframe {...props} />
|
|
16
|
+
</BlockStyleWrapperView>
|
|
17
|
+
),
|
|
18
|
+
edit: (props) => (
|
|
19
|
+
<BlockStyleWrapperEdit {...props}>
|
|
20
|
+
<EditIframe {...props} />
|
|
21
|
+
</BlockStyleWrapperEdit>
|
|
22
|
+
),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
export default customBlockTemplates;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SidebarPortal, BlockDataForm } from '@plone/volto/components';
|
|
3
|
+
import MsfdDataExplorerBlockView from './View';
|
|
4
|
+
import schema from './schema';
|
|
5
|
+
|
|
6
|
+
const MsfdDataExplorerBlockEdit = (props) => {
|
|
7
|
+
const { selected, onChangeBlock, data = {}, block } = props;
|
|
8
|
+
return (
|
|
9
|
+
<div>
|
|
10
|
+
<MsfdDataExplorerBlockView {...props} />
|
|
11
|
+
|
|
12
|
+
<SidebarPortal selected={selected}>
|
|
13
|
+
<BlockDataForm
|
|
14
|
+
schema={schema}
|
|
15
|
+
title={schema.title}
|
|
16
|
+
onChangeField={(id, value) => {
|
|
17
|
+
onChangeBlock(block, {
|
|
18
|
+
...data,
|
|
19
|
+
[id]: value,
|
|
20
|
+
});
|
|
21
|
+
}}
|
|
22
|
+
formData={data}
|
|
23
|
+
/>
|
|
24
|
+
</SidebarPortal>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default MsfdDataExplorerBlockEdit;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Dimmer,
|
|
4
|
+
Loader,
|
|
5
|
+
Segment,
|
|
6
|
+
Placeholder,
|
|
7
|
+
Message,
|
|
8
|
+
} from 'semantic-ui-react';
|
|
9
|
+
import axios from 'axios';
|
|
10
|
+
import $ from 'jquery';
|
|
11
|
+
|
|
12
|
+
const MsfdDataExplorerBlockView = (props) => {
|
|
13
|
+
const [content, setContent] = React.useState('');
|
|
14
|
+
const [loading, setloading] = useState(true);
|
|
15
|
+
const { editable } = props;
|
|
16
|
+
const { article_select } = props.data;
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (article_select) {
|
|
20
|
+
axios
|
|
21
|
+
.get(`/marine/++api++/${article_select}`)
|
|
22
|
+
.then((res) => {
|
|
23
|
+
const el = document.createElement('div');
|
|
24
|
+
el.innerHTML = res.data;
|
|
25
|
+
const msfdContent = el.querySelector('.msfd-search-wrapper');
|
|
26
|
+
setContent(msfdContent);
|
|
27
|
+
})
|
|
28
|
+
.catch((err) => {
|
|
29
|
+
setContent({ data: <div>Something went wrong.</div> });
|
|
30
|
+
})
|
|
31
|
+
.finally(() => {
|
|
32
|
+
setloading(false);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, [article_select]);
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
window.$ = $;
|
|
39
|
+
window.jQuery = $;
|
|
40
|
+
global.jQuery = $;
|
|
41
|
+
|
|
42
|
+
const scripts = [
|
|
43
|
+
'https://cdnjs.cloudflare.com/ajax/libs/select2/3.5.4/select2.min.js',
|
|
44
|
+
'/marine/++api++/++resource++msfd/js/jquery-ui.js',
|
|
45
|
+
'/marine/++api++/++resource++msfd/js/tabs.js',
|
|
46
|
+
'/marine/++api++/++resource++msfd/js/msfd_search.js',
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
if (!loading) {
|
|
50
|
+
$.getScript(scripts[0], () => {
|
|
51
|
+
$.getScript(scripts[1], () => {
|
|
52
|
+
$.getScript(scripts[2], () => {
|
|
53
|
+
$.getScript(scripts[3]);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// scripts.forEach((element) => {
|
|
59
|
+
// // $.getScript(element);
|
|
60
|
+
// const script = document.createElement('script');
|
|
61
|
+
// script.src = element;
|
|
62
|
+
// script.setAttribute('type', 'text/javascript');
|
|
63
|
+
// script.async = false;
|
|
64
|
+
// // script.defer = 'defer';
|
|
65
|
+
|
|
66
|
+
// document.body.appendChild(script);
|
|
67
|
+
// });
|
|
68
|
+
// setTimeout(() => {
|
|
69
|
+
// $.getScript('/++api++/++resource++msfd/js/msfd_search.js');
|
|
70
|
+
// }, 200);
|
|
71
|
+
}
|
|
72
|
+
}, [loading]);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<>
|
|
76
|
+
{article_select ? (
|
|
77
|
+
<div>
|
|
78
|
+
{loading ? (
|
|
79
|
+
<Segment>
|
|
80
|
+
<Dimmer active inverted>
|
|
81
|
+
<Loader inverted>Loading</Loader>
|
|
82
|
+
</Dimmer>
|
|
83
|
+
|
|
84
|
+
<Placeholder>
|
|
85
|
+
<Placeholder.Line />
|
|
86
|
+
<Placeholder.Line />
|
|
87
|
+
<Placeholder.Line />
|
|
88
|
+
<Placeholder.Line />
|
|
89
|
+
<Placeholder.Line />
|
|
90
|
+
</Placeholder>
|
|
91
|
+
</Segment>
|
|
92
|
+
) : (
|
|
93
|
+
<div>
|
|
94
|
+
<div dangerouslySetInnerHTML={{ __html: content.outerHTML }} />
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
</div>
|
|
98
|
+
) : (
|
|
99
|
+
<>{editable ? <Message>Select article</Message> : ''}</>
|
|
100
|
+
)}
|
|
101
|
+
</>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default MsfdDataExplorerBlockView;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import worldSVG from '@plone/volto/icons/world.svg';
|
|
2
|
+
import MsfdDataExplorerBlockView from './View';
|
|
3
|
+
import MsfdDataExplorerBlockEdit from './Edit';
|
|
4
|
+
|
|
5
|
+
export default (config) => {
|
|
6
|
+
config.blocks.blocksConfig.msfdDataExplorerBlock = {
|
|
7
|
+
id: 'msfdDataExplorerBlock',
|
|
8
|
+
title: 'MSFD Data explorer block',
|
|
9
|
+
icon: worldSVG,
|
|
10
|
+
group: 'marine_addons',
|
|
11
|
+
view: MsfdDataExplorerBlockView,
|
|
12
|
+
edit: MsfdDataExplorerBlockEdit,
|
|
13
|
+
restricted: false,
|
|
14
|
+
mostUsed: false,
|
|
15
|
+
blockHasOwnFocusManagement: false,
|
|
16
|
+
sidebarTab: 1,
|
|
17
|
+
security: {
|
|
18
|
+
addPermission: [],
|
|
19
|
+
view: [],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
return config;
|
|
23
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const MsfdDataExplorerBlockSchema = {
|
|
2
|
+
title: 'Data Explorer Block',
|
|
3
|
+
fieldsets: [
|
|
4
|
+
{
|
|
5
|
+
id: 'default',
|
|
6
|
+
title: 'Default',
|
|
7
|
+
fields: ['article_select'],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
|
|
11
|
+
properties: {
|
|
12
|
+
article_select: {
|
|
13
|
+
title: 'Select article',
|
|
14
|
+
choices: [
|
|
15
|
+
['marine-units', 'Article 4'],
|
|
16
|
+
['competent-authorities', 'Article 7'],
|
|
17
|
+
['assessments', 'Article 8'],
|
|
18
|
+
['determination-of-good-environmental-status', 'Article 9'],
|
|
19
|
+
['establishment-of-environmental-targets', 'Article 10'],
|
|
20
|
+
['monitoring-programmes', 'Article 11'],
|
|
21
|
+
['programmes-of-measures-progress-of-pom', 'Article 13 & 18'],
|
|
22
|
+
['exceptions', 'Article 14'],
|
|
23
|
+
['datasets-used', 'Article 19.3'],
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
required: ['article_select'],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default MsfdDataExplorerBlockSchema;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Label } from 'semantic-ui-react';
|
|
4
|
+
import { SegmentedBreadcrumb, StringList, ResultContext } from '@eeacms/search';
|
|
5
|
+
import { UniversalCard } from '@eeacms/volto-listing-block';
|
|
6
|
+
import { firstWords, getTermDisplayValue } from '@eeacms/search/lib/utils';
|
|
7
|
+
import { useAppConfig } from '@eeacms/search/lib/hocs';
|
|
8
|
+
|
|
9
|
+
import ExternalLink from '@eeacms/search/components/Result/ExternalLink';
|
|
10
|
+
|
|
11
|
+
const ExtraContent = (props) => {
|
|
12
|
+
const { result, vocab } = props;
|
|
13
|
+
const measureSector = result.wm_spm_sector ? result.wm_spm_sector.raw : '';
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div>
|
|
17
|
+
<div className="result-bottom">
|
|
18
|
+
<div className="result-info">
|
|
19
|
+
<span className="result-info-title">Sector: </span>
|
|
20
|
+
<StringList value={measureSector} />
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<div className="result-info result-source">
|
|
25
|
+
<span className="result-info-title">Source: </span>
|
|
26
|
+
<ExternalLink href={result.href}>
|
|
27
|
+
<strong title={result.source} className="source">
|
|
28
|
+
{firstWords(
|
|
29
|
+
getTermDisplayValue({
|
|
30
|
+
vocab,
|
|
31
|
+
field: 'cluster_name',
|
|
32
|
+
term: result.source,
|
|
33
|
+
}),
|
|
34
|
+
8,
|
|
35
|
+
)}
|
|
36
|
+
</strong>
|
|
37
|
+
<SegmentedBreadcrumb
|
|
38
|
+
href={result.href}
|
|
39
|
+
short={true}
|
|
40
|
+
maxChars={40}
|
|
41
|
+
/>
|
|
42
|
+
</ExternalLink>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const MarineMeasureItem = (props) => {
|
|
50
|
+
const { result } = props;
|
|
51
|
+
const { appConfig } = useAppConfig();
|
|
52
|
+
const { vocab = {} } = appConfig;
|
|
53
|
+
|
|
54
|
+
const item = {
|
|
55
|
+
'@id': result.href,
|
|
56
|
+
title: (
|
|
57
|
+
<>
|
|
58
|
+
<ExternalLink href={result.href} title={result.title}>
|
|
59
|
+
{result.title}
|
|
60
|
+
{/* {result.isNew && <Label className="new-item">New</Label>} */}
|
|
61
|
+
{result.isExpired && (
|
|
62
|
+
<Label className="archived-item">Archived</Label>
|
|
63
|
+
)}
|
|
64
|
+
</ExternalLink>
|
|
65
|
+
</>
|
|
66
|
+
),
|
|
67
|
+
// meta: <ContentClusters clusters={clusters} item={result} />,
|
|
68
|
+
description: props.children ? props.children : <ResultContext {...props} />,
|
|
69
|
+
preview_image_url: result.hasImage ? result.thumbUrl : undefined,
|
|
70
|
+
extra: <ExtraContent result={result} vocab={vocab} />,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const itemModel = {
|
|
74
|
+
hasImage: result.hasImage,
|
|
75
|
+
hasDescription: true,
|
|
76
|
+
imageOnRightSide: true,
|
|
77
|
+
'@type': 'searchItem',
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return <UniversalCard item={item} itemModel={itemModel} />;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default MarineMeasureItem;
|