@eeacms/volto-cca-policy 0.2.5 → 0.2.6
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 +22 -0
- package/package.json +1 -1
- package/src/components/index.js +3 -0
- package/src/components/manage/Blocks/CountryProfileDetail/View.js +13 -8
- package/src/components/manage/Blocks/CountryProfileDetail/styles.less +5 -1
- package/src/components/manage/Blocks/RASTBlock/RASTMap.jsx +3 -1
- package/src/components/theme/MissionDisclaimer/MissionDisclaimer.jsx +24 -0
- package/src/components/theme/Views/MissionFundingCCAView.jsx +22 -53
- package/src/components/theme/Views/MissionFundingCCAView.test.jsx +1 -3
- package/src/components/theme/Views/MissionToolView.jsx +226 -0
- package/src/components/theme/Views/MissionToolView.test.jsx +154 -0
- package/src/helpers/ContentMetadata.jsx +16 -34
- package/src/helpers/Utils.jsx +23 -0
- package/src/helpers/index.js +1 -0
- package/src/index.js +3 -0
- package/theme/elements/list.variables +1 -1
- package/theme/globals/mission.less +15 -0
- package/src/components/theme/Views/styles.less +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,28 @@ 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.6](https://github.com/eea/volto-cca-policy/compare/0.2.5...0.2.6) - 17 April 2024
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat(view): add MissionToolView for mission_tool content type - Refs #268126 [kreafox - [`598f038`](https://github.com/eea/volto-cca-policy/commit/598f038b17754d272424a04e45ebc2b41766d724)]
|
|
12
|
+
|
|
13
|
+
#### :bug: Bug Fixes
|
|
14
|
+
|
|
15
|
+
- fix(view): fix condition in MissionFundingView [kreafox - [`45f8741`](https://github.com/eea/volto-cca-policy/commit/45f87418982cad2ec33d72a3bacb907ff39a6336)]
|
|
16
|
+
|
|
17
|
+
#### :nail_care: Enhancements
|
|
18
|
+
|
|
19
|
+
- change(view): use semantic List [kreafox - [`3cba130`](https://github.com/eea/volto-cca-policy/commit/3cba130f2c9cf3d39e8131b04beca5750affe73f)]
|
|
20
|
+
- change(view): use MetadataItemList [kreafox - [`a501d41`](https://github.com/eea/volto-cca-policy/commit/a501d413ceb4a78bfdfe38eaaaec38d93eddb7f7)]
|
|
21
|
+
- change(view): use MetadataItemList instead of ItemsList [kreafox - [`df2a28d`](https://github.com/eea/volto-cca-policy/commit/df2a28da12a37252e745ac87984eedea2701e16f)]
|
|
22
|
+
|
|
23
|
+
#### :hammer_and_wrench: Others
|
|
24
|
+
|
|
25
|
+
- test: update snapshot [kreafox - [`a8589e3`](https://github.com/eea/volto-cca-policy/commit/a8589e32cd506eae790cde287fbdf82fa0e29012)]
|
|
26
|
+
- test: reduce duplicated code , move disclaimer to separate component - Refs #268126 [kreafox - [`3ae3d09`](https://github.com/eea/volto-cca-policy/commit/3ae3d09ebdf6b32ef858051eb08d8088bec89d23)]
|
|
27
|
+
- test: add tests for Mission Tool content type [kreafox - [`5214c0f`](https://github.com/eea/volto-cca-policy/commit/5214c0f58646956055f10a07da8acf72398b6e29)]
|
|
28
|
+
- test: update snapshots [kreafox - [`8ce574c`](https://github.com/eea/volto-cca-policy/commit/8ce574cdf17edfe72ece2e4cc59d984746693f03)]
|
|
7
29
|
### [0.2.5](https://github.com/eea/volto-cca-policy/compare/0.2.4...0.2.5) - 15 April 2024
|
|
8
30
|
|
|
9
31
|
#### :rocket: New Features
|
package/package.json
CHANGED
package/src/components/index.js
CHANGED
|
@@ -4,3 +4,6 @@ export PortalMessage from './theme/PortalMessage/PortalMessage';
|
|
|
4
4
|
export TranslationDisclaimer from './theme/TranslationDisclaimer/TranslationDisclaimer';
|
|
5
5
|
export ShareInfoButton from './theme/ShareInfoButton/ShareInfoButton';
|
|
6
6
|
export ASTNavigation from './theme/ASTNavigation/ASTNavigation';
|
|
7
|
+
|
|
8
|
+
export { default as MissionToolView } from './theme/Views/MissionToolView';
|
|
9
|
+
export { default as MissionDisclaimer } from './theme/MissionDisclaimer/MissionDisclaimer';
|
|
@@ -6,9 +6,10 @@ import CountryTabPane from './CountryTabPane';
|
|
|
6
6
|
import './styles.less';
|
|
7
7
|
|
|
8
8
|
export default function View(props) {
|
|
9
|
-
const dataJson = JSON.parse(
|
|
10
|
-
|
|
11
|
-
);
|
|
9
|
+
// const dataJson = JSON.parse(
|
|
10
|
+
// props?.properties['@components']?.countryprofile?.html,
|
|
11
|
+
// );
|
|
12
|
+
const dataJson = props?.properties['@components']?.countryprofile?.html;
|
|
12
13
|
const [activePanes, setActivePanes] = React.useState({});
|
|
13
14
|
|
|
14
15
|
const panes = [];
|
|
@@ -35,8 +36,9 @@ export default function View(props) {
|
|
|
35
36
|
{dataJson.message_top ? (
|
|
36
37
|
<div class="eea callout">{dataJson.message_top}</div>
|
|
37
38
|
) : null}
|
|
38
|
-
{dataJson.top_accordeon
|
|
39
|
-
|
|
39
|
+
{dataJson.top_accordeon ? (
|
|
40
|
+
<div className="top-accordion">
|
|
41
|
+
{dataJson.top_accordeon.map((accordion, index) => (
|
|
40
42
|
<Accordion className="secondary">
|
|
41
43
|
<Accordion.Title
|
|
42
44
|
role="button"
|
|
@@ -57,8 +59,9 @@ export default function View(props) {
|
|
|
57
59
|
dangerouslySetInnerHTML={{ __html: accordion.value }}
|
|
58
60
|
></Accordion.Content>
|
|
59
61
|
</Accordion>
|
|
60
|
-
))
|
|
61
|
-
|
|
62
|
+
))}
|
|
63
|
+
</div>
|
|
64
|
+
) : null}
|
|
62
65
|
<Tab
|
|
63
66
|
className="secondary menu"
|
|
64
67
|
panes={panes}
|
|
@@ -73,7 +76,9 @@ export default function View(props) {
|
|
|
73
76
|
tabIndex: 0,
|
|
74
77
|
}}
|
|
75
78
|
/>
|
|
76
|
-
{dataJson.updated ?
|
|
79
|
+
{dataJson.updated ? (
|
|
80
|
+
<p>Reported updated until: {dataJson.updated}</p>
|
|
81
|
+
) : null}
|
|
77
82
|
</>
|
|
78
83
|
);
|
|
79
84
|
}
|
|
@@ -21,8 +21,10 @@ export default function RASTMap(props) {
|
|
|
21
21
|
const { path, pathname, activeMenu, skip_items } = props;
|
|
22
22
|
const currentPath = path || pathname;
|
|
23
23
|
|
|
24
|
-
const items = props.items;
|
|
25
24
|
let data = skip_items.split(',');
|
|
25
|
+
const items = props.items.filter(
|
|
26
|
+
(_item, index) => !data.includes(index.toString()),
|
|
27
|
+
);
|
|
26
28
|
let currentMenu = activeMenu;
|
|
27
29
|
|
|
28
30
|
if (activeMenu !== null) {
|
|
@@ -0,0 +1,24 @@
|
|
|
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,13 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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';
|
|
5
11
|
|
|
6
12
|
function MissiongFundingCCAView(props) {
|
|
7
13
|
const { content } = props;
|
|
8
14
|
|
|
9
15
|
return (
|
|
10
|
-
<div className="mission-
|
|
16
|
+
<div className="mission-item-view">
|
|
11
17
|
<BannerTitle
|
|
12
18
|
content={{ ...content, image: '' }}
|
|
13
19
|
data={{
|
|
@@ -99,7 +105,7 @@ function MissiongFundingCCAView(props) {
|
|
|
99
105
|
computer={4}
|
|
100
106
|
className="col-right"
|
|
101
107
|
>
|
|
102
|
-
<
|
|
108
|
+
<Segment className="metadata">
|
|
103
109
|
{!!content.country && content.country.length > 0 && (
|
|
104
110
|
<>
|
|
105
111
|
<h5>Countries where the funding opportunity is offered</h5>
|
|
@@ -119,69 +125,32 @@ function MissiongFundingCCAView(props) {
|
|
|
119
125
|
{!!content.rast_steps && content.rast_steps.length > 0 && (
|
|
120
126
|
<>
|
|
121
127
|
<h5>RAST step(s) of relevance</h5>
|
|
122
|
-
<
|
|
123
|
-
{content.rast_steps.map((step) => (
|
|
124
|
-
<
|
|
128
|
+
<List>
|
|
129
|
+
{content.rast_steps.map((step, index) => (
|
|
130
|
+
<List.Item key={index}>{step.title}</List.Item>
|
|
125
131
|
))}
|
|
126
|
-
</
|
|
132
|
+
</List>
|
|
127
133
|
</>
|
|
128
134
|
)}
|
|
129
135
|
{!!content.eligible_entities &&
|
|
130
136
|
content.eligible_entities.length > 0 && (
|
|
131
137
|
<>
|
|
132
138
|
<h5>Eligible to receive funding</h5>
|
|
133
|
-
<
|
|
134
|
-
{content.eligible_entities.map((entity) => (
|
|
135
|
-
<li>{entity.title}</li>
|
|
136
|
-
))}
|
|
137
|
-
</ul>
|
|
139
|
+
<MetadataItemList value={content.eligible_entities} />
|
|
138
140
|
</>
|
|
139
141
|
)}
|
|
140
|
-
{!!content.sectors && content.
|
|
142
|
+
{!!content.sectors && content.sectors.length > 0 && (
|
|
141
143
|
<>
|
|
142
144
|
<h5>Adaptation Sectors</h5>
|
|
143
|
-
<
|
|
144
|
-
{content.sectors.map((sector) => (
|
|
145
|
-
<li>{sector.title}</li>
|
|
146
|
-
))}
|
|
147
|
-
</ul>
|
|
145
|
+
<MetadataItemList value={content.sectors} />
|
|
148
146
|
</>
|
|
149
147
|
)}
|
|
150
|
-
</
|
|
151
|
-
</Grid.Column>
|
|
152
|
-
</div>
|
|
153
|
-
</Grid>
|
|
154
|
-
<Grid columns="12">
|
|
155
|
-
<div className="row">
|
|
156
|
-
<Grid.Column
|
|
157
|
-
mobile={12}
|
|
158
|
-
tablet={12}
|
|
159
|
-
computer={12}
|
|
160
|
-
className="col-full"
|
|
161
|
-
>
|
|
162
|
-
<div className="styled-slate has--style_name--content-box-gray styled">
|
|
163
|
-
<div className="disclaimer content-box">
|
|
164
|
-
<div className="content-box-inner">
|
|
165
|
-
<p>
|
|
166
|
-
<strong>Disclaimer</strong>
|
|
167
|
-
<br />
|
|
168
|
-
The contents and links to third-party items on this
|
|
169
|
-
Mission webpage are developed by the MIP4Adapt team led by
|
|
170
|
-
Ricardo, under contract CINEA/2022/OP/0013/SI2.884597
|
|
171
|
-
funded by the European Union and do not necessarily
|
|
172
|
-
reflect those of the European Union, CINEA, or those of
|
|
173
|
-
the European Environment Agency (EEA) as host of the
|
|
174
|
-
Climate-ADAPT Platform. Neither the European Union nor
|
|
175
|
-
CINEA nor the EEA accepts responsibility or liability
|
|
176
|
-
arising out of or in connection with the information on
|
|
177
|
-
these pages.
|
|
178
|
-
</p>
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
148
|
+
</Segment>
|
|
182
149
|
</Grid.Column>
|
|
183
150
|
</div>
|
|
184
151
|
</Grid>
|
|
152
|
+
|
|
153
|
+
<MissionDisclaimer />
|
|
185
154
|
</Container>
|
|
186
155
|
</div>
|
|
187
156
|
);
|
|
@@ -99,8 +99,6 @@ describe('MissiongFundingCCAView', () => {
|
|
|
99
99
|
</MemoryRouter>
|
|
100
100
|
</Provider>,
|
|
101
101
|
);
|
|
102
|
-
expect(
|
|
103
|
-
container.querySelector('.mission-funding-cca-view'),
|
|
104
|
-
).toBeInTheDocument();
|
|
102
|
+
expect(container.querySelector('.mission-item-view')).toBeInTheDocument();
|
|
105
103
|
});
|
|
106
104
|
});
|
|
@@ -0,0 +1,226 @@
|
|
|
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;
|
|
@@ -0,0 +1,154 @@
|
|
|
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,3 +1,7 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { useLocation } from 'react-router-dom';
|
|
3
|
+
import { Popup, Segment } from 'semantic-ui-react';
|
|
4
|
+
import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
|
|
1
5
|
import {
|
|
2
6
|
ACE_COUNTRIES,
|
|
3
7
|
BIOREGIONS,
|
|
@@ -9,11 +13,10 @@ import {
|
|
|
9
13
|
INDICATOR,
|
|
10
14
|
PUBICATION_REPORT,
|
|
11
15
|
} from '@eeacms/volto-cca-policy/helpers/Constants';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
|
|
16
|
+
import {
|
|
17
|
+
isObservatoryMetadataURL,
|
|
18
|
+
MetadataItemList,
|
|
19
|
+
} from '@eeacms/volto-cca-policy/helpers';
|
|
17
20
|
|
|
18
21
|
const messages = defineMessages({
|
|
19
22
|
'The date refers to the moment in which the item has been prepared or updated by contributing experts to be submitted for the publication in Climate ADAPT': {
|
|
@@ -312,27 +315,8 @@ function PublicationDateInfo(props) {
|
|
|
312
315
|
) : null;
|
|
313
316
|
}
|
|
314
317
|
|
|
315
|
-
function ItemsList(props) {
|
|
316
|
-
let { value, join } = props;
|
|
317
|
-
if (join === undefined) {
|
|
318
|
-
join = ', ';
|
|
319
|
-
}
|
|
320
|
-
if (join === '<br />') {
|
|
321
|
-
return (
|
|
322
|
-
<span>
|
|
323
|
-
{value.map((item, index) => (
|
|
324
|
-
<Fragment key={index}>
|
|
325
|
-
<span>{item.title}</span>
|
|
326
|
-
<br />
|
|
327
|
-
</Fragment>
|
|
328
|
-
))}
|
|
329
|
-
</span>
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
return <span>{value.map((item) => item.title).join(join)}</span>;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
318
|
function ContentMetadata(props) {
|
|
319
|
+
const intl = useIntl();
|
|
336
320
|
const { content } = props;
|
|
337
321
|
const {
|
|
338
322
|
sectors,
|
|
@@ -353,8 +337,6 @@ function ContentMetadata(props) {
|
|
|
353
337
|
const isObservatoryItem = isObservatoryMetadataURL(location.pathname);
|
|
354
338
|
const hasGeoChars = geochars !== null || spatial_layer.length > 0;
|
|
355
339
|
|
|
356
|
-
const intl = useIntl();
|
|
357
|
-
|
|
358
340
|
let date_title;
|
|
359
341
|
if (type === VIDEO) {
|
|
360
342
|
date_title = intl.formatMessage(messages['Date of release:']);
|
|
@@ -387,7 +369,7 @@ function ContentMetadata(props) {
|
|
|
387
369
|
defaultMessage="Health impact:"
|
|
388
370
|
/>
|
|
389
371
|
</h5>
|
|
390
|
-
<
|
|
372
|
+
<MetadataItemList value={health_impacts} />
|
|
391
373
|
</>
|
|
392
374
|
)}
|
|
393
375
|
</>
|
|
@@ -410,7 +392,7 @@ function ContentMetadata(props) {
|
|
|
410
392
|
defaultMessage="Key Type Measures:"
|
|
411
393
|
/>
|
|
412
394
|
</h5>
|
|
413
|
-
<
|
|
395
|
+
<MetadataItemList value={key_type_measures} />
|
|
414
396
|
</>
|
|
415
397
|
)}
|
|
416
398
|
|
|
@@ -422,7 +404,7 @@ function ContentMetadata(props) {
|
|
|
422
404
|
defaultMessage="IPCC adaptation options categories:"
|
|
423
405
|
/>
|
|
424
406
|
</h5>
|
|
425
|
-
<
|
|
407
|
+
<MetadataItemList value={ipcc_category} />
|
|
426
408
|
</>
|
|
427
409
|
)}
|
|
428
410
|
|
|
@@ -436,7 +418,7 @@ function ContentMetadata(props) {
|
|
|
436
418
|
defaultMessage="Climate impacts:"
|
|
437
419
|
/>
|
|
438
420
|
</h5>
|
|
439
|
-
<
|
|
421
|
+
<MetadataItemList value={climate_impacts} />
|
|
440
422
|
</>
|
|
441
423
|
)}
|
|
442
424
|
|
|
@@ -448,7 +430,7 @@ function ContentMetadata(props) {
|
|
|
448
430
|
defaultMessage="Adaptation elements:"
|
|
449
431
|
/>
|
|
450
432
|
</h5>
|
|
451
|
-
<
|
|
433
|
+
<MetadataItemList value={elements} />
|
|
452
434
|
</>
|
|
453
435
|
)}
|
|
454
436
|
|
|
@@ -457,7 +439,7 @@ function ContentMetadata(props) {
|
|
|
457
439
|
<h5>
|
|
458
440
|
<FormattedMessage id="Sectors:" defaultMessage="Sectors:" />
|
|
459
441
|
</h5>
|
|
460
|
-
<
|
|
442
|
+
<MetadataItemList value={sectors} />
|
|
461
443
|
</>
|
|
462
444
|
)}
|
|
463
445
|
</>
|
|
@@ -471,7 +453,7 @@ function ContentMetadata(props) {
|
|
|
471
453
|
defaultMessage="Governance level:"
|
|
472
454
|
/>
|
|
473
455
|
</h5>
|
|
474
|
-
<
|
|
456
|
+
<MetadataItemList value={governance_level} join_type="<br />" />
|
|
475
457
|
</>
|
|
476
458
|
)}
|
|
477
459
|
|
package/src/helpers/Utils.jsx
CHANGED
|
@@ -482,3 +482,26 @@ export const EventDetails = (props) => {
|
|
|
482
482
|
</>
|
|
483
483
|
);
|
|
484
484
|
};
|
|
485
|
+
|
|
486
|
+
export const MetadataItemList = (props) => {
|
|
487
|
+
const { value, join_type } = props;
|
|
488
|
+
|
|
489
|
+
return value && value.length > 0 ? (
|
|
490
|
+
<>
|
|
491
|
+
{!join_type ? (
|
|
492
|
+
<p>{value.map((item) => item.title).join(', ')}</p>
|
|
493
|
+
) : (
|
|
494
|
+
<>
|
|
495
|
+
{value.map((item, index) => (
|
|
496
|
+
<React.Fragment key={index}>
|
|
497
|
+
<span>{item.title}</span>
|
|
498
|
+
{index !== value.length - 1 && (
|
|
499
|
+
<span dangerouslySetInnerHTML={{ __html: join_type }} />
|
|
500
|
+
)}
|
|
501
|
+
</React.Fragment>
|
|
502
|
+
))}
|
|
503
|
+
</>
|
|
504
|
+
)}
|
|
505
|
+
</>
|
|
506
|
+
) : null;
|
|
507
|
+
};
|
package/src/helpers/index.js
CHANGED
package/src/index.js
CHANGED
|
@@ -11,6 +11,8 @@ import C3SIndicatorView from './components/theme/Views/C3SIndicatorView';
|
|
|
11
11
|
import DatabaseItemView from './components/theme/Views/DatabaseItemView';
|
|
12
12
|
import MissionFundingCCAView from './components/theme/Views/MissionFundingCCAView';
|
|
13
13
|
|
|
14
|
+
import { MissionToolView } from '@eeacms/volto-cca-policy/components';
|
|
15
|
+
|
|
14
16
|
import HealthHorizontalCardItem from './components/Result/HealthHorizontalCardItem';
|
|
15
17
|
|
|
16
18
|
import ccaLogo from '@eeacms/volto-cca-policy/../theme/assets/images/Header/climate-adapt-logo.svg';
|
|
@@ -287,6 +289,7 @@ const applyConfig = (config) => {
|
|
|
287
289
|
'eea.climateadapt.adaptationoption': AdaptationOptionView,
|
|
288
290
|
'News Item': NewsItemView,
|
|
289
291
|
mission_funding_cca: MissionFundingCCAView,
|
|
292
|
+
mission_tool: MissionToolView,
|
|
290
293
|
};
|
|
291
294
|
|
|
292
295
|
config.views.layoutViewsNamesMapping.view_cca_event = 'CCA Event View';
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
/* Mission subsite */
|
|
2
2
|
|
|
3
|
+
.mission-item-view {
|
|
4
|
+
.ui.segment.metadata {
|
|
5
|
+
border: none;
|
|
6
|
+
background-color: #f9f9f9;
|
|
7
|
+
|
|
8
|
+
h5 {
|
|
9
|
+
margin: 1em 0 0.5em 0;
|
|
10
|
+
|
|
11
|
+
&:first-child {
|
|
12
|
+
margin-top: 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
3
18
|
body.view-viewview.contenttype-subsite.section-mission
|
|
4
19
|
.block.__grid.teaserGrid.centered
|
|
5
20
|
h2 {
|