@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.
Files changed (150) 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/LICENSE.md +9 -0
  8. package/README.md +172 -0
  9. package/RELEASE.md +74 -0
  10. package/babel.config.js +17 -0
  11. package/bootstrap +41 -0
  12. package/cypress.config.js +24 -0
  13. package/docker-compose.yml +32 -0
  14. package/jest-addon.config.js +50 -0
  15. package/jest.setup.js +65 -0
  16. package/locales/de/LC_MESSAGES/volto.po +14 -0
  17. package/locales/en/LC_MESSAGES/volto.po +14 -0
  18. package/locales/it/LC_MESSAGES/volto.po +14 -0
  19. package/locales/ro/LC_MESSAGES/volto.po +14 -0
  20. package/locales/volto.pot +16 -0
  21. package/package.json +69 -0
  22. package/razzle.extend.js +29 -0
  23. package/src/components/Blocks/CustomBlockTemplates/customBlockTemplates.js +25 -0
  24. package/src/components/Blocks/MsfdDataExplorerBlock/Edit.jsx +29 -0
  25. package/src/components/Blocks/MsfdDataExplorerBlock/View.jsx +105 -0
  26. package/src/components/Blocks/MsfdDataExplorerBlock/index.js +23 -0
  27. package/src/components/Blocks/MsfdDataExplorerBlock/schema.jsx +30 -0
  28. package/src/components/Result/MarineMeasureItem.jsx +83 -0
  29. package/src/components/Widgets/MeasureViewWidget.jsx +233 -0
  30. package/src/components/Widgets/String.jsx +15 -0
  31. package/src/components/Widgets/TextAlign.jsx +41 -0
  32. package/src/components/Widgets/measure.css +101 -0
  33. package/src/components/index.js +15 -0
  34. package/src/components/theme/AppExtras/PrintPage/PrintPage.jsx +61 -0
  35. package/src/components/theme/AppExtras/PrintPage/css/printpage.less +29 -0
  36. package/src/components/theme/AppExtras/PrintPage/index.js +3 -0
  37. package/src/components/theme/AppExtras/ScrollToTop/ScrollToTop.jsx +61 -0
  38. package/src/components/theme/AppExtras/ScrollToTop/css/scrolltop.less +19 -0
  39. package/src/components/theme/AppExtras/ScrollToTop/index.js +3 -0
  40. package/src/components/theme/AppExtras/index.js +18 -0
  41. package/src/components/theme/DatabaseItemView/DatabaseItemView.jsx +39 -0
  42. package/src/components/theme/DatabaseItemView/style.less +87 -0
  43. package/src/components/theme/Header/HeroSection.jsx +45 -0
  44. package/src/components/theme/Header/StickyHeader.jsx +51 -0
  45. package/src/components/theme/Header/less/globals.less +18 -0
  46. package/src/components/theme/Header/less/herosection.less +64 -0
  47. package/src/components/theme/Header/less/herosection.variables +18 -0
  48. package/src/components/theme/ItemMetadata/ItemMetadata.jsx +217 -0
  49. package/src/components/theme/ItemMetadata/ItemMetadataSnippet.jsx +69 -0
  50. package/src/components/theme/ItemMetadata/ItemTitle.jsx +29 -0
  51. package/src/components/theme/MetadataListingView/MapPreview.jsx +105 -0
  52. package/src/components/theme/MetadataListingView/MetadataHeader.jsx +66 -0
  53. package/src/components/theme/MetadataListingView/MetadataListingView.jsx +36 -0
  54. package/src/components/theme/MetadataListingView/style.less +219 -0
  55. package/src/components/theme/SimpleListingView/SimpleListingView.jsx +97 -0
  56. package/src/components/theme/SimpleListingView/style.less +33 -0
  57. package/src/components/theme/Tableau/TableauDownload.jsx +86 -0
  58. package/src/components/theme/Tableau/TableauFullscreen.jsx +78 -0
  59. package/src/components/theme/Tableau/TableauShare.jsx +128 -0
  60. package/src/components/theme/View/FullwidthView.jsx +102 -0
  61. package/src/components/theme/View/HeroSectionView.jsx +125 -0
  62. package/src/constants/ActionTypes.js +12 -0
  63. package/src/constants/measureFields.js +56 -0
  64. package/src/customizations/@eeacms/volto-block-style/StyleWrapper/schema.js +217 -0
  65. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +358 -0
  66. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +403 -0
  67. package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +131 -0
  68. package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/Logo.jsx +32 -0
  69. package/src/customizations/@eeacms/volto-eea-design-system/ui/Logo/marine_logo.svg +63 -0
  70. package/src/customizations/volto/components/manage/Contents/ContentsBreadcrumbs.jsx +81 -0
  71. package/src/customizations/volto/components/manage/Contents/README.md +1 -0
  72. package/src/customizations/volto/components/manage/Toolbar/PersonalTools.jsx +205 -0
  73. package/src/customizations/volto/components/manage/Toolbar/Toolbar.jsx +624 -0
  74. package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.jsx +49 -0
  75. package/src/customizations/volto/components/theme/Breadcrumbs/README.md +1 -0
  76. package/src/customizations/volto/components/theme/Header/Header.jsx +272 -0
  77. package/src/helpers/index.js +2 -0
  78. package/src/helpers/useCopyToClipboard.js +25 -0
  79. package/src/helpers/useOutsideClick.js +20 -0
  80. package/src/icons/arrow.svg +3 -0
  81. package/src/icons/basket.svg +3 -0
  82. package/src/icons/newspaper.svg +3 -0
  83. package/src/icons/popup.svg +3 -0
  84. package/src/icons/search.svg +3 -0
  85. package/src/icons/star-full.svg +3 -0
  86. package/src/icons/user.svg +3 -0
  87. package/src/index.js +467 -0
  88. package/src/reducers/breadcrumb/breadcrumb.js +59 -0
  89. package/src/reducers/index.js +2 -0
  90. package/src/reducers/localnavigation/localnavigation.js +69 -0
  91. package/src/search/config.js +93 -0
  92. package/src/search/facets.js +85 -0
  93. package/src/search/index.js +48 -0
  94. package/src/search/views.js +15 -0
  95. package/src/slate-styles.less +43 -0
  96. package/src/static/bise_logo.svg +1 -0
  97. package/src/static/cca_logo.svg +20 -0
  98. package/src/static/ec_logo.svg +343 -0
  99. package/src/static/ec_logo_white.svg +10 -0
  100. package/src/static/eea_logo.svg +14 -0
  101. package/src/static/footer-fishes.svg +21 -0
  102. package/src/static/forest_logo.svg +30 -0
  103. package/src/static/freshwater_logo.svg +12 -0
  104. package/src/static/marine_logo.svg +63 -0
  105. package/src/static/marine_logo_white.svg +44 -0
  106. package/src/utils.js +38 -0
  107. package/theme/assets/fonts/Poppins/Poppins-Bold.ttf +0 -0
  108. package/theme/assets/fonts/Poppins/Poppins-Bold.woff +0 -0
  109. package/theme/assets/fonts/Poppins/Poppins-Bold.woff2 +0 -0
  110. package/theme/assets/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  111. package/theme/assets/fonts/Poppins/Poppins-Light.ttf +0 -0
  112. package/theme/assets/fonts/Poppins/Poppins-Light.woff +0 -0
  113. package/theme/assets/fonts/Poppins/Poppins-Light.woff2 +0 -0
  114. package/theme/assets/fonts/Poppins/Poppins-Regular.ttf +0 -0
  115. package/theme/assets/fonts/Poppins/Poppins-Regular.woff +0 -0
  116. package/theme/assets/fonts/Poppins/Poppins-Regular.woff2 +0 -0
  117. package/theme/assets/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  118. package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff +0 -0
  119. package/theme/assets/fonts/Poppins/Poppins-SemiBold.woff2 +0 -0
  120. package/theme/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
  121. package/theme/assets/fonts/Roboto/Roboto-Light.woff +0 -0
  122. package/theme/assets/fonts/Roboto/Roboto-Light.woff2 +0 -0
  123. package/theme/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
  124. package/theme/assets/fonts/Roboto/Roboto-Medium.woff +0 -0
  125. package/theme/assets/fonts/Roboto/Roboto-Medium.woff2 +0 -0
  126. package/theme/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
  127. package/theme/assets/fonts/Roboto/Roboto-Regular.woff +0 -0
  128. package/theme/assets/fonts/Roboto/Roboto-Regular.woff2 +0 -0
  129. package/theme/assets/images/Footer/ec_logo.svg +10 -0
  130. package/theme/assets/images/Header/climate-adapt-logo-1.svg +20 -0
  131. package/theme/assets/images/Header/climate-adapt-logo.svg +22 -0
  132. package/theme/assets/images/Header/wise-marine-logo-white.svg +143 -0
  133. package/theme/assets/images/Header/wise-marine-logo.svg +143 -0
  134. package/theme/assets/images/spinner.svg +1 -0
  135. package/theme/collections/table.variables +17 -0
  136. package/theme/elements/button.overrides +22 -0
  137. package/theme/extras/banner.variables +5 -0
  138. package/theme/extras/contextNavigation.overrides +60 -0
  139. package/theme/extras/contextNavigation.variables +32 -0
  140. package/theme/extras/footer.variables +6 -0
  141. package/theme/extras/header.overrides +20 -0
  142. package/theme/extras/header.variables +7 -0
  143. package/theme/extras/hero.overrides +4 -0
  144. package/theme/extras/inpageNavigation.variables +5 -0
  145. package/theme/extras/mixins.less +8 -0
  146. package/theme/globals/site.overrides +349 -0
  147. package/theme/globals/site.variables +997 -0
  148. package/theme/theme.config +136 -0
  149. package/theme/tokens/colors.less +9 -0
  150. package/theme/tokens/tokens.less +1 -0
