@eeacms/volto-cca-policy 0.1.76 → 0.1.77

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.json +1 -1
  3. package/src/components/theme/Views/AdaptationOptionView.jsx +40 -50
  4. package/src/components/theme/Views/AdaptationOptionView.test.jsx +9 -0
  5. package/src/components/theme/Views/CaseStudyView.jsx +3 -2
  6. package/src/components/theme/Views/CaseStudyView.test.jsx +9 -0
  7. package/src/components/theme/Views/GuidanceView.jsx +2 -3
  8. package/src/components/theme/Views/GuidanceView.test.jsx +9 -0
  9. package/src/components/theme/Views/IndicatorView.jsx +3 -2
  10. package/src/components/theme/Views/IndicatorView.test.jsx +9 -0
  11. package/src/components/theme/Views/InformationPortalView.jsx +4 -3
  12. package/src/components/theme/Views/InformationPortalView.test.jsx +9 -0
  13. package/src/components/theme/Views/OrganisationView.jsx +13 -11
  14. package/src/components/theme/Views/OrganisationView.test.jsx +9 -0
  15. package/src/components/theme/Views/ProjectView.jsx +23 -4
  16. package/src/components/theme/Views/ProjectView.test.jsx +9 -0
  17. package/src/components/theme/Views/PublicationReportView.jsx +3 -2
  18. package/src/components/theme/Views/PublicationReportView.test.jsx +9 -0
  19. package/src/components/theme/Views/ToolView.jsx +4 -2
  20. package/src/components/theme/Views/ToolView.test.jsx +9 -0
  21. package/src/components/theme/Views/VideoView.jsx +4 -2
  22. package/src/components/theme/Views/VideoView.test.jsx +9 -0
  23. package/src/customizations/volto/components/theme/Widgets/RichTextWidget.jsx +20 -0
  24. package/src/helpers/Utils.jsx +28 -1
  25. package/src/helpers/index.js +1 -0
  26. package/src/search/mission_projects/facets-projects.js +23 -6
  27. package/src/search/mission_stories/facets-stories.js +16 -24
