@eeacms/volto-cca-policy 0.1.83 → 0.1.84
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 +32 -9
- package/package.json +1 -1
- package/src/components/index.js +1 -0
- package/src/components/manage/Blocks/Listing/EventCardsListingView.jsx +1 -1
- package/src/components/theme/ImageGallery/ImageGallery.jsx +82 -0
- package/src/components/theme/Views/AdaptationOptionView.jsx +102 -88
- package/src/components/theme/Views/C3SIndicatorView.jsx +81 -42
- package/src/components/theme/Views/CaseStudyView.jsx +91 -79
- package/src/components/theme/Views/CcaEventView.jsx +3 -12
- package/src/components/theme/Views/EventView.jsx +3 -12
- package/src/components/theme/Views/GuidanceView.jsx +38 -48
- package/src/components/theme/Views/IndicatorView.jsx +39 -49
- package/src/components/theme/Views/InformationPortalView.jsx +23 -40
- package/src/components/theme/Views/OrganisationView.jsx +51 -68
- package/src/components/theme/Views/ProjectView.jsx +47 -47
- package/src/components/theme/Views/PublicationReportView.jsx +17 -25
- package/src/components/theme/Views/ToolView.jsx +10 -24
- package/src/components/theme/Views/VideoView.jsx +77 -81
- package/src/helpers/ContentMetadata.jsx +13 -33
- package/src/helpers/Utils.jsx +8 -15
- package/src/index.js +0 -1
- package/src/policy.js +0 -2
- package/src/search/mission_stories/config-stories.js +2 -2
- package/theme/extras/header.overrides +1 -0
- package/theme/globals/site.overrides +196 -57
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Footer/Contact.jsx +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,38 @@ 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.1.
|
|
7
|
+
### [0.1.84](https://github.com/eea/volto-cca-policy/compare/0.1.83...0.1.84) - 28 February 2024
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: image gallery [kreafox - [`758a8f3`](https://github.com/eea/volto-cca-policy/commit/758a8f3d187e44e7782c6bba2e9d98e3f179b559)]
|
|
12
|
+
- fix: remove unused import [kreafox - [`9790189`](https://github.com/eea/volto-cca-policy/commit/97901892059d308a9500f53573ea1f1f0e27a587)]
|
|
13
|
+
- fix: className [kreafox - [`851d7f1`](https://github.com/eea/volto-cca-policy/commit/851d7f1c6ac5ccc338225f18ab33f08b414d517f)]
|
|
14
|
+
- fix: more checks on db items [kreafox - [`e673ca8`](https://github.com/eea/volto-cca-policy/commit/e673ca85fed7ebab6879a3dc8d09f6b80b97fce5)]
|
|
15
|
+
- fix: missing content on c3sindicator view [kreafox - [`0126bb5`](https://github.com/eea/volto-cca-policy/commit/0126bb5ad2653956cd2863e03f66b6f18d9a25c4)]
|
|
16
|
+
- fix: error on missing metadata values [kreafox - [`300849b`](https://github.com/eea/volto-cca-policy/commit/300849b0d4b17d6352290479fdd6458af538aa50)]
|
|
17
|
+
|
|
18
|
+
#### :nail_care: Enhancements
|
|
19
|
+
|
|
20
|
+
- change: remove Footer customization [kreafox - [`b1c2c86`](https://github.com/eea/volto-cca-policy/commit/b1c2c8608eaff77db40cbf1d9158a7a72bd558aa)]
|
|
21
|
+
- change: small updates on db items, cleanup [kreafox - [`0a3981b`](https://github.com/eea/volto-cca-policy/commit/0a3981be1d2761d2bdf5049b0a2cffa1417687bc)]
|
|
22
|
+
- change: update mission stories search index [kreafox - [`3ea7107`](https://github.com/eea/volto-cca-policy/commit/3ea71075e30cb8fa8d5a0b28822ab67ea6c1c7e9)]
|
|
23
|
+
- change: update case study view, add ImageGallery component [kreafox - [`5a83100`](https://github.com/eea/volto-cca-policy/commit/5a83100f76f4f64655561f09e20a516a403dd982)]
|
|
24
|
+
- change: formatting [kreafox - [`00a0baa`](https://github.com/eea/volto-cca-policy/commit/00a0baa225d2e39cc3b75e41a870c23a45a9b62a)]
|
|
25
|
+
|
|
26
|
+
#### :house: Internal changes
|
|
27
|
+
|
|
28
|
+
- style: nonclickable menu [kreafox - [`dc11808`](https://github.com/eea/volto-cca-policy/commit/dc11808c1ca5006713522f152c0d8359a4324ea1)]
|
|
29
|
+
- style: update c3s indicator view [kreafox - [`2007587`](https://github.com/eea/volto-cca-policy/commit/2007587f919d2866ea79b846585c3177e4b905fd)]
|
|
30
|
+
|
|
31
|
+
#### :hammer_and_wrench: Others
|
|
32
|
+
|
|
33
|
+
- Refs #265786 - Fix text Climate-ADAPT in events cards listing. [GhitaB - [`66e5f3d`](https://github.com/eea/volto-cca-policy/commit/66e5f3d6876cae0f6e3e2ebda11fcbd19cc10e5b)]
|
|
34
|
+
- test: update tests for db items view [kreafox - [`ed3af67`](https://github.com/eea/volto-cca-policy/commit/ed3af67da0f535b5dda8616fe8523f286bbca935)]
|
|
35
|
+
- CCA Event, Event view: use BannerTitle. [GhitaB - [`84d1dd6`](https://github.com/eea/volto-cca-policy/commit/84d1dd6e9472de069de8c2d1aedf9f00030e60c8)]
|
|
36
|
+
- WIP: improve layout on DB items, code cleanup [kreafox - [`2f14ad1`](https://github.com/eea/volto-cca-policy/commit/2f14ad1be2b09ddf569b1c9893f113031421d6f5)]
|
|
37
|
+
- WIP: database items view [kreafox - [`4602d76`](https://github.com/eea/volto-cca-policy/commit/4602d762849b2c84cc26af9f528fb11f22618c0f)]
|
|
38
|
+
### [0.1.83](https://github.com/eea/volto-cca-policy/compare/0.1.82...0.1.83) - 27 February 2024
|
|
8
39
|
|
|
9
40
|
#### :hammer_and_wrench: Others
|
|
10
41
|
|
|
@@ -409,13 +440,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
409
440
|
- Refs #260715 rast-block wip [Tripon Eugen - [`f19d54e`](https://github.com/eea/volto-cca-policy/commit/f19d54e0b9a6a86bf344eb85b6a1cda7f3de91bf)]
|
|
410
441
|
- Refs #260715 rast-block wip [Tripon Eugen - [`2828537`](https://github.com/eea/volto-cca-policy/commit/2828537b6c084cd1a82162d552fb4ef025b71f9f)]
|
|
411
442
|
- Refs #260715 rast-block updates [Tripon Eugen - [`1e803e5`](https://github.com/eea/volto-cca-policy/commit/1e803e5bd3d3fb7558f261c76c68866be7beb8b5)]
|
|
412
|
-
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0a15e1b`](https://github.com/eea/volto-cca-policy/commit/0a15e1b2ad081233685e80d5b3c60a8663f6b896)]
|
|
413
|
-
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`9554e44`](https://github.com/eea/volto-cca-policy/commit/9554e44c92a621a52b2adb5a4830fb084ee5734b)]
|
|
414
443
|
### [0.1.49](https://github.com/eea/volto-cca-policy/compare/0.1.48...0.1.49) - 15 November 2023
|
|
415
444
|
|
|
416
445
|
#### :house: Internal changes
|
|
417
446
|
|
|
418
|
-
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`7b820a6`](https://github.com/eea/volto-cca-policy/commit/7b820a6369c2ddd5203b1a4abe352cb4bb43db7a)]
|
|
419
447
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`f0a8061`](https://github.com/eea/volto-cca-policy/commit/f0a8061c275c236deb00087c23fac9860a073106)]
|
|
420
448
|
|
|
421
449
|
#### :hammer_and_wrench: Others
|
|
@@ -432,9 +460,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
432
460
|
- Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
|
|
433
461
|
- Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
|
|
434
462
|
- Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
|
|
435
|
-
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
|
|
436
|
-
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
|
|
437
|
-
- test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
|
|
438
463
|
- Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
|
|
439
464
|
- 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)]
|
|
440
465
|
- Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
|
|
@@ -651,7 +676,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
651
676
|
|
|
652
677
|
#### :house: Internal changes
|
|
653
678
|
|
|
654
|
-
- chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
|
|
655
679
|
|
|
656
680
|
#### :hammer_and_wrench: Others
|
|
657
681
|
|
|
@@ -1132,7 +1156,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
1132
1156
|
#### :hammer_and_wrench: Others
|
|
1133
1157
|
|
|
1134
1158
|
- Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
|
|
1135
|
-
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
|
|
1136
1159
|
### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
|
|
1137
1160
|
|
|
1138
1161
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
package/src/components/index.js
CHANGED
|
@@ -122,7 +122,7 @@ const EventCardsListingView = ({ items, isEditMode, token }) => {
|
|
|
122
122
|
)}
|
|
123
123
|
<div className="source">
|
|
124
124
|
<ConditionalLink item={item} condition={!isEditMode}>
|
|
125
|
-
Climate
|
|
125
|
+
Climate-ADAPT page for this event
|
|
126
126
|
</ConditionalLink>
|
|
127
127
|
</div>
|
|
128
128
|
{!!item.contact_email && (
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import loadable from '@loadable/component';
|
|
3
|
+
import { Modal, Image } from 'semantic-ui-react';
|
|
4
|
+
|
|
5
|
+
import 'slick-carousel/slick/slick.css';
|
|
6
|
+
import 'slick-carousel/slick/slick-theme.css';
|
|
7
|
+
|
|
8
|
+
const Slider = loadable(() => import('react-slick'));
|
|
9
|
+
|
|
10
|
+
const ImageGallery = (props) => {
|
|
11
|
+
const { items = [] } = props;
|
|
12
|
+
|
|
13
|
+
const [open, setOpen] = React.useState(false);
|
|
14
|
+
const [slideIndex, setSlideIndex] = React.useState(0);
|
|
15
|
+
const [updateCount, setUpdateCount] = React.useState(0);
|
|
16
|
+
const sliderRef = React.useRef(null);
|
|
17
|
+
|
|
18
|
+
const carouselSettings = React.useMemo(
|
|
19
|
+
() => ({
|
|
20
|
+
afterChange: () => setUpdateCount(updateCount + 1),
|
|
21
|
+
beforeChange: (current, next) => setSlideIndex(next),
|
|
22
|
+
infinite: true,
|
|
23
|
+
slidesToShow: 1,
|
|
24
|
+
slidesToScroll: 1,
|
|
25
|
+
dots: false,
|
|
26
|
+
arrows: true,
|
|
27
|
+
adaptiveHeight: true,
|
|
28
|
+
autoplay: false,
|
|
29
|
+
fade: false,
|
|
30
|
+
useTransform: false,
|
|
31
|
+
initialSlide: slideIndex,
|
|
32
|
+
}),
|
|
33
|
+
[slideIndex, updateCount],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const handleClick = () => {
|
|
37
|
+
if (items.length) {
|
|
38
|
+
setSlideIndex(0);
|
|
39
|
+
setOpen(true);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className="image-gallery">
|
|
45
|
+
<div
|
|
46
|
+
tabIndex={0}
|
|
47
|
+
role="button"
|
|
48
|
+
onKeyDown={handleClick}
|
|
49
|
+
onClick={handleClick}
|
|
50
|
+
>
|
|
51
|
+
<Image
|
|
52
|
+
src={items[0]?.url}
|
|
53
|
+
alt={items[0]?.title}
|
|
54
|
+
className="preview-image"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<Modal
|
|
59
|
+
closeIcon
|
|
60
|
+
open={open}
|
|
61
|
+
className="slider-modal"
|
|
62
|
+
onClose={() => setOpen(false)}
|
|
63
|
+
onOpen={() => setOpen(true)}
|
|
64
|
+
>
|
|
65
|
+
<Modal.Content>
|
|
66
|
+
<h3>{items[slideIndex]?.title}</h3>
|
|
67
|
+
<p>{items[slideIndex]?.description}</p>
|
|
68
|
+
<Slider {...carouselSettings} ref={sliderRef}>
|
|
69
|
+
{items.map((item, i) => {
|
|
70
|
+
return <Image key={i} src={item.url} alt={item?.title} />;
|
|
71
|
+
})}
|
|
72
|
+
</Slider>
|
|
73
|
+
<div className="slide-image-count">
|
|
74
|
+
<strong>{slideIndex + 1}</strong> of {items.length}
|
|
75
|
+
</div>
|
|
76
|
+
</Modal.Content>
|
|
77
|
+
</Modal>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default ImageGallery;
|
|
@@ -7,7 +7,9 @@ import {
|
|
|
7
7
|
ShareInfo,
|
|
8
8
|
BannerTitle,
|
|
9
9
|
} from '@eeacms/volto-cca-policy/helpers';
|
|
10
|
-
import {
|
|
10
|
+
import { Segment, Divider } from 'semantic-ui-react';
|
|
11
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
12
|
+
import cx from 'classnames';
|
|
11
13
|
|
|
12
14
|
function createDataField(type, field, section, title) {
|
|
13
15
|
return {
|
|
@@ -69,21 +71,23 @@ const SectionsMenu = (props) => {
|
|
|
69
71
|
const { sections } = props;
|
|
70
72
|
|
|
71
73
|
return (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
<div className="adaptation-details">
|
|
75
|
+
<div>
|
|
76
|
+
{sections.length > 0 && (
|
|
77
|
+
<>
|
|
78
|
+
<h3>Additional Details</h3>
|
|
79
|
+
<ul>
|
|
80
|
+
{sections.map((data, index) => (
|
|
81
|
+
<li key={index}>
|
|
82
|
+
<a href={'#' + sectionID(data.title)}>{data.title}</a>
|
|
83
|
+
</li>
|
|
84
|
+
))}
|
|
85
|
+
</ul>
|
|
86
|
+
</>
|
|
87
|
+
)}
|
|
88
|
+
</div>
|
|
89
|
+
<div>
|
|
90
|
+
<h3>Reference information</h3>
|
|
87
91
|
<ul>
|
|
88
92
|
<li>
|
|
89
93
|
<a href="#websites">Websites</a>
|
|
@@ -92,95 +96,105 @@ const SectionsMenu = (props) => {
|
|
|
92
96
|
<a href="#source">Source</a>
|
|
93
97
|
</li>
|
|
94
98
|
</ul>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
98
101
|
);
|
|
99
102
|
};
|
|
100
103
|
|
|
101
104
|
function AdaptationOptionView(props) {
|
|
102
105
|
const { content } = props;
|
|
106
|
+
const {
|
|
107
|
+
related_case_studies,
|
|
108
|
+
long_description,
|
|
109
|
+
websites,
|
|
110
|
+
source,
|
|
111
|
+
ipcc_category,
|
|
112
|
+
} = content;
|
|
103
113
|
|
|
104
114
|
const usedSections = dataDisplay.filter((data) =>
|
|
105
115
|
content?.hasOwnProperty(data.field),
|
|
106
116
|
);
|
|
107
117
|
|
|
108
118
|
return (
|
|
109
|
-
<div className="adaptation-option-view">
|
|
119
|
+
<div className="db-item-view adaptation-option-view">
|
|
110
120
|
<BannerTitle content={content} type="Adaptation Option" />
|
|
111
121
|
|
|
112
122
|
<div className="ui container">
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
>
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
{usedSections.map((data, index) => (
|
|
141
|
-
<Fragment key={index}>
|
|
142
|
-
<div id={sectionID(data.title)} className="section">
|
|
143
|
-
<h5 className="section-title">{data.title}</h5>
|
|
144
|
-
<HTMLField
|
|
145
|
-
value={content[data.field]}
|
|
146
|
-
className="long_description"
|
|
147
|
-
/>
|
|
148
|
-
</div>
|
|
149
|
-
</Fragment>
|
|
150
|
-
))}
|
|
151
|
-
</>
|
|
152
|
-
)}
|
|
153
|
-
</div>
|
|
154
|
-
<hr />
|
|
155
|
-
</Fragment>
|
|
123
|
+
<HTMLField value={long_description} />
|
|
124
|
+
<SectionsMenu sections={usedSections} />
|
|
125
|
+
<Divider />
|
|
126
|
+
|
|
127
|
+
{content?.ipcc_category?.length > 0 && (
|
|
128
|
+
<Fragment>
|
|
129
|
+
<h2>Adaptation Details</h2>
|
|
130
|
+
<div id={sectionID('IPCC categories')} className="section">
|
|
131
|
+
<h5 className="section-title">IPCC categories</h5>
|
|
132
|
+
{ipcc_category
|
|
133
|
+
.map((item) => item.title)
|
|
134
|
+
.sort()
|
|
135
|
+
.join(', ')}
|
|
136
|
+
|
|
137
|
+
{usedSections.length > 0 && (
|
|
138
|
+
<>
|
|
139
|
+
{usedSections
|
|
140
|
+
.filter((data) => data.field !== 'ipcc_category')
|
|
141
|
+
.map((data, index) => (
|
|
142
|
+
<Fragment key={index}>
|
|
143
|
+
<div id={sectionID(data.title)} className="section">
|
|
144
|
+
<h5 className="section-title">{data.title}</h5>
|
|
145
|
+
<HTMLField value={content[data.field]} />
|
|
146
|
+
</div>
|
|
147
|
+
</Fragment>
|
|
148
|
+
))}
|
|
149
|
+
</>
|
|
156
150
|
)}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
151
|
+
</div>
|
|
152
|
+
<Divider />
|
|
153
|
+
</Fragment>
|
|
154
|
+
)}
|
|
155
|
+
|
|
156
|
+
<h2>Reference information</h2>
|
|
157
|
+
|
|
158
|
+
{websites && websites?.length > 0 && (
|
|
159
|
+
<LinksList title="Websites:" value={websites} />
|
|
160
|
+
)}
|
|
161
|
+
|
|
162
|
+
<div id="source" className="section">
|
|
163
|
+
<h5 id="source">References:</h5>
|
|
164
|
+
<HTMLField value={source} />
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<PublishedModifiedInfo {...props} />
|
|
168
|
+
<ShareInfo {...props} />
|
|
169
|
+
|
|
170
|
+
<div className="content-box">
|
|
171
|
+
<div className="content-box-inner">
|
|
172
|
+
<Segment>
|
|
173
|
+
<ContentMetadata {...props} />
|
|
174
|
+
</Segment>
|
|
175
|
+
|
|
176
|
+
{related_case_studies?.length > 0 && (
|
|
177
|
+
<div className="content-metadata">
|
|
178
|
+
<Segment>
|
|
179
|
+
<h5>Case studies related to this option</h5>
|
|
180
|
+
<ul
|
|
181
|
+
className={cx('related-case-studies', {
|
|
182
|
+
columned: related_case_studies?.length > 5,
|
|
183
|
+
})}
|
|
184
|
+
>
|
|
185
|
+
{related_case_studies.map((item, index) => (
|
|
186
|
+
<li key={index}>
|
|
187
|
+
<UniversalLink key={index} href={item.url}>
|
|
188
|
+
{item.title}
|
|
189
|
+
</UniversalLink>
|
|
190
|
+
</li>
|
|
191
|
+
))}
|
|
192
|
+
</ul>
|
|
193
|
+
</Segment>
|
|
180
194
|
</div>
|
|
181
|
-
|
|
195
|
+
)}
|
|
182
196
|
</div>
|
|
183
|
-
</
|
|
197
|
+
</div>
|
|
184
198
|
</div>
|
|
185
199
|
</div>
|
|
186
200
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import spinner from '@eeacms/volto-cca-policy/../theme//assets/images/spinner.svg';
|
|
3
|
-
import { HTMLField } from '@eeacms/volto-cca-policy/helpers';
|
|
4
|
-
import {
|
|
3
|
+
import { HTMLField, BannerTitle } from '@eeacms/volto-cca-policy/helpers';
|
|
4
|
+
import { Accordion, Icon, Segment } from 'semantic-ui-react';
|
|
5
5
|
|
|
6
6
|
if (!__SERVER__) {
|
|
7
7
|
window.cds_toolbox = {
|
|
@@ -47,10 +47,13 @@ const createIframe = (div_id, details_url, details_params, spinner_url) => {
|
|
|
47
47
|
|
|
48
48
|
const Details = (props) => {
|
|
49
49
|
const { content } = props;
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
).replace(
|
|
50
|
+
const { details_app_toolbox_url, details_app_parameters } = content;
|
|
51
|
+
|
|
52
|
+
const c3s_details_url = details_app_toolbox_url;
|
|
53
|
+
const c3s_details_params = JSON.stringify(details_app_parameters).replace(
|
|
54
|
+
/"/g,
|
|
55
|
+
"'",
|
|
56
|
+
); // we avoid double quotes in iframe text
|
|
54
57
|
const [spinnerUrl, setSpinnerUrl] = useState(null);
|
|
55
58
|
|
|
56
59
|
React.useEffect(() => {
|
|
@@ -74,10 +77,12 @@ const Details = (props) => {
|
|
|
74
77
|
|
|
75
78
|
const Overview = (props) => {
|
|
76
79
|
const { content } = props;
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
const { overview_app_toolbox_url, overview_app_parameters } = content;
|
|
81
|
+
const c3s_overview_url = overview_app_toolbox_url;
|
|
82
|
+
const c3s_overview_params = JSON.stringify(overview_app_parameters).replace(
|
|
83
|
+
/"/g,
|
|
84
|
+
"'",
|
|
85
|
+
); // we avoid double quotes in iframe text
|
|
81
86
|
const [spinnerUrl, setSpinnerUrl] = useState(null);
|
|
82
87
|
|
|
83
88
|
React.useEffect(() => {
|
|
@@ -101,7 +106,19 @@ const Overview = (props) => {
|
|
|
101
106
|
|
|
102
107
|
function C3SIndicatorView(props) {
|
|
103
108
|
const { content } = props;
|
|
109
|
+
const { definition_app, long_description, indicator_title } = content;
|
|
104
110
|
const [showDetails, setShowDetails] = useState(false);
|
|
111
|
+
const hasIndicatorTitle =
|
|
112
|
+
indicator_title && indicator_title !== '_' && indicator_title !== '-';
|
|
113
|
+
|
|
114
|
+
const [activeAccIndex, setActiveAccIndex] = React.useState(null);
|
|
115
|
+
|
|
116
|
+
function handleAccClick(e, titleProps) {
|
|
117
|
+
const { index } = titleProps;
|
|
118
|
+
const newIndex = activeAccIndex === index ? -1 : index;
|
|
119
|
+
|
|
120
|
+
setActiveAccIndex(newIndex);
|
|
121
|
+
}
|
|
105
122
|
|
|
106
123
|
const toggleIframe = () => {
|
|
107
124
|
setShowDetails(!showDetails);
|
|
@@ -122,52 +139,74 @@ function C3SIndicatorView(props) {
|
|
|
122
139
|
}, [showDetails]);
|
|
123
140
|
|
|
124
141
|
return (
|
|
125
|
-
<div className="c3sindicator-view">
|
|
142
|
+
<div className="db-item-view c3sindicator-view">
|
|
143
|
+
<BannerTitle content={content} />
|
|
144
|
+
|
|
126
145
|
<div className="ui container">
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
146
|
+
<h2>Background information</h2>
|
|
147
|
+
<HTMLField value={long_description} />
|
|
148
|
+
|
|
149
|
+
<div className="c3s-buttons">
|
|
150
|
+
<a href="#details">
|
|
151
|
+
<button className="ui button primary" onClick={toggleIframe}>
|
|
152
|
+
{showDetails ? 'Go back' : 'Explore in detail'}
|
|
153
|
+
</button>
|
|
154
|
+
</a>
|
|
155
|
+
<a href="/knowledge/european-climate-data-explorer/">
|
|
156
|
+
<button className="ui button primary">ECDE homepage</button>
|
|
157
|
+
</a>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
{definition_app && !hasIndicatorTitle && (
|
|
161
|
+
<Accordion>
|
|
162
|
+
<Accordion.Title
|
|
163
|
+
className="accordion-title "
|
|
164
|
+
active={activeAccIndex === 0}
|
|
165
|
+
index={0}
|
|
166
|
+
onClick={handleAccClick}
|
|
134
167
|
>
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
168
|
+
<span>Visualisation and Navigation</span>
|
|
169
|
+
{activeAccIndex === 0 ? (
|
|
170
|
+
<Icon name="ri-arrow-up-s-line" size="24px" />
|
|
171
|
+
) : (
|
|
172
|
+
<Icon name="ri-arrow-down-s-line" size="24px" />
|
|
173
|
+
)}
|
|
174
|
+
</Accordion.Title>
|
|
175
|
+
<Accordion.Content active={activeAccIndex === 0}>
|
|
176
|
+
<HTMLField value={definition_app} />
|
|
177
|
+
</Accordion.Content>
|
|
178
|
+
</Accordion>
|
|
179
|
+
)}
|
|
180
|
+
|
|
181
|
+
<h2>
|
|
182
|
+
{hasIndicatorTitle && <>{indicator_title}</>}
|
|
183
|
+
{showDetails && ' - Explore index'}
|
|
184
|
+
</h2>
|
|
185
|
+
|
|
186
|
+
<div>
|
|
187
|
+
{!__SERVER__ && !showDetails && <Overview {...props} />}
|
|
188
|
+
{!__SERVER__ && showDetails && <Details {...props} />}
|
|
189
|
+
</div>
|
|
156
190
|
|
|
191
|
+
<div className="content-box">
|
|
192
|
+
<div className="content-box-inner">
|
|
193
|
+
<Segment>
|
|
157
194
|
<p>
|
|
158
195
|
Content in the European Climate Data Explorer pages is delivered
|
|
159
196
|
by the{' '}
|
|
160
197
|
<a href="https://climate.copernicus.eu/">
|
|
161
198
|
Copernicus Climate Change Service (C3S)
|
|
162
199
|
</a>{' '}
|
|
163
|
-
implemented by ECMWF.
|
|
200
|
+
implemented by ECMWF.
|
|
201
|
+
</p>
|
|
202
|
+
<p>
|
|
164
203
|
<a href="/knowledge/european-climate-data-explorer/disclaimer">
|
|
165
204
|
Disclaimer
|
|
166
205
|
</a>
|
|
167
206
|
</p>
|
|
168
|
-
</
|
|
207
|
+
</Segment>
|
|
169
208
|
</div>
|
|
170
|
-
</
|
|
209
|
+
</div>
|
|
171
210
|
</div>
|
|
172
211
|
</div>
|
|
173
212
|
);
|