package/src/index.js ADDED
@@ -0,0 +1,467 @@
1
+ import React from 'react';
2
+ import {
3
+ // HeroSectionView,
4
+ // FullwidthView,
5
+ DatabaseItemView,
6
+ MetadataListingView,
7
+ SimpleListingView,
8
+ } from './components';
9
+ // import installAppExtras from './components/theme/AppExtras';
10
+ // import HomePageView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageView';
11
+ // import HomePageInverseView from '@eeacms/volto-eea-website-theme/components/theme/Homepage/HomePageInverseView';
12
+
13
+ import installMsfdDataExplorerBlock from './components/Blocks/MsfdDataExplorerBlock';
14
+ import { breadcrumb, localnavigation } from './reducers';
15
+ import customBlockTemplates from '@eeacms/volto-marine-policy/components/Blocks/CustomBlockTemplates/customBlockTemplates';
16
+ import TextAlignWidget from './components/Widgets/TextAlign';
17
+ import './slate-styles.less';
18
+
19
+ import installSearchEngine from './search';
20
+
21
+ // import TokenWidget from '@plone/volto/components/manage/Widgets/TokenWidget';
22
+ import linkSVG from '@plone/volto/icons/link.svg';
23
+ import { makeInlineElementPlugin } from '@plone/volto-slate/elementEditor';
24
+ import { LINK } from '@plone/volto-slate/constants';
25
+ import { LinkElement } from '@plone/volto-slate/editor/plugins/AdvancedLink/render';
26
+ import { withLink } from '@plone/volto-slate/editor/plugins/AdvancedLink/extensions';
27
+ import { linkDeserializer } from '@plone/volto-slate/editor/plugins/AdvancedLink/deserialize';
28
+ import LinkEditSchema from '@plone/volto-slate/editor/plugins/AdvancedLink/schema';
29
+
30
+ import { defineMessages } from 'react-intl'; // , defineMessages
31
+
32
+ import marineLogo from '@eeacms/volto-marine-policy/../theme/assets/images/Header/wise-marine-logo.svg';
33
+ import marineLogoWhite from '@eeacms/volto-marine-policy/../theme/assets/images/Header/wise-marine-logo-white.svg';
34
+ import eeaWhiteLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/eea-logo-white.svg';
35
+ import europeanComissionLogo from '@eeacms/volto-marine-policy/static/ec_logo_white.svg';
36
+ import MeasureView from '@eeacms/volto-marine-policy/components/Widgets/MeasureViewWidget';
37
+
38
+ const available_colors = [
39
+ '#ffffff',
40
+ '#f7f3ef',
41
+ '#e3edf7',
42
+ '#002d54',
43
+ '#59d3ff',
44
+ '#2dd2b7',
45
+ '#1271e1',
46
+ '#826A6A',
47
+ '#FAD0C3',
48
+ '#F3E2AB',
49
+ '#C1E1C5',
50
+ '#BEDADC',
51
+ '#BED3F3',
52
+ '#000000',
53
+ ];
54
+
55
+ const restrictedBlocks = ['imagecards'];
56
+
57
+ const messages = defineMessages({
58
+ edit: {
59
+ id: 'Edit link',
60
+ defaultMessage: 'Edit link',
61
+ },
62
+ delete: {
63
+ id: 'Remove link',
64
+ defaultMessage: 'Remove link',
65
+ },
66
+ document_view: {
67
+ id: 'Document View',
68
+ defaultMessage: 'Document View',
69
+ },
70
+ herosection_view: {
71
+ id: 'Hero Section View',
72
+ defaultMessage: 'Hero Section View',
73
+ },
74
+ fullwidth_view: {
75
+ id: 'Full Width View',
76
+ defaultMessage: 'Full Width View',
77
+ },
78
+ });
79
+
80
+ const applyConfig = (config) => {
81
+ config.views.layoutViews = {
82
+ ...config.views.layoutViews,
83
+ // document_view: HeroSectionView,
84
+ // herosection_view: HeroSectionView,
85
+ // fullwidth_view: FullwidthView,
86
+ };
87
+ config.views.layoutViewsNamesMapping = {
88
+ ...(config.views.layoutViewsNamesMapping || {}),
89
+ document_view: 'Document View',
90
+ // herosection_view: 'Hero Section View',
91
+ // fullwidth_view: 'Full Width View',
92
+ };
93
+ config.views.contentTypesViews = {
94
+ ...config.views.contentTypesViews,
95
+ // Folder: HomePageInverseView,
96
+ // Document: HeroSectionView,
97
+ dashboard: DatabaseItemView,
98
+ dataset: DatabaseItemView,
99
+ database: DatabaseItemView,
100
+ publication_report: DatabaseItemView,
101
+ indicator: DatabaseItemView,
102
+ briefing: DatabaseItemView,
103
+ // map_interactive: DatabaseItemView,
104
+ };
105
+
106
+ config.addonReducers = {
107
+ ...(config.addonReducers || {}),
108
+ breadcrumb,
109
+ localnavigation,
110
+ };
111
+
112
+ config.widgets.widget.text_align = TextAlignWidget;
113
+ // Disabled TokenWidget for 'theme', it breaks the 'theme' field in volto-tabs-block in the 'horizontal carousel' layout
114
+ // We have a 'theme' field in the wise catalogue metadata (CatalogueMetadata)
115
+ // config.widgets.id.theme = TokenWidget;
116
+
117
+ config.blocks.groupBlocksOrder = [
118
+ ...config.blocks.groupBlocksOrder,
119
+ { id: 'marine_addons', title: 'Marine' },
120
+ ];
121
+
122
+ config.blocks = {
123
+ ...config.blocks,
124
+ blocksConfig: { ...customBlockTemplates(config) },
125
+ };
126
+
127
+ // on home contextNavigation should return false
128
+ config.blocks.blocksConfig.contextNavigation = {
129
+ ...config.blocks.blocksConfig.contextNavigation,
130
+ blockHasValue: (data) => {
131
+ return data.pathname !== '/';
132
+ },
133
+ };
134
+ config.blocks.blocksConfig.listing = {
135
+ ...config.blocks.blocksConfig.listing,
136
+ variations: [
137
+ ...config.blocks.blocksConfig.listing.variations,
138
+ {
139
+ id: 'metadata',
140
+ title: 'Metadata Listing',
141
+ template: MetadataListingView,
142
+ isDefault: false,
143
+ },
144
+ {
145
+ id: 'simple',
146
+ title: 'Simple Listing',
147
+ template: SimpleListingView,
148
+ isDefault: false,
149
+ },
150
+ ],
151
+ };
152
+
153
+ config.settings.useQuantaToolbar = false;
154
+
155
+ config.settings.apiExpanders = [
156
+ ...config.settings.apiExpanders,
157
+ {
158
+ match: '/marine',
159
+ GET_CONTENT: ['object_provides'],
160
+ },
161
+ {
162
+ match: '/marine-new',
163
+ GET_CONTENT: ['object_provides'],
164
+ },
165
+ ];
166
+
167
+ // do not expand breadcrumbs. This fixed the breadcrumbs in contents view. The hasApiExpander needs to be made
168
+ // generic to also look for nonContentRoutes.
169
+ (config.settings.apiExpanders || []).forEach((item) => {
170
+ if (item.GET_CONTENT.includes('breadcrumbs')) {
171
+ item.GET_CONTENT.splice(item.GET_CONTENT.indexOf('breadcrumbs', 1));
172
+ }
173
+ });
174
+
175
+ config.settings.navDepth = 3;
176
+
177
+ config.settings.available_colors = available_colors;
178
+
179
+ config.settings.externalRoutes = [
180
+ ...(config.settings.externalRoutes || []),
181
+ ...(config.settings.prefixPath
182
+ ? [
183
+ {
184
+ match: {
185
+ path: /\/$/,
186
+ exact: true,
187
+ strict: true,
188
+ },
189
+
190
+ url(payload) {
191
+ return payload.location.pathname;
192
+ },
193
+ },
194
+ ]
195
+ : []),
196
+ ];
197
+ config.settings.externalRoutes = [
198
+ ...(config.settings.externalRoutes || []),
199
+ {
200
+ match: {
201
+ path: '/(.*)marine(-new)?/assessment-module(.*)',
202
+ exact: false,
203
+ strict: false,
204
+ },
205
+ url(payload) {
206
+ return payload.location.pathname;
207
+ },
208
+ },
209
+ {
210
+ match: {
211
+ path:
212
+ '/(.*)marine(-new)?/countries-and-regional-seas/country-profiles(.*)',
213
+ exact: false,
214
+ strict: false,
215
+ },
216
+ url(payload) {
217
+ return payload.location.pathname;
218
+ },
219
+ },
220
+ {
221
+ match: {
222
+ path:
223
+ '/(.*)marine(-new)?/policy-and-reporting/msfd-reports-and-assessments(.*)',
224
+ exact: false,
225
+ strict: false,
226
+ },
227
+ url(payload) {
228
+ return payload.location.pathname;
229
+ },
230
+ },
231
+ {
232
+ match: {
233
+ path:
234
+ '/(.*)marine(-new)?/policy-and-reporting/reports-and-assessments(.*)',
235
+ exact: false,
236
+ strict: false,
237
+ },
238
+ url(payload) {
239
+ return payload.location.pathname;
240
+ },
241
+ },
242
+ {
243
+ match: {
244
+ path:
245
+ '/(.*)marine(-new)?/policy-and-reporting/assessment-by-country(.*)',
246
+ exact: false,
247
+ strict: false,
248
+ },
249
+ url(payload) {
250
+ return payload.location.pathname;
251
+ },
252
+ },
253
+ {
254
+ match: {
255
+ path:
256
+ '/(.*)marine(-new)?/policy-and-reporting/assessment-by-region(.*)',
257
+ exact: false,
258
+ strict: false,
259
+ },
260
+ url(payload) {
261
+ return payload.location.pathname;
262
+ },
263
+ },
264
+ ];
265
+
266
+ config.settings.pluggableStyles = [
267
+ ...(config.settings.pluggableStyles || []),
268
+ {
269
+ id: 'uiContainer',
270
+ title: 'Container',
271
+ viewComponent: (props) => {
272
+ return <div className="ui container">{props.children}</div>;
273
+ },
274
+ },
275
+ {
276
+ id: 'primary-table',
277
+ title: 'Primary table',
278
+ // previewComponent: () => (
279
+ // <Icon name={contentBoxSVG} size="88px" className="primary" />
280
+ // ),
281
+ viewComponent: (props) => {
282
+ return (
283
+ <div className="content-box primary-table">
284
+ <div className="content-box-inner">{props.children}</div>
285
+ </div>
286
+ );
287
+ },
288
+ },
289
+ ];
290
+
291
+ // restrict blocks
292
+ restrictedBlocks.forEach((block) => {
293
+ if (config.blocks.blocksConfig[block]) {
294
+ config.blocks.blocksConfig[block].restricted = true;
295
+ }
296
+ });
297
+
298
+ // mega menu layout settings
299
+ config.settings.menuItemsLayouts = {
300
+ ...config.settings.menuItemsLayouts,
301
+ '/marine/countries-and-regional-seas': {
302
+ menuItemColumns: ['eight wide column', 'four wide column'],
303
+ menuItemChildrenListColumns: [5, 1],
304
+ appendExtraMenuItemsToLastColumn: true,
305
+ hideChildrenFromNavigation: false,
306
+ },
307
+ '/marine/europe-seas': {
308
+ // menuItemColumns: [
309
+ // 'three wide column',
310
+ // 'three wide column',
311
+ // 'three wide column',
312
+ // // 'three wide column',
313
+ // // 'three wide column',
314
+ // ],
315
+ menuItemChildrenListColumns: [1, 1, 1],
316
+ appendExtraMenuItemsToLastColumn: false,
317
+ hideChildrenFromNavigation: false,
318
+ },
319
+ '/marine/resources': {
320
+ // menuItemColumns: [
321
+ // 'three wide column',
322
+ // 'three wide column',
323
+ // 'three wide column',
324
+ // // 'three wide column',
325
+ // // 'three wide column',
326
+ // ],
327
+ menuItemChildrenListColumns: [1, 1, 1],
328
+ appendExtraMenuItemsToLastColumn: false,
329
+ hideChildrenFromNavigation: false,
330
+ },
331
+ };
332
+
333
+ config.settings.slate.styleMenu = config.settings.slate.styleMenu || {};
334
+ config.settings.slate.styleMenu.inlineStyles = [
335
+ ...(config.settings.slate.styleMenu?.inlineStyles || []),
336
+ { cssClass: 'h1', label: 'H1 36px' },
337
+ { cssClass: 'h2', label: 'H2 30px' },
338
+ { cssClass: 'h3', label: 'H3 24px' },
339
+ { cssClass: 'h4', label: 'H4 18px' },
340
+ { cssClass: 'h5', label: 'H5 14px' },
341
+ { cssClass: 'p-text', label: 'Paragraph 18px' },
342
+ { cssClass: 'poppins-regular', label: 'Poppins Regular' },
343
+ { cssClass: 'poppins-light', label: 'Poppins Light' },
344
+ { cssClass: 'poppins-bold', label: 'Poppins Bold' },
345
+ ];
346
+
347
+ // EEA customizations
348
+ config.settings.eea.websiteTitle = 'Wise - Marine';
349
+ config.settings.eea = {
350
+ ...(config.settings.eea || {}),
351
+ headerOpts: {
352
+ ...(config.settings.eea?.headerOpts || {}),
353
+ logo: marineLogo,
354
+ logoWhite: marineLogoWhite,
355
+ },
356
+ headerSearchBox: [
357
+ {
358
+ isDefault: true,
359
+ path: '/marine/advanced-search',
360
+ placeholder: 'Search Marine...',
361
+ description:
362
+ 'Looking for more information? Try searching the full EEA website content',
363
+ buttonTitle: 'Go to advanced search',
364
+ buttonUrl: 'https://www.eea.europa.eu/en/advanced-search',
365
+ },
366
+ ],
367
+ footerOpts: {
368
+ ...(config.settings.eea?.footerOpts || {}),
369
+ logosHeader: 'Managed by',
370
+ // description:
371
+ // 'WISE - Marine is a gateway to information on European marine issues in support of ecosystem based management and ocean governance',
372
+ managedBy: [
373
+ {
374
+ link: 'https://www.eea.europa.eu/',
375
+ src: eeaWhiteLogo,
376
+ alt: 'EEA Logo',
377
+ className: 'site logo',
378
+ columnSize: {
379
+ mobile: 6,
380
+ tablet: 12,
381
+ computer: 4,
382
+ },
383
+ },
384
+ {
385
+ link: 'https://commission.europa.eu/',
386
+ src: europeanComissionLogo,
387
+ alt: 'European Commission Logo',
388
+ className: 'ec logo',
389
+ columnSize: {
390
+ mobile: 6,
391
+ tablet: 12,
392
+ computer: 4,
393
+ },
394
+ },
395
+ ],
396
+ social: [],
397
+ actions: [
398
+ {
399
+ url: '/sitemap',
400
+ title: 'Sitemap',
401
+ },
402
+ {
403
+ url: '/#legal-notice',
404
+ title: 'Privacy statement',
405
+ },
406
+ {
407
+ url: '/marine/login',
408
+ title: 'Login',
409
+ },
410
+ ],
411
+
412
+ contacts: [
413
+ // {
414
+ // icon: 'comment outline',
415
+ // text: 'About',
416
+ // link: '/marine/wise-marine',
417
+ // children: [],
418
+ // },
419
+ // {
420
+ // icon: 'comment outline',
421
+ // text: 'Contact',
422
+ // link: 'mailto:WISE@eea.europa.eu',
423
+ // },
424
+ ],
425
+ },
426
+ organisationName: 'Marine Water Information System for Europe',
427
+ };
428
+
429
+ // SPMeasure View widget
430
+ config.views.contentTypesViews.spmeasure = MeasureView;
431
+
432
+ //advancedlink is currently not working properly/not recognized in fise, so we add it to config manually
433
+ const { slate } = config.settings;
434
+
435
+ slate.toolbarButtons = [...(slate.toolbarButtons || []), LINK];
436
+ slate.expandedToolbarButtons = [
437
+ ...(slate.expandedToolbarButtons || []),
438
+ LINK,
439
+ ];
440
+
441
+ slate.htmlTagsToSlate.A = linkDeserializer;
442
+
443
+ const opts = {
444
+ title: 'Link',
445
+ pluginId: LINK,
446
+ elementType: LINK,
447
+ element: LinkElement,
448
+ isInlineElement: true,
449
+ editSchema: LinkEditSchema,
450
+ extensions: [withLink],
451
+ hasValue: (formData) => !!formData.link,
452
+ toolbarButtonIcon: linkSVG,
453
+ messages,
454
+ };
455
+
456
+ const [installLinkEditor] = makeInlineElementPlugin(opts);
457
+ config = installLinkEditor(config);
458
+
459
+ const final = [installMsfdDataExplorerBlock, installSearchEngine].reduce(
460
+ (acc, apply) => apply(acc),
461
+ config,
462
+ );
463
+
464
+ return final;
465
+ };
466
+
467
+ export default applyConfig;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Breadcrumbs reducer.
3
+ * @module reducers/breadcrumbs/breadcrumbs
4
+ */
5
+
6
+ import { map } from 'lodash';
7
+ import { flattenToAppURL } from '@plone/volto/helpers';
8
+
9
+ import { GET_BREADCRUMBS } from '@plone/volto/constants/ActionTypes';
10
+
11
+ const initialState = {
12
+ error: null,
13
+ items: [],
14
+ root: null,
15
+ loaded: false,
16
+ loading: false,
17
+ };
18
+
19
+ /**
20
+ * Breadcrumbs reducer.
21
+ * @function breadcrumbs
22
+ * @param {Object} state Current state.
23
+ * @param {Object} action Action to be handled.
24
+ * @returns {Object} New state.
25
+ */
26
+ export default function breadcrumb(state = initialState, action = {}) {
27
+ switch (action.type) {
28
+ case `${GET_BREADCRUMBS}_PENDING`:
29
+ return {
30
+ ...state,
31
+ error: null,
32
+ loaded: false,
33
+ loading: true,
34
+ };
35
+ case `${GET_BREADCRUMBS}_SUCCESS`:
36
+ return {
37
+ ...state,
38
+ error: null,
39
+ items: map(action.result.items, (item) => ({
40
+ title: item.title,
41
+ url: flattenToAppURL(item['@id']),
42
+ review_state: item.review_state,
43
+ })),
44
+ root: flattenToAppURL(action.result.root),
45
+ loaded: true,
46
+ loading: false,
47
+ };
48
+ case `${GET_BREADCRUMBS}_FAIL`:
49
+ return {
50
+ ...state,
51
+ error: action.error,
52
+ items: [],
53
+ loaded: false,
54
+ loading: false,
55
+ };
56
+ default:
57
+ return state;
58
+ }
59
+ }
@@ -0,0 +1,2 @@
1
+ export breadcrumb from './breadcrumb/breadcrumb';
2
+ export localnavigation from './localnavigation/localnavigation';
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Navigation reducer.
3
+ * @module reducers/navigation/navigation
4
+ */
5
+
6
+ import { map } from 'lodash';
7
+ import { flattenToAppURL } from '@plone/volto/helpers';
8
+
9
+ import { GET_NAVIGATION } from '@plone/volto/constants/ActionTypes';
10
+
11
+ const initialState = {
12
+ error: null,
13
+ items: [],
14
+ loaded: false,
15
+ loading: false,
16
+ };
17
+
18
+ /**
19
+ * Recursive function that process the items returned by the navigation
20
+ * endpoint
21
+ * @function getRecursiveItems
22
+ * @param {array} items The items inside a navigation response.
23
+ * @returns {*} The navigation items object (recursive)
24
+ */
25
+ function getRecursiveItems(items) {
26
+ return map(items, (item) => ({
27
+ title: item.title,
28
+ url: flattenToAppURL(item['@id']),
29
+ ...(item.items && { items: getRecursiveItems(item.items) }),
30
+ review_state: item.review_state,
31
+ }));
32
+ }
33
+
34
+ /**
35
+ * Navigation reducer.
36
+ * @function navigation
37
+ * @param {Object} state Current state.
38
+ * @param {Object} action Action to be handled.
39
+ * @returns {Object} New state.
40
+ */
41
+ export default function localnavigation(state = initialState, action = {}) {
42
+ switch (action.type) {
43
+ case `${GET_NAVIGATION}_PENDING`:
44
+ return {
45
+ ...state,
46
+ error: null,
47
+ loaded: false,
48
+ loading: true,
49
+ };
50
+ case `${GET_NAVIGATION}_SUCCESS`:
51
+ return {
52
+ ...state,
53
+ error: null,
54
+ items: getRecursiveItems(action.result.items),
55
+ loaded: true,
56
+ loading: false,
57
+ };
58
+ case `${GET_NAVIGATION}_FAIL`:
59
+ return {
60
+ ...state,
61
+ error: action.error,
62
+ items: [],
63
+ loaded: false,
64
+ loading: false,
65
+ };
66
+ default:
67
+ return state;
68
+ }
69
+ }
@@ -0,0 +1,93 @@
1
+ import { mergeConfig } from '@eeacms/search';
2
+ import facets from './facets';
3
+ import views from './views';
4
+ import { build_runtime_mappings } from '@eeacms/volto-globalsearch/utils';
5
+
6
+ const getClientProxyAddress = () => {
7
+ const url = new URL(window.location);
8
+ url.pathname = '';
9
+ url.search = '';
10
+ return url.toString();
11
+ };
12
+
13
+ export const clusters = {
14
+ name: 'op_cluster',
15
+ field: 'objectProvides',
16
+ clusters: [
17
+ {
18
+ name: 'Maps and Charts',
19
+ values: ['Map (interactive)', 'Map (simple)', 'Chart (interactive)'],
20
+ defaultResultView: 'horizontalCard',
21
+ },
22
+ {
23
+ name: 'Dashboards',
24
+ values: ['Dashboard'],
25
+ defaultResultView: 'horizontalCard',
26
+ },
27
+ {
28
+ name: 'Web pages',
29
+ values: ['Webpage'],
30
+ defaultResultView: 'horizontalCard',
31
+ },
32
+ {
33
+ name: 'Country factsheet',
34
+ values: ['Country fact sheet'],
35
+ defaultResultView: 'horizontalCard',
36
+ },
37
+ {
38
+ name: 'Others',
39
+ values: [
40
+ 'Glossary term',
41
+ 'Case study',
42
+ 'Measure',
43
+ 'Shipping and Ports Measure',
44
+ ],
45
+ defaultResultView: 'horizontalCard',
46
+ },
47
+ ],
48
+ };
49
+
50
+ const marineMeasureSearchConfig = {
51
+ title: 'Marine measure search',
52
+ ...facets,
53
+ ...views,
54
+ };
55
+
56
+ export default function install(config) {
57
+ const envConfig = process.env.RAZZLE_ENV_CONFIG
58
+ ? JSON.parse(process.env.RAZZLE_ENV_CONFIG)
59
+ : marineMeasureSearchConfig;
60
+
61
+ const pjson = require('../../package.json');
62
+ envConfig.app_name = pjson.name;
63
+ envConfig.app_version = pjson.version;
64
+
65
+ config.searchui.marinemeasure = {
66
+ ...mergeConfig(envConfig, config.searchui.globalsearch),
67
+ elastic_index: '_es/marinemeasure',
68
+ index_name: 'wisetest_searchui',
69
+ host: process.env.RAZZLE_ES_PROXY_ADDR || 'http://localhost:3000',
70
+ runtime_mappings: build_runtime_mappings(clusters),
71
+ };
72
+
73
+ config.searchui.marinemeasure.facets = envConfig.facets;
74
+
75
+ config.searchui.marinemeasure.contentSectionsParams = {
76
+ enable: true,
77
+ sectionFacetsField: 'op_cluster',
78
+ sections: clusters.clusters,
79
+ clusterMapping: Object.assign(
80
+ {},
81
+ ...clusters.clusters.map(({ name, values }) =>
82
+ Object.assign({}, ...values.map((v) => ({ [v]: name }))),
83
+ ),
84
+ ),
85
+ };
86
+
87
+ if (typeof window !== 'undefined') {
88
+ config.searchui.marinemeasure.host =
89
+ process.env.RAZZLE_ES_PROXY_ADDR || getClientProxyAddress();
90
+ }
91
+
92
+ return config;
93
+ }