package/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@ 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.77](https://github.com/eea/volto-cca-policy/compare/0.1.76...0.1.77) - 19 February 2024
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: typo [kreafox - [`b5dc1fe`](https://github.com/eea/volto-cca-policy/commit/b5dc1fe0fa28ff05dc2482d23fa7b0c4b27941de)]
12
+ - fix: add RichTextWidget override - refs: #265406 [kreafox - [`e25f6f0`](https://github.com/eea/volto-cca-policy/commit/e25f6f092cc15495ec2d6f3bc4a29caeda68b3eb)]
13
+
14
+ #### :nail_care: Enhancements
15
+
16
+ - change: update search facets [kreafox - [`41c9e3b`](https://github.com/eea/volto-cca-policy/commit/41c9e3bf18d033334c43ebdaad015bed8304890b)]
17
+ - change: update search facets [kreafox - [`fee246b`](https://github.com/eea/volto-cca-policy/commit/fee246b38965baaf38f0c9b7da5c0d48d91f1af8)]
18
+ - change: update mission projects facets [kreafox - [`10bbb14`](https://github.com/eea/volto-cca-policy/commit/10bbb14a12d8450295470536170979874bf5d0f5)]
19
+ - change: facets order [kreafox - [`ad7a023`](https://github.com/eea/volto-cca-policy/commit/ad7a023c05933d855329dbe9c1638ec24aaab2ab)]
20
+ - change: update mission stories search [kreafox - [`6bf68a6`](https://github.com/eea/volto-cca-policy/commit/6bf68a6ddc19ba13ea205c18dc84e5fd009f8267)]
21
+ - change: add Title block on database items view [kreafox - [`a59c677`](https://github.com/eea/volto-cca-policy/commit/a59c677143d2817f4d258c855f3adab8b4fb5ca2)]
22
+
23
+ #### :hammer_and_wrench: Others
24
+
25
+ - test: increase coverage [kreafox - [`d32e592`](https://github.com/eea/volto-cca-policy/commit/d32e592a1274748cae3b3b39ba23c2a51e93a4f9)]
26
+ - test: reduce duplicated code [kreafox - [`97319a4`](https://github.com/eea/volto-cca-policy/commit/97319a45b87afe2d35f01f8618b8746c37718f88)]
27
+ - test: remove unused import [kreafox - [`f393b42`](https://github.com/eea/volto-cca-policy/commit/f393b42bfbda103c290be658abf510fd5902f226)]
28
+ - test: reduce duplicated code [kreafox - [`037c3cb`](https://github.com/eea/volto-cca-policy/commit/037c3cbd5f82acec32959af96a374707b4e1bf02)]
29
+ - test: update volto version in Jenkinsfile [kreafox - [`43e8b76`](https://github.com/eea/volto-cca-policy/commit/43e8b7628e85cdf1965b8c88b90660e585811db4)]
30
+ - test: update tests for Database items view [kreafox - [`b611f0f`](https://github.com/eea/volto-cca-policy/commit/b611f0fea373f041ed196bad096fe7ac48df65c7)]
7
31
  ### [0.1.76](https://github.com/eea/volto-cca-policy/compare/0.1.75...0.1.76) - 16 February 2024
8
32
 
9
33
  #### :nail_care: Enhancements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.1.76",
3
+ "version": "0.1.77",
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",
@@ -5,58 +5,48 @@ import {
5
5
  LinksList,
6
6
  PublishedModifiedInfo,
7
7
  ShareInfo,
8
+ BannerTitle,
8
9
  } from '@eeacms/volto-cca-policy/helpers';
9
10
  import { Grid } from 'semantic-ui-react';
10
11
 
12
+ function createDataField(type, field, section, title) {
13
+ return {
14
+ type,
15
+ field,
16
+ section,
17
+ title,
18
+ };
19
+ }
20
+
11
21
  const dataDisplay = [
12
- {
13
- type: 'other',
14
- field: 'category',
15
- section: 'ao_category',
16
- title: 'Category',
17
- },
18
- {
19
- type: 'other',
20
- field: 'ipcc_category',
21
- section: 'ipcc_category',
22
- title: 'IPCC categories',
23
- },
24
- {
25
- type: 'HTMLField',
26
- field: 'stakeholder_participation',
27
- section: 'stakeholder_participation',
28
- title: 'Stakeholder participation',
29
- },
30
- {
31
- type: 'HTMLField',
32
- field: 'success_limitations',
33
- section: 'success_factors',
34
- title: 'Success and Limiting Factors',
35
- },
36
- {
37
- type: 'HTMLField',
38
- field: 'cost_benefit',
39
- section: 'costs_benefits',
40
- title: 'Costs and Benefits',
41
- },
42
- {
43
- type: 'HTMLField',
44
- field: 'legal_aspects',
45
- section: 'legal',
46
- title: 'Legal Aspects',
47
- },
48
- {
49
- type: 'HTMLField',
50
- field: 'implementation_time',
51
- section: 'implementation',
52
- title: 'Implementation Time',
53
- },
54
- {
55
- type: 'HTMLField',
56
- field: 'lifetime',
57
- section: 'life_time',
58
- title: 'Life Time',
59
- },
22
+ createDataField('other', 'category', 'ao_category', 'Category'),
23
+ createDataField('other', 'ipcc_category', 'ipcc_category', 'IPCC categories'),
24
+ createDataField(
25
+ 'HTMLField',
26
+ 'stakeholder_participation',
27
+ 'stakeholder_participation',
28
+ 'Stakeholder participation',
29
+ ),
30
+ createDataField(
31
+ 'HTMLField',
32
+ 'success_limitations',
33
+ 'success_factors',
34
+ 'Success and Limiting Factors',
35
+ ),
36
+ createDataField(
37
+ 'HTMLField',
38
+ 'cost_benefit',
39
+ 'costs_benefits',
40
+ 'Costs and Benefits',
41
+ ),
42
+ createDataField('HTMLField', 'legal_aspects', 'legal', 'Legal Aspects'),
43
+ createDataField(
44
+ 'HTMLField',
45
+ 'implementation_time',
46
+ 'implementation',
47
+ 'Implementation Time',
48
+ ),
49
+ createDataField('HTMLField', 'lifetime', 'life_time', 'Life Time'),
60
50
  ];
61
51
 
62
52
  const findSection = (title) => {
@@ -117,6 +107,8 @@ function AdaptationOptionView(props) {
117
107
 
118
108
  return (
119
109
  <div className="adaptation-option-view">
110
+ <BannerTitle content={content} type="Adaptation Option" />
111
+
120
112
  <div className="ui container">
121
113
  <Grid columns="12">
122
114
  <div className="row">
@@ -126,8 +118,6 @@ function AdaptationOptionView(props) {
126
118
  computer={9}
127
119
  className="col-left"
128
120
  >
129
- <div className="ui label">Adaptation option</div>
130
- <h1>{content.title}</h1>
131
121
  <HTMLField
132
122
  value={content.long_description}
133
123
  className="long_description"
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import AdaptationOptionView from './AdaptationOptionView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -6,6 +6,7 @@ import {
6
6
  PublishedModifiedInfo,
7
7
  DocumentsList,
8
8
  ShareInfo,
9
+ BannerTitle,
9
10
  } from '@eeacms/volto-cca-policy/helpers';
10
11
  import { Grid } from 'semantic-ui-react';
11
12
 
@@ -250,6 +251,8 @@ function CaseStudyView(props) {
250
251
 
251
252
  return (
252
253
  <div className="case-study-view">
254
+ <BannerTitle content={content} type="Case Studies" />
255
+
253
256
  <div className="ui container">
254
257
  <Grid columns="12">
255
258
  <div className="row">
@@ -259,8 +262,6 @@ function CaseStudyView(props) {
259
262
  computer={9}
260
263
  className="col-left"
261
264
  >
262
- <div className="ui label">Case studies</div>
263
- <h1>{content.title}</h1>
264
265
  <PrimaryPhoto {...props} />
265
266
 
266
267
  <HTMLField
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import CaseStudyView from './CaseStudyView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -5,6 +5,7 @@ import {
5
5
  LinksList,
6
6
  PublishedModifiedInfo,
7
7
  ShareInfo,
8
+ BannerTitle,
8
9
  } from '@eeacms/volto-cca-policy/helpers';
9
10
  import { Grid } from 'semantic-ui-react';
10
11
 
@@ -35,6 +36,7 @@ function GuidanceView(props) {
35
36
 
36
37
  return (
37
38
  <div className="guidance-view">
39
+ <BannerTitle content={content} type="Guidance Document" />
38
40
  <div className="ui container">
39
41
  <Grid columns="12">
40
42
  <div className="row">
@@ -44,9 +46,6 @@ function GuidanceView(props) {
44
46
  computer={9}
45
47
  className="col-left"
46
48
  >
47
- <div className="ui label">Guidance Document</div>
48
- <h1>{content.title}</h1>
49
- <hr />
50
49
  <h4>Description:</h4>
51
50
  <HTMLField
52
51
  value={content.long_description}
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import GuidanceView from './GuidanceView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -5,6 +5,7 @@ import {
5
5
  LinksList,
6
6
  PublishedModifiedInfo,
7
7
  ShareInfo,
8
+ BannerTitle,
8
9
  } from '@eeacms/volto-cca-policy/helpers';
9
10
  import { Grid } from 'semantic-ui-react';
10
11
 
@@ -13,6 +14,8 @@ function IndicatorView(props) {
13
14
 
14
15
  return (
15
16
  <div className="indicator-view">
17
+ <BannerTitle content={content} type="Indicator" />
18
+
16
19
  <div className="ui container">
17
20
  <Grid columns="12">
18
21
  <div className="row">
@@ -22,8 +25,6 @@ function IndicatorView(props) {
22
25
  computer={9}
23
26
  className="col-left"
24
27
  >
25
- <div className="ui label">Indicator</div>
26
- <h1>{content.title}</h1>
27
28
  <h4>Description</h4>
28
29
  <HTMLField
29
30
  value={content.long_description}
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import IndicatorView from './IndicatorView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -5,6 +5,7 @@ import {
5
5
  LinksList,
6
6
  PublishedModifiedInfo,
7
7
  ShareInfo,
8
+ BannerTitle,
8
9
  } from '@eeacms/volto-cca-policy/helpers';
9
10
  import { Grid } from 'semantic-ui-react';
10
11
 
@@ -13,6 +14,8 @@ function InformationPortalView(props) {
13
14
 
14
15
  return (
15
16
  <div className="information-portal-view">
17
+ <BannerTitle content={content} type="Information Portal" />
18
+
16
19
  <div className="ui container">
17
20
  <Grid columns="12">
18
21
  <div className="row">
@@ -22,9 +25,7 @@ function InformationPortalView(props) {
22
25
  computer={9}
23
26
  className="col-left"
24
27
  >
25
- <div className="ui label">Information Portal</div>
26
- <h1>{content.title}</h1>
27
- <h4>Description</h4>
28
+ <h4>Description:</h4>
28
29
  <HTMLField
29
30
  value={content.long_description}
30
31
  className="long_description"
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import InformationPortalView from './InformationPortalView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { Fragment } from 'react';
1
+ import React, { Fragment } from 'react';
3
2
  import { UniversalLink } from '@plone/volto/components';
4
3
  import {
5
4
  HTMLField,
@@ -7,6 +6,7 @@ import {
7
6
  LinksList,
8
7
  PublishedModifiedInfo,
9
8
  ShareInfo,
9
+ BannerTitle,
10
10
  } from '@eeacms/volto-cca-policy/helpers';
11
11
  import { Grid } from 'semantic-ui-react';
12
12
 
@@ -27,6 +27,8 @@ function OrganisationView(props) {
27
27
 
28
28
  return (
29
29
  <div className="organisation-view">
30
+ <BannerTitle content={content} type="Organisation" />
31
+
30
32
  <div className="ui container">
31
33
  <Grid columns="12">
32
34
  <div className="row">
@@ -36,15 +38,15 @@ function OrganisationView(props) {
36
38
  computer={9}
37
39
  className="col-left"
38
40
  >
39
- <div className="ui label">Organisation</div>
40
- <h1>{content.title}</h1>
41
- <h4>Description:</h4>
42
- <HTMLField
43
- value={content.long_description}
44
- className="long_description"
45
- />
46
- <hr />
47
- <h4>Reference information</h4>
41
+ <div>
42
+ <h4>Description:</h4>
43
+ <HTMLField
44
+ value={content.long_description}
45
+ className="long_description"
46
+ />
47
+ <hr />
48
+ <h4>Reference information</h4>
49
+ </div>
48
50
 
49
51
  {content?.websites?.length > 0 && (
50
52
  <LinksList title="Websites:" value={content.websites} />
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import OrganisationView from './OrganisationView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -7,11 +7,34 @@ import {
7
7
  ShareInfo,
8
8
  } from '@eeacms/volto-cca-policy/helpers';
9
9
  import { Grid } from 'semantic-ui-react';
10
+ import config from '@plone/volto/registry';
10
11
 
11
12
  function ProjectView(props) {
12
13
  const { content } = props;
14
+ const {
15
+ blocks: { blocksConfig },
16
+ } = config;
17
+ const TitleBlockView = blocksConfig?.title?.view;
18
+
13
19
  return (
14
20
  <div className="project-view">
21
+ <TitleBlockView
22
+ {...props}
23
+ data={{
24
+ info: [{ description: '' }],
25
+ hideContentType: true,
26
+ hideCreationDate: true,
27
+ hideModificationDate: true,
28
+ hidePublishingDate: true,
29
+ hideDownloadButton: true,
30
+ hideShareButton: false,
31
+ subtitle: 'Project',
32
+ }}
33
+ metadata={{
34
+ ...content,
35
+ title: content.title + ' (' + content.acronym + ')',
36
+ }}
37
+ />
15
38
  <div className="ui container">
16
39
  <Grid columns="12">
17
40
  <div className="row">
@@ -21,10 +44,6 @@ function ProjectView(props) {
21
44
  computer={9}
22
45
  className="col-left"
23
46
  >
24
- <div className="ui label">Project</div>
25
- <h1>
26
- {content.title} ({content.acronym})
27
- </h1>
28
47
  <h4>Description:</h4>
29
48
  <HTMLField
30
49
  value={content.long_description}
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import ProjectView from './ProjectView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -5,6 +5,7 @@ import {
5
5
  DocumentsList,
6
6
  ShareInfo,
7
7
  ReferenceInfo,
8
+ BannerTitle,
8
9
  } from '@eeacms/volto-cca-policy/helpers';
9
10
  import { Grid } from 'semantic-ui-react';
10
11
 
@@ -13,6 +14,8 @@ function PublicationReportView(props) {
13
14
 
14
15
  return (
15
16
  <div className="publication-report-view">
17
+ <BannerTitle content={content} type="Publications and Report" />
18
+
16
19
  <div className="ui container">
17
20
  <Grid columns="12">
18
21
  <div className="row">
@@ -22,8 +25,6 @@ function PublicationReportView(props) {
22
25
  computer={9}
23
26
  className="col-left"
24
27
  >
25
- <div className="ui label">Publications and Reports</div>
26
-
27
28
  <ReferenceInfo content={content} />
28
29
  <PublishedModifiedInfo {...props} />
29
30
  <ShareInfo {...props} />
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import PublicationReportView from './PublicationReportView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -3,13 +3,17 @@ import {
3
3
  ContentMetadata,
4
4
  PublishedModifiedInfo,
5
5
  ReferenceInfo,
6
+ BannerTitle,
6
7
  } from '@eeacms/volto-cca-policy/helpers';
7
8
  import { Grid } from 'semantic-ui-react';
8
9
 
9
10
  function ToolView(props) {
10
11
  const { content } = props;
12
+
11
13
  return (
12
14
  <div className="tool-view">
15
+ <BannerTitle content={content} type="Tools" />
16
+
13
17
  <div className="ui container">
14
18
  <Grid columns="12">
15
19
  <div className="row">
@@ -19,8 +23,6 @@ function ToolView(props) {
19
23
  computer={9}
20
24
  className="col-left"
21
25
  >
22
- <div className="ui label">Tools</div>
23
-
24
26
  <ReferenceInfo content={content} />
25
27
 
26
28
  <PublishedModifiedInfo {...props} />
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import ToolView from './ToolView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -5,11 +5,13 @@ import {
5
5
  ExternalLink,
6
6
  LinksList,
7
7
  ShareInfo,
8
+ BannerTitle,
8
9
  } from '@eeacms/volto-cca-policy/helpers';
9
10
  import { Grid } from 'semantic-ui-react';
10
11
 
11
12
  function VideoView(props) {
12
13
  const { content } = props;
14
+
13
15
  const share_eea = ['https://cmshare.eea.eu', 'shareit.eea.europa.eu'];
14
16
  const is_cmshare_video = share_eea.some((domain) =>
15
17
  content.embed_url.includes(domain),
@@ -25,6 +27,8 @@ function VideoView(props) {
25
27
 
26
28
  return (
27
29
  <div className="video-view">
30
+ <BannerTitle content={content} type="Video" />
31
+
28
32
  <div className="ui container">
29
33
  <Grid columns="12">
30
34
  <div className="row">
@@ -34,8 +38,6 @@ function VideoView(props) {
34
38
  computer={9}
35
39
  className="col-left"
36
40
  >
37
- <div className="ui label">Video</div>
38
- <h1>{content.title}</h1>
39
41
  <HTMLField
40
42
  value={content.long_description}
41
43
  className="long_description"
@@ -5,6 +5,15 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { Provider } from 'react-intl-redux';
6
6
  import VideoView from './ToolView';
7
7
  import renderer from 'react-test-renderer';
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
+ };
8
17
 
9
18
  const mockStore = configureStore();
10
19
 
@@ -0,0 +1,20 @@
1
+ // Original: https://github.com/plone/volto/blob/16.x.x/src/components/theme/Widgets/RichTextWidget.jsx
2
+ // Fixed 'dangerouslySetInnerHTML' did not match. Server: "" Client: "<p>This is my paragraph.</p>" error
3
+ // replaced <p> to <div>, the value can already be wrapped in <p> and nested <p> is invalid HTML
4
+
5
+ import React from 'react';
6
+ import cx from 'classnames';
7
+
8
+ const RichTextWidget = ({ value, className }) =>
9
+ value ? (
10
+ <div
11
+ className={cx(className, 'richtext', 'widget')}
12
+ dangerouslySetInnerHTML={{
13
+ __html: value.data,
14
+ }}
15
+ />
16
+ ) : (
17
+ ''
18
+ );
19
+
20
+ export default RichTextWidget;
@@ -1,4 +1,5 @@
1
1
  import { UniversalLink } from '@plone/volto/components';
2
+ import config from '@plone/volto/registry';
2
3
 
3
4
  export const HTMLField = ({ value, className }) => {
4
5
  if (value === null) {
@@ -68,11 +69,37 @@ export const LinksList = (props) => {
68
69
  }
69
70
  };
70
71
 
72
+ export const BannerTitle = (props) => {
73
+ const { content, type } = props;
74
+ const {
75
+ blocks: { blocksConfig },
76
+ } = config;
77
+ const TitleBlockView = blocksConfig?.title?.view;
78
+
79
+ return (
80
+ <>
81
+ <TitleBlockView
82
+ {...props}
83
+ data={{
84
+ info: [{ description: '' }],
85
+ hideContentType: true,
86
+ hideCreationDate: true,
87
+ hideModificationDate: true,
88
+ hidePublishingDate: true,
89
+ hideDownloadButton: true,
90
+ hideShareButton: false,
91
+ subtitle: type,
92
+ }}
93
+ metadata={content}
94
+ />
95
+ </>
96
+ );
97
+ };
98
+
71
99
  export const ReferenceInfo = (props) => {
72
100
  const { content } = props;
73
101
  return (
74
102
  <>
75
- <h1>{content.title}</h1>
76
103
  <h4>Description</h4>
77
104
  <HTMLField
78
105
  value={content.long_description}
@@ -10,6 +10,7 @@ export {
10
10
  LinksList,
11
11
  DocumentsList,
12
12
  ReferenceInfo,
13
+ BannerTitle,
13
14
  } from './Utils';
14
15
  export ContentMetadata from './ContentMetadata';
15
16
  export ShareInfo from './ShareInfo';
@@ -1,21 +1,33 @@
1
1
  import { multiTermFacet } from '@eeacms/search';
2
-
3
- import globalSearchBaseConfig from '@eeacms/volto-globalsearch/config/global-search-base-config.js';
2
+ import {
3
+ include_archived,
4
+ objectProvides,
5
+ language,
6
+ issued_date,
7
+ geographic_countries,
8
+ } from './../common';
4
9
 
5
10
  const facets = [
6
- ...globalSearchBaseConfig.facets,
7
11
  multiTermFacet({
8
- field: 'cca_adaptation_sectors.keyword',
12
+ field: 'cca_funding_programme.keyword',
9
13
  isFilterable: false,
10
14
  isMulti: true,
11
- label: 'Sectors',
15
+ label: 'Funding Programme',
16
+ iconsFamily: 'Funding Programme',
12
17
  alwaysVisible: false,
13
18
  }),
14
19
  multiTermFacet({
15
20
  field: 'cca_climate_impacts.keyword',
16
21
  isFilterable: false,
17
22
  isMulti: true,
18
- label: 'Climate impacts',
23
+ label: 'Climate Impacts',
24
+ alwaysVisible: false,
25
+ }),
26
+ multiTermFacet({
27
+ field: 'cca_adaptation_sectors.keyword',
28
+ isFilterable: false,
29
+ isMulti: true,
30
+ label: 'Adaptation Sectors',
19
31
  alwaysVisible: false,
20
32
  }),
21
33
  multiTermFacet({
@@ -25,6 +37,11 @@ const facets = [
25
37
  label: 'Adaptation Elements',
26
38
  alwaysVisible: false,
27
39
  }),
40
+ geographic_countries,
41
+ include_archived,
42
+ issued_date,
43
+ language,
44
+ objectProvides,
28
45
  ];
29
46
 
30
47
  export default facets;
@@ -3,53 +3,45 @@ import { multiTermFacet } from '@eeacms/search';
3
3
  import globalSearchBaseConfig from '@eeacms/volto-globalsearch/config/global-search-base-config.js';
4
4
 
5
5
  const facets = [
6
- ...globalSearchBaseConfig.facets,
7
- // multiTermFacet({
8
- // field: 'spatial',
9
- // isFilterable: false,
10
- // isMulti: true,
11
- // label: 'Country',
12
- // iconsFamily: 'Country',
13
- // alwaysVisible: false,
14
- // }),
15
6
  multiTermFacet({
16
- field: 'cca_adaptation_sectors.keyword',
7
+ field: 'cca_climate_impacts.keyword',
17
8
  isFilterable: false,
18
9
  isMulti: true,
19
- label: 'Sectors',
20
- iconsFamily: 'Sectors',
10
+ label: 'Climate Impacts',
11
+ iconsFamily: 'Climate Impacts',
21
12
  alwaysVisible: false,
22
13
  }),
23
14
  multiTermFacet({
24
- field: 'key_system.keyword',
15
+ field: 'cca_adaptation_sectors.keyword',
25
16
  isFilterable: false,
26
17
  isMulti: true,
27
- label: 'Key System',
28
- iconsFamily: 'Key System',
18
+ label: 'Adaptation Sectors',
19
+ iconsFamily: 'Adaptation Sectors',
29
20
  alwaysVisible: false,
30
21
  }),
31
22
  multiTermFacet({
32
- field: 'climate_threats.keyword',
23
+ field: 'key_system.keyword',
33
24
  isFilterable: false,
34
25
  isMulti: true,
35
- label: 'Hazard Type',
36
- iconsFamily: 'Hazard Type',
26
+ label: 'Key Community Systems',
27
+ iconsFamily: 'Key Community Systems',
37
28
  alwaysVisible: false,
38
29
  }),
30
+ ...globalSearchBaseConfig.facets,
39
31
  multiTermFacet({
40
- field: 'cca_climate_impacts.keyword',
32
+ field: 'cca_funding_programme.keyword',
41
33
  isFilterable: false,
42
34
  isMulti: true,
43
- label: 'Climate Impacts',
44
- iconsFamily: 'Climate Impacts',
35
+ label: 'Funding Programme',
36
+ iconsFamily: 'Funding Programme',
45
37
  alwaysVisible: false,
46
38
  }),
47
39
  multiTermFacet({
48
- field: 'cca_funding_programme.keyword',
40
+ field: 'climate_threats.keyword',
49
41
  isFilterable: false,
50
42
  isMulti: true,
51
- label: 'Funding Programme',
52
- iconsFamily: 'Funding Programme',
43
+ label: 'Hazard Type',
44
+ iconsFamily: 'Hazard Type',
53
45
  alwaysVisible: false,
54
46
  }),
55
47
  ];