@eeacms/volto-cca-policy 0.2.6 → 0.2.7

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,36 @@ 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.7](https://github.com/eea/volto-cca-policy/compare/0.2.6...0.2.7) - 19 April 2024
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat(view): add RASTWidgetView [kreafox - [`2a80745`](https://github.com/eea/volto-cca-policy/commit/2a80745b6f97d03ca33bda8cd3b40e3fd030c521)]
12
+
13
+ #### :nail_care: Enhancements
14
+
15
+ - change: remove MissionFundingView, use dexterity layout - Refs #267791 [kreafox - [`f27de36`](https://github.com/eea/volto-cca-policy/commit/f27de36778d57f5b11b3d9d2abf26bd5bde134f4)]
16
+ - change(view): remove MissionToolView, use dexterity layout - Refs #268126 [kreafox - [`1d11d7d`](https://github.com/eea/volto-cca-policy/commit/1d11d7d6f3429af7a2ea5fd94060893066b68c33)]
17
+
18
+ #### :house: Internal changes
19
+
20
+ - chore: update components export [kreafox - [`5c81f64`](https://github.com/eea/volto-cca-policy/commit/5c81f641275a4ab6087b09c21e333f5a01009c7f)]
21
+ - chore: cleanup code - remove unused widget [kreafox - [`6c6297d`](https://github.com/eea/volto-cca-policy/commit/6c6297df2dbd13010807e409634dfe7a90031407)]
22
+
23
+ #### :hammer_and_wrench: Others
24
+
25
+ - Refs #260715 - remove icons [Tripon Eugen - [`cacff37`](https://github.com/eea/volto-cca-policy/commit/cacff37322171b8faaf6fc1a1e4cd2335376bc41)]
26
+ - Refs #260715 - remove icons [Tripon Eugen - [`7fd9186`](https://github.com/eea/volto-cca-policy/commit/7fd91866c88a9bec53422412c967219242aad5f6)]
27
+ - test: fix SyntaxError [kreafox - [`e942845`](https://github.com/eea/volto-cca-policy/commit/e942845ce658b084715c39eea9f90adbb7bc60fe)]
28
+ - Styleling [Tiberiu Ichim - [`39a22cb`](https://github.com/eea/volto-cca-policy/commit/39a22cbc76a245286d9daa6da84ee5bf539f3dc4)]
29
+ - Remove logging [Tiberiu Ichim - [`ace005c`](https://github.com/eea/volto-cca-policy/commit/ace005c3e7a9d0ab708d48a16cb286253bb44ab9)]
30
+ - Better buffer [Tiberiu Ichim - [`8a7d99f`](https://github.com/eea/volto-cca-policy/commit/8a7d99f901752a2d2eb8db799e415a2aab88a1f6)]
31
+ - Better height [Tiberiu Ichim - [`4928376`](https://github.com/eea/volto-cca-policy/commit/492837652238098e2ce8b5e7bc593db3b8c0ba04)]
32
+ - Hardcode buffer value [Tiberiu Ichim - [`95ed23d`](https://github.com/eea/volto-cca-policy/commit/95ed23dd4dfc53c5ed82108b97023600cc455bcb)]
33
+ - Zoom to point [Tiberiu Ichim - [`2043cb9`](https://github.com/eea/volto-cca-policy/commit/2043cb98ce1db30b6dc80b890e4dee9183ccb092)]
34
+ - Code cleanup [Tiberiu Ichim - [`43fdf78`](https://github.com/eea/volto-cca-policy/commit/43fdf78af12cb6ee2b588ec7641f22052c6bf6fa)]
35
+ - Tweak layer [Tiberiu Ichim - [`f33d894`](https://github.com/eea/volto-cca-policy/commit/f33d894730f9459d7f8638fa680b7ad9572e685f)]
36
+ - Improvements to casestudy explorer map [Tiberiu Ichim - [`b5cf129`](https://github.com/eea/volto-cca-policy/commit/b5cf129ad6106125fb367a25f6bc218a349c1982)]
7
37
  ### [0.2.6](https://github.com/eea/volto-cca-policy/compare/0.2.5...0.2.6) - 17 April 2024
8
38
 
9
39
  #### :rocket: New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
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",
@@ -1,9 +1,9 @@
1
- export ImageGallery from './theme/ImageGallery/ImageGallery';
2
- export BannerTitle from './theme/BannerTitle/BannerTitle';
3
- export PortalMessage from './theme/PortalMessage/PortalMessage';
4
- export TranslationDisclaimer from './theme/TranslationDisclaimer/TranslationDisclaimer';
5
- export ShareInfoButton from './theme/ShareInfoButton/ShareInfoButton';
6
- export ASTNavigation from './theme/ASTNavigation/ASTNavigation';
1
+ export { default as ImageGallery } from './theme/ImageGallery/ImageGallery';
2
+ export { default as BannerTitle } from './theme/BannerTitle/BannerTitle';
3
+ export { default as PortalMessage } from './theme/PortalMessage/PortalMessage';
4
+ export { default as TranslationDisclaimer } from './theme/TranslationDisclaimer/TranslationDisclaimer';
5
+ export { default as ShareInfoButton } from './theme/ShareInfoButton/ShareInfoButton';
6
+ export { default as ASTNavigation } from './theme/ASTNavigation/ASTNavigation';
7
7
 
8
- export { default as MissionToolView } from './theme/Views/MissionToolView';
9
- export { default as MissionDisclaimer } from './theme/MissionDisclaimer/MissionDisclaimer';
8
+ // Widgets
9
+ export { default as RASTWidgetView } from './theme/Widgets/RASTWidgetView';
@@ -62,7 +62,7 @@ export default function CaseStudyExplorerView(props) {
62
62
  if (__SERVER__) return '';
63
63
 
64
64
  return (
65
- <div>
65
+ <div className="casestudy-explorer-map">
66
66
  <Grid columns="12">
67
67
  <Grid.Column mobile={9} tablet={9} computer={9} className="col-left">
68
68
  {cases.length ? (
@@ -1,4 +1,4 @@
1
- import React, { FormEvent } from 'react';
1
+ import React from 'react';
2
2
  import { useIntl, FormattedMessage } from 'react-intl';
3
3
  import { Accordion, Icon, Checkbox } from 'semantic-ui-react';
4
4
 
@@ -32,7 +32,7 @@ export default function CaseStudyFilters(props) {
32
32
  setActiveIndex(index);
33
33
  }
34
34
 
35
- const checkboxChangeHandler = (_event: FormEvent<HTMLInputElement>, data) => {
35
+ const checkboxChangeHandler = (_event, data) => {
36
36
  const temp = JSON.parse(JSON.stringify(activeFilters));
37
37
 
38
38
  if (data.checked) {
@@ -48,7 +48,7 @@ export default function CaseStudyFilters(props) {
48
48
 
49
49
  const intl = useIntl();
50
50
  return (
51
- <>
51
+ <div className="casestudy-filters">
52
52
  <Accordion exclusive={false} className="secondary">
53
53
  <Accordion.Title
54
54
  active={activeIndex.includes(0)}
@@ -89,7 +89,6 @@ export default function CaseStudyFilters(props) {
89
89
  <Accordion.Content active={activeIndex.includes(1)}>
90
90
  {Object.entries(filters?.impacts || {}).map(
91
91
  ([value, label], index) => (
92
- // <p key={index}>
93
92
  <Checkbox
94
93
  label={intl.formatMessage({ id: label })}
95
94
  checked={activeFilters.impacts.includes(value)}
@@ -98,7 +97,6 @@ export default function CaseStudyFilters(props) {
98
97
  onChange={checkboxChangeHandler}
99
98
  key={'impact' + index}
100
99
  />
101
- // </p>
102
100
  ),
103
101
  )}
104
102
  </Accordion.Content>
@@ -120,7 +118,7 @@ export default function CaseStudyFilters(props) {
120
118
  <p>
121
119
  <strong>{intl.formatMessage({ id: key })}</strong>
122
120
  </p>
123
- {Object.entries(values).map(([valKey, valData]) => (
121
+ {Object.entries(values).map(([_, valData]) => (
124
122
  <Checkbox
125
123
  label={intl.formatMessage({ id: valData.value })}
126
124
  value={valData.key}
@@ -145,17 +143,20 @@ export default function CaseStudyFilters(props) {
145
143
  ) : null}
146
144
  <div className="case-study-legend">
147
145
  <p>
148
- <strong>Climate-ADAPT case studies</strong>
149
- </p>
150
- <p>
151
- <span></span>Climate-ADAPT case studies
146
+ <span></span>
147
+ <FormattedMessage
148
+ id="Climate-ADAPT case studies"
149
+ defaultMessage="Climate-ADAPT case studies"
150
+ />
152
151
  </p>
153
152
  <p>
154
153
  <span className="light-blue"></span>
155
- Case studies collected at national level in Spain, provided by
156
- AdapteCCA.es
154
+ <FormattedMessage
155
+ id="Case studies collected at national level in Spain, provided by AdapteCCA.es"
156
+ defaultMessage="Case studies collected at national level in Spain, provided by AdapteCCA.es"
157
+ />
157
158
  </p>
158
159
  </div>
159
- </>
160
+ </div>
160
161
  );
161
162
  }
@@ -15,11 +15,11 @@ export default function CaseStudyMap(props) {
15
15
  const features = getFeatures(items);
16
16
 
17
17
  const [tileWMSSources] = React.useState([
18
- // , setTileWMSSources
19
18
  new ol.source.TileWMS({
19
+ // see https://gisco-services.ec.europa.eu/maps/demo/ for more layers
20
20
  url: 'https://gisco-services.ec.europa.eu/maps/service',
21
21
  params: {
22
- LAYERS: 'OSMBlossomComposite',
22
+ LAYERS: 'OSMCartoComposite',
23
23
  TILED: true,
24
24
  },
25
25
  serverType: 'geoserver',
@@ -59,7 +59,12 @@ export default function FeatureInteraction({ onFeatureSelect }) {
59
59
  const subfeatures = feature.values_.features;
60
60
  if (subfeatures.length === 1) {
61
61
  const selectedFeature = subfeatures[0].values_;
62
+ const extent = selectedFeature.geometry.extent_;
63
+
62
64
  onFeatureSelect(selectedFeature);
65
+ const paddedExtent = ol.extent.buffer(extent, 50000);
66
+
67
+ map.getView().fit(paddedExtent, { ...map.getSize(), duration: 1000 });
63
68
  } else {
64
69
  // zoom to extent of cluster points
65
70
  const extent = getExtentOfFeatures(subfeatures);
@@ -68,8 +73,6 @@ export default function FeatureInteraction({ onFeatureSelect }) {
68
73
  (extent[3] - extent[1] + extent[2] - extent[0]) / 4;
69
74
  extentBuffer = extentBuffer < 500 ? 500 : extentBuffer;
70
75
  const paddedExtent = ol.extent.buffer(extent, extentBuffer);
71
-
72
- // const paddedExtent = ol.extent.buffer(extent, 50000);
73
76
  map.getView().fit(paddedExtent, { ...map.getSize(), duration: 1000 });
74
77
  }
75
78
  });
@@ -20,6 +20,9 @@ export default function InfoOverlay({
20
20
 
21
21
  const prevLayerId = usePrevious(layerId);
22
22
 
23
+ const [isClient, setIsClient] = React.useState(false);
24
+ React.useEffect(() => setIsClient(true), []);
25
+
23
26
  React.useEffect(() => {
24
27
  if (prevLayerId && layerId !== prevLayerId) {
25
28
  setShowTooltip(false);
@@ -32,7 +35,7 @@ export default function InfoOverlay({
32
35
  const overlay = new ol.Overlay({
33
36
  element: document.getElementById('popup-overlay'),
34
37
  positioning: 'bottom-center',
35
- offset: [0, -10],
38
+ offset: [10, -10],
36
39
  stopEvent: false,
37
40
  });
38
41
  map.addOverlay(overlay);
@@ -61,9 +64,6 @@ export default function InfoOverlay({
61
64
  };
62
65
  }, [map, tooltip, onFeatureSelect, hasCusters]);
63
66
 
64
- const [isClient, setIsClient] = React.useState(false);
65
- React.useEffect(() => setIsClient(true), []);
66
-
67
67
  return isClient ? (
68
68
  <div
69
69
  id="popup-overlay"
@@ -5,7 +5,10 @@
5
5
  }
6
6
 
7
7
  #csepopup {
8
+ width: 300px;
9
+ padding: 10px 0;
8
10
  border-bottom: 6px solid #005c96;
11
+ background-color: white;
9
12
 
10
13
  p {
11
14
  padding: 0 10px 0 10px;
@@ -35,84 +38,110 @@
35
38
  }
36
39
  }
37
40
 
38
- #cse-filter {
39
- h4 {
40
- position: relative;
41
- padding: 10px;
42
- border-bottom: 1px solid #d8d8d8;
43
- margin-top: 0 !important;
44
- margin-bottom: 0 !important;
45
- background-color: #fff;
46
- clear: both;
47
- color: #005c96;
48
- cursor: pointer;
49
- font-size: 14px;
41
+ .section-case-study-explorer #popup-overlay {
42
+ width: 340px;
43
+ // max-height: 300px;
44
+ padding: 0;
45
+ background-color: #fff;
46
+ }
47
+
48
+ @mapHeight: 70vh;
49
+
50
+ .casestudy-explorer-map {
51
+ // height: @mapHeight;
52
+ min-height: @mapHeight;
53
+
54
+ .ol-map {
55
+ // height: @mapHeight;
56
+ min-height: @mapHeight;
50
57
  }
51
58
 
52
- p {
53
- // padding: 2px;
54
- padding-bottom: 10px;
55
- clear: both;
56
- line-height: 20px;
57
-
58
- span {
59
- float: left;
60
- font-family: OpenSansM, sans-serif;
61
- font-size: 12px;
59
+ .casestudy-filters {
60
+ display: flex;
61
+ min-height: @mapHeight;
62
+ flex-direction: column;
63
+ }
64
+
65
+ #cse-filter {
66
+ h4 {
67
+ position: relative;
68
+ padding: 10px;
69
+ border-bottom: 1px solid #d8d8d8;
70
+ margin-top: 0 !important;
71
+ margin-bottom: 0 !important;
72
+ background-color: #fff;
73
+ clear: both;
74
+ color: #005c96;
75
+ cursor: pointer;
76
+ font-size: 14px;
62
77
  }
63
78
 
64
- input {
65
- float: right;
79
+ p {
80
+ // padding: 2px;
81
+ padding-bottom: 10px;
82
+ clear: both;
83
+ line-height: 20px;
84
+
85
+ span {
86
+ float: left;
87
+ font-family: OpenSansM, sans-serif;
88
+ font-size: 12px;
89
+ }
90
+
91
+ input {
92
+ float: right;
93
+ }
66
94
  }
67
- }
68
95
 
69
- div.title {
70
- width: 100%;
71
- }
96
+ div.title {
97
+ width: 100%;
98
+ }
72
99
 
73
- .ui.accordion > .title > .icon {
74
- line-height: 1rem;
75
- }
100
+ .ui.accordion {
101
+ & > .title > .icon {
102
+ line-height: 1rem;
103
+ }
76
104
 
77
- .ui.accordion p {
78
- margin: 0;
79
- }
105
+ p {
106
+ margin: 0;
107
+ }
80
108
 
81
- .ui.accordion .subcategory {
82
- margin-bottom: 30px;
83
- }
109
+ .content {
110
+ overflow: auto;
111
+ max-height: 400px;
84
112
 
85
- button.reset {
86
- margin-top: 20px;
87
- }
113
+ .subcategory {
114
+ margin-bottom: 30px;
115
+ }
116
+ }
117
+ }
88
118
 
89
- .ui.checkbox {
90
- width: 100%;
91
- }
119
+ button.reset {
120
+ margin-top: 20px;
121
+ }
92
122
 
93
- .case-study-legend {
94
- padding-top: 20px;
95
-
96
- span {
97
- display: inline-block;
98
- width: 12px;
99
- height: 12px;
100
- margin-top: 3px;
101
- margin-right: 5px;
102
- background-color: #005c96 !important;
103
- background-color: #bbb;
104
- border-radius: 50%;
123
+ .ui.checkbox {
124
+ width: 100%;
105
125
  }
106
126
 
107
- span.light-blue {
108
- background-color: #00ffff !important;
127
+ .case-study-legend {
128
+ padding-top: 20px;
129
+ margin-top: auto;
130
+
131
+ span {
132
+ display: inline-block;
133
+ width: 12px;
134
+ height: 12px;
135
+ margin-top: 3px;
136
+ margin-right: 5px;
137
+ background-color: #005c96 !important;
138
+ background-color: #bbb;
139
+ border-radius: 50%;
140
+ }
141
+
142
+ span.light-blue {
143
+ background-color: #00ffff !important;
144
+ }
109
145
  }
110
146
  }
111
147
  }
112
-
113
- .section-case-study-explorer #popup-overlay {
114
- width: 340px;
115
- // max-height: 300px;
116
- padding: 0;
117
- background-color: #fff;
118
- }
@@ -40,21 +40,19 @@ export const Interactions = ({
40
40
  ) {
41
41
  // if (countries_metadata.length>0) {
42
42
  let countryName = feature.get('na');
43
- let noDataReportedMsg =
44
- 'No data reported through the reporting mechanism of the Governance Regulation. Last information is available <a href="' +
45
- baseUrl +
46
- '/' +
47
- countryName.toLowerCase() +
48
- '">here</a>';
43
+ let noDataReportedMsg = `
44
+ No data reported through the reporting mechanism of the Governance Regulation.
45
+ Last information is available
46
+ <a href="${baseUrl}/${countryName.toLowerCase()}">here</a>`;
47
+
49
48
  if (countryName === 'Türkiye') {
50
49
  countryName = 'Turkiye';
51
- noDataReportedMsg =
52
- 'Data reported in 2021 through the reporting mechanism of the Governance Regulation. Information is available <a href="' +
53
- baseUrl +
54
- '/' +
55
- countryName.toLowerCase() +
56
- '">here</a>';
50
+ noDataReportedMsg = `
51
+ Data reported in 2021 through the reporting mechanism of the Governance Regulation.
52
+ Information is available
53
+ <a href="${baseUrl}/${countryName.toLowerCase()}">here</a>`;
57
54
  }
55
+
58
56
  if (!Object.hasOwn(countries_metadata[0], countryName)) {
59
57
  return;
60
58
  }
@@ -65,7 +63,7 @@ export const Interactions = ({
65
63
  let tooltipContent = '';
66
64
  if (thematicMapMode === 'National adaption policy') {
67
65
  if (metadata[0]?.notreported) {
68
- tooltipContent = '<span>' + noDataReportedMsg + '</span>';
66
+ tooltipContent = `<span>${noDataReportedMsg}</span>`;
69
67
  } else {
70
68
  tooltipContent =
71
69
  metadata[0]?.mixed || '<span>NAS and NAP not reported</span>';
@@ -79,28 +77,19 @@ export const Interactions = ({
79
77
  // overlaySource.addFeature(feature);
80
78
  map.getTargetElement().style.cursor = 'pointer';
81
79
  const node = tooltipRef.current;
82
- let tooltipContentDiv =
83
- `<div id="country-name">
84
- <a href="https://climate-adapt.eea.europa.eu/en/countries-regions/countries/` +
85
- countryName.toLowerCase() +
86
- `">
87
- <h3>` +
88
- countryName +
89
- `</h3>
90
- </a>
91
- <img class="tooltip-country-flag" src="` +
92
- feature.get('flag').src +
93
- // feature.getflag +
94
- `" height="33" width="54">
95
- </div><div class="tooltip-content">` +
96
- tooltipContent +
97
- `</div>`;
98
- setTooltipVisibility(
99
- node,
100
- '<div class="country-tooltip">' + tooltipContentDiv + '</div>',
101
- domEvt,
102
- true,
103
- );
80
+ const flag = feature.get('flag').src;
81
+ const cn = countryName.toLowerCase();
82
+ let tooltipContentDiv = `
83
+ <div class="country-tooltip">
84
+ <div id="country-name">
85
+ <a href="/en/countries-regions/countries/${cn}"><h3>${countryName}</h3></a>
86
+ <img class="tooltip-country-flag" src="${flag}" height="33" width="54">
87
+ </div>
88
+ <div class="tooltip-content">${tooltipContent}</div>
89
+ </div>
90
+ `;
91
+
92
+ setTooltipVisibility(node, tooltipContentDiv, domEvt, true);
104
93
  }
105
94
 
106
95
  // if (feature) {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Accordion, Icon } from 'semantic-ui-react';
2
+ import { Accordion } from 'semantic-ui-react';
3
3
  import RASTAccordionContent from './RASTAccordionContent';
4
4
  import { useHistory } from 'react-router-dom';
5
5
 
@@ -36,13 +36,6 @@ const RASTAccordion = (props) => {
36
36
  }}
37
37
  >
38
38
  <span className="item-title">{item.title}</span>
39
- {show_subfolders ? (
40
- active ? (
41
- <Icon className="ri-arrow-up-s-line" />
42
- ) : (
43
- <Icon className="ri-arrow-down-s-line" />
44
- )
45
- ) : null}
46
39
  </Accordion.Title>
47
40
  {show_subfolders ? (
48
41
  <Accordion.Content active={active}>
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { List } from 'semantic-ui-react';
3
+ import cx from 'classnames';
4
+
5
+ const RASTWidgetView = ({ value, className }) => {
6
+ return value && value.length > 0 ? (
7
+ <span className={cx(className, 'widget')}>
8
+ <List>
9
+ {value.map((step, index) => (
10
+ <List.Item key={index}>{step.title}</List.Item>
11
+ ))}
12
+ </List>
13
+ </span>
14
+ ) : (
15
+ ''
16
+ );
17
+ };
18
+ export default RASTWidgetView;
package/src/index.js CHANGED
@@ -1,6 +1,11 @@
1
1
  import { compose } from 'redux';
2
-
3
2
  import { Sitemap } from '@plone/volto/components';
3
+ import {
4
+ RASTWidgetView,
5
+ TranslationDisclaimer,
6
+ } from '@eeacms/volto-cca-policy/components';
7
+ import { blockAvailableInMission } from '@eeacms/volto-cca-policy/utils';
8
+
4
9
  import CcaEventView from './components/theme/Views/CcaEventView';
5
10
  import NewsItemView from './components/theme/Views/NewsItemView';
6
11
  import EventView from './components/theme/Views/EventView';
@@ -9,30 +14,23 @@ import CaseStudyView from './components/theme/Views/CaseStudyView';
9
14
  import ProjectView from './components/theme/Views/ProjectView';
10
15
  import C3SIndicatorView from './components/theme/Views/C3SIndicatorView';
11
16
  import DatabaseItemView from './components/theme/Views/DatabaseItemView';
12
- import MissionFundingCCAView from './components/theme/Views/MissionFundingCCAView';
13
-
14
- import { MissionToolView } from '@eeacms/volto-cca-policy/components';
15
17
 
18
+ import GeocharsWidget from './components/theme/Widgets/GeocharsWidget';
19
+ import GeolocationWidget from './components/theme/Widgets/GeolocationWidget';
20
+ import MigrationButtons from './components/MigrationButtons';
16
21
  import HealthHorizontalCardItem from './components/Result/HealthHorizontalCardItem';
17
22
 
18
- import ccaLogo from '@eeacms/volto-cca-policy/../theme/assets/images/Header/climate-adapt-logo.svg';
19
- import ccaLogoWhite from '@eeacms/volto-cca-policy/../theme/assets/images/Header/climate-adapt-logo-white.svg';
20
- import eeaWhiteLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/eea-logo-white.svg';
21
-
22
- import observatoryLogoWhite from '@eeacms/volto-cca-policy/../theme/assets/images/Header/observatory-white-logo.svg';
23
- import europeanComissionLogo from '@eeacms/volto-cca-policy/../theme/assets/images/Footer/ec_logo.svg';
23
+ import { langRedirection } from './store/middleware';
24
24
 
25
25
  import installBlocks from './components/manage/Blocks';
26
26
  import installSearchEngine from './search';
27
27
  import installStore from './store';
28
28
 
29
- import GeocharsWidget from './components/theme/Widgets/GeocharsWidget';
30
- import GeolocationWidget from './components/theme/Widgets/GeolocationWidget';
31
- import MigrationButtons from './components/MigrationButtons';
32
- import { TranslationDisclaimer } from '@eeacms/volto-cca-policy/components';
33
-
34
- import { blockAvailableInMission } from '@eeacms/volto-cca-policy/utils';
35
- import { langRedirection } from './store/middleware';
29
+ import ccaLogo from '@eeacms/volto-cca-policy/../theme/assets/images/Header/climate-adapt-logo.svg';
30
+ import ccaLogoWhite from '@eeacms/volto-cca-policy/../theme/assets/images/Header/climate-adapt-logo-white.svg';
31
+ import observatoryLogoWhite from '@eeacms/volto-cca-policy/../theme/assets/images/Header/observatory-white-logo.svg';
32
+ import europeanComissionLogo from '@eeacms/volto-cca-policy/../theme/assets/images/Footer/ec_logo.svg';
33
+ import eeaWhiteLogo from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/eea-logo-white.svg';
36
34
 
37
35
  import './slate-styles.less';
38
36
 
@@ -288,8 +286,6 @@ const applyConfig = (config) => {
288
286
  'eea.climateadapt.c3sindicator': C3SIndicatorView,
289
287
  'eea.climateadapt.adaptationoption': AdaptationOptionView,
290
288
  'News Item': NewsItemView,
291
- mission_funding_cca: MissionFundingCCAView,
292
- mission_tool: MissionToolView,
293
289
  };
294
290
 
295
291
  config.views.layoutViewsNamesMapping.view_cca_event = 'CCA Event View';
@@ -390,6 +386,11 @@ const applyConfig = (config) => {
390
386
  config.widgets.id.geochars = GeocharsWidget;
391
387
  config.widgets.id.geolocation = GeolocationWidget;
392
388
 
389
+ if (config.widgets.views?.widget) {
390
+ config.widgets.views.id.rast_steps = RASTWidgetView;
391
+ config.widgets.views.widget.rast_steps = RASTWidgetView;
392
+ }
393
+
393
394
  config.settings.slate.styleMenu.inlineStyles = [
394
395
  ...(config.settings.slate.styleMenu?.inlineStyles || []),
395
396
  { cssClass: 'large-text', label: 'Large text' },
@@ -445,7 +446,6 @@ const applyConfig = (config) => {
445
446
  ];
446
447
 
447
448
  // plug custom redux middleware
448
- //
449
449
  const storeExtender = (stack) => [langRedirection, ...stack];
450
450
  config.settings.storeExtenders = [
451
451
  storeExtender,
@@ -1,4 +1,4 @@
1
1
  .styled-hero {
2
2
  margin-top: 0;
3
3
  margin-bottom: 0;
4
- }
4
+ }
@@ -1,24 +0,0 @@
1
- const MissionDisclaimer = () => {
2
- return (
3
- <div className="styled-slate has--style_name--content-box-gray styled">
4
- <div className="disclaimer content-box">
5
- <div className="content-box-inner">
6
- <p>
7
- <strong>Disclaimer</strong>
8
- <br />
9
- The contents and links to third-party items on this Mission webpage
10
- are developed by the MIP4Adapt team led by Ricardo, under contract
11
- CINEA/2022/OP/0013/SI2.884597 funded by the European Union and do
12
- not necessarily reflect those of the European Union, CINEA, or those
13
- of the European Environment Agency (EEA) as host of the
14
- Climate-ADAPT Platform. Neither the European Union nor CINEA nor the
15
- EEA accepts responsibility or liability arising out of or in
16
- connection with the information on these pages.
17
- </p>
18
- </div>
19
- </div>
20
- </div>
21
- );
22
- };
23
-
24
- export default MissionDisclaimer;
@@ -1,159 +0,0 @@
1
- import {
2
- HTMLField,
3
- BannerTitle,
4
- MetadataItemList,
5
- } from '@eeacms/volto-cca-policy/helpers';
6
- import { Container, Grid, Segment, List } from 'semantic-ui-react';
7
- import {
8
- PortalMessage,
9
- MissionDisclaimer,
10
- } from '@eeacms/volto-cca-policy/components';
11
-
12
- function MissiongFundingCCAView(props) {
13
- const { content } = props;
14
-
15
- return (
16
- <div className="mission-item-view">
17
- <BannerTitle
18
- content={{ ...content, image: '' }}
19
- data={{
20
- info: [{ description: '' }],
21
- hideContentType: true,
22
- hideCreationDate: true,
23
- hideModificationDate: true,
24
- hidePublishingDate: true,
25
- hideDownloadButton: false,
26
- hideShareButton: false,
27
- subtitle: 'EU and National Funding of Climate Change Adaption',
28
- }}
29
- />
30
-
31
- <Container>
32
- <PortalMessage content={content} />
33
- <Grid columns="12">
34
- <div className="row">
35
- <Grid.Column
36
- mobile={12}
37
- tablet={12}
38
- computer={8}
39
- className="col-left"
40
- >
41
- {!!content.objective && content.objective.data.length > 7 && (
42
- <>
43
- <h3>Objective of the funding programme</h3>
44
- <HTMLField value={content.objective} />
45
- </>
46
- )}
47
-
48
- {!!content.funding_type && (
49
- <>
50
- <h3>Type of funding</h3>
51
- <HTMLField value={content.funding_type} />
52
- </>
53
- )}
54
-
55
- {!!content.budget_range && (
56
- <>
57
- <h3>Expected budget range of proposals</h3>
58
- <p>{content.budget_range}</p>
59
- </>
60
- )}
61
-
62
- {!!content.funding_rate && (
63
- <>
64
- <h3>Funding rate (percentage of covered costs)</h3>
65
- <p>{content.funding_rate}</p>
66
- </>
67
- )}
68
- <h3>
69
- Can the received funding be combined with other funding sources
70
- (blended)?
71
- </h3>
72
- <p>{content.is_blended === true ? 'Yes' : 'No'}</p>
73
- <h3>Is a Consortium required to apply for the funding?</h3>
74
- <p>{content.is_consortium_required === true ? 'Yes' : 'No'}</p>
75
- {!!content.authority && (
76
- <>
77
- <h3>Administering authority</h3>
78
- <p>{content.authority}</p>
79
- </>
80
- )}
81
- {!!content.publication_page && (
82
- <>
83
- <h3>Publication page</h3>
84
- <a href={content.publication_page}>
85
- {content.publication_page}
86
- </a>
87
- </>
88
- )}
89
- {!!content.general_info && (
90
- <>
91
- <h3>General information</h3>
92
- <a href={content.general_info}>{content.general_info}</a>
93
- </>
94
- )}
95
- {!!content.further_info && (
96
- <>
97
- <h3>Further information</h3>
98
- <p>{content.further_info}</p>
99
- </>
100
- )}
101
- </Grid.Column>
102
- <Grid.Column
103
- mobile={12}
104
- tablet={12}
105
- computer={4}
106
- className="col-right"
107
- >
108
- <Segment className="metadata">
109
- {!!content.country && content.country.length > 0 && (
110
- <>
111
- <h5>Countries where the funding opportunity is offered</h5>
112
- <p>
113
- {content.country
114
- .map((country) => country.title)
115
- .join(', ')}
116
- </p>
117
- </>
118
- )}
119
- {!!content.regions && content.regions.length > 0 && (
120
- <>
121
- <h5>Region where the funding is offered</h5>
122
- <p>{content.regions}</p>
123
- </>
124
- )}
125
- {!!content.rast_steps && content.rast_steps.length > 0 && (
126
- <>
127
- <h5>RAST step(s) of relevance</h5>
128
- <List>
129
- {content.rast_steps.map((step, index) => (
130
- <List.Item key={index}>{step.title}</List.Item>
131
- ))}
132
- </List>
133
- </>
134
- )}
135
- {!!content.eligible_entities &&
136
- content.eligible_entities.length > 0 && (
137
- <>
138
- <h5>Eligible to receive funding</h5>
139
- <MetadataItemList value={content.eligible_entities} />
140
- </>
141
- )}
142
- {!!content.sectors && content.sectors.length > 0 && (
143
- <>
144
- <h5>Adaptation Sectors</h5>
145
- <MetadataItemList value={content.sectors} />
146
- </>
147
- )}
148
- </Segment>
149
- </Grid.Column>
150
- </div>
151
- </Grid>
152
-
153
- <MissionDisclaimer />
154
- </Container>
155
- </div>
156
- );
157
- }
158
-
159
- export default MissiongFundingCCAView;
@@ -1,104 +0,0 @@
1
- import React from 'react';
2
- import { MemoryRouter } from 'react-router-dom';
3
- import configureStore from 'redux-mock-store';
4
- import { render } from '@testing-library/react';
5
- import '@testing-library/jest-dom/extend-expect';
6
- import { Provider } from 'react-intl-redux';
7
- import MissiongFundingCCAView from './MissionFundingCCAView';
8
- import config from '@plone/volto/registry';
9
-
10
- config.blocks = {
11
- blocksConfig: {
12
- title: {
13
- view: () => <div>Title Block Component</div>,
14
- },
15
- },
16
- };
17
-
18
- const mockStore = configureStore();
19
-
20
- describe('MissiongFundingCCAView', () => {
21
- it('should render the component', () => {
22
- const data = {
23
- content: {
24
- contributors: [],
25
- country: [
26
- {
27
- title: 'Albania',
28
- token: 'AL',
29
- },
30
- {
31
- title: 'Armenia',
32
- token: 'AM',
33
- },
34
- ],
35
- description: 'Summary',
36
- eligible_entities: [
37
- {
38
- title: 'Social, cultural, educational bodies',
39
- token: 'B_SOCIAL_CULTURAL',
40
- },
41
- {
42
- title: 'NGOs',
43
- token: 'D_NGOS',
44
- },
45
- ],
46
- funding_rate: 'funding rate',
47
- funding_type: {
48
- 'content-type': 'text/html',
49
- data: '<p>type of funding</p>',
50
- encoding: 'utf8',
51
- },
52
- further_info: 'further info',
53
- general_info: '/sandbox',
54
- is_blended: true,
55
- is_consortium_required: false,
56
- objective: {
57
- 'content-type': 'text/html',
58
- data: '<p></p>',
59
- encoding: 'utf8',
60
- },
61
- publication_page: 'https://google.com',
62
- rast_steps: [
63
- {
64
- title: 'Step 1. Preparing the ground for adaptation',
65
- token: 'STEP_1',
66
- },
67
- {
68
- title: 'Step 4. Assessing and selecting adaptation options',
69
- token: 'STEP_4',
70
- },
71
- ],
72
- regions: 'region here',
73
- sectors: [
74
- {
75
- title: 'Biodiversity',
76
- token: 'BIODIVERSITY',
77
- },
78
- {
79
- title: 'Coastal areas',
80
- token: 'COASTAL',
81
- },
82
- ],
83
- title: 'Title here',
84
- },
85
- };
86
-
87
- const store = mockStore({
88
- userSession: { token: '1234' },
89
- intl: {
90
- locale: 'en',
91
- messages: {},
92
- },
93
- });
94
-
95
- const { container } = render(
96
- <Provider store={store}>
97
- <MemoryRouter>
98
- <MissiongFundingCCAView {...data} />
99
- </MemoryRouter>
100
- </Provider>,
101
- );
102
- expect(container.querySelector('.mission-item-view')).toBeInTheDocument();
103
- });
104
- });
@@ -1,226 +0,0 @@
1
- import React from 'react';
2
- import {
3
- HTMLField,
4
- BannerTitle,
5
- MetadataItemList,
6
- } from '@eeacms/volto-cca-policy/helpers';
7
- import { Container, Grid, Image, Segment, List } from 'semantic-ui-react';
8
- import {
9
- PortalMessage,
10
- MissionDisclaimer,
11
- } from '@eeacms/volto-cca-policy/components';
12
-
13
- function MissionToolView(props) {
14
- const { content } = props;
15
-
16
- return (
17
- <div className="mission-item-view">
18
- <BannerTitle
19
- content={{ ...content, image: '' }}
20
- data={{
21
- info: [{ description: '' }],
22
- hideContentType: true,
23
- hideCreationDate: false,
24
- hideModificationDate: false,
25
- hidePublishingDate: false,
26
- hideDownloadButton: false,
27
- hideShareButton: false,
28
- }}
29
- />
30
-
31
- <Container>
32
- <PortalMessage content={content} />
33
- <Grid columns="12">
34
- <div className="row">
35
- <Grid.Column
36
- mobile={12}
37
- tablet={12}
38
- computer={8}
39
- className="col-left"
40
- >
41
- {!!content.objective && (
42
- <>
43
- <h2>Objective(s)</h2>
44
- <HTMLField value={content.objective} />
45
- </>
46
- )}
47
-
48
- {!!content.short_description && (
49
- <>
50
- <h2>Short description</h2>
51
- <HTMLField value={content.short_description} />
52
- </>
53
- )}
54
-
55
- {!!content.free_keywords && (
56
- <>
57
- <h2>Free keywords</h2>
58
- <HTMLField value={content.free_keywords} />
59
- </>
60
- )}
61
-
62
- {!!content.readiness_for_use &&
63
- content.readiness_for_use.length > 0 && (
64
- <>
65
- <h2>Readiness for use</h2>
66
-
67
- <MetadataItemList value={content.readiness_for_use} />
68
- </>
69
- )}
70
-
71
- {!!content.applications && (
72
- <>
73
- <h2>Applications</h2>
74
- <HTMLField value={content.applications} />
75
- </>
76
- )}
77
-
78
- {!!content.strengths_weaknesses && (
79
- <>
80
- <h2>
81
- Strengths and weaknesses, comparative added value to other
82
- similar tools
83
- </h2>
84
- <HTMLField value={content.strengths_weaknesses} />
85
- </>
86
- )}
87
-
88
- {!!content.input && (
89
- <>
90
- <h2>Input(s)</h2>
91
- <HTMLField value={content.input} />
92
- </>
93
- )}
94
-
95
- {!!content.output && (
96
- <>
97
- <h3>Output(s)</h3>
98
- <HTMLField value={content.output} />
99
- </>
100
- )}
101
-
102
- {!!content.output_image && (
103
- <Image
104
- src={content.output_image?.scales?.large?.download}
105
- alt={content.title}
106
- style={{ margin: '2.5em 0' }}
107
- />
108
- )}
109
-
110
- {!!content.replicability && (
111
- <>
112
- <h2>Replicability: Cost/effort for (new) usage</h2>
113
- <HTMLField value={content.replicability} />
114
- </>
115
- )}
116
-
117
- {!!content.materials && (
118
- <>
119
- <h2>Materials or other support available</h2>
120
- <HTMLField value={content.materials} />
121
- </>
122
- )}
123
-
124
- {!!content.website && (
125
- <>
126
- <h2>Website and maintenance</h2>
127
- <HTMLField value={content.website} />
128
- </>
129
- )}
130
-
131
- {!!content.contact && (
132
- <>
133
- <h2>Contact</h2>
134
- <HTMLField value={content.contact} />
135
- </>
136
- )}
137
-
138
- {!!content.associated_project && (
139
- <>
140
- <h2>Associated project(s)</h2>
141
- <HTMLField value={content.associated_project} />
142
- </>
143
- )}
144
- </Grid.Column>
145
- <Grid.Column
146
- mobile={12}
147
- tablet={12}
148
- computer={4}
149
- className="col-right"
150
- >
151
- <Segment className="metadata">
152
- {!!content.rast_steps && content.rast_steps.length > 0 && (
153
- <>
154
- <h5>RAST step(s) of relevance:</h5>
155
- <List>
156
- {content.rast_steps.map((step, index) => (
157
- <List.Item key={index}>{step.title}</List.Item>
158
- ))}
159
- </List>
160
- </>
161
- )}
162
-
163
- {!!content.geographical_scale &&
164
- content.geographical_scale.length > 0 && (
165
- <>
166
- <h5>Geographical scale:</h5>
167
- <MetadataItemList value={content.geographical_scale} />
168
- </>
169
- )}
170
-
171
- {!!content.geographical_area && (
172
- <>
173
- <h5>Geographical area:</h5>
174
- <HTMLField value={content.geographical_area} />
175
- </>
176
- )}
177
-
178
- {!!content.climate_impacts &&
179
- content.climate_impacts.length > 0 && (
180
- <>
181
- <h5>Climate impacts:</h5>
182
- <MetadataItemList value={content.climate_impacts} />
183
- </>
184
- )}
185
-
186
- {!!content.tool_language && content.tool_language.length > 0 && (
187
- <>
188
- <h5>Language(s) of the tool:</h5>
189
- <MetadataItemList value={content.tool_language} />
190
- </>
191
- )}
192
-
193
- {!!content.sectors && content.sectors.length > 0 && (
194
- <>
195
- <h5>Adaptation sectors:</h5>
196
- <MetadataItemList value={content.sectors} />
197
- </>
198
- )}
199
-
200
- {!!content.most_useful_for &&
201
- content.most_useful_for.length > 0 && (
202
- <>
203
- <h5>Most useful for:</h5>
204
- <MetadataItemList value={content.most_useful_for} />
205
- </>
206
- )}
207
-
208
- {!!content.user_requirements &&
209
- content.user_requirements.length > 0 && (
210
- <>
211
- <h5>User requirements:</h5>
212
- <MetadataItemList value={content.user_requirements} />
213
- </>
214
- )}
215
- </Segment>
216
- </Grid.Column>
217
- </div>
218
- </Grid>
219
-
220
- <MissionDisclaimer />
221
- </Container>
222
- </div>
223
- );
224
- }
225
-
226
- export default MissionToolView;
@@ -1,154 +0,0 @@
1
- import React from 'react';
2
- import { MemoryRouter } from 'react-router-dom';
3
- import configureStore from 'redux-mock-store';
4
- import renderer from 'react-test-renderer';
5
- import '@testing-library/jest-dom/extend-expect';
6
- import { Provider } from 'react-intl-redux';
7
- import MissionToolView from './MissionToolView';
8
- import config from '@plone/volto/registry';
9
-
10
- config.blocks = {
11
- blocksConfig: {
12
- title: {
13
- view: () => <div>Title Block Component</div>,
14
- },
15
- },
16
- };
17
-
18
- const mockStore = configureStore();
19
-
20
- describe('MissionToolView', () => {
21
- it('should render the component', () => {
22
- const data = {
23
- content: {
24
- contributors: [],
25
- description: 'Summary',
26
- objective: {
27
- 'content-type': 'text/html',
28
- data: '<p></p>',
29
- encoding: 'utf8',
30
- },
31
- short_description: {
32
- 'content-type': 'text/html',
33
- data: '<p></p>',
34
- encoding: 'utf8',
35
- },
36
- free_keywords: {
37
- 'content-type': 'text/html',
38
- data: '<p></p>',
39
- encoding: 'utf8',
40
- },
41
- readiness_for_use: [
42
- {
43
- title: 'Tool tested in several case studies',
44
- token: 'Tool tested in several case studies',
45
- },
46
- {
47
- title: 'Tool broadly used',
48
- token: 'Tool broadly used',
49
- },
50
- ],
51
- application: {
52
- 'content-type': 'text/html',
53
- data: '<p></p>',
54
- encoding: 'utf8',
55
- },
56
- strengths_weaknesses: {
57
- 'content-type': 'text/html',
58
- data: '<p></p>',
59
- encoding: 'utf8',
60
- },
61
- input: {
62
- 'content-type': 'text/html',
63
- data: '<p></p>',
64
- encoding: 'utf8',
65
- },
66
- output: {
67
- 'content-type': 'text/html',
68
- data: '<p></p>',
69
- encoding: 'utf8',
70
- },
71
- replicability: {
72
- 'content-type': 'text/html',
73
- data: '<p></p>',
74
- encoding: 'utf8',
75
- },
76
- materials: {
77
- 'content-type': 'text/html',
78
- data: '<p></p>',
79
- encoding: 'utf8',
80
- },
81
- website: {
82
- 'content-type': 'text/html',
83
- data: '<p></p>',
84
- encoding: 'utf8',
85
- },
86
- contact: {
87
- 'content-type': 'text/html',
88
- data: '<p></p>',
89
- encoding: 'utf8',
90
- },
91
- associated_project: {
92
- 'content-type': 'text/html',
93
- data: '<p></p>',
94
- encoding: 'utf8',
95
- },
96
- rast_steps: [
97
- {
98
- title: 'Step 1. Preparing the ground for adaptation',
99
- token: 'STEP_1',
100
- },
101
- {
102
- title: 'Step 4. Assessing and selecting adaptation options',
103
- token: 'STEP_4',
104
- },
105
- ],
106
- geographical_scale: [
107
- {
108
- title: 'Item 1',
109
- token: 'Item 1',
110
- },
111
- {
112
- title: 'Item 2',
113
- token: 'Item 2',
114
- },
115
- ],
116
- geographical_area: {
117
- 'content-type': 'text/html',
118
- data: '<p></p>',
119
- encoding: 'utf8',
120
- },
121
- sectors: [
122
- {
123
- title: 'Biodiversity',
124
- token: 'BIODIVERSITY',
125
- },
126
- {
127
- title: 'Coastal areas',
128
- token: 'COASTAL',
129
- },
130
- ],
131
- title: 'Title here',
132
- },
133
- };
134
-
135
- const store = mockStore({
136
- userSession: { token: '1234' },
137
- intl: {
138
- locale: 'en',
139
- messages: {},
140
- },
141
- });
142
-
143
- const component = renderer.create(
144
- <Provider store={store}>
145
- <MemoryRouter>
146
- <MissionToolView {...data} />
147
- </MemoryRouter>
148
- </Provider>,
149
- );
150
-
151
- const json = component.toJSON();
152
- expect(json).toMatchSnapshot();
153
- });
154
- });
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import cx from 'classnames';
3
- import Tag from '@eeacms/volto-eea-design-system/ui/Tag/Tag';
4
-
5
- export const TokenWidget = ({ value, children, className }) =>
6
- value ? (
7
- <span className={cx(className, 'token', 'widget')}>
8
- {value.map((tag) => (
9
- <Tag href={`http://search.apps.eea.europa.eu/?q=${tag}`} key={tag}>
10
- {children ? children(tag) : tag}
11
- </Tag>
12
- ))}
13
- </span>
14
- ) : (
15
- ''
16
- );