@eeacms/volto-cca-policy 0.3.46 → 0.3.47
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 +10 -0
- package/package.json +1 -1
- package/src/components/theme/MissionSignatoryProfile/MissionSignatoryProfileView.jsx +14 -3
- package/src/components/theme/MissionSignatoryProfile/MissionSignatoryProfileView.test.jsx +16 -5
- package/theme/globals/mission.less +13 -0
- package/src/components/theme/MissionSignatoryProfile/TabSections/IntroductionTab.jsx +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ 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.47](https://github.com/eea/volto-cca-policy/compare/0.3.46...0.3.47) - 21 May 2025
|
|
8
|
+
|
|
9
|
+
#### :nail_care: Enhancements
|
|
10
|
+
|
|
11
|
+
- change(mission): cleanup, remove unused component [kreafox - [`0440183`](https://github.com/eea/volto-cca-policy/commit/044018381a8c42e1a45ff9ba3668613dc08f5198)]
|
|
12
|
+
- change(mission): add link to signatory landing page - refs #287964 [kreafox - [`78378a3`](https://github.com/eea/volto-cca-policy/commit/78378a3d7f8bab7aa6414342e228b45fc24ec57b)]
|
|
13
|
+
|
|
14
|
+
#### :hammer_and_wrench: Others
|
|
15
|
+
|
|
16
|
+
- update test [kreafox - [`ae30035`](https://github.com/eea/volto-cca-policy/commit/ae30035c6f3f1d81d560b5552afc0bc9764df983)]
|
|
7
17
|
### [0.3.46](https://github.com/eea/volto-cca-policy/compare/0.3.45...0.3.46) - 21 May 2025
|
|
8
18
|
|
|
9
19
|
#### :house: Internal changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import { Tab, Container, Divider, Button, Icon } from 'semantic-ui-react';
|
|
3
4
|
import { formatTextToHTML } from '@eeacms/volto-cca-policy/utils';
|
|
4
5
|
import { BannerTitle, HTMLField } from '@eeacms/volto-cca-policy/helpers';
|
|
6
|
+
import { flattenToAppURL } from '@plone/volto/helpers';
|
|
5
7
|
|
|
6
8
|
import GovernanceTab from './TabSections/GovernanceTab';
|
|
7
9
|
import AssessmentTab from './TabSections/AssessmentTab';
|
|
@@ -29,6 +31,9 @@ const MissionSignatoryProfileView = ({ content }) => {
|
|
|
29
31
|
general_text = [{}],
|
|
30
32
|
} = signatoryData;
|
|
31
33
|
|
|
34
|
+
const { Back_To_Map_Link, Country_Or_Area } = general_text?.[0] || {};
|
|
35
|
+
const backToMapPath = flattenToAppURL(content?.parent?.['@id'] || '/');
|
|
36
|
+
|
|
32
37
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
33
38
|
|
|
34
39
|
const tabData = {
|
|
@@ -60,12 +65,18 @@ const MissionSignatoryProfileView = ({ content }) => {
|
|
|
60
65
|
hidePublishingDate: true,
|
|
61
66
|
hideDownloadButton: false,
|
|
62
67
|
hideShareButton: false,
|
|
63
|
-
subtitle:
|
|
68
|
+
subtitle: Country_Or_Area,
|
|
64
69
|
}}
|
|
65
70
|
/>
|
|
66
71
|
|
|
67
72
|
<div className="signatory-profile">
|
|
68
|
-
<
|
|
73
|
+
<Link to={backToMapPath}>
|
|
74
|
+
<Button icon inverted primary className="left labeled back-to-map">
|
|
75
|
+
<Icon className="chevron left icon" />
|
|
76
|
+
{Back_To_Map_Link || 'Back to Signatories map'}
|
|
77
|
+
</Button>
|
|
78
|
+
</Link>
|
|
79
|
+
|
|
69
80
|
<Tab
|
|
70
81
|
menu={{
|
|
71
82
|
fluid: true,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { render, fireEvent, screen } from '@testing-library/react';
|
|
2
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
2
3
|
import '@testing-library/jest-dom';
|
|
3
4
|
import MissionSignatoryProfileView from './MissionSignatoryProfileView';
|
|
4
5
|
|
|
@@ -38,15 +39,25 @@ describe('MissionSignatoryProfileView', () => {
|
|
|
38
39
|
{ key: 'Action_Label', value: 'Action' },
|
|
39
40
|
{ key: 'Language', value: 'en' },
|
|
40
41
|
],
|
|
42
|
+
general_text: [
|
|
43
|
+
{
|
|
44
|
+
Back_To_Map_Link: 'Back to map',
|
|
45
|
+
Country_Or_Area: 'Testland',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
41
48
|
},
|
|
42
49
|
},
|
|
43
50
|
},
|
|
51
|
+
parent: {
|
|
52
|
+
'@id': '/signatories-map',
|
|
53
|
+
},
|
|
44
54
|
};
|
|
45
55
|
|
|
56
|
+
const renderWithRouter = (ui) => render(<MemoryRouter>{ui}</MemoryRouter>);
|
|
57
|
+
|
|
46
58
|
it('renders tab labels and default content', () => {
|
|
47
|
-
|
|
59
|
+
renderWithRouter(<MissionSignatoryProfileView content={content} />);
|
|
48
60
|
|
|
49
|
-
// Tab labels
|
|
50
61
|
expect(screen.getByText('Governance')).toBeInTheDocument();
|
|
51
62
|
expect(screen.getByText('Assessment')).toBeInTheDocument();
|
|
52
63
|
expect(screen.getByText('Planning & Target')).toBeInTheDocument();
|
|
@@ -54,7 +65,7 @@ describe('MissionSignatoryProfileView', () => {
|
|
|
54
65
|
});
|
|
55
66
|
|
|
56
67
|
it('switches tabs and renders corresponding content', () => {
|
|
57
|
-
|
|
68
|
+
renderWithRouter(<MissionSignatoryProfileView content={content} />);
|
|
58
69
|
|
|
59
70
|
fireEvent.click(screen.getByText('Governance'));
|
|
60
71
|
expect(screen.getByText('Mocked Governance')).toBeInTheDocument();
|
|
@@ -70,10 +81,10 @@ describe('MissionSignatoryProfileView', () => {
|
|
|
70
81
|
});
|
|
71
82
|
|
|
72
83
|
it('renders footer disclaimer text if present', () => {
|
|
73
|
-
|
|
84
|
+
renderWithRouter(<MissionSignatoryProfileView content={content} />);
|
|
74
85
|
expect(screen.getByText('Disclaimer Title')).toBeInTheDocument();
|
|
75
86
|
expect(
|
|
76
|
-
screen.getByText((
|
|
87
|
+
screen.getByText((text) => text.includes('This is a disclaimer.')),
|
|
77
88
|
).toBeInTheDocument();
|
|
78
89
|
});
|
|
79
90
|
});
|
|
@@ -123,6 +123,19 @@ body.subsite-mkh {
|
|
|
123
123
|
margin: 2em 0 !important;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
.ui.inverted.button.back-to-map {
|
|
127
|
+
margin-bottom: 2em;
|
|
128
|
+
box-shadow: 0px 0px 0px 2px @pineGreen inset !important;
|
|
129
|
+
color: @pineGreen;
|
|
130
|
+
|
|
131
|
+
&:hover,
|
|
132
|
+
&:active,
|
|
133
|
+
&:focus,
|
|
134
|
+
&:focus-visible {
|
|
135
|
+
background-color: @pineGreen;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
126
139
|
.column > .ui.segment {
|
|
127
140
|
background-color: #fff !important;
|
|
128
141
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Tab } from 'semantic-ui-react';
|
|
3
|
-
import { Callout } from '@eeacms/volto-eea-design-system/ui';
|
|
4
|
-
|
|
5
|
-
const IntroductionTab = () => {
|
|
6
|
-
return (
|
|
7
|
-
<Tab.Pane>
|
|
8
|
-
<h2>Introduction</h2>
|
|
9
|
-
<Callout>
|
|
10
|
-
Duis non quam et nisi tincidunt fermentum. Pellentesque habitant morbi
|
|
11
|
-
tristique senectus et netus et malesuada fames ac turpis egestas.
|
|
12
|
-
</Callout>
|
|
13
|
-
<h3>The Mission on Adaptation</h3>
|
|
14
|
-
<p>
|
|
15
|
-
Nulla facilisi. Donec fringilla urna id ligula ullamcorper, vel
|
|
16
|
-
tristique lorem posuere. Donec et orci mauris. Nullam tempor velit id mi
|
|
17
|
-
luctus, a scelerisque libero accumsan. In hac habitasse platea dictumst.
|
|
18
|
-
Cras ac nunc nec massa tristique fringilla.
|
|
19
|
-
</p>
|
|
20
|
-
<h3>Data source</h3>
|
|
21
|
-
<p>
|
|
22
|
-
Donec eget libero id leo congue venenatis. Ut enim ad minim veniam, quis
|
|
23
|
-
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
24
|
-
consequat. Duis aute irure dolor in reprehenderit in voluptate velit
|
|
25
|
-
esse cillum dolore eu fugiat nulla pariatur.
|
|
26
|
-
</p>
|
|
27
|
-
<p>
|
|
28
|
-
Donec eget libero id leo congue venenatis. Ut enim ad minim veniam, quis
|
|
29
|
-
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
30
|
-
consequat. Duis aute irure dolor in reprehenderit in voluptate velit
|
|
31
|
-
esse cillum dolore eu fugiat nulla pariatur.
|
|
32
|
-
</p>
|
|
33
|
-
</Tab.Pane>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default IntroductionTab;
|