@eeacms/volto-cca-policy 0.2.42 → 0.2.44

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/CHANGELOG.md CHANGED
@@ -4,6 +4,51 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [0.2.44](https://github.com/eea/volto-cca-policy/compare/0.2.43...0.2.44) - 20 June 2024
8
+
9
+ #### :nail_care: Enhancements
10
+
11
+ - change(block): RAST svg styling [kreafox - [`da47397`](https://github.com/eea/volto-cca-policy/commit/da47397a0513b8ff55a3796712b7f70c64ec2966)]
12
+
13
+ #### :house: Internal changes
14
+
15
+ - style: Automated code fix [eea-jenkins - [`b41cc24`](https://github.com/eea/volto-cca-policy/commit/b41cc24fcaf25a32af2fed778af7183b942c2dbd)]
16
+
17
+ #### :hammer_and_wrench: Others
18
+
19
+ - Fix bugs [Tiberiu Ichim - [`9585833`](https://github.com/eea/volto-cca-policy/commit/9585833739e2e951bff24c5a33c2d99ab36fb0c1)]
20
+ - Update snapshots [Tiberiu Ichim - [`15a62cf`](https://github.com/eea/volto-cca-policy/commit/15a62cf96d5b112e1d3cf1df44c6758ce0e2d73c)]
21
+ ### [0.2.43](https://github.com/eea/volto-cca-policy/compare/0.2.42...0.2.43) - 13 June 2024
22
+
23
+ #### :rocket: New Features
24
+
25
+ - feat(event): add i18n messages for documents and improve code readability [kreafox - [`f23168a`](https://github.com/eea/volto-cca-policy/commit/f23168ad982317bdf1523cdd42f39ef84b55da0e)]
26
+
27
+ #### :rocket: Dependency updates
28
+
29
+ - Release @eeacms/volto-embed@10.0.2 [EEA Jenkins - [`2e0174c`](https://github.com/eea/volto-cca-policy/commit/2e0174c154250e838535e3f9c8b1c8f83fa8ccde)]
30
+
31
+ #### :bug: Bug Fixes
32
+
33
+ - fix(event): use email link interpolation correctly [kreafox - [`0527737`](https://github.com/eea/volto-cca-policy/commit/0527737a47ae1e70a5719b160736be9247d68634)]
34
+
35
+ #### :nail_care: Enhancements
36
+
37
+ - change(event): simplify component structure and organize imports [kreafox - [`30a7766`](https://github.com/eea/volto-cca-policy/commit/30a7766d33a04d26d17b798d0ef776603c7fe29c)]
38
+ - change(event): use renderBlocks instead of custom BannerTitle component [kreafox - [`0dd267a`](https://github.com/eea/volto-cca-policy/commit/0dd267af20184dbd683671ef1e23dd3d15606667)]
39
+
40
+ #### :hammer_and_wrench: Others
41
+
42
+ - test: fix warning message [kreafox - [`4d31ff2`](https://github.com/eea/volto-cca-policy/commit/4d31ff20dcfce88ad96f608409a5e12b20f13c9e)]
43
+ - test: update snapshot [kreafox - [`c8047ca`](https://github.com/eea/volto-cca-policy/commit/c8047ca5d592fea5db728999f1f7a8f96cad6496)]
44
+ - New version [Tiberiu Ichim - [`8617e34`](https://github.com/eea/volto-cca-policy/commit/8617e343ec075259078b533064bb6de2a3005a48)]
45
+ - https://github.com/elastic/search-ui/issues/1046 [Tiberiu Ichim - [`9eb0d03`](https://github.com/eea/volto-cca-policy/commit/9eb0d03aace62b7692033d9e429c42f10e176354)]
46
+ - Pin @eeacms/volto-embed [kreafox - [`0418854`](https://github.com/eea/volto-cca-policy/commit/04188549444a127e041ef98973900814f86e3859)]
47
+ - Let's try something else [Tiberiu Ichim - [`ab847b7`](https://github.com/eea/volto-cca-policy/commit/ab847b7d35448dadf29892bc10f8024dabf6d664)]
48
+ - Remove dependency for search-ui [Tiberiu Ichim - [`f3bf4a4`](https://github.com/eea/volto-cca-policy/commit/f3bf4a42f1dac44c57b6c1557b583112e328d26d)]
49
+ - Refs #271086 - wip tests [Tripon Eugen - [`e2cfdc7`](https://github.com/eea/volto-cca-policy/commit/e2cfdc78dc82b70d147bc1a7505632b9577719b8)]
50
+ - Refs #271086 - package.json resolutions [Tripon Eugen - [`09cce63`](https://github.com/eea/volto-cca-policy/commit/09cce6376cc489d5466981ce1a8e53bb8a994c1e)]
51
+ - Refs #271086 - add elements filter at cse [Tripon Eugen - [`549030c`](https://github.com/eea/volto-cca-policy/commit/549030cde005331f26a9ccde09394fee3f43f049)]
7
52
  ### [0.2.42](https://github.com/eea/volto-cca-policy/compare/0.2.41...0.2.42) - 4 June 2024
8
53
 
9
54
  ### [0.2.41](https://github.com/eea/volto-cca-policy/compare/0.2.40...0.2.41) - 4 June 2024
@@ -1362,13 +1407,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1362
1407
  - Refs #260715 rast-block wip [Tripon Eugen - [`f19d54e`](https://github.com/eea/volto-cca-policy/commit/f19d54e0b9a6a86bf344eb85b6a1cda7f3de91bf)]
1363
1408
  - Refs #260715 rast-block wip [Tripon Eugen - [`2828537`](https://github.com/eea/volto-cca-policy/commit/2828537b6c084cd1a82162d552fb4ef025b71f9f)]
1364
1409
  - Refs #260715 rast-block updates [Tripon Eugen - [`1e803e5`](https://github.com/eea/volto-cca-policy/commit/1e803e5bd3d3fb7558f261c76c68866be7beb8b5)]
1365
- - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0a15e1b`](https://github.com/eea/volto-cca-policy/commit/0a15e1b2ad081233685e80d5b3c60a8663f6b896)]
1366
- - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`9554e44`](https://github.com/eea/volto-cca-policy/commit/9554e44c92a621a52b2adb5a4830fb084ee5734b)]
1367
1410
  ### [0.1.49](https://github.com/eea/volto-cca-policy/compare/0.1.48...0.1.49) - 15 November 2023
1368
1411
 
1369
1412
  #### :house: Internal changes
1370
1413
 
1371
- - chore: [JENKINS] Refactor automated testing [valentinab25 - [`7b820a6`](https://github.com/eea/volto-cca-policy/commit/7b820a6369c2ddd5203b1a4abe352cb4bb43db7a)]
1372
1414
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`f0a8061`](https://github.com/eea/volto-cca-policy/commit/f0a8061c275c236deb00087c23fac9860a073106)]
1373
1415
 
1374
1416
  #### :hammer_and_wrench: Others
@@ -1385,9 +1427,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1385
1427
  - Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
1386
1428
  - Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
1387
1429
  - Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
1388
- - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
1389
- - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
1390
- - test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
1391
1430
  - Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
1392
1431
  - Refs #256681 - Fix error in CCA Event view menu. ([React Intl] An id must be provided to format a message.) [GhitaB - [`517eeb8`](https://github.com/eea/volto-cca-policy/commit/517eeb817264a47bbfd6b9b7d22aaf22d44ed224)]
1393
1432
  - Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
@@ -1604,7 +1643,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1604
1643
 
1605
1644
  #### :house: Internal changes
1606
1645
 
1607
- - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
1608
1646
 
1609
1647
  #### :hammer_and_wrench: Others
1610
1648
 
@@ -2085,7 +2123,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2085
2123
  #### :hammer_and_wrench: Others
2086
2124
 
2087
2125
  - Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
2088
- - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
2089
2126
  ### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
2090
2127
 
2091
2128
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.2.42",
3
+ "version": "0.2.44",
4
4
  "description": "@eeacms/volto-cca-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -31,13 +31,13 @@
31
31
  "@eeacms/volto-datablocks": "*",
32
32
  "@eeacms/volto-eea-design-system": "*",
33
33
  "@eeacms/volto-eea-website-theme": "^1.33.2",
34
- "@eeacms/volto-embed": "10.0.1",
34
+ "@eeacms/volto-embed": "^9.1.1",
35
35
  "@eeacms/volto-globalsearch": "^1.1.0",
36
36
  "@eeacms/volto-openlayers-map": "*",
37
- "@eeacms/volto-searchlib": "^0.9.3",
37
+ "@eeacms/volto-searchlib": "2.0.2",
38
+ "@elastic/search-ui": "1.21.2",
38
39
  "@eeacms/volto-slate-label": "^0.6.0",
39
40
  "@eeacms/volto-tabs-block": "^7.5.1",
40
- "@elastic/search-ui": "1.21.2",
41
41
  "d3-array": "^2.12.1",
42
42
  "jotai": "^1.6.0",
43
43
  "query-string": "7.1.0",
@@ -19,12 +19,14 @@ export default function CaseStudyExplorerView(props) {
19
19
  const [activeFilters, setActiveFilters] = React.useState({
20
20
  sectors: [],
21
21
  impacts: [],
22
+ elements: [],
22
23
  measures: [],
23
24
  });
24
25
 
25
26
  const [activeItems, setActiveItems] = React.useState(cases);
26
27
  const [filters, setFilters] = React.useState({
27
28
  impacts: [],
29
+ elements: [],
28
30
  sectors: [],
29
31
  measures: {},
30
32
  });
@@ -44,12 +46,14 @@ export default function CaseStudyExplorerView(props) {
44
46
  let _filters = filters;
45
47
  _filters.impacts = _filters_data.impacts;
46
48
  _filters.sectors = _filters_data.sectors;
49
+ _filters.elements = _filters_data.elements;
47
50
  setFilters(_filters);
48
51
  }, [
49
52
  filters,
50
53
  cases,
51
54
  activeFilters.impacts,
52
55
  activeFilters.sectors,
56
+ activeFilters.elements,
53
57
  activeFilters.measures,
54
58
  activeItems.length,
55
59
  ]);
@@ -84,6 +84,31 @@ export default function CaseStudyFilters(props) {
84
84
  ),
85
85
  )}
86
86
  </Accordion.Content>
87
+ <Accordion.Title
88
+ active={activeIndex.includes(3)}
89
+ index={3}
90
+ onClick={handleClick}
91
+ >
92
+ <AccordionIcon active={activeIndex.includes(3)} />
93
+ <FormattedMessage
94
+ id="Adaptation elements"
95
+ defaultMessage="Adaptation elements"
96
+ />
97
+ </Accordion.Title>
98
+ <Accordion.Content active={activeIndex.includes(3)}>
99
+ {Object.entries(filters?.elements || {}).map(
100
+ ([value, label], index) => (
101
+ <Checkbox
102
+ label={intl.formatMessage({ id: label })}
103
+ value={value}
104
+ checked={activeFilters.elements.includes(value)}
105
+ name="elements"
106
+ onChange={checkboxChangeHandler}
107
+ key={'element' + index}
108
+ />
109
+ ),
110
+ )}
111
+ </Accordion.Content>
87
112
  <Accordion.Title
88
113
  active={activeIndex.includes(1)}
89
114
  index={1}
@@ -16,6 +16,7 @@ describe('CaseStudyFilters', () => {
16
16
  // impacts: [{ DROUGHT: 'Drought' }],
17
17
  sectors: [],
18
18
  impacts: [],
19
+ elements: [],
19
20
  measures: {
20
21
  // Measure1: [
21
22
  // { key: 'M11', value: 'm11' },
@@ -26,6 +27,7 @@ describe('CaseStudyFilters', () => {
26
27
  activeFilters: {
27
28
  sectors: [],
28
29
  impacts: [],
30
+ elements: [],
29
31
  measures: [],
30
32
  },
31
33
  };
@@ -43,7 +43,6 @@ export default function FeatureDisplay({ feature }) {
43
43
  <span
44
44
  dangerouslySetInnerHTML={{
45
45
  __html: feature.adaptation_options_links.replaceAll('<>', '; '),
46
- // __html: feature.adaptation_options_links,
47
46
  }}
48
47
  ></span>
49
48
  </p>
@@ -35,6 +35,7 @@ export function filterCases(cases, activeFilters) {
35
35
  if (
36
36
  activeFilters.sectors.length === 0 &&
37
37
  activeFilters.measures.length === 0 &&
38
+ activeFilters.elements.length === 0 &&
38
39
  activeFilters.impacts.length === 0
39
40
  )
40
41
  return _case;
@@ -45,6 +46,10 @@ export function filterCases(cases, activeFilters) {
45
46
  if (_case.properties.sectors.includes(',' + filter + ',')) flag = true;
46
47
  });
47
48
 
49
+ activeFilters.elements.forEach((filter) => {
50
+ if (_case.properties.elements.includes(',' + filter + ',')) flag = true;
51
+ });
52
+
48
53
  activeFilters.impacts.forEach((filter) => {
49
54
  if (_case.properties.impacts.includes(',' + filter + ',')) flag = true;
50
55
  });
@@ -60,7 +65,7 @@ export function filterCases(cases, activeFilters) {
60
65
  }
61
66
 
62
67
  export function getFilters(cases) {
63
- let _filters = { sectors: {}, impacts: {}, measures: {} };
68
+ let _filters = { sectors: {}, impacts: {}, elements: {}, measures: {} };
64
69
 
65
70
  for (let key of Object.keys(cases)) {
66
71
  const _case = cases[key];
@@ -81,6 +86,17 @@ export function getFilters(cases) {
81
86
  }
82
87
  }
83
88
 
89
+ let elementKeys = _case.properties?.elements?.split(',');
90
+ let elementNames = _case.properties?.elements_str?.split(',') || [];
91
+ for (let i = 0; i < elementNames.length; i++) {
92
+ if (
93
+ !_filters.elements.hasOwnProperty(elementKeys[i + 1]) &&
94
+ elementKeys[i + 1].length
95
+ ) {
96
+ _filters.elements[elementKeys[i + 1]] = elementNames[i];
97
+ }
98
+ }
99
+
84
100
  // let ktmKeys = _case.properties.ktms.split(',');
85
101
  // let ktmNames = _case.properties.impacts_str.split(',');
86
102
  // for (let i = 0; i < ktmKeys.length; i++) {
@@ -6,7 +6,7 @@ import View from './CollectionStatsView';
6
6
  import TransparentOverlay from '../../TransparentOverlay';
7
7
 
8
8
  const Edit = (props) => {
9
- const schema = Schema();
9
+ const schema = Schema(props.data);
10
10
  return (
11
11
  <>
12
12
  <TransparentOverlay>
@@ -66,21 +66,29 @@ const makeSearchBlockQuery = ({ base, query, field, value }) => {
66
66
  return `${base}?${params}`;
67
67
  };
68
68
 
69
- const makeEEASearchQuery = ({ base, field, value }) => {
69
+ const makeEEASearchQuery = ({ base, field, value, extraFilters }) => {
70
70
  // TODO: don't hardcode the language
71
- const rest =
72
- 'filters[1][field]=issued.date' +
73
- '&filters[1][values][0]=Last 5 years' +
74
- '&filters[1][type]=any' +
75
- '&filters[2][field]=language' +
76
- '&filters[2][values][0]=en' +
77
- '&filters[2][type]=any' +
78
- '&sort-field=issued.date' +
79
- '&sort-direction=desc';
80
-
81
- const filter = `filters[0][field]=${field}&filters[0][type]=any&filters[0][values][0]=${value}`;
82
-
83
- return `${base}?size=n_10_n&${filter}&${rest}`;
71
+ const allFields = [
72
+ ['issued.date', 'Last 5 years'],
73
+ ['language', 'en'],
74
+ [field, value],
75
+ ...(extraFilters?.map(({ id, value }) => [id, value]) || []),
76
+ ];
77
+
78
+ const rest = '&sort-field=issued.date&sort-direction=desc';
79
+
80
+ // See FilterAceContentView
81
+ const filters = allFields
82
+ .map(([name, anyValue], index) =>
83
+ [
84
+ `filters[${index}][field]=${name}`,
85
+ `filters[${index}][type]=any`,
86
+ `filters[${index}][values][0]=${anyValue}`,
87
+ ].join('&'),
88
+ )
89
+ .join('&');
90
+
91
+ return `${base}?size=n_10_n&${filters}&${rest}`;
84
92
  };
85
93
 
86
94
  const urlBuilders = {
@@ -116,6 +124,7 @@ export default function CollectionStatsView(props) {
116
124
 
117
125
  const keys = Object.keys(stats);
118
126
  const urlHandler = urlBuilders[queryParameterStyle] || nop;
127
+ const extraFilters = data?.extraFilters || [];
119
128
 
120
129
  return (
121
130
  (field && keys.length > 0 && (
@@ -133,6 +142,7 @@ export default function CollectionStatsView(props) {
133
142
  query: query.query,
134
143
  field: groupDefinition.searchFieldName || field,
135
144
  value: kV,
145
+ extraFilters,
136
146
  })}
137
147
  >
138
148
  <IconComponent
@@ -3,14 +3,36 @@ import {
3
3
  hasDateOperation,
4
4
  } from '@plone/volto/components/manage/Blocks/Search/utils';
5
5
 
6
- const Schema = () => {
6
+ const ExtraFilter = (_) => ({
7
+ title: 'Extra Filters',
8
+ fieldsets: [{ id: 'default', fields: ['id', 'value'], title: 'Default' }],
9
+ properties: {
10
+ id: {
11
+ title: 'Field ID',
12
+ },
13
+ value: {
14
+ title: 'Filter value',
15
+ },
16
+ },
17
+ required: [],
18
+ });
19
+
20
+ const Schema = (formData) => {
21
+ const isEEASearch = formData?.queryParameterStyle === 'EEASemanticSearch';
22
+
7
23
  return {
8
24
  title: 'Collection Statistics',
9
25
  fieldsets: [
10
26
  {
11
27
  id: 'default',
12
28
  title: 'Default',
13
- fields: ['aggregateField', 'queryParameterStyle', 'href', 'showLabel'],
29
+ fields: [
30
+ 'aggregateField',
31
+ 'queryParameterStyle',
32
+ 'href',
33
+ 'showLabel',
34
+ ...(isEEASearch ? ['extraFilters'] : []),
35
+ ],
14
36
  },
15
37
  {
16
38
  id: 'query',
@@ -68,6 +90,12 @@ const Schema = () => {
68
90
  selectedItemAttrs: [],
69
91
  allowExternals: true,
70
92
  },
93
+ extraFilters: {
94
+ title: 'Extra filters',
95
+ widget: 'object_list',
96
+ schema: ExtraFilter({ formData }),
97
+ // schemaExtender: (schema) => schema,
98
+ },
71
99
  },
72
100
  required: [],
73
101
  };
@@ -12,17 +12,18 @@ const messages = defineMessages({
12
12
  });
13
13
 
14
14
  const getDropdownOptions = (items) => {
15
- const options = items?.map((item) => {
16
- const source = item?.source?.[0];
17
- return {
18
- key: source?.id,
19
- value: source?.id,
20
- text: item.item_title,
21
- as: Link,
22
- to: flattenToAppURL(source?.['@id']),
23
- };
24
- });
25
- return options;
15
+ return (
16
+ items?.map((item, index) => {
17
+ const source = item?.source?.[0];
18
+ return {
19
+ key: source?.id || index,
20
+ value: source?.id,
21
+ text: item.item_title,
22
+ as: Link,
23
+ to: flattenToAppURL(source?.['@id']),
24
+ };
25
+ }) || []
26
+ );
26
27
  };
27
28
 
28
29
  const DropdownListView = (props) => {
@@ -1,11 +1,17 @@
1
1
  import React from 'react';
2
2
  import { UniversalLink } from '@plone/volto/components';
3
+ import cx from 'classnames';
3
4
  import './styles.less';
4
5
 
5
- const LinkWrap = ({ item, pathname, children, isActive }) => {
6
+ const LinkWrap = ({ item, children, isActive, className }) => {
6
7
  return item ? (
7
- <UniversalLink item={item} className="step-link">
8
- <g className={isActive ? 'link-active' : ''}>
8
+ <UniversalLink
9
+ item={item}
10
+ className={cx('step-link', className, {
11
+ active: isActive,
12
+ })}
13
+ >
14
+ <g>
9
15
  <title>{item.title}</title>
10
16
  {children}
11
17
  </g>
@@ -15,8 +21,6 @@ const LinkWrap = ({ item, pathname, children, isActive }) => {
15
21
  );
16
22
  };
17
23
 
18
- // export default function RASTView(props) {
19
- // const RASTView = (props) => {
20
24
  export default function RASTMap(props) {
21
25
  const { path, pathname, activeMenu, skip_items } = props;
22
26
  const currentPath = path || pathname;
@@ -29,7 +33,7 @@ export default function RASTMap(props) {
29
33
 
30
34
  if (activeMenu !== null) {
31
35
  if (data.includes(activeMenu.toString())) {
32
- currentMenu = -1;
36
+ currentMenu = null;
33
37
  } else {
34
38
  let activeMenuMinus = 0;
35
39
  for (let i = 0; i < data.length; i++) {
@@ -40,7 +44,11 @@ export default function RASTMap(props) {
40
44
  }
41
45
 
42
46
  return (
43
- <div className="rast-map-block">
47
+ <div
48
+ className={cx('rast-map-block', {
49
+ landing: currentMenu === null,
50
+ })}
51
+ >
44
52
  <svg
45
53
  width="290"
46
54
  height="280"
@@ -337,6 +345,7 @@ export default function RASTMap(props) {
337
345
  item={items[0]}
338
346
  pathname={currentPath}
339
347
  isActive={currentMenu === 0 ? true : false}
348
+ className="step-0"
340
349
  >
341
350
  <path
342
351
  d="M210.5 32C222.4 32 232 41.6 232 53.5C232 65.4 222.4 75 210.5 75C198.6 75 189 65.4 189 53.5C189 41.6 198.6 32 210.5 32Z"
@@ -356,6 +365,7 @@ export default function RASTMap(props) {
356
365
  item={items[1]}
357
366
  pathname={currentPath}
358
367
  isActive={currentMenu === 1 ? true : false}
368
+ className="step-1"
359
369
  >
360
370
  <path
361
371
  d="M260.5 128C272.4 128 282 137.6 282 149.5C282 161.4 272.4 171 260.5 171C248.6 171 239 161.4 239 149.5C239 137.6 248.6 128 260.5 128Z"
@@ -375,6 +385,7 @@ export default function RASTMap(props) {
375
385
  item={items[2]}
376
386
  pathname={currentPath}
377
387
  isActive={currentMenu === 2 ? true : false}
388
+ className="step-2"
378
389
  >
379
390
  <path
380
391
  d="M210.5 228C222.4 228 232 237.6 232 249.5C232 261.4 222.4 271 210.5 271C198.6 271 189 261.4 189 249.5C189 237.6 198.6 228 210.5 228Z"
@@ -394,6 +405,7 @@ export default function RASTMap(props) {
394
405
  item={items[3]}
395
406
  pathname={currentPath}
396
407
  isActive={currentMenu === 3 ? true : false}
408
+ className="step-3"
397
409
  >
398
410
  <path
399
411
  d="M82.5 228C94.4 228 104 237.6 104 249.5C104 261.4 94.4 271 82.5 271C70.6 271 61 261.4 61 249.5C61 237.6 70.6 228 82.5 228Z"
@@ -413,6 +425,7 @@ export default function RASTMap(props) {
413
425
  item={items[4]}
414
426
  pathname={currentPath}
415
427
  isActive={currentMenu === 4 ? true : false}
428
+ className="step-4"
416
429
  >
417
430
  <path
418
431
  d="M29.5 128C41.4 128 51 137.6 51 149.5C51 161.4 41.4 171 29.5 171C17.6 171 8 161.4 8 149.5C8 137.6 17.6 128 29.5 128Z"
@@ -432,6 +445,7 @@ export default function RASTMap(props) {
432
445
  item={items[5]}
433
446
  pathname={currentPath}
434
447
  isActive={currentMenu === 5 ? true : false}
448
+ className="step-5"
435
449
  >
436
450
  <path
437
451
  d="M82.5 32C94.4 32 104 41.6 104 53.5C104 65.4 94.4 75 82.5 75C70.6 75 61 65.4 61 53.5C61 41.6 70.6 32 82.5 32Z"
@@ -3,52 +3,104 @@
3
3
 
4
4
  @import (multiple, reference, optional) '../../theme.config';
5
5
 
6
- .rast-block {
7
- a rect.circle:hover {
8
- fill: #183 !important;
9
- }
6
+ .rast-map-block {
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ margin-bottom: 2em;
10
11
 
11
- // a rect.circle {
12
- // pointer-events: all !important;
13
- // }
12
+ &:not(.landing) {
13
+ .step-0:not(.active) g path:nth-of-type(1) {
14
+ fill: #0c3330;
15
+ }
14
16
 
15
- // svg,
16
- // svg * {
17
- // pointer-events: none;
18
- // }
17
+ .step-1:not(.active) g path:nth-of-type(1) {
18
+ fill: #031624;
19
+ }
19
20
 
20
- .step-link:hover {
21
- .circle {
22
- filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 1));
21
+ .step-2:not(.active) g path:nth-of-type(1) {
22
+ fill: #081936;
23
23
  }
24
- }
25
24
 
26
- .link-active {
27
- .circle {
28
- filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 1));
25
+ .step-3:not(.active) g path:nth-of-type(1) {
26
+ fill: #262c4e;
29
27
  }
28
+
29
+ .step-4:not(.active) g path:nth-of-type(1) {
30
+ fill: #534022;
31
+ }
32
+
33
+ .step-5:not(.active) g path:nth-of-type(1) {
34
+ fill: #39531f;
35
+ }
36
+
37
+ .step-link {
38
+ path:nth-of-type(2),
39
+ path:nth-of-type(3) {
40
+ fill: #929eaf;
41
+ }
42
+ }
43
+ }
44
+
45
+ .step-link {
46
+ transform-box: fill-box;
47
+ transform-origin: 50% 50%;
48
+ transition: 0.3s all;
49
+ }
50
+
51
+ .step-0.step-link:hover g path:nth-of-type(1),
52
+ .step-0.step-link.active g path:nth-of-type(1) {
53
+ fill: #155246;
54
+ }
55
+
56
+ .step-1.step-link:hover g path:nth-of-type(1),
57
+ .step-1.step-link.active g path:nth-of-type(1) {
58
+ fill: #062435;
30
59
  }
31
60
 
32
- .item.active a {
33
- font-weight: bold;
61
+ .step-2.step-link:hover g path:nth-of-type(1),
62
+ .step-2.step-link.active g path:nth-of-type(1) {
63
+ fill: #0d284f;
34
64
  }
35
65
 
36
- .ui.accordion .active.content {
37
- padding: 1rem 1rem !important;
66
+ .step-3.step-link:hover g path:nth-of-type(1),
67
+ .step-3.step-link.active g path:nth-of-type(1) {
68
+ fill: #434772;
38
69
  }
39
70
 
40
- .substep a {
41
- color: inherit;
71
+ .step-4.step-link:hover g path:nth-of-type(1),
72
+ .step-4.step-link.active g path:nth-of-type(1) {
73
+ fill: #926830;
42
74
  }
43
75
 
44
- .substep:not(:last-child) {
45
- padding-bottom: 0.8em;
76
+ .step-5.step-link:hover g path:nth-of-type(1),
77
+ .step-5.step-link.active g path:nth-of-type(1) {
78
+ fill: #64862c;
46
79
  }
47
80
 
48
- .rast-map-block {
49
- display: flex;
50
- align-items: center;
51
- justify-content: center;
52
- margin-bottom: 2em;
81
+ .step-link:hover,
82
+ .step-link.active {
83
+ transform: scale(1.3, 1.3);
84
+
85
+ path:nth-of-type(2),
86
+ path:nth-of-type(3) {
87
+ fill: #fff;
88
+ }
89
+
90
+ .step-link .item.active a {
91
+ font-weight: bold;
92
+ }
93
+
94
+ .ui.accordion .active.content {
95
+ padding: 1rem 1rem !important;
96
+ }
97
+
98
+ .substep a {
99
+ color: inherit;
100
+ }
101
+
102
+ .substep:not(:last-child) {
103
+ padding-bottom: 0.8em;
104
+ }
53
105
  }
54
106
  }
@@ -1,58 +1,73 @@
1
1
  import React from 'react';
2
+ import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
2
3
  import { Grid, Container, Segment } from 'semantic-ui-react';
3
4
  import {
4
- DocumentsList,
5
5
  HTMLField,
6
- BannerTitle,
7
6
  EventDetails,
7
+ DocumentsList,
8
8
  } from '@eeacms/volto-cca-policy/helpers';
9
9
  import { PortalMessage } from '@eeacms/volto-cca-policy/components';
10
- import { FormattedMessage } from 'react-intl';
10
+ import { filterBlocks } from '@eeacms/volto-cca-policy/utils';
11
+ import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
12
+
13
+ const messages = defineMessages({
14
+ download_agenda: {
15
+ id: 'Download the detailed agenda',
16
+ defaultMessage: 'Download the detailed agenda',
17
+ },
18
+ download_documents: {
19
+ id: 'A background document for the event is available',
20
+ defaultMessage: 'A background document for the event is available',
21
+ },
22
+ });
23
+
24
+ const DocumentSection = ({ title, file }) => (
25
+ <DocumentsList
26
+ content={{
27
+ show_counter: false,
28
+ section_title: title,
29
+ cca_files: [
30
+ {
31
+ url: file?.download,
32
+ title: file?.filename,
33
+ },
34
+ ],
35
+ }}
36
+ />
37
+ );
11
38
 
12
39
  function CcaEventView(props) {
40
+ const intl = useIntl();
13
41
  const { content } = props;
14
- const { event_language } = content;
15
- // cca_files: [content.agenda_file]}
16
- if (content.agenda_file) {
17
- content.agenda_file['url'] = content.agenda_file['download'];
18
- content.agenda_file['title'] = content.agenda_file['filename'];
19
- }
20
- if (content.background_documents) {
21
- content.background_documents['url'] =
22
- content.background_documents['download'];
23
- content.background_documents['title'] =
24
- content.background_documents['filename'];
25
- }
26
- const agenda_files = {
27
- section_title: 'Download the detailed agenda',
28
- cca_files: [content.agenda_file],
29
- show_counter: false,
30
- };
31
- const background_documents = {
32
- section_title: 'A background document for the event is available ',
33
- cca_files: [content.background_documents],
34
- show_counter: false,
35
- };
42
+ const {
43
+ event_language,
44
+ agenda_file,
45
+ background_documents,
46
+ participation,
47
+ contact_email,
48
+ } = content;
49
+
50
+ const {
51
+ blocks: filtered_blocks,
52
+ blocks_layout: filtered_blocks_layout,
53
+ } = filterBlocks(content, 'tabs_block');
36
54
 
37
55
  return (
38
56
  <div className="cca-event-view">
39
- <BannerTitle
40
- content={{ ...content, '@type': 'Climate adapt event' }}
41
- data={{
42
- info: [{ description: '' }],
43
- hideContentType: false,
44
- hideCreationDate: false,
45
- hideModificationDate: false,
46
- hidePublishingDate: false,
47
- hideDownloadButton: false,
48
- hideShareButton: false,
57
+ <RenderBlocks
58
+ {...props}
59
+ content={{
60
+ ...content,
61
+ '@type': 'climate-adapt-event',
62
+ blocks: filtered_blocks,
63
+ blocks_layout: filtered_blocks_layout,
49
64
  }}
50
65
  />
51
66
 
52
67
  <Container>
53
68
  <PortalMessage content={content} />
54
69
  <Grid columns="12">
55
- <div className="row">
70
+ <Grid.Row>
56
71
  <Grid.Column
57
72
  mobile={12}
58
73
  tablet={12}
@@ -69,9 +84,18 @@ function CcaEventView(props) {
69
84
  </h2>
70
85
  <HTMLField value={content.agenda} />
71
86
 
72
- {content?.agenda_file && <DocumentsList content={agenda_files} />}
73
- {content?.background_documents && (
74
- <DocumentsList content={background_documents} />
87
+ {agenda_file && (
88
+ <DocumentSection
89
+ title={intl.formatMessage(messages.download_agenda)}
90
+ file={agenda_file}
91
+ />
92
+ )}
93
+
94
+ {background_documents && (
95
+ <DocumentSection
96
+ title={intl.formatMessage(messages.download_documents)}
97
+ file={background_documents}
98
+ />
75
99
  )}
76
100
 
77
101
  <h2>
@@ -86,20 +110,21 @@ function CcaEventView(props) {
86
110
  defaultMessage="Participation"
87
111
  />
88
112
  </h3>
89
- <HTMLField value={content.participation} />
113
+ <HTMLField value={participation} />
90
114
 
91
115
  <h2>
92
116
  <FormattedMessage id="Contact" defaultMessage="Contact" />
93
117
  </h2>
94
- <p>
95
- <FormattedMessage
96
- id="If you have any further questions you can contact"
97
- defaultMessage="If you have any further questions you can contact"
98
- />{' '}
99
- <a href="mailto:{content.contact_email}">
100
- {content.contact_email}
101
- </a>
102
- </p>
118
+
119
+ {contact_email && (
120
+ <p>
121
+ <FormattedMessage
122
+ id="If you have any further questions you can contact"
123
+ defaultMessage="If you have any further questions you can contact"
124
+ />{' '}
125
+ <a href={`mailto:${contact_email}`}>{contact_email}</a>
126
+ </p>
127
+ )}
103
128
 
104
129
  {event_language && (
105
130
  <>
@@ -123,7 +148,7 @@ function CcaEventView(props) {
123
148
  <EventDetails {...props} />
124
149
  </Segment>
125
150
  </Grid.Column>
126
- </div>
151
+ </Grid.Row>
127
152
  </Grid>
128
153
  </Container>
129
154
  </div>
@@ -1,7 +1,5 @@
1
1
  import React from 'react';
2
- import { expandToBackendURL } from '@plone/volto/helpers';
3
- import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
4
- import { Grid, Container, Segment, Button, Icon } from 'semantic-ui-react';
2
+ import { Grid, Container, Segment } from 'semantic-ui-react';
5
3
  import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
6
4
  import {
7
5
  SubjectTags,
@@ -11,15 +9,7 @@ import {
11
9
  import { filterBlocks } from '@eeacms/volto-cca-policy/utils';
12
10
  import { PortalMessage } from '@eeacms/volto-cca-policy/components';
13
11
 
14
- const messages = defineMessages({
15
- downloadEvent: {
16
- id: 'Download this event in iCal format',
17
- defaultMessage: 'Download this event in iCal format',
18
- },
19
- });
20
-
21
12
  function EventView(props) {
22
- const intl = useIntl();
23
13
  const { content } = props;
24
14
  const {
25
15
  blocks: filtered_blocks,
@@ -56,41 +46,6 @@ function EventView(props) {
56
46
  <Grid.Column mobile={12} tablet={12} computer={4}>
57
47
  <Segment>
58
48
  <EventDetails {...props} />
59
- {content?.event_url && (
60
- <>
61
- <h4>
62
- <FormattedMessage id="Web" defaultMessage="Web" />
63
- </h4>
64
- <p>
65
- <a href={content.event_url} target="_blank">
66
- <FormattedMessage
67
- id="Visit external website"
68
- defaultMessage="Visit external website"
69
- />
70
- </a>
71
- </p>
72
- </>
73
- )}
74
-
75
- <div className="download-event">
76
- <a
77
- className="ics-download"
78
- target="_blank"
79
- rel="noreferrer"
80
- href={`${expandToBackendURL(content['@id'])}/ics_view`}
81
- >
82
- <Button
83
- className="icon inverted primary labeled"
84
- title={intl.formatMessage(messages.downloadEvent)}
85
- >
86
- <Icon name="calendar alternate outline" />
87
- <FormattedMessage
88
- id="Download Event"
89
- defaultMessage="Download Event"
90
- />
91
- </Button>
92
- </a>
93
- </div>
94
49
  </Segment>
95
50
  </Grid.Column>
96
51
  </Grid.Row>
@@ -1,17 +1,18 @@
1
1
  import React, { Fragment } from 'react';
2
+ import { expandToBackendURL } from '@plone/volto/helpers';
2
3
  import { Link } from 'react-router-dom';
3
- import { FormattedMessage } from 'react-intl';
4
- import { UniversalLink } from '@plone/volto/components';
5
- import config from '@plone/volto/registry';
4
+ import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
6
5
  import {
7
6
  Segment,
8
7
  Image,
9
8
  ListItem,
10
9
  List,
11
- Button,
12
10
  Icon,
13
11
  Label,
12
+ Button,
14
13
  } from 'semantic-ui-react';
14
+ import { UniversalLink } from '@plone/volto/components';
15
+ import config from '@plone/volto/registry';
15
16
  import {
16
17
  CASE_STUDY,
17
18
  PUBLICATION_REPORT,
@@ -22,9 +23,12 @@ import {
22
23
  } from '@eeacms/volto-cca-policy/helpers/Constants';
23
24
  import { When } from '@plone/volto/components/theme/View/EventDatesInfo';
24
25
  import { makeContributionsSearchQuery } from '@eeacms/volto-cca-policy/helpers';
25
- import { useIntl, defineMessages } from 'react-intl';
26
26
 
27
27
  const messages = defineMessages({
28
+ downloadEvent: {
29
+ id: 'Download this event in iCal format',
30
+ defaultMessage: 'Download this event in iCal format',
31
+ },
28
32
  documents: {
29
33
  id: 'Documents',
30
34
  defaultMessage: 'Documents',
@@ -449,8 +453,29 @@ export const SubjectTags = (props) => {
449
453
  ) : null;
450
454
  };
451
455
 
456
+ export const WebDetails = (props) => {
457
+ const { content } = props;
458
+ const eventUrl = content?.event_url;
459
+ return eventUrl ? (
460
+ <>
461
+ <h4>
462
+ <FormattedMessage id="Web" defaultMessage="Web" />
463
+ </h4>
464
+ <p>
465
+ <a href={eventUrl} target="_blank">
466
+ <FormattedMessage
467
+ id="Visit external website"
468
+ defaultMessage="Visit external website"
469
+ />
470
+ </a>
471
+ </p>
472
+ </>
473
+ ) : null;
474
+ };
475
+
452
476
  export const EventDetails = (props) => {
453
477
  const { content } = props;
478
+ const intl = useIntl();
454
479
 
455
480
  return (
456
481
  <>
@@ -479,6 +504,28 @@ export const EventDetails = (props) => {
479
504
  <p>{content.contact_email}</p>
480
505
  </>
481
506
  )}
507
+
508
+ <WebDetails {...props} />
509
+
510
+ <div className="download-event">
511
+ <a
512
+ className="ics-download"
513
+ target="_blank"
514
+ rel="noreferrer"
515
+ href={`${expandToBackendURL(content['@id'])}/ics_view`}
516
+ >
517
+ <Button
518
+ className="icon inverted primary labeled"
519
+ title={intl.formatMessage(messages.downloadEvent)}
520
+ >
521
+ <Icon name="calendar alternate outline" />
522
+ <FormattedMessage
523
+ id="Download Event"
524
+ defaultMessage="Download Event"
525
+ />
526
+ </Button>
527
+ </a>
528
+ </div>
482
529
  </>
483
530
  );
484
531
  };