@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.
Files changed (154) hide show
  1. package/.coverage.babel.config.js +9 -0
  2. package/.eslintrc.js +65 -0
  3. package/.husky/pre-commit +2 -0
  4. package/.release-it.json +17 -0
  5. package/CHANGELOG.md +5 -0
  6. package/DEVELOP.md +53 -0
  7. package/DEVELOP.md.tpl +106 -0
  8. package/Jenkinsfile.tpl +416 -0
  9. package/LICENSE.md +9 -0
  10. package/Makefile.tpl +165 -0
  11. package/README.md +172 -0
  12. package/README.md.tpl +93 -0
  13. package/RELEASE.md +74 -0
  14. package/babel.config.js +17 -0
  15. package/bootstrap +41 -0
  16. package/cypress.config.js +24 -0
  17. package/docker-compose.yml +32 -0
  18. package/jest-addon.config.js +35 -0
  19. package/jest-addon.config.js.tpl +51 -0
  20. package/jest.setup.js +65 -0
  21. package/locales/de/LC_MESSAGES/volto.po +14 -0
  22. package/locales/en/LC_MESSAGES/volto.po +14 -0
  23. package/locales/it/LC_MESSAGES/volto.po +14 -0
  24. package/locales/ro/LC_MESSAGES/volto.po +14 -0
  25. package/locales/volto.pot +16 -0
  26. package/package.json +68 -0
  27. package/package.json.tpl +70 -0
  28. package/razzle.extend.js +29 -0
  29. package/src/components/Blocks/CustomBlockTemplates/customBlockTemplates.js +25 -0
  30. package/src/components/Blocks/MsfdDataExplorerBlock/Edit.jsx +29 -0
  31. package/src/components/Blocks/MsfdDataExplorerBlock/View.jsx +105 -0
  32. package/src/components/Blocks/MsfdDataExplorerBlock/index.js +23 -0
  33. package/src/components/Blocks/MsfdDataExplorerBlock/schema.jsx +30 -0
  34. package/src/components/Result/MarineMeasureItem.jsx +83 -0
  35. package/src/components/Widgets/MeasureViewWidget.jsx +233 -0
  36. package/src/components/Widgets/String.jsx +15 -0
  37. package/src/components/Widgets/TextAlign.jsx +41 -0
  38. package/src/components/Widgets/measure.css +101 -0
  39. package/src/components/index.js +15 -0
  40. package/src/components/theme/AppExtras/PrintPage/PrintPage.jsx +61 -0
  41. package/src/components/theme/AppExtras/PrintPage/css/printpage.less +29 -0
  42. package/src/components/theme/AppExtras/PrintPage/index.js +3 -0
  43. package/src/components/theme/AppExtras/ScrollToTop/ScrollToTop.jsx +61 -0
  44. package/src/components/theme/AppExtras/ScrollToTop/css/scrolltop.less +19 -0
  45. package/src/components/theme/AppExtras/ScrollToTop/index.js +3 -0
  46. package/src/components/theme/AppExtras/index.js +18 -0
  47. package/src/components/theme/DatabaseItemView/DatabaseItemView.jsx +39 -0
  48. package/src/components/theme/DatabaseItemView/style.less +87 -0
  49. package/src/components/theme/Header/HeroSection.jsx +45 -0
  50. package/src/components/theme/Header/StickyHeader.jsx +51 -0
  51. package/src/components/theme/Header/less/globals.less +18 -0
  52. package/src/components/theme/Header/less/herosection.less +64 -0
  53. package/src/components/theme/Header/less/herosection.variables +18 -0
  54. package/src/components/theme/ItemMetadata/ItemMetadata.jsx +217 -0
  55. package/src/components/theme/ItemMetadata/ItemMetadataSnippet.jsx +69 -0
  56. package/src/components/theme/ItemMetadata/ItemTitle.jsx +29 -0
  57. package/src/components/theme/MetadataListingView/MapPreview.jsx +105 -0
  58. package/src/components/theme/MetadataListingView/MetadataHeader.jsx +66 -0
  59. package/src/components/theme/MetadataListingView/MetadataListingView.jsx +36 -0
  60. package/src/components/theme/MetadataListingView/style.less +219 -0
  61. package/src/components/theme/SimpleListingView/SimpleListingView.jsx +97 -0
  62. package/src/components/theme/SimpleListingView/style.less +33 -0
  63. package/src/components/theme/Tableau/TableauDownload.jsx +86 -0
  64. package/src/components/theme/Tableau/TableauFullscreen.jsx +78 -0
  65. package/src/components/theme/Tableau/TableauShare.jsx +128 -0
  66. package/src/components/theme/View/FullwidthView.jsx +102 -0
  67. package/src/components/theme/View/HeroSectionView.jsx +125 -0
  68. package/src/constants/ActionTypes.js +12 -0
  69. package/src/constants/measureFields.js +56 -0
  70. package/src/customizations/@eeacms/volto-block-style/StyleWrapper/schema.js +217 -0
  71. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +358 -0
  72. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +403 -0
  73. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +131 -0
  74. package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/Logo.jsx +32 -0
  75. package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/marine_logo.svg +63 -0
  76. package/src/customizations/volto/components/manage/Contents/ContentsBreadcrumbs.jsx +81 -0
  77. package/src/customizations/volto/components/manage/Contents/README.md +1 -0
  78. package/src/customizations/volto/components/manage/Toolbar/PersonalTools.jsx +205 -0
  79. package/src/customizations/volto/components/manage/Toolbar/Toolbar.jsx +624 -0
  80. package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.jsx +49 -0
  81. package/src/customizations/volto/components/theme/Breadcrumbs/README.md +1 -0
  82. package/src/customizations/volto/components/theme/Header/Header.jsx +272 -0
  83. package/src/helpers/index.js +2 -0
  84. package/src/helpers/useCopyToClipboard.js +25 -0
  85. package/src/helpers/useOutsideClick.js +20 -0
  86. package/src/icons/arrow.svg +3 -0
  87. package/src/icons/basket.svg +3 -0
  88. package/src/icons/newspaper.svg +3 -0
  89. package/src/icons/popup.svg +3 -0
  90. package/src/icons/search.svg +3 -0
  91. package/src/icons/star-full.svg +3 -0
  92. package/src/icons/user.svg +3 -0
  93. package/src/index.js +466 -0
  94. package/src/reducers/breadcrumb/breadcrumb.js +59 -0
  95. package/src/reducers/index.js +2 -0
  96. package/src/reducers/localnavigation/localnavigation.js +69 -0
  97. package/src/search/config.js +98 -0
  98. package/src/search/facets.js +85 -0
  99. package/src/search/index.js +48 -0
  100. package/src/search/views.js +15 -0
  101. package/src/slate-styles.less +43 -0
  102. package/src/static/bise_logo.svg +1 -0
  103. package/src/static/cca_logo.svg +20 -0
  104. package/src/static/ec_logo.svg +343 -0
  105. package/src/static/ec_logo_white.svg +10 -0
  106. package/src/static/eea_logo.svg +14 -0
  107. package/src/static/footer-fishes.svg +21 -0
  108. package/src/static/forest_logo.svg +30 -0
  109. package/src/static/freshwater_logo.svg +12 -0
  110. package/src/static/marine_logo.svg +63 -0
  111. package/src/static/marine_logo_white.svg +44 -0
  112. package/src/utils.js +38 -0
  113. package/theme/assets/fonts/Poppins/Poppins-Bold.ttf +0 -0
  114. package/theme/assets/fonts/Poppins/Poppins-Bold.woff +0 -0
  115. package/theme/assets/fonts/Poppins/Poppins-Bold.woff2 +0 -0
  116. package/theme/assets/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  117. package/theme/assets/fonts/Poppins/Poppins-Light.ttf +0 -0
  118. package/theme/assets/fonts/Poppins/Poppins-Light.woff +0 -0
  119. package/theme/assets/fonts/Poppins/Poppins-Light.woff2 +0 -0
  120. package/theme/assets/fonts/Poppins/Poppins-Regular.ttf +0 -0
  121. package/theme/assets/fonts/Poppins/Poppins-Regular.woff +0 -0
  122. package/theme/assets/fonts/Poppins/Poppins-Regular.woff2 +0 -0
  123. package/theme/assets/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  124. package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff +0 -0
  125. package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff2 +0 -0
  126. package/theme/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
  127. package/theme/assets/fonts/Roboto/Roboto-Light.woff +0 -0
  128. package/theme/assets/fonts/Roboto/Roboto-Light.woff2 +0 -0
  129. package/theme/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
  130. package/theme/assets/fonts/Roboto/Roboto-Medium.woff +0 -0
  131. package/theme/assets/fonts/Roboto/Roboto-Medium.woff2 +0 -0
  132. package/theme/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
  133. package/theme/assets/fonts/Roboto/Roboto-Regular.woff +0 -0
  134. package/theme/assets/fonts/Roboto/Roboto-Regular.woff2 +0 -0
  135. package/theme/assets/images/Footer/ec_logo.svg +10 -0
  136. package/theme/assets/images/Header/climate-adapt-logo-1.svg +20 -0
  137. package/theme/assets/images/Header/climate-adapt-logo.svg +22 -0
  138. package/theme/assets/images/spinner.svg +1 -0
  139. package/theme/collections/table.variables +17 -0
  140. package/theme/elements/button.overrides +22 -0
  141. package/theme/extras/banner.variables +5 -0
  142. package/theme/extras/contextNavigation.overrides +60 -0
  143. package/theme/extras/contextNavigation.variables +32 -0
  144. package/theme/extras/footer.variables +6 -0
  145. package/theme/extras/header.overrides +20 -0
  146. package/theme/extras/header.variables +7 -0
  147. package/theme/extras/hero.overrides +4 -0
  148. package/theme/extras/inpageNavigation.variables +5 -0
  149. package/theme/extras/mixins.less +8 -0
  150. package/theme/globals/site.overrides +349 -0
  151. package/theme/globals/site.variables +997 -0
  152. package/theme/theme.config +136 -0
  153. package/theme/tokens/colors.less +9 -0
  154. package/theme/tokens/tokens.less +1 -0
