@eeacms/volto-cca-policy 0.1.43 → 0.1.45
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 +23 -2
- package/package.json +1 -1
- package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockEdit.jsx +32 -0
- package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockView.jsx +35 -0
- package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/index.js +28 -0
- package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/schema.js +14 -0
- package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/C3SIndicatorsOverviewBlockEdit.jsx +32 -0
- package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/C3SIndicatorsOverviewBlockView.jsx +55 -0
- package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/index.js +28 -0
- package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/schema.js +35 -0
- package/src/components/manage/Blocks/ReadMore/ReadMoreEdit.jsx +32 -0
- package/src/components/manage/Blocks/ReadMore/ReadMoreView.jsx +86 -0
- package/src/components/manage/Blocks/ReadMore/index.js +22 -0
- package/src/components/manage/Blocks/ReadMore/schema.js +42 -0
- package/src/components/manage/Blocks/ReadMore/style.less +25 -0
- package/src/components/manage/Blocks/index.js +6 -0
- package/src/components/theme/Header.jsx +8 -2
- package/src/components/theme/Views/AdaptationOptionView.jsx +0 -10
- package/src/components/theme/Widgets/GeocharsWidget.jsx +1 -1
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/Header.jsx +395 -0
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderMenuPopUp.js +403 -0
- package/src/customizations/@eeacms/volto-eea-design-system/ui/Header/HeaderSearchPopUp.js +131 -0
- package/src/customizations/volto/components/theme/View/DefaultView.jsx +0 -1
- package/src/helpers/Utils.jsx +1 -1
- package/src/index.js +0 -2
- package/src/search/config-health.js +6 -0
- package/src/search/facets-health.js +1 -1
- package/theme/globals/site.overrides +52 -34
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ 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.45](https://github.com/eea/volto-cca-policy/compare/0.1.44...0.1.45) - 25 September 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Refs #161483 - Fix name. [GhitaB - [`e614a27`](https://github.com/eea/volto-cca-policy/commit/e614a275681b42d23292f0eb8f371686fefa8d70)]
|
|
12
|
+
- Code cleanup [Tiberiu Ichim - [`c0521db`](https://github.com/eea/volto-cca-policy/commit/c0521dbd4642516c49ec1560d7cc648b2918fddc)]
|
|
13
|
+
- Refs #161483 - Fix jenkins and infinite loop render. [GhitaB - [`2080298`](https://github.com/eea/volto-cca-policy/commit/20802988bbf2bee0759f524c0907da8dd6769284)]
|
|
14
|
+
- Refs #161483 - Add ECDE C3S indicators glossary block. [GhitaB - [`806a768`](https://github.com/eea/volto-cca-policy/commit/806a76888290cb52616dfd6a937a8e49fc6a9ed3)]
|
|
15
|
+
- Refs #161483 - Fix error in documents list when no files. (in add/edit/view publication report form) [GhitaB - [`954f19d`](https://github.com/eea/volto-cca-policy/commit/954f19dd2f09fd2a884c34c95a7c818304b231ae)]
|
|
16
|
+
### [0.1.44](https://github.com/eea/volto-cca-policy/compare/0.1.43...0.1.44) - 22 September 2023
|
|
17
|
+
|
|
18
|
+
#### :hammer_and_wrench: Others
|
|
19
|
+
|
|
20
|
+
- Allow subsite behavior in folders that are not subsites [Tiberiu Ichim - [`28faeb4`](https://github.com/eea/volto-cca-policy/commit/28faeb41c43833352da3ed4002c82cc0429e4a47)]
|
|
21
|
+
- Support subsite logo uploaded as svg [Tiberiu Ichim - [`c1c0874`](https://github.com/eea/volto-cca-policy/commit/c1c08740c838da4f3f5fe2a8b74c4fa87364edce)]
|
|
22
|
+
- Refs #161483 - Fix description html - C3S Indicators Overview block. [GhitaB - [`0853fc4`](https://github.com/eea/volto-cca-policy/commit/0853fc449b64620d173582cadfe6763d73ce8551)]
|
|
23
|
+
- Refs #161483 - Use universal link - C3S Indicators Overview block. [GhitaB - [`054fa8d`](https://github.com/eea/volto-cca-policy/commit/054fa8d62bfd9824ceddf52cc3ebc51b456c935b)]
|
|
24
|
+
- Refs #161483 - Select category - C3S Indicators Overview block. [GhitaB - [`eb75b38`](https://github.com/eea/volto-cca-policy/commit/eb75b3858d6e83fbe87f123381df65f9de4b84ca)]
|
|
25
|
+
- Refs #161483 - Add C3S Indicators Overview block. [GhitaB - [`cf86213`](https://github.com/eea/volto-cca-policy/commit/cf862135713780355a38a1eb683abd1166041cb9)]
|
|
26
|
+
- Cleanup in read more block [kreafox - [`20ac717`](https://github.com/eea/volto-cca-policy/commit/20ac7171575a1966a8aabb50d5ae9e2808429423)]
|
|
27
|
+
- Refs #161485 - Fix error in GeocharsWidget. [GhitaB - [`6fda82d`](https://github.com/eea/volto-cca-policy/commit/6fda82ded95cba32b7519c8bcfa49358887bac6b)]
|
|
28
|
+
- Add read more block [kreafox - [`7fafeaa`](https://github.com/eea/volto-cca-policy/commit/7fafeaabf7bb091db76f9fc083cf61fce2bf6c06)]
|
|
29
|
+
- Refs #161485 - Fix field for Observatory partner. Add facet in search landing page. [GhitaB - [`c21d23e`](https://github.com/eea/volto-cca-policy/commit/c21d23e38ce07733775a3513544c2d3bb5f99edb)]
|
|
7
30
|
### [0.1.43](https://github.com/eea/volto-cca-policy/compare/0.1.42...0.1.43) - 15 September 2023
|
|
8
31
|
|
|
9
32
|
#### :hammer_and_wrench: Others
|
|
@@ -159,7 +182,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
159
182
|
|
|
160
183
|
#### :house: Internal changes
|
|
161
184
|
|
|
162
|
-
- chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
|
|
163
185
|
|
|
164
186
|
#### :hammer_and_wrench: Others
|
|
165
187
|
|
|
@@ -640,7 +662,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
640
662
|
#### :hammer_and_wrench: Others
|
|
641
663
|
|
|
642
664
|
- Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
|
|
643
|
-
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
|
|
644
665
|
### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
|
|
645
666
|
|
|
646
667
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockEdit.jsx
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { SidebarPortal } from '@plone/volto/components';
|
|
4
|
+
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
5
|
+
|
|
6
|
+
import C3SIndicatorsGlossaryBlockView from './C3SIndicatorsGlossaryBlockView';
|
|
7
|
+
import schema from './schema';
|
|
8
|
+
|
|
9
|
+
export default function C3SIndicatorsGlossaryBlockEdit(props) {
|
|
10
|
+
const { block, data, onChangeBlock, selected, id } = props;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div>
|
|
14
|
+
<C3SIndicatorsGlossaryBlockView data={data} id={id} mode="edit" />
|
|
15
|
+
<SidebarPortal selected={selected}>
|
|
16
|
+
<BlockDataForm
|
|
17
|
+
block={block}
|
|
18
|
+
title={schema.title}
|
|
19
|
+
schema={schema}
|
|
20
|
+
onChangeField={(id, value) => {
|
|
21
|
+
onChangeBlock(block, {
|
|
22
|
+
...data,
|
|
23
|
+
[id]: value,
|
|
24
|
+
});
|
|
25
|
+
}}
|
|
26
|
+
onChangeBlock={onChangeBlock}
|
|
27
|
+
formData={data}
|
|
28
|
+
/>
|
|
29
|
+
</SidebarPortal>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
package/src/components/manage/Blocks/C3SIndicatorsGlossaryBlock/C3SIndicatorsGlossaryBlockView.jsx
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
|
|
4
|
+
export default function C3SIndicatorsGlossaryBlockView(props) {
|
|
5
|
+
const [tableHTML, setTableHTML] = React.useState('');
|
|
6
|
+
|
|
7
|
+
const getIndicatorsData = () => {
|
|
8
|
+
const url =
|
|
9
|
+
'/++api++/en/knowledge/european-climate-data-explorer/@c3s_indicators_glossary_table';
|
|
10
|
+
|
|
11
|
+
axios
|
|
12
|
+
.get(url)
|
|
13
|
+
.then((response) => {
|
|
14
|
+
setTableHTML(response.data.c3s_indicators_glossary_table);
|
|
15
|
+
})
|
|
16
|
+
.catch((error) => {
|
|
17
|
+
// console.error(error);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
getIndicatorsData();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className="block c3sindicators-glossary-block">
|
|
27
|
+
<div
|
|
28
|
+
className="glossary-table"
|
|
29
|
+
dangerouslySetInnerHTML={{
|
|
30
|
+
__html: tableHTML,
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import zoomSVG from '@plone/volto/icons/zoom.svg';
|
|
2
|
+
import C3SIndicatorsGlossaryBlockEdit from './C3SIndicatorsGlossaryBlockEdit';
|
|
3
|
+
import C3SIndicatorsGlossaryBlockView from './C3SIndicatorsGlossaryBlockView';
|
|
4
|
+
import { blockAvailableInMission } from '@eeacms/volto-cca-policy/utils';
|
|
5
|
+
|
|
6
|
+
export default function installBlock(config) {
|
|
7
|
+
const blocksConfig = config.blocks.blocksConfig;
|
|
8
|
+
|
|
9
|
+
blocksConfig.c3SIndicatorsGlossaryBlock = {
|
|
10
|
+
id: 'c3SIndicatorsGlossaryBlock',
|
|
11
|
+
title: 'C3S Indicators Glossary',
|
|
12
|
+
icon: zoomSVG,
|
|
13
|
+
group: 'site',
|
|
14
|
+
view: C3SIndicatorsGlossaryBlockView,
|
|
15
|
+
edit: C3SIndicatorsGlossaryBlockEdit,
|
|
16
|
+
sidebarTab: 1,
|
|
17
|
+
security: {
|
|
18
|
+
addPermission: [],
|
|
19
|
+
view: [],
|
|
20
|
+
},
|
|
21
|
+
variations: [],
|
|
22
|
+
restricted: ({ properties, block }) => {
|
|
23
|
+
return blockAvailableInMission(properties, block);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return config;
|
|
28
|
+
}
|
package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/C3SIndicatorsOverviewBlockEdit.jsx
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { SidebarPortal } from '@plone/volto/components';
|
|
4
|
+
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
5
|
+
|
|
6
|
+
import C3SIndicatorsOverviewBlockView from './C3SIndicatorsOverviewBlockView';
|
|
7
|
+
import schema from './schema';
|
|
8
|
+
|
|
9
|
+
export default function C3SIndicatorsOverviewBlockEdit(props) {
|
|
10
|
+
const { block, data, onChangeBlock, selected, id } = props;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div>
|
|
14
|
+
<C3SIndicatorsOverviewBlockView data={data} id={id} mode="edit" />
|
|
15
|
+
<SidebarPortal selected={selected}>
|
|
16
|
+
<BlockDataForm
|
|
17
|
+
block={block}
|
|
18
|
+
title={schema.title}
|
|
19
|
+
schema={schema}
|
|
20
|
+
onChangeField={(id, value) => {
|
|
21
|
+
onChangeBlock(block, {
|
|
22
|
+
...data,
|
|
23
|
+
[id]: value,
|
|
24
|
+
});
|
|
25
|
+
}}
|
|
26
|
+
onChangeBlock={onChangeBlock}
|
|
27
|
+
formData={data}
|
|
28
|
+
/>
|
|
29
|
+
</SidebarPortal>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
package/src/components/manage/Blocks/C3SIndicatorsOverviewBlock/C3SIndicatorsOverviewBlockView.jsx
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
4
|
+
|
|
5
|
+
export default function C3SIndicatorsOverviewBlockView(props) {
|
|
6
|
+
const [pageDescription, setPageDescription] = React.useState('');
|
|
7
|
+
const [indicators, setIndicators] = React.useState([]);
|
|
8
|
+
|
|
9
|
+
const category = props.data.category;
|
|
10
|
+
|
|
11
|
+
const getIndicatorsData = () => {
|
|
12
|
+
const url =
|
|
13
|
+
'/++api++/en/knowledge/european-climate-data-explorer/' +
|
|
14
|
+
category +
|
|
15
|
+
'/@c3s_indicators_overview';
|
|
16
|
+
|
|
17
|
+
axios
|
|
18
|
+
.get(url)
|
|
19
|
+
.then((response) => {
|
|
20
|
+
setPageDescription(response.data.c3s_indicators_overview.description);
|
|
21
|
+
setIndicators(response.data.c3s_indicators_overview.items);
|
|
22
|
+
})
|
|
23
|
+
.catch((error) => {
|
|
24
|
+
// console.error(error);
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
getIndicatorsData();
|
|
30
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
+
}, [category]);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div className="block c3sindicators-overview-block">
|
|
35
|
+
<div
|
|
36
|
+
className="description"
|
|
37
|
+
dangerouslySetInnerHTML={{
|
|
38
|
+
__html: pageDescription,
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
{indicators ? (
|
|
43
|
+
<ul>
|
|
44
|
+
{indicators.map((item, index) => (
|
|
45
|
+
<li key={index}>
|
|
46
|
+
<UniversalLink href={item.url}>{item.title}</UniversalLink>
|
|
47
|
+
</li>
|
|
48
|
+
))}
|
|
49
|
+
</ul>
|
|
50
|
+
) : (
|
|
51
|
+
<p>Loading...</p>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import zoomSVG from '@plone/volto/icons/zoom.svg';
|
|
2
|
+
import C3SIndicatorsOverviewBlockEdit from './C3SIndicatorsOverviewBlockEdit';
|
|
3
|
+
import C3SIndicatorsOverviewBlockView from './C3SIndicatorsOverviewBlockView';
|
|
4
|
+
import { blockAvailableInMission } from '@eeacms/volto-cca-policy/utils';
|
|
5
|
+
|
|
6
|
+
export default function installBlock(config) {
|
|
7
|
+
const blocksConfig = config.blocks.blocksConfig;
|
|
8
|
+
|
|
9
|
+
blocksConfig.c3SIndicatorsOverviewBlock = {
|
|
10
|
+
id: 'c3SIndicatorsOverviewBlock',
|
|
11
|
+
title: 'C3S Indicators Overview',
|
|
12
|
+
icon: zoomSVG,
|
|
13
|
+
group: 'site',
|
|
14
|
+
view: C3SIndicatorsOverviewBlockView,
|
|
15
|
+
edit: C3SIndicatorsOverviewBlockEdit,
|
|
16
|
+
sidebarTab: 1,
|
|
17
|
+
security: {
|
|
18
|
+
addPermission: [],
|
|
19
|
+
view: [],
|
|
20
|
+
},
|
|
21
|
+
variations: [],
|
|
22
|
+
restricted: ({ properties, block }) => {
|
|
23
|
+
return blockAvailableInMission(properties, block);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return config;
|
|
28
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const fields = ['category'];
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'C3S Indicators Overview',
|
|
5
|
+
|
|
6
|
+
fieldsets: [
|
|
7
|
+
{
|
|
8
|
+
id: 'default',
|
|
9
|
+
title: 'Default',
|
|
10
|
+
fields,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
|
|
14
|
+
properties: {
|
|
15
|
+
category: {
|
|
16
|
+
title: 'Category',
|
|
17
|
+
type: 'string',
|
|
18
|
+
factory: 'Choice',
|
|
19
|
+
choices: [
|
|
20
|
+
['health', 'Health'],
|
|
21
|
+
['agriculture', 'Agriculture'],
|
|
22
|
+
['forestry', 'Forestry'],
|
|
23
|
+
['energy', 'Energy'],
|
|
24
|
+
['tourism', 'Tourism'],
|
|
25
|
+
['water-and-coastal', 'Water and Coastal'],
|
|
26
|
+
],
|
|
27
|
+
default: 'health',
|
|
28
|
+
description: 'Choose indicators category to be used as filter.',
|
|
29
|
+
required: true,
|
|
30
|
+
noValueOption: false,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
required: [],
|
|
35
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SidebarPortal } from '@plone/volto/components';
|
|
3
|
+
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
4
|
+
import ReadMoreView from './ReadMoreView';
|
|
5
|
+
import schema from './schema';
|
|
6
|
+
|
|
7
|
+
const ReadMoreEdit = (props) => {
|
|
8
|
+
const { block, data, onChangeBlock, selected, id } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<ReadMoreView data={data} id={id} mode="edit" />
|
|
13
|
+
|
|
14
|
+
<SidebarPortal selected={selected}>
|
|
15
|
+
<BlockDataForm
|
|
16
|
+
block={block}
|
|
17
|
+
title={schema.title}
|
|
18
|
+
schema={schema}
|
|
19
|
+
onChangeField={(id, value) => {
|
|
20
|
+
onChangeBlock(block, {
|
|
21
|
+
...data,
|
|
22
|
+
[id]: value,
|
|
23
|
+
});
|
|
24
|
+
}}
|
|
25
|
+
onChangeBlock={onChangeBlock}
|
|
26
|
+
formData={data}
|
|
27
|
+
/>
|
|
28
|
+
</SidebarPortal>
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
export default ReadMoreEdit;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Icon } from 'semantic-ui-react';
|
|
3
|
+
import { BodyClass } from '@plone/volto/helpers';
|
|
4
|
+
import cx from 'classnames';
|
|
5
|
+
|
|
6
|
+
import './style.less';
|
|
7
|
+
|
|
8
|
+
const ReadMoreView = (props) => {
|
|
9
|
+
const { data, mode } = props;
|
|
10
|
+
const isEditMode = mode === 'edit';
|
|
11
|
+
const { label_opened, label_closed, label_position, height } = data;
|
|
12
|
+
|
|
13
|
+
const [isReadMore, setIsReadMore] = React.useState(true);
|
|
14
|
+
const [wrapperHeight, setWrapperHeight] = React.useState(height);
|
|
15
|
+
const [mounted, setMounted] = React.useState(false);
|
|
16
|
+
const readMoreRef = React.createRef();
|
|
17
|
+
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
setMounted(true);
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (isEditMode || !mounted) return;
|
|
24
|
+
|
|
25
|
+
const button = readMoreRef.current;
|
|
26
|
+
const wrapper = document.createElement('div');
|
|
27
|
+
wrapper.className = 'panel-wrapper';
|
|
28
|
+
|
|
29
|
+
const nodes = [];
|
|
30
|
+
let prev_elem = button.previousSibling;
|
|
31
|
+
while (prev_elem) {
|
|
32
|
+
nodes.push(prev_elem);
|
|
33
|
+
prev_elem = prev_elem.previousSibling;
|
|
34
|
+
}
|
|
35
|
+
const section = document.getElementsByClassName('panel-wrapper');
|
|
36
|
+
if (section.length > 0) return;
|
|
37
|
+
|
|
38
|
+
Array.from(nodes).forEach((e) => {
|
|
39
|
+
wrapper.appendChild(e);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
button.parentNode.insertBefore(wrapper, button);
|
|
43
|
+
wrapper.append(...Array.from(wrapper.childNodes).reverse());
|
|
44
|
+
}, [mounted, readMoreRef, isEditMode]);
|
|
45
|
+
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
if (isEditMode || !mounted) return;
|
|
48
|
+
|
|
49
|
+
const wrapper = document.getElementsByClassName('panel-wrapper')[0];
|
|
50
|
+
|
|
51
|
+
if (wrapper) {
|
|
52
|
+
wrapper.style.height = wrapperHeight;
|
|
53
|
+
}
|
|
54
|
+
}, [mounted, wrapperHeight, isEditMode]);
|
|
55
|
+
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
isReadMore ? setWrapperHeight(height) : setWrapperHeight('auto');
|
|
58
|
+
}, [height, isReadMore]);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
ref={readMoreRef}
|
|
63
|
+
id="read-more-button"
|
|
64
|
+
className={cx('styled-readMoreBlock', {
|
|
65
|
+
left: label_position === 'left',
|
|
66
|
+
right: label_position === 'right',
|
|
67
|
+
})}
|
|
68
|
+
>
|
|
69
|
+
<BodyClass className={`${isReadMore ? 'closed' : 'opened'}`} />
|
|
70
|
+
<Button basic icon primary onClick={() => setIsReadMore(!isReadMore)}>
|
|
71
|
+
{isReadMore ? (
|
|
72
|
+
<>
|
|
73
|
+
<strong>{label_closed || 'Read more'}</strong>
|
|
74
|
+
<Icon className="ri-arrow-down-s-line" />
|
|
75
|
+
</>
|
|
76
|
+
) : (
|
|
77
|
+
<>
|
|
78
|
+
<strong>{label_opened || 'Read less'}</strong>
|
|
79
|
+
<Icon className="ri-arrow-up-s-line" />
|
|
80
|
+
</>
|
|
81
|
+
)}
|
|
82
|
+
</Button>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
export default ReadMoreView;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import ReadMoreEdit from './ReadMoreEdit';
|
|
2
|
+
import ReadMoreView from './ReadMoreView';
|
|
3
|
+
import iconSVG from '@plone/volto/icons/divide-horizontal.svg';
|
|
4
|
+
|
|
5
|
+
export default function installBlock(config) {
|
|
6
|
+
config.blocks.blocksConfig.readMoreBlock = {
|
|
7
|
+
id: 'readMoreBlock',
|
|
8
|
+
title: 'Read more',
|
|
9
|
+
icon: iconSVG,
|
|
10
|
+
group: 'site',
|
|
11
|
+
edit: ReadMoreEdit,
|
|
12
|
+
view: ReadMoreView,
|
|
13
|
+
mostUsed: false,
|
|
14
|
+
sidebarTab: 1,
|
|
15
|
+
security: {
|
|
16
|
+
addPermission: [],
|
|
17
|
+
view: [],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return config;
|
|
22
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title: 'Read more',
|
|
3
|
+
fieldsets: [
|
|
4
|
+
{
|
|
5
|
+
id: 'default',
|
|
6
|
+
title: 'Default',
|
|
7
|
+
fields: ['label_closed', 'label_opened', 'label_position', 'height'],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
properties: {
|
|
11
|
+
label_closed: {
|
|
12
|
+
title: 'Closed button',
|
|
13
|
+
default: 'Read more',
|
|
14
|
+
},
|
|
15
|
+
label_opened: {
|
|
16
|
+
title: 'Opened button',
|
|
17
|
+
default: 'Read less',
|
|
18
|
+
},
|
|
19
|
+
label_position: {
|
|
20
|
+
title: 'Button position',
|
|
21
|
+
choices: [
|
|
22
|
+
['left', 'Left'],
|
|
23
|
+
['right', 'Right'],
|
|
24
|
+
],
|
|
25
|
+
default: 'right',
|
|
26
|
+
},
|
|
27
|
+
height: {
|
|
28
|
+
title: (
|
|
29
|
+
<a
|
|
30
|
+
rel="noreferrer"
|
|
31
|
+
target="_blank"
|
|
32
|
+
href="https://developer.mozilla.org/en-US/docs/Web/CSS/height"
|
|
33
|
+
>
|
|
34
|
+
CSS height
|
|
35
|
+
</a>
|
|
36
|
+
),
|
|
37
|
+
default: '50vh',
|
|
38
|
+
description: 'Visible section height',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
required: [],
|
|
42
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.styled-readMoreBlock {
|
|
2
|
+
display: flex;
|
|
3
|
+
margin: 1.5em 0;
|
|
4
|
+
|
|
5
|
+
&.right {
|
|
6
|
+
flex-direction: row-reverse;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
button {
|
|
10
|
+
display: flex !important;
|
|
11
|
+
align-items: center !important;
|
|
12
|
+
font-size: 18px !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
i.icon {
|
|
16
|
+
font-size: 26px !important;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
body.closed {
|
|
21
|
+
.panel-wrapper {
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
-webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -11,6 +11,9 @@ import installCountryMapHeatIndex from './CountryMapHeatIndex';
|
|
|
11
11
|
import installCountryMapProfile from './CountryMapProfile';
|
|
12
12
|
import installListing from './Listing';
|
|
13
13
|
import installRAST from './RASTBlock';
|
|
14
|
+
import installC3SIndicatorsOverviewBlock from './C3SIndicatorsOverviewBlock';
|
|
15
|
+
import installC3SIndicatorsGlossaryBlock from './C3SIndicatorsGlossaryBlock';
|
|
16
|
+
import installReadMore from './ReadMore';
|
|
14
17
|
|
|
15
18
|
export default function installBlocks(config) {
|
|
16
19
|
config.blocks.blocksConfig.title.restricted = false;
|
|
@@ -18,6 +21,9 @@ export default function installBlocks(config) {
|
|
|
18
21
|
|
|
19
22
|
return compose(
|
|
20
23
|
installRAST,
|
|
24
|
+
installReadMore,
|
|
25
|
+
installC3SIndicatorsOverviewBlock,
|
|
26
|
+
installC3SIndicatorsGlossaryBlock,
|
|
21
27
|
installMKHMap,
|
|
22
28
|
installECDEIndicatorsBlock,
|
|
23
29
|
installCaseStudyExplorerBlock,
|
|
@@ -20,6 +20,7 @@ import { usePrevious } from '@eeacms/volto-eea-design-system/helpers';
|
|
|
20
20
|
import { find } from 'lodash';
|
|
21
21
|
import globeIcon from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/global-line.svg';
|
|
22
22
|
import eeaFlag from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/eea.png';
|
|
23
|
+
import { toPublicURL } from '@plone/volto/helpers';
|
|
23
24
|
|
|
24
25
|
import config from '@plone/volto/registry';
|
|
25
26
|
import { compose } from 'recompose';
|
|
@@ -72,7 +73,7 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
|
|
|
72
73
|
return removeTrailingSlash(state.router?.location?.pathname) || '';
|
|
73
74
|
});
|
|
74
75
|
|
|
75
|
-
const isSubsite = subsite?.['@type']
|
|
76
|
+
const isSubsite = ['Folder', 'Subsite'].indexOf(subsite?.['@type']) > -1;
|
|
76
77
|
|
|
77
78
|
const isHomePageInverse = useSelector((state) => {
|
|
78
79
|
const layout = state.content?.data?.layout;
|
|
@@ -115,6 +116,11 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
|
|
|
115
116
|
}
|
|
116
117
|
}, [token, dispatch, pathname, previousToken]);
|
|
117
118
|
|
|
119
|
+
const subsiteLogo = subsite?.subsite_logo
|
|
120
|
+
? subsite.subsite_logo.scales?.preview?.download ||
|
|
121
|
+
toPublicURL(`${subsite['@id']}/@@images/subsite_logo`)
|
|
122
|
+
: null;
|
|
123
|
+
|
|
118
124
|
return (
|
|
119
125
|
<Header menuItems={items}>
|
|
120
126
|
{isHomePageInverse && <BodyClass className="homepage" />}
|
|
@@ -238,7 +244,7 @@ const EEAHeader = ({ pathname, token, items, history, subsite }) => {
|
|
|
238
244
|
<>
|
|
239
245
|
{subsite.subsite_logo ? (
|
|
240
246
|
<Logo
|
|
241
|
-
src={
|
|
247
|
+
src={subsiteLogo}
|
|
242
248
|
title={subsite.title}
|
|
243
249
|
alt={subsite.title}
|
|
244
250
|
url={flattenToAppURL(subsite['@id'])}
|
|
@@ -138,16 +138,6 @@ function AdaptationOptionView(props) {
|
|
|
138
138
|
|
|
139
139
|
<h4>Adaptation Details</h4>
|
|
140
140
|
|
|
141
|
-
<div id={sectionID('Category')} className="section">
|
|
142
|
-
<h5 className="section-title">Category</h5>
|
|
143
|
-
{content.category
|
|
144
|
-
.map((item) => item.token)
|
|
145
|
-
.sort()
|
|
146
|
-
.map((cat, index) => (
|
|
147
|
-
<Fragment key={index}>{cat}</Fragment>
|
|
148
|
-
))}
|
|
149
|
-
</div>
|
|
150
|
-
|
|
151
141
|
<div id={sectionID('IPCC categories')} className="section">
|
|
152
142
|
<h5 className="section-title">IPCC categories</h5>
|
|
153
143
|
{content.ipcc_category
|
|
@@ -110,7 +110,7 @@ const SelectCountries = (props) => {
|
|
|
110
110
|
key={country.code}
|
|
111
111
|
value={country.code}
|
|
112
112
|
label={country.name}
|
|
113
|
-
checked={countries
|
|
113
|
+
checked={countries?.includes(country.code) || false}
|
|
114
114
|
onChange={handleSelect}
|
|
115
115
|
/>
|
|
116
116
|
))}
|