@eeacms/volto-cca-policy 0.3.27 → 0.3.28
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 +27 -0
- package/package.json +1 -1
- package/src/components/manage/Blocks/MissionSignatoriesProfile/MissionSignatoriesProfileView.js +7 -13
- package/src/components/manage/Blocks/MissionSignatoriesProfile/MissionSignatoriesProfileView.test.jsx +31 -78
- package/src/components/manage/Blocks/MissionSignatoriesProfile/TabSections/AssessmentTab.jsx +90 -65
- package/src/components/manage/Blocks/MissionSignatoriesProfile/TabSections/AssessmentTab.test.jsx +63 -0
- package/src/components/manage/Blocks/MissionSignatoriesProfile/TabSections/GovernanceTab.jsx +29 -16
- package/src/components/manage/Blocks/MissionSignatoriesProfile/TabSections/GovernanceTab.test.jsx +10 -6
- package/src/components/manage/Blocks/MissionSignatoriesProfile/style.less +23 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,33 @@ 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.28](https://github.com/eea/volto-cca-policy/compare/0.3.27...0.3.28) - 22 April 2025
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: update assessment section view - refs #286757 [kreafox - [`1997bff`](https://github.com/eea/volto-cca-policy/commit/1997bff63788aff4c5e834bd73bef1443f4f869a)]
|
|
12
|
+
|
|
13
|
+
#### :bug: Bug Fixes
|
|
14
|
+
|
|
15
|
+
- fix: mission profile template fixes - refs #286757 [kreafox - [`583594e`](https://github.com/eea/volto-cca-policy/commit/583594e4d25bb7269037a5b7628a8f37dcd126ae)]
|
|
16
|
+
- fix: governance section - refs #285296 [kreafox - [`f34df51`](https://github.com/eea/volto-cca-policy/commit/f34df512bb82b50895b3f8ed6f83926da7c152b1)]
|
|
17
|
+
|
|
18
|
+
#### :nail_care: Enhancements
|
|
19
|
+
|
|
20
|
+
- change: update assessment section view - refs #286757 [kreafox - [`7e15434`](https://github.com/eea/volto-cca-policy/commit/7e15434972f54f5836063224ebf7fc4793de3606)]
|
|
21
|
+
- change: update planning section - refs #286151 [kreafox - [`38b8007`](https://github.com/eea/volto-cca-policy/commit/38b8007be3a6ecc88ccccbef3f6f14eec27a5e6b)]
|
|
22
|
+
|
|
23
|
+
#### :house: Internal changes
|
|
24
|
+
|
|
25
|
+
- style: Automated code fix [eea-jenkins - [`7b6b95f`](https://github.com/eea/volto-cca-policy/commit/7b6b95fcf910e33f70a7ab41bb6fbb3652dcb4ce)]
|
|
26
|
+
- style: Automated code fix [eea-jenkins - [`fc17148`](https://github.com/eea/volto-cca-policy/commit/fc17148d1e433b0990abe81b267343e36de3bd8f)]
|
|
27
|
+
|
|
28
|
+
#### :hammer_and_wrench: Others
|
|
29
|
+
|
|
30
|
+
- test: increase code coverage [kreafox - [`4bfdeaa`](https://github.com/eea/volto-cca-policy/commit/4bfdeaa37f8ce25591248ced83642acb54527053)]
|
|
31
|
+
- update tests [kreafox - [`83cf81c`](https://github.com/eea/volto-cca-policy/commit/83cf81cd58b6dc1b771b9f283e34d5b42ee7abbc)]
|
|
32
|
+
- test: update GovernanceTab test [kreafox - [`fd25e65`](https://github.com/eea/volto-cca-policy/commit/fd25e65c24838205ae5e4376a50c642f3686cb97)]
|
|
33
|
+
- update planning section - refs #285361 [kreafox - [`110f4de`](https://github.com/eea/volto-cca-policy/commit/110f4def3b73544c18f4a963e9a9c9592865333e)]
|
|
7
34
|
### [0.3.27](https://github.com/eea/volto-cca-policy/compare/0.3.26...0.3.27) - 16 April 2025
|
|
8
35
|
|
|
9
36
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
package/src/components/manage/Blocks/MissionSignatoriesProfile/MissionSignatoriesProfileView.js
CHANGED
|
@@ -12,7 +12,9 @@ import './style.less';
|
|
|
12
12
|
const MissionSignatoriesProfileView = (props) => {
|
|
13
13
|
const { data } = props;
|
|
14
14
|
const result = data?._v_results || {};
|
|
15
|
-
const governance = result?.governance?.[0] ||
|
|
15
|
+
const governance = result?.governance?.[0] || [];
|
|
16
|
+
const planning = result?.planning || {};
|
|
17
|
+
const assessment = result?.assessment || {};
|
|
16
18
|
|
|
17
19
|
// const dataJson = JSON.parse(result?.Cooperation_Experience);
|
|
18
20
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
@@ -25,7 +27,8 @@ const MissionSignatoriesProfileView = (props) => {
|
|
|
25
27
|
'DescribeDetailCooperationEnhance'
|
|
26
28
|
]
|
|
27
29
|
} */}
|
|
28
|
-
<h2>{
|
|
30
|
+
<h2>{planning?.planning_titles?.[0].Signatory}</h2>
|
|
31
|
+
{/* <h2>{planning?.planning_titles?.[0].Id}</h2> */}
|
|
29
32
|
|
|
30
33
|
<br />
|
|
31
34
|
|
|
@@ -50,20 +53,11 @@ const MissionSignatoriesProfileView = (props) => {
|
|
|
50
53
|
},
|
|
51
54
|
{
|
|
52
55
|
menuItem: 'Assessment',
|
|
53
|
-
render: () => <AssessmentTab />,
|
|
56
|
+
render: () => <AssessmentTab result={assessment} />,
|
|
54
57
|
},
|
|
55
58
|
{
|
|
56
59
|
menuItem: 'Planning',
|
|
57
|
-
render: () =>
|
|
58
|
-
<PlanningTab
|
|
59
|
-
result={{
|
|
60
|
-
planning_goals: result?.planning_goals,
|
|
61
|
-
planning_titles: result?.planning_titles,
|
|
62
|
-
planning_climate_action: result?.planning_climate_action,
|
|
63
|
-
planning_climate_sectors: result?.planning_climate_sectors,
|
|
64
|
-
}}
|
|
65
|
-
/>
|
|
66
|
-
),
|
|
60
|
+
render: () => <PlanningTab result={planning} />,
|
|
67
61
|
},
|
|
68
62
|
{
|
|
69
63
|
menuItem: 'Action Pages',
|
|
@@ -1,107 +1,60 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import '@testing-library/
|
|
3
|
-
import
|
|
2
|
+
import { render, fireEvent, screen } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
4
|
import MissionSignatoriesProfileView from './MissionSignatoriesProfileView';
|
|
5
5
|
|
|
6
|
-
// Mock components
|
|
6
|
+
// Mock the tab components with minimal placeholders
|
|
7
7
|
jest.mock('./TabSections/IntroductionTab', () => () => (
|
|
8
|
-
<div>Introduction
|
|
8
|
+
<div>Mocked Introduction</div>
|
|
9
9
|
));
|
|
10
10
|
jest.mock('./TabSections/GovernanceTab', () => () => (
|
|
11
|
-
<div>Governance
|
|
11
|
+
<div>Mocked Governance</div>
|
|
12
12
|
));
|
|
13
13
|
jest.mock('./TabSections/AssessmentTab', () => () => (
|
|
14
|
-
<div>Assessment
|
|
14
|
+
<div>Mocked Assessment</div>
|
|
15
15
|
));
|
|
16
|
-
jest.mock('./TabSections/PlanningTab', () => () => <div>Planning
|
|
16
|
+
jest.mock('./TabSections/PlanningTab', () => () => <div>Mocked Planning</div>);
|
|
17
17
|
jest.mock('./TabSections/ActionPagesTab', () => () => (
|
|
18
|
-
<div>Action Pages
|
|
18
|
+
<div>Mocked Action Pages</div>
|
|
19
19
|
));
|
|
20
20
|
|
|
21
21
|
describe('MissionSignatoriesProfileView', () => {
|
|
22
22
|
const data = {
|
|
23
23
|
_v_results: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
planning_climate_sectors: [],
|
|
24
|
+
planning: {
|
|
25
|
+
planning_titles: [{}],
|
|
26
|
+
},
|
|
28
27
|
governance: [{}],
|
|
29
28
|
},
|
|
30
29
|
};
|
|
31
30
|
|
|
32
|
-
it('
|
|
33
|
-
|
|
31
|
+
it('renders tab labels and default content', () => {
|
|
32
|
+
render(<MissionSignatoriesProfileView data={data} />);
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
expect(getByText('
|
|
37
|
-
expect(getByText('
|
|
38
|
-
expect(getByText('
|
|
39
|
-
expect(getByText('
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
it('should render Signatory title', () => {
|
|
43
|
-
const { getByText } = render(<MissionSignatoriesProfileView data={data} />);
|
|
44
|
-
expect(getByText('Test Signatory Title')).toBeInTheDocument();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should handle missing planning_titles gracefully', () => {
|
|
48
|
-
const data = { _v_results: { governance: [{}] } };
|
|
49
|
-
const { container } = render(<MissionSignatoriesProfileView data={data} />);
|
|
50
|
-
expect(container).toBeInTheDocument();
|
|
51
|
-
});
|
|
34
|
+
// Tab labels
|
|
35
|
+
expect(screen.getByText('Introduction')).toBeInTheDocument();
|
|
36
|
+
expect(screen.getByText('Governance')).toBeInTheDocument();
|
|
37
|
+
expect(screen.getByText('Assessment')).toBeInTheDocument();
|
|
38
|
+
expect(screen.getByText('Planning')).toBeInTheDocument();
|
|
39
|
+
expect(screen.getByText('Action Pages')).toBeInTheDocument();
|
|
52
40
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<MissionSignatoriesProfileView data={{ _v_results: {} }} />,
|
|
56
|
-
);
|
|
57
|
-
expect(getByText('Introduction')).toBeInTheDocument();
|
|
41
|
+
// Default selected tab content (Introduction)
|
|
42
|
+
expect(screen.getByText('Mocked Introduction')).toBeInTheDocument();
|
|
58
43
|
});
|
|
59
44
|
|
|
60
|
-
it('
|
|
61
|
-
|
|
62
|
-
expect(getByText('Planning')).toBeInTheDocument();
|
|
63
|
-
expect(getByText('Introduction')).toBeInTheDocument();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('should render all tab labels', () => {
|
|
67
|
-
const { getByText } = render(<MissionSignatoriesProfileView data={{}} />);
|
|
68
|
-
[
|
|
69
|
-
'Introduction',
|
|
70
|
-
'Governance',
|
|
71
|
-
'Assessment',
|
|
72
|
-
'Planning',
|
|
73
|
-
'Action Pages',
|
|
74
|
-
].forEach((label) => {
|
|
75
|
-
expect(getByText(label)).toBeInTheDocument();
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should switch between tabs and display correct content', async () => {
|
|
80
|
-
const { getByText } = render(<MissionSignatoriesProfileView data={data} />);
|
|
81
|
-
|
|
82
|
-
fireEvent.click(getByText('Governance'));
|
|
83
|
-
await waitFor(() =>
|
|
84
|
-
expect(getByText('Governance Content')).toBeInTheDocument(),
|
|
85
|
-
);
|
|
45
|
+
it('switches tabs and renders corresponding content', () => {
|
|
46
|
+
render(<MissionSignatoriesProfileView data={data} />);
|
|
86
47
|
|
|
87
|
-
fireEvent.click(getByText('
|
|
88
|
-
|
|
89
|
-
expect(getByText('Introduction Content')).toBeInTheDocument(),
|
|
90
|
-
);
|
|
48
|
+
fireEvent.click(screen.getByText('Governance'));
|
|
49
|
+
expect(screen.getByText('Mocked Governance')).toBeInTheDocument();
|
|
91
50
|
|
|
92
|
-
fireEvent.click(getByText('Assessment'));
|
|
93
|
-
|
|
94
|
-
expect(getByText('Assessment Content')).toBeInTheDocument(),
|
|
95
|
-
);
|
|
51
|
+
fireEvent.click(screen.getByText('Assessment'));
|
|
52
|
+
expect(screen.getByText('Mocked Assessment')).toBeInTheDocument();
|
|
96
53
|
|
|
97
|
-
fireEvent.click(getByText('Planning'));
|
|
98
|
-
|
|
99
|
-
expect(getByText('Planning Content')).toBeInTheDocument(),
|
|
100
|
-
);
|
|
54
|
+
fireEvent.click(screen.getByText('Planning'));
|
|
55
|
+
expect(screen.getByText('Mocked Planning')).toBeInTheDocument();
|
|
101
56
|
|
|
102
|
-
fireEvent.click(getByText('Action Pages'));
|
|
103
|
-
|
|
104
|
-
expect(getByText('Action Pages Content')).toBeInTheDocument(),
|
|
105
|
-
);
|
|
57
|
+
fireEvent.click(screen.getByText('Action Pages'));
|
|
58
|
+
expect(screen.getByText('Mocked Action Pages')).toBeInTheDocument();
|
|
106
59
|
});
|
|
107
60
|
});
|
package/src/components/manage/Blocks/MissionSignatoriesProfile/TabSections/AssessmentTab.jsx
CHANGED
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
Tab,
|
|
4
4
|
Image,
|
|
5
|
-
Button,
|
|
6
5
|
Segment,
|
|
7
6
|
Item,
|
|
8
7
|
ItemGroup,
|
|
@@ -14,83 +13,109 @@ import AccordionList from './../AccordionList';
|
|
|
14
13
|
import image from '@eeacms/volto-cca-policy/../theme//assets/images/image-narrow.svg';
|
|
15
14
|
|
|
16
15
|
const ItemsSection = ({ items }) => {
|
|
16
|
+
if (!items?.length) return null;
|
|
17
|
+
|
|
17
18
|
return (
|
|
18
19
|
<ItemGroup className="items-group">
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<Item>
|
|
27
|
-
<Image size="small" src={image} />
|
|
28
|
-
<ItemContent verticalAlign="middle">
|
|
29
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
30
|
-
</ItemContent>
|
|
31
|
-
</Item>
|
|
20
|
+
{items.map((item, index) => (
|
|
21
|
+
<Item key={index}>
|
|
22
|
+
<Image size="small" src={image} />
|
|
23
|
+
<ItemContent verticalAlign="middle">{item.Factor}</ItemContent>
|
|
24
|
+
</Item>
|
|
25
|
+
))}
|
|
32
26
|
</ItemGroup>
|
|
33
27
|
);
|
|
34
28
|
};
|
|
35
29
|
|
|
36
|
-
const
|
|
30
|
+
const AssessmentAccordionContent = ({ result }) => {
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<p>
|
|
34
|
+
<a href={result.Hyperlink} target="_blank" rel="noreferrer">
|
|
35
|
+
<strong>{result.Explore_Link_Text}</strong>
|
|
36
|
+
</a>
|
|
37
|
+
</p>
|
|
38
|
+
<p>
|
|
39
|
+
<span>
|
|
40
|
+
{result.Year_Of_Publication_Label}
|
|
41
|
+
{': '}
|
|
42
|
+
</span>
|
|
43
|
+
<strong>{result.Year_Of_Publication}</strong>
|
|
44
|
+
</p>
|
|
45
|
+
|
|
46
|
+
<h5>{result.Further_Details_Label}</h5>
|
|
47
|
+
<Segment className="border">
|
|
48
|
+
<p>{result.Please_Explain}</p>
|
|
49
|
+
</Segment>
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const AssessmentTab = ({ result }) => {
|
|
55
|
+
const {
|
|
56
|
+
Title,
|
|
57
|
+
Subheading,
|
|
58
|
+
Abstract,
|
|
59
|
+
Cra_Title,
|
|
60
|
+
Cra_Abstract,
|
|
61
|
+
Attachments,
|
|
62
|
+
Hazards_Title,
|
|
63
|
+
Hazards_Abstract,
|
|
64
|
+
} = result.assessment_text[0] || [];
|
|
65
|
+
|
|
37
66
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
67
|
+
|
|
38
68
|
return (
|
|
39
69
|
<Tab.Pane>
|
|
40
|
-
<h2>
|
|
41
|
-
|
|
70
|
+
{Title && <h2>{Title}</h2>}
|
|
71
|
+
{Subheading && (
|
|
72
|
+
<Callout>
|
|
73
|
+
<p>{Subheading}</p>
|
|
74
|
+
</Callout>
|
|
75
|
+
)}
|
|
76
|
+
|
|
77
|
+
{Abstract && <p>{Abstract}</p>}
|
|
78
|
+
|
|
79
|
+
<div className="tab-section-wrapper assessment">
|
|
80
|
+
{Cra_Title && <h3>{Cra_Title}</h3>}
|
|
81
|
+
{Cra_Abstract && <h5>{Cra_Abstract}</h5>}
|
|
82
|
+
|
|
83
|
+
<ItemsSection items={result.assessment_factors} />
|
|
84
|
+
|
|
85
|
+
{Attachments && <h4>{Attachments}</h4>}
|
|
86
|
+
|
|
42
87
|
<p>
|
|
43
|
-
Lorem ipsum dolor sit amet
|
|
44
|
-
|
|
88
|
+
Lorem ipsum dolor sit amet consectetur. Quam porta convallis ultrices
|
|
89
|
+
aliquet. Imperdiet maecenas at velit gravida arcu blandit eget. Etiam
|
|
90
|
+
tellus vulputate mi vitae bibendum fermentum condimentum facilisis.
|
|
91
|
+
Amet et sed nunc pretium fames nibh lacus mi magna.
|
|
45
92
|
</p>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<h4>The CRA conducted considers the following factors</h4>
|
|
69
|
-
|
|
70
|
-
<div className="items-wrapper">
|
|
71
|
-
<ItemsSection />
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<h4>Further details</h4>
|
|
75
|
-
<Segment>
|
|
76
|
-
Nam tempor finibus lorem, nec varius arcu convallis sed. Nunc id orci
|
|
77
|
-
a neque vehicula malesuada. Donec vehicula libero vel leo convallis,
|
|
78
|
-
nec tincidunt felis tincidunt. Maecenas euismod tristique leo, vel
|
|
79
|
-
malesuada ligula malesuada sed. Donec eget libero id leo congue
|
|
80
|
-
venenatis.
|
|
81
|
-
</Segment>
|
|
82
|
-
<Button primary inverted>
|
|
83
|
-
Download
|
|
84
|
-
</Button>
|
|
93
|
+
|
|
94
|
+
{result.assessment_risks.map((risk, index) => {
|
|
95
|
+
const title = risk?.Attachment_Title
|
|
96
|
+
? `${risk.Assessment_Id}. ${risk.Attachment_Title} - ${
|
|
97
|
+
risk.Year_Of_Publication || ''
|
|
98
|
+
}`
|
|
99
|
+
: null;
|
|
100
|
+
return (
|
|
101
|
+
<div key={index}>
|
|
102
|
+
<AccordionList
|
|
103
|
+
variation="tertiary"
|
|
104
|
+
accordions={[
|
|
105
|
+
{
|
|
106
|
+
title: title,
|
|
107
|
+
content: <AssessmentAccordionContent result={risk} />,
|
|
108
|
+
},
|
|
109
|
+
]}
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
})}
|
|
85
114
|
</div>
|
|
86
115
|
|
|
87
|
-
<h3>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
91
|
-
consequat. Duis aute irure dolor in reprehenderit in voluptate velit
|
|
92
|
-
esse cillum dolore eu fugiat nulla pariatur.
|
|
93
|
-
</p>
|
|
116
|
+
{Hazards_Title && <h3>{Hazards_Title}</h3>}
|
|
117
|
+
|
|
118
|
+
{Hazards_Abstract && <p>{Hazards_Abstract}</p>}
|
|
94
119
|
|
|
95
120
|
<br />
|
|
96
121
|
|
package/src/components/manage/Blocks/MissionSignatoriesProfile/TabSections/AssessmentTab.test.jsx
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
|
+
import AssessmentTab from './AssessmentTab';
|
|
5
|
+
|
|
6
|
+
jest.mock('@eeacms/volto-eea-design-system/ui', () => ({
|
|
7
|
+
Callout: ({ children }) => <div>{children}</div>,
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
const mockData = {
|
|
11
|
+
assessment_text: [
|
|
12
|
+
{
|
|
13
|
+
Title: 'Assessment Title',
|
|
14
|
+
Subheading: 'Assessment Subheading',
|
|
15
|
+
Abstract: 'Assessment abstract content.',
|
|
16
|
+
Cra_Title: 'CRA Title',
|
|
17
|
+
Cra_Abstract: 'CRA Abstract here.',
|
|
18
|
+
Attachments: 'Attachment Heading',
|
|
19
|
+
Hazards_Title: 'Hazards',
|
|
20
|
+
Hazards_Abstract: 'Hazards abstract text.',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
assessment_factors: [{ Factor: 'Factor A' }, { Factor: 'Factor B' }],
|
|
24
|
+
assessment_risks: [
|
|
25
|
+
{
|
|
26
|
+
Assessment_Id: '1',
|
|
27
|
+
Attachment_Title: 'Risk Attachment Title',
|
|
28
|
+
Year_Of_Publication: '2023',
|
|
29
|
+
Hyperlink: 'https://example.com',
|
|
30
|
+
Explore_Link_Text: 'Explore this risk',
|
|
31
|
+
Year_Of_Publication_Label: 'Published Year',
|
|
32
|
+
Further_Details_Label: 'Details',
|
|
33
|
+
Please_Explain: 'Explanation content here.',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
describe('AssessmentTab', () => {
|
|
39
|
+
it('renders core sections and nested tabs', () => {
|
|
40
|
+
render(<AssessmentTab result={mockData} />);
|
|
41
|
+
|
|
42
|
+
// General headings
|
|
43
|
+
expect(screen.getByText('Assessment Title')).toBeInTheDocument();
|
|
44
|
+
expect(screen.getByText('Assessment Subheading')).toBeInTheDocument();
|
|
45
|
+
expect(
|
|
46
|
+
screen.getByText('Assessment abstract content.'),
|
|
47
|
+
).toBeInTheDocument();
|
|
48
|
+
expect(screen.getByText('CRA Title')).toBeInTheDocument();
|
|
49
|
+
expect(screen.getByText('CRA Abstract here.')).toBeInTheDocument();
|
|
50
|
+
expect(screen.getByText('Attachment Heading')).toBeInTheDocument();
|
|
51
|
+
expect(screen.getByText('Hazards')).toBeInTheDocument();
|
|
52
|
+
expect(screen.getByText('Hazards abstract text.')).toBeInTheDocument();
|
|
53
|
+
|
|
54
|
+
// Items section
|
|
55
|
+
expect(screen.getByText('Factor A')).toBeInTheDocument();
|
|
56
|
+
expect(screen.getByText('Factor B')).toBeInTheDocument();
|
|
57
|
+
|
|
58
|
+
// Hazard tabs
|
|
59
|
+
expect(screen.getByText('Water related')).toBeInTheDocument();
|
|
60
|
+
expect(screen.getByText('Heat related')).toBeInTheDocument();
|
|
61
|
+
expect(screen.getByText('Other hazards')).toBeInTheDocument();
|
|
62
|
+
});
|
|
63
|
+
});
|
package/src/components/manage/Blocks/MissionSignatoriesProfile/TabSections/GovernanceTab.jsx
CHANGED
|
@@ -6,30 +6,43 @@ import { formatTextToHTML } from '@eeacms/volto-cca-policy/utils';
|
|
|
6
6
|
import AccordionList from './../AccordionList';
|
|
7
7
|
|
|
8
8
|
const GovernanceTab = ({ result }) => {
|
|
9
|
-
const {
|
|
10
|
-
|
|
9
|
+
const {
|
|
10
|
+
Title,
|
|
11
|
+
Introduction,
|
|
12
|
+
Describe_Title,
|
|
13
|
+
Describe,
|
|
14
|
+
Provide_Title,
|
|
15
|
+
Provide,
|
|
16
|
+
} = result;
|
|
11
17
|
|
|
12
18
|
return (
|
|
13
19
|
<Tab.Pane>
|
|
14
|
-
<h2>
|
|
15
|
-
<Callout>
|
|
16
|
-
<p>{Introduction}</p>
|
|
17
|
-
</Callout>
|
|
20
|
+
{Title && <h2>{Title}</h2>}
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
{Introduction && (
|
|
23
|
+
<Callout>
|
|
24
|
+
<p>{Introduction}</p>
|
|
25
|
+
</Callout>
|
|
26
|
+
)}
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
{Describe_Title && <h3>{Describe_Title}</h3>}
|
|
29
|
+
|
|
30
|
+
{Describe && <HTMLField value={{ data: formatTextToHTML(Describe) }} />}
|
|
22
31
|
|
|
23
32
|
<br />
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
{Provide_Title && Provide && (
|
|
35
|
+
<AccordionList
|
|
36
|
+
accordions={[
|
|
37
|
+
{
|
|
38
|
+
title: Provide_Title,
|
|
39
|
+
content: (
|
|
40
|
+
<HTMLField value={{ data: formatTextToHTML(Provide) }} />
|
|
41
|
+
),
|
|
42
|
+
},
|
|
43
|
+
]}
|
|
44
|
+
/>
|
|
45
|
+
)}
|
|
33
46
|
</Tab.Pane>
|
|
34
47
|
);
|
|
35
48
|
};
|
package/src/components/manage/Blocks/MissionSignatoriesProfile/TabSections/GovernanceTab.test.jsx
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
4
|
import GovernanceTab from './GovernanceTab';
|
|
5
5
|
|
|
6
6
|
describe('GovernanceTab', () => {
|
|
7
7
|
const mockResult = {
|
|
8
|
+
Title: 'Governance Section',
|
|
9
|
+
Introduction: 'This is an introduction to governance.',
|
|
8
10
|
Describe_Title: 'Opportunities and benefits of climate action',
|
|
9
|
-
Provide_Title: 'Further details and evidence',
|
|
10
11
|
};
|
|
11
12
|
|
|
12
|
-
it('renders the governance tab correctly', () => {
|
|
13
|
-
|
|
13
|
+
it('renders the governance tab correctly with all sections', () => {
|
|
14
|
+
render(<GovernanceTab result={mockResult} />);
|
|
14
15
|
|
|
16
|
+
expect(screen.getByText('Governance Section')).toBeInTheDocument();
|
|
15
17
|
expect(
|
|
16
|
-
getByText('
|
|
18
|
+
screen.getByText('This is an introduction to governance.'),
|
|
19
|
+
).toBeInTheDocument();
|
|
20
|
+
expect(
|
|
21
|
+
screen.getByText('Opportunities and benefits of climate action'),
|
|
17
22
|
).toBeInTheDocument();
|
|
18
|
-
expect(getByText('Further details and evidence')).toBeInTheDocument();
|
|
19
23
|
});
|
|
20
24
|
});
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
@import (multiple, reference, optional) '../../theme.config';
|
|
5
5
|
|
|
6
6
|
.signatories-profile {
|
|
7
|
-
.items-
|
|
8
|
-
margin: 2em 0;
|
|
7
|
+
.ui.items.items-group {
|
|
8
|
+
margin: 2em 0 !important;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.column > .ui.segment {
|
|
@@ -23,6 +23,27 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
.tab-section-wrapper {
|
|
27
|
+
padding: 1.5em;
|
|
28
|
+
margin: 2em 0;
|
|
29
|
+
background-color: #f9f9f9;
|
|
30
|
+
|
|
31
|
+
&.assessment {
|
|
32
|
+
.ui.accordion {
|
|
33
|
+
margin-top: 1em;
|
|
34
|
+
|
|
35
|
+
.content.active {
|
|
36
|
+
padding: 1rem 1rem !important;
|
|
37
|
+
background-color: @white;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ui.segment.border {
|
|
41
|
+
border: 1px solid #e6e7e8;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
26
47
|
.section-wrapper {
|
|
27
48
|
margin: 1em 0;
|
|
28
49
|
|