@eeacms/volto-cca-policy 0.3.31 → 0.3.33
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 +31 -0
- package/package.json +2 -2
- package/src/components/index.js +1 -0
- package/src/components/manage/Blocks/index.js +0 -2
- package/src/components/{manage/Blocks/MissionSignatoriesProfile/MissionSignatoriesProfileView.js → theme/MissionSignatoryProfile/MissionSignatoryProfileView.jsx} +25 -21
- package/src/components/{manage/Blocks/MissionSignatoriesProfile/MissionSignatoriesProfileView.test.jsx → theme/MissionSignatoryProfile/MissionSignatoryProfileView.test.jsx} +11 -17
- package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/ActionPagesTab.jsx +1 -1
- package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/AssessmentTab.jsx +1 -1
- package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/GovernanceTab.jsx +2 -2
- package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/PlanningTab.jsx +1 -1
- package/src/index.js +2 -0
- package/src/utils.js +7 -1
- package/src/components/manage/Blocks/MissionSignatoriesProfile/MissionSignatoriesProfileEdit.js +0 -28
- package/src/components/manage/Blocks/MissionSignatoriesProfile/index.js +0 -25
- package/src/components/manage/Blocks/MissionSignatoriesProfile/schema.js +0 -18
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/AccordionList.jsx +0 -0
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/AccordionList.test.jsx +0 -0
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/StatisticsSection.jsx +0 -0
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/ActionPagesTab.test.jsx +0 -0
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/AssessmentTab.test.jsx +0 -0
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/GovernanceTab.test.jsx +0 -0
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/IntroductionTab.jsx +0 -0
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/TabSections/PlanningTab.test.jsx +0 -0
- /package/src/components/{manage/Blocks/MissionSignatoriesProfile → theme/MissionSignatoryProfile}/style.less +0 -0
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.3.33](https://github.com/eea/volto-cca-policy/compare/0.3.32...0.3.33) - 5 May 2025
|
|
8
|
+
|
|
9
|
+
#### :rocket: Dependency updates
|
|
10
|
+
|
|
11
|
+
- Release @eeacms/volto-searchlib@2.0.16 [EEA Jenkins - [`dba0f63`](https://github.com/eea/volto-cca-policy/commit/dba0f63b7800d064f16b7f7a4278b3a820c71591)]
|
|
12
|
+
|
|
13
|
+
#### :nail_care: Enhancements
|
|
14
|
+
|
|
15
|
+
- change: update tests - refs #287273 [kreafox - [`c79837c`](https://github.com/eea/volto-cca-policy/commit/c79837c907c5d4daecede23dcfe5ab93f7232a01)]
|
|
16
|
+
- change: remove Introduction tab - refs #287273 [kreafox - [`4791f04`](https://github.com/eea/volto-cca-policy/commit/4791f0410b5abaf3bb25b325a268b4868f801215)]
|
|
17
|
+
|
|
18
|
+
### [0.3.32](https://github.com/eea/volto-cca-policy/compare/0.3.31...0.3.32) - 30 April 2025
|
|
19
|
+
|
|
20
|
+
#### :bug: Bug Fixes
|
|
21
|
+
|
|
22
|
+
- fix: remove fallback [kreafox - [`738324e`](https://github.com/eea/volto-cca-policy/commit/738324edeb747b4d3f030b7e92a45614923a659b)]
|
|
23
|
+
- fix: update tests [kreafox - [`ed276ea`](https://github.com/eea/volto-cca-policy/commit/ed276eaceab752cd54a1d96db4cee9b1605f34ed)]
|
|
24
|
+
|
|
25
|
+
#### :nail_care: Enhancements
|
|
26
|
+
|
|
27
|
+
- change: enhance formatTextToHTML to auto-link URLs as clickable anchor tags - refs #285296 [kreafox - [`c660faf`](https://github.com/eea/volto-cca-policy/commit/c660faf359963084537c28c4c558473227c35b59)]
|
|
28
|
+
- change: refactor mission signatory profile; add view, remove block - refs #285361 [kreafox - [`3424316`](https://github.com/eea/volto-cca-policy/commit/34243168e2cae1b617f6ea05d479157109be5dcf)]
|
|
29
|
+
|
|
7
30
|
### [0.3.31](https://github.com/eea/volto-cca-policy/compare/0.3.30...0.3.31) - 29 April 2025
|
|
8
31
|
|
|
9
32
|
#### :bug: Bug Fixes
|
|
@@ -2228,10 +2251,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
2228
2251
|
- Refs #260715 rast-block wip [Tripon Eugen - [`f19d54e`](https://github.com/eea/volto-cca-policy/commit/f19d54e0b9a6a86bf344eb85b6a1cda7f3de91bf)]
|
|
2229
2252
|
- Refs #260715 rast-block wip [Tripon Eugen - [`2828537`](https://github.com/eea/volto-cca-policy/commit/2828537b6c084cd1a82162d552fb4ef025b71f9f)]
|
|
2230
2253
|
- Refs #260715 rast-block updates [Tripon Eugen - [`1e803e5`](https://github.com/eea/volto-cca-policy/commit/1e803e5bd3d3fb7558f261c76c68866be7beb8b5)]
|
|
2254
|
+
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0a15e1b`](https://github.com/eea/volto-cca-policy/commit/0a15e1b2ad081233685e80d5b3c60a8663f6b896)]
|
|
2255
|
+
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`9554e44`](https://github.com/eea/volto-cca-policy/commit/9554e44c92a621a52b2adb5a4830fb084ee5734b)]
|
|
2231
2256
|
### [0.1.49](https://github.com/eea/volto-cca-policy/compare/0.1.48...0.1.49) - 15 November 2023
|
|
2232
2257
|
|
|
2233
2258
|
#### :house: Internal changes
|
|
2234
2259
|
|
|
2260
|
+
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`7b820a6`](https://github.com/eea/volto-cca-policy/commit/7b820a6369c2ddd5203b1a4abe352cb4bb43db7a)]
|
|
2235
2261
|
- chore: husky, lint-staged use fixed versions [valentinab25 - [`f0a8061`](https://github.com/eea/volto-cca-policy/commit/f0a8061c275c236deb00087c23fac9860a073106)]
|
|
2236
2262
|
|
|
2237
2263
|
#### :hammer_and_wrench: Others
|
|
@@ -2248,6 +2274,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
2248
2274
|
- Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
|
|
2249
2275
|
- Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
|
|
2250
2276
|
- Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
|
|
2277
|
+
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
|
|
2278
|
+
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
|
|
2279
|
+
- test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
|
|
2251
2280
|
- Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
|
|
2252
2281
|
- Refs #256681 - Fix error in CCA Event view menu. ([React Intl] An id must be provided to format a message.) [GhitaB - [`517eeb8`](https://github.com/eea/volto-cca-policy/commit/517eeb817264a47bbfd6b9b7d22aaf22d44ed224)]
|
|
2253
2282
|
- Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
|
|
@@ -2464,6 +2493,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
2464
2493
|
|
|
2465
2494
|
#### :house: Internal changes
|
|
2466
2495
|
|
|
2496
|
+
- chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
|
|
2467
2497
|
|
|
2468
2498
|
#### :hammer_and_wrench: Others
|
|
2469
2499
|
|
|
@@ -2944,6 +2974,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
2944
2974
|
#### :hammer_and_wrench: Others
|
|
2945
2975
|
|
|
2946
2976
|
- Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
|
|
2977
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
|
|
2947
2978
|
### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
|
|
2948
2979
|
|
|
2949
2980
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-cca-policy",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.33",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@eeacms/volto-globalsearch": "2.0.11",
|
|
36
36
|
"@eeacms/volto-hero-block": "^7.1.0",
|
|
37
37
|
"@eeacms/volto-openlayers-map": "*",
|
|
38
|
-
"@eeacms/volto-searchlib": "2.0.
|
|
38
|
+
"@eeacms/volto-searchlib": "2.0.16",
|
|
39
39
|
"@eeacms/volto-slate-label": "^0.6.0",
|
|
40
40
|
"@eeacms/volto-tabs-block": "^7.5.1",
|
|
41
41
|
"@elastic/search-ui": "1.21.2",
|
package/src/components/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { default as TranslationDisclaimer } from './theme/TranslationDisclaimer/
|
|
|
5
5
|
export { default as ShareInfoButton } from './theme/ShareInfoButton/ShareInfoButton';
|
|
6
6
|
export { default as ASTNavigation } from './theme/ASTNavigation/ASTNavigation';
|
|
7
7
|
export { default as RedirectToLogin } from './theme/RedirectToLogin/RedirectToLogin';
|
|
8
|
+
export { default as MissionSignatoryProfileView } from './theme/MissionSignatoryProfile/MissionSignatoryProfileView';
|
|
8
9
|
|
|
9
10
|
// Widgets
|
|
10
11
|
export { default as RASTWidgetView } from './theme/Widgets/RASTWidgetView';
|
|
@@ -22,7 +22,6 @@ import installTabsBlock from './TabsBlock';
|
|
|
22
22
|
import installRedirectBlock from './RedirectBlock';
|
|
23
23
|
import installContentLinks from './ContentLinks';
|
|
24
24
|
import installASTNavigation from './ASTNavigation';
|
|
25
|
-
import installMissionSignatoriesProfileBlock from './MissionSignatoriesProfile';
|
|
26
25
|
|
|
27
26
|
export default function installBlocks(config) {
|
|
28
27
|
config.blocks.blocksConfig.title.restricted = false;
|
|
@@ -54,6 +53,5 @@ export default function installBlocks(config) {
|
|
|
54
53
|
installRedirectBlock,
|
|
55
54
|
installContentLinks,
|
|
56
55
|
installASTNavigation,
|
|
57
|
-
installMissionSignatoriesProfileBlock,
|
|
58
56
|
)(config);
|
|
59
57
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Tab } from 'semantic-ui-react';
|
|
3
|
-
|
|
4
|
-
import IntroductionTab from './TabSections/IntroductionTab';
|
|
2
|
+
import { Tab, Container } from 'semantic-ui-react';
|
|
3
|
+
import { BannerTitle } from '@eeacms/volto-cca-policy/helpers';
|
|
5
4
|
import GovernanceTab from './TabSections/GovernanceTab';
|
|
6
5
|
import AssessmentTab from './TabSections/AssessmentTab';
|
|
7
6
|
import PlanningTab from './TabSections/PlanningTab';
|
|
@@ -9,26 +8,35 @@ import ActionPagesTab from './TabSections/ActionPagesTab';
|
|
|
9
8
|
|
|
10
9
|
import './style.less';
|
|
11
10
|
|
|
12
|
-
const
|
|
13
|
-
const {
|
|
14
|
-
const
|
|
11
|
+
const MissionSignatoryProfileView = (props) => {
|
|
12
|
+
const { content } = props || {};
|
|
13
|
+
const dataJson =
|
|
14
|
+
props?.content?.['@components']?.missionsignatoryprofile || {};
|
|
15
|
+
|
|
16
|
+
const result = dataJson?.result || {};
|
|
15
17
|
const governance = result?.governance?.[0] || [];
|
|
16
18
|
const planning = result?.planning || {};
|
|
17
19
|
const assessment = result?.assessment || {};
|
|
18
20
|
const action = result?.action || {};
|
|
19
21
|
|
|
20
|
-
// const dataJson = JSON.parse(result?.Cooperation_Experience);
|
|
21
22
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
22
23
|
|
|
23
24
|
return (
|
|
24
|
-
|
|
25
|
+
<Container>
|
|
26
|
+
<BannerTitle
|
|
27
|
+
content={content}
|
|
28
|
+
data={{
|
|
29
|
+
info: [{ description: '' }],
|
|
30
|
+
hideContentType: true,
|
|
31
|
+
hideCreationDate: true,
|
|
32
|
+
hideModificationDate: true,
|
|
33
|
+
hidePublishingDate: true,
|
|
34
|
+
hideDownloadButton: false,
|
|
35
|
+
hideShareButton: false,
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
25
38
|
<div className="signatories-profile">
|
|
26
|
-
{/* {
|
|
27
|
-
dataJson['Cooperation_Experience'][0][
|
|
28
|
-
'DescribeDetailCooperationEnhance'
|
|
29
|
-
]
|
|
30
|
-
} */}
|
|
31
|
-
<h2>{planning?.planning_titles?.[0].Signatory}</h2>
|
|
39
|
+
{/* <h2>{planning?.planning_titles?.[0].Signatory}</h2> */}
|
|
32
40
|
{/* <h2>{planning?.planning_titles?.[0].Id}</h2> */}
|
|
33
41
|
|
|
34
42
|
<br />
|
|
@@ -44,10 +52,6 @@ const MissionSignatoriesProfileView = (props) => {
|
|
|
44
52
|
activeIndex={activeIndex}
|
|
45
53
|
onTabChange={(e, { activeIndex }) => setActiveIndex(activeIndex)}
|
|
46
54
|
panes={[
|
|
47
|
-
{
|
|
48
|
-
menuItem: 'Introduction',
|
|
49
|
-
render: () => <IntroductionTab activeIndex={activeIndex} />,
|
|
50
|
-
},
|
|
51
55
|
{
|
|
52
56
|
menuItem: 'Governance',
|
|
53
57
|
render: () => <GovernanceTab result={governance} />,
|
|
@@ -61,14 +65,14 @@ const MissionSignatoriesProfileView = (props) => {
|
|
|
61
65
|
render: () => <PlanningTab result={planning} />,
|
|
62
66
|
},
|
|
63
67
|
{
|
|
64
|
-
menuItem: 'Action
|
|
68
|
+
menuItem: 'Action',
|
|
65
69
|
render: () => <ActionPagesTab result={action} />,
|
|
66
70
|
},
|
|
67
71
|
]}
|
|
68
72
|
/>
|
|
69
73
|
</div>
|
|
70
|
-
|
|
74
|
+
</Container>
|
|
71
75
|
);
|
|
72
76
|
};
|
|
73
77
|
|
|
74
|
-
export default
|
|
78
|
+
export default MissionSignatoryProfileView;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, fireEvent, screen } from '@testing-library/react';
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
|
-
import
|
|
4
|
+
import MissionSignatoryProfileView from './MissionSignatoryProfileView';
|
|
5
5
|
|
|
6
6
|
// Mock the tab components with minimal placeholders
|
|
7
|
-
jest.mock('./TabSections/IntroductionTab', () => () => (
|
|
8
|
-
<div>Mocked Introduction</div>
|
|
9
|
-
));
|
|
10
7
|
jest.mock('./TabSections/GovernanceTab', () => () => (
|
|
11
8
|
<div>Mocked Governance</div>
|
|
12
9
|
));
|
|
@@ -14,11 +11,12 @@ jest.mock('./TabSections/AssessmentTab', () => () => (
|
|
|
14
11
|
<div>Mocked Assessment</div>
|
|
15
12
|
));
|
|
16
13
|
jest.mock('./TabSections/PlanningTab', () => () => <div>Mocked Planning</div>);
|
|
17
|
-
jest.mock('./TabSections/ActionPagesTab', () => () =>
|
|
18
|
-
|
|
19
|
-
)
|
|
14
|
+
jest.mock('./TabSections/ActionPagesTab', () => () => <div>Mocked Action</div>);
|
|
15
|
+
jest.mock('@eeacms/volto-cca-policy/helpers', () => ({
|
|
16
|
+
BannerTitle: ({ children }) => <div>{children}</div>,
|
|
17
|
+
}));
|
|
20
18
|
|
|
21
|
-
describe('
|
|
19
|
+
describe('MissionSignatoryProfileView', () => {
|
|
22
20
|
const data = {
|
|
23
21
|
_v_results: {
|
|
24
22
|
planning: {
|
|
@@ -29,21 +27,17 @@ describe('MissionSignatoriesProfileView', () => {
|
|
|
29
27
|
};
|
|
30
28
|
|
|
31
29
|
it('renders tab labels and default content', () => {
|
|
32
|
-
render(<
|
|
30
|
+
render(<MissionSignatoryProfileView data={data} />);
|
|
33
31
|
|
|
34
32
|
// Tab labels
|
|
35
|
-
expect(screen.getByText('Introduction')).toBeInTheDocument();
|
|
36
33
|
expect(screen.getByText('Governance')).toBeInTheDocument();
|
|
37
34
|
expect(screen.getByText('Assessment')).toBeInTheDocument();
|
|
38
35
|
expect(screen.getByText('Planning')).toBeInTheDocument();
|
|
39
|
-
expect(screen.getByText('Action
|
|
40
|
-
|
|
41
|
-
// Default selected tab content (Introduction)
|
|
42
|
-
expect(screen.getByText('Mocked Introduction')).toBeInTheDocument();
|
|
36
|
+
expect(screen.getByText('Action')).toBeInTheDocument();
|
|
43
37
|
});
|
|
44
38
|
|
|
45
39
|
it('switches tabs and renders corresponding content', () => {
|
|
46
|
-
render(<
|
|
40
|
+
render(<MissionSignatoryProfileView data={data} />);
|
|
47
41
|
|
|
48
42
|
fireEvent.click(screen.getByText('Governance'));
|
|
49
43
|
expect(screen.getByText('Mocked Governance')).toBeInTheDocument();
|
|
@@ -54,7 +48,7 @@ describe('MissionSignatoriesProfileView', () => {
|
|
|
54
48
|
fireEvent.click(screen.getByText('Planning'));
|
|
55
49
|
expect(screen.getByText('Mocked Planning')).toBeInTheDocument();
|
|
56
50
|
|
|
57
|
-
fireEvent.click(screen.getByText('Action
|
|
58
|
-
expect(screen.getByText('Mocked Action
|
|
51
|
+
fireEvent.click(screen.getByText('Action'));
|
|
52
|
+
expect(screen.getByText('Mocked Action')).toBeInTheDocument();
|
|
59
53
|
});
|
|
60
54
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Tab, Grid } from 'semantic-ui-react';
|
|
3
3
|
import { Callout } from '@eeacms/volto-eea-design-system/ui';
|
|
4
|
-
import AccordionList from '
|
|
4
|
+
import AccordionList from '../AccordionList';
|
|
5
5
|
|
|
6
6
|
const ActionsTabContent = ({ action }) => {
|
|
7
7
|
const hasHazards = action?.Climate_Hazards?.length > 0;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ItemContent,
|
|
9
9
|
} from 'semantic-ui-react';
|
|
10
10
|
import { Callout } from '@eeacms/volto-eea-design-system/ui';
|
|
11
|
-
import AccordionList from '
|
|
11
|
+
import AccordionList from '../AccordionList';
|
|
12
12
|
|
|
13
13
|
import image from '@eeacms/volto-cca-policy/../theme//assets/images/image-narrow.svg';
|
|
14
14
|
|
|
@@ -3,7 +3,7 @@ import { Tab } from 'semantic-ui-react';
|
|
|
3
3
|
import { Callout } from '@eeacms/volto-eea-design-system/ui';
|
|
4
4
|
import { HTMLField } from '@eeacms/volto-cca-policy/helpers';
|
|
5
5
|
import { formatTextToHTML } from '@eeacms/volto-cca-policy/utils';
|
|
6
|
-
import AccordionList from '
|
|
6
|
+
import AccordionList from '../AccordionList';
|
|
7
7
|
|
|
8
8
|
const GovernanceTab = ({ result }) => {
|
|
9
9
|
const {
|
|
@@ -27,7 +27,7 @@ const GovernanceTab = ({ result }) => {
|
|
|
27
27
|
|
|
28
28
|
<br />
|
|
29
29
|
|
|
30
|
-
{
|
|
30
|
+
{Provide && (
|
|
31
31
|
<AccordionList
|
|
32
32
|
accordions={[
|
|
33
33
|
{
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
formatTextToHTML,
|
|
16
16
|
extractPlanNameAndURL,
|
|
17
17
|
} from '@eeacms/volto-cca-policy/utils';
|
|
18
|
-
import AccordionList from '
|
|
18
|
+
import AccordionList from '../AccordionList';
|
|
19
19
|
import image from '@eeacms/volto-cca-policy/../theme/assets/images/image-narrow.svg';
|
|
20
20
|
|
|
21
21
|
const ItemsSection = ({ items }) => {
|
package/src/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
RASTWidgetView,
|
|
9
9
|
TranslationDisclaimer,
|
|
10
10
|
RedirectToLogin,
|
|
11
|
+
MissionSignatoryProfileView,
|
|
11
12
|
} from '@eeacms/volto-cca-policy/components';
|
|
12
13
|
import { blockAvailableInMission } from '@eeacms/volto-cca-policy/utils';
|
|
13
14
|
|
|
@@ -375,6 +376,7 @@ const applyConfig = (config) => {
|
|
|
375
376
|
'eea.climateadapt.c3sindicator': C3SIndicatorView,
|
|
376
377
|
'eea.climateadapt.adaptationoption': AdaptationOptionView,
|
|
377
378
|
'News Item': NewsItemView,
|
|
379
|
+
mission_signatory_profile: MissionSignatoryProfileView,
|
|
378
380
|
};
|
|
379
381
|
|
|
380
382
|
config.views.layoutViewsNamesMapping.view_cca_event = 'CCA Event View';
|
package/src/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
2
2
|
|
|
3
3
|
export const blockAvailableInMission = (properties, block) => {
|
|
4
|
-
const missionBlocks = ['mkh_map', 'rastBlock'
|
|
4
|
+
const missionBlocks = ['mkh_map', 'rastBlock'];
|
|
5
5
|
const id = properties?.['@id'];
|
|
6
6
|
|
|
7
7
|
if (!id) {
|
|
@@ -90,6 +90,12 @@ export const formatTextToHTML = (text) => {
|
|
|
90
90
|
.replace(/\\no\s*/g, '<br />• ') // list-like "o " to bullet point
|
|
91
91
|
.replace(/\\n/g, '<br />'); // single line break
|
|
92
92
|
|
|
93
|
+
// Convert URLs to clickable links
|
|
94
|
+
formattedText = formattedText.replace(
|
|
95
|
+
/((https?:\/\/[^\s<>"]+))/g,
|
|
96
|
+
'<a href="$1" target="_blank" rel="noreferrer">$1</a>',
|
|
97
|
+
);
|
|
98
|
+
|
|
93
99
|
return `<p>${formattedText}</p>`;
|
|
94
100
|
};
|
|
95
101
|
|
package/src/components/manage/Blocks/MissionSignatoriesProfile/MissionSignatoriesProfileEdit.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { SidebarPortal } from '@plone/volto/components';
|
|
2
|
-
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
3
|
-
import MissionSignatoriesProfile from './MissionSignatoriesProfileView';
|
|
4
|
-
import schema from './schema';
|
|
5
|
-
|
|
6
|
-
export default function Edit(props) {
|
|
7
|
-
const { block, data, onChangeBlock, selected } = props;
|
|
8
|
-
return (
|
|
9
|
-
<>
|
|
10
|
-
<MissionSignatoriesProfile {...props} mode="edit" />
|
|
11
|
-
<SidebarPortal selected={selected}>
|
|
12
|
-
<BlockDataForm
|
|
13
|
-
block={block}
|
|
14
|
-
title={schema.title}
|
|
15
|
-
schema={schema}
|
|
16
|
-
onChangeField={(id, value) => {
|
|
17
|
-
onChangeBlock(block, {
|
|
18
|
-
...data,
|
|
19
|
-
[id]: value,
|
|
20
|
-
});
|
|
21
|
-
}}
|
|
22
|
-
onChangeBlock={onChangeBlock}
|
|
23
|
-
formData={data}
|
|
24
|
-
/>
|
|
25
|
-
</SidebarPortal>
|
|
26
|
-
</>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import MissionSignatoriesProfileEdit from './MissionSignatoriesProfileEdit';
|
|
2
|
-
import MissionSignatoriesProfileView from './MissionSignatoriesProfileView';
|
|
3
|
-
import { blockAvailableInMission } from '@eeacms/volto-cca-policy/utils';
|
|
4
|
-
import worldSVG from '@plone/volto/icons/world.svg';
|
|
5
|
-
|
|
6
|
-
export default function installMissionSignatoriesProfileBlock(config) {
|
|
7
|
-
config.blocks.blocksConfig.missionSignatoriesProfile = {
|
|
8
|
-
id: 'missionSignatoriesProfile',
|
|
9
|
-
title: 'Mission Signatories Profile',
|
|
10
|
-
icon: worldSVG,
|
|
11
|
-
group: 'site',
|
|
12
|
-
edit: MissionSignatoriesProfileEdit,
|
|
13
|
-
view: MissionSignatoriesProfileView,
|
|
14
|
-
sidebarTab: 1,
|
|
15
|
-
security: {
|
|
16
|
-
addPermission: [],
|
|
17
|
-
view: [],
|
|
18
|
-
},
|
|
19
|
-
restricted: ({ properties, block }) => {
|
|
20
|
-
return blockAvailableInMission(properties, block);
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return config;
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
title: 'Mission Signatories Profile',
|
|
3
|
-
fieldsets: [
|
|
4
|
-
{
|
|
5
|
-
id: 'default',
|
|
6
|
-
title: 'Default',
|
|
7
|
-
fields: ['profile_id'],
|
|
8
|
-
},
|
|
9
|
-
],
|
|
10
|
-
properties: {
|
|
11
|
-
profile_id: {
|
|
12
|
-
title: 'Profile ID',
|
|
13
|
-
type: 'number',
|
|
14
|
-
default: '54403',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
required: [],
|
|
18
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|