@eeacms/volto-cca-policy 0.2.6 → 0.2.8

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/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;