@@ -0,0 +1,51 @@
1
+ require('dotenv').config({ path: __dirname + '/.env' })
2
+
3
+ module.exports = {
4
+ testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
5
+ collectCoverageFrom: [
6
+ 'src/addons/**/src/**/*.{js,jsx,ts,tsx}',
7
+ '!src/**/*.d.ts',
8
+ ],
9
+ moduleNameMapper: {
10
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
11
+ '@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
12
+ '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
13
+ '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
14
+ '@package/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
15
+ '@root/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
16
+ '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
17
+ '@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
18
+ '@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
19
+ '@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
20
+ '@plone/volto-slate$':
21
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
22
+ '@plone/volto-slate/(.*)$':
23
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
24
+ '~/(.*)$': '<rootDir>/src/$1',
25
+ 'load-volto-addons':
26
+ '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
27
+ },
28
+ transformIgnorePatterns: [
29
+ '/node_modules/(?!(@plone|@root|@package|@eeacms)/).*/',
30
+ ],
31
+ transform: {
32
+ '^.+\\.js(x)?$': 'babel-jest',
33
+ '^.+\\.ts(x)?$': 'babel-jest',
34
+ '^.+\\.(png)$': 'jest-file',
35
+ '^.+\\.(jpg)$': 'jest-file',
36
+ '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
37
+ },
38
+ coverageThreshold: {
39
+ global: {
40
+ branches: 5,
41
+ functions: 5,
42
+ lines: 5,
43
+ statements: 5,
44
+ },
45
+ },
46
+ ...(process.env.JEST_USE_SETUP === 'ON' && {
47
+ setupFilesAfterEnv: [
48
+ '<rootDir>/node_modules/@eeacms/<%= name %>/jest.setup.js',
49
+ ],
50
+ }),
51
+ }
package/jest.setup.js ADDED
@@ -0,0 +1,65 @@
1
+ import { jest } from '@jest/globals';
2
+ import configureStore from 'redux-mock-store';
3
+ import thunk from 'redux-thunk';
4
+ import { blocksConfig } from '@plone/volto/config/Blocks';
5
+ import installSlate from '@plone/volto-slate/index';
6
+
7
+ var mockSemanticComponents = jest.requireActual('semantic-ui-react');
8
+ var mockComponents = jest.requireActual('@plone/volto/components');
9
+ var config = jest.requireActual('@plone/volto/registry').default;
10
+
11
+ config.blocks.blocksConfig = {
12
+ ...blocksConfig,
13
+ ...config.blocks.blocksConfig,
14
+ };
15
+
16
+ jest.doMock('semantic-ui-react', () => ({
17
+ __esModule: true,
18
+ ...mockSemanticComponents,
19
+ Popup: ({ content, trigger }) => {
20
+ return (
21
+ <div className="popup">
22
+ <div className="trigger">{trigger}</div>
23
+ <div className="content">{content}</div>
24
+ </div>
25
+ );
26
+ },
27
+ }));
28
+
29
+ jest.doMock('@plone/volto/components', () => {
30
+ return {
31
+ __esModule: true,
32
+ ...mockComponents,
33
+ SidebarPortal: ({ children }) => <div id="sidebar">{children}</div>,
34
+ };
35
+ });
36
+
37
+ jest.doMock('@plone/volto/registry', () =>
38
+ [installSlate].reduce((acc, apply) => apply(acc), config),
39
+ );
40
+
41
+ const mockStore = configureStore([thunk]);
42
+
43
+ global.fetch = jest.fn(() =>
44
+ Promise.resolve({
45
+ json: () => Promise.resolve({}),
46
+ }),
47
+ );
48
+
49
+ global.store = mockStore({
50
+ intl: {
51
+ locale: 'en',
52
+ messages: {},
53
+ formatMessage: jest.fn(),
54
+ },
55
+ content: {
56
+ create: {},
57
+ subrequests: [],
58
+ },
59
+ connected_data_parameters: {},
60
+ screen: {
61
+ page: {
62
+ width: 768,
63
+ },
64
+ },
65
+ });
@@ -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,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,68 @@
1
+ {
2
+ "name": "@eeacms/volto-marine-policy",
3
+ "version": "1.0.0",
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
+ },
53
+ "scripts": {
54
+ "release": "release-it",
55
+ "release-major-beta": "release-it major --preRelease=beta",
56
+ "release-beta": "release-it --preRelease=beta",
57
+ "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
58
+ "stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
59
+ "stylelint:overrides": "../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
60
+ "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
61
+ "prettier": "../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'",
62
+ "prettier:fix": "../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'",
63
+ "lint": "../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'",
64
+ "lint:fix": "../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'",
65
+ "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",
66
+ "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"
67
+ }
68
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "<%= addonName %>",
3
+ "version": "0.1.0",
4
+ "description": "<%= addonName %>: 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/<%= name %>",
9
+ "keywords": [
10
+ "volto-addon",
11
+ "volto",
12
+ "plone",
13
+ "react"
14
+ ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git@github.com:eea/<%= name %>.git"
18
+ },
19
+ "dependencies": {},
20
+ "devDependencies": {
21
+ "@plone/scripts": "*",
22
+ "@cypress/code-coverage": "^3.10.0",
23
+ "cypress-fail-fast": "^5.0.1",
24
+ "babel-plugin-transform-class-properties": "^6.24.1",
25
+ "husky": "^8.0.3",
26
+ "lint-staged": "^14.0.1",
27
+ "md5": "^2.3.0"
28
+ },
29
+ "lint-staged": {
30
+ "src/**/*.{js,jsx,ts,tsx,json}": [
31
+ "make lint-fix",
32
+ "make prettier-fix"
33
+ ],
34
+ "src/**/*.{jsx}": [
35
+ "make i18n"
36
+ ],
37
+ "theme/**/*.{css,less}": [
38
+ "make stylelint-fix"
39
+ ],
40
+ "src/**/*.{css,less}": [
41
+ "make stylelint-fix"
42
+ ],
43
+ "theme/**/*.overrides": [
44
+ "make stylelint-fix"
45
+ ],
46
+ "src/**/*.overrides": [
47
+ "make stylelint-fix"
48
+ ]
49
+ },
50
+ "scripts": {
51
+ "prepare": "husky install",
52
+ "release": "release-it",
53
+ "release-major-beta": "release-it major --preRelease=beta",
54
+ "release-beta": "release-it --preRelease=beta",
55
+ "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
56
+ "test": "make test",
57
+ "test:fix": "make test-update",
58
+ "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
59
+ "stylelint": "make stylelint",
60
+ "stylelint:overrides": "make stylelint-overrides",
61
+ "stylelint:fix": "make stylelint-fix",
62
+ "prettier": "make prettier",
63
+ "prettier:fix": "make prettier-fix",
64
+ "lint": "make lint",
65
+ "lint:fix": "make lint-fix",
66
+ "i18n": "make i18n",
67
+ "cypress:run": "make cypress-run",
68
+ "cypress:open": "make cypress-open"
69
+ }
70
+ }
@@ -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;