@eeacms/volto-marine-policy 1.1.4 → 1.1.6
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
CHANGED
|
@@ -4,11 +4,23 @@ 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
|
-
### [1.1.
|
|
7
|
+
### [1.1.6](https://github.com/eea/volto-marine-policy/compare/1.1.5...1.1.6) - 9 May 2024
|
|
8
8
|
|
|
9
|
-
#### :
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: custom-page-header css [laszlocseh - [`6b1e65b`](https://github.com/eea/volto-marine-policy/commit/6b1e65b8cde50f8c5c4f2dcd6bcd078d7c759dfd)]
|
|
12
|
+
|
|
13
|
+
#### :house: Internal changes
|
|
14
|
+
|
|
15
|
+
- chore: remove paths from externalRoutes as they will be implemented as volto pages [laszlocseh - [`75a4f6d`](https://github.com/eea/volto-marine-policy/commit/75a4f6df797f374794f91dc3bbfc43fbcf6b272c)]
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
### [1.1.5](https://github.com/eea/volto-marine-policy/compare/1.1.4...1.1.5) - 7 May 2024
|
|
18
|
+
|
|
19
|
+
#### :bug: Bug Fixes
|
|
20
|
+
|
|
21
|
+
- fix: eslint . [nileshgulia1 - [`6280d19`](https://github.com/eea/volto-marine-policy/commit/6280d191037782ce11c491b681b9e20878da15f2)]
|
|
22
|
+
|
|
23
|
+
### [1.1.4](https://github.com/eea/volto-marine-policy/compare/1.1.3...1.1.4) - 29 April 2024
|
|
12
24
|
|
|
13
25
|
### [1.1.3](https://github.com/eea/volto-marine-policy/compare/1.1.2...1.1.3) - 25 April 2024
|
|
14
26
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Accordion as SemanticAccordion, Icon } from 'semantic-ui-react';
|
|
3
|
-
|
|
4
3
|
import AccordionContent from './AccordionContent';
|
|
5
4
|
import { useHistory } from 'react-router-dom';
|
|
6
5
|
|
|
7
6
|
const Accordion = (props) => {
|
|
8
7
|
const { items = {}, curent_location, activeMenu, data = {} } = props;
|
|
9
8
|
const [currentIndex, setIndex] = React.useState(activeMenu ?? 0);
|
|
9
|
+
const [showChildren, setShowChildren] = React.useState(false);
|
|
10
10
|
const history = useHistory();
|
|
11
11
|
|
|
12
12
|
const handleClick = (e, item) => {
|
|
@@ -19,6 +19,7 @@ const Accordion = (props) => {
|
|
|
19
19
|
const newIndex = currentIndex === index ? -1 : index;
|
|
20
20
|
setIndex(newIndex);
|
|
21
21
|
};
|
|
22
|
+
|
|
22
23
|
return (
|
|
23
24
|
<>
|
|
24
25
|
<div className="context-navigation-header">{data?.title}</div>
|
|
@@ -45,7 +46,7 @@ const Accordion = (props) => {
|
|
|
45
46
|
}}
|
|
46
47
|
>
|
|
47
48
|
<span className="item-title">{item.title}</span>
|
|
48
|
-
{active ? (
|
|
49
|
+
{active && showChildren ? (
|
|
49
50
|
<Icon
|
|
50
51
|
className="ri-arrow-up-s-line"
|
|
51
52
|
onClick={(e) => {
|
|
@@ -61,7 +62,7 @@ const Accordion = (props) => {
|
|
|
61
62
|
/>
|
|
62
63
|
)}
|
|
63
64
|
</SemanticAccordion.Title>
|
|
64
|
-
<SemanticAccordion.Content active={active}>
|
|
65
|
+
<SemanticAccordion.Content active={active && showChildren}>
|
|
65
66
|
<AccordionContent
|
|
66
67
|
curent_location={curent_location}
|
|
67
68
|
key={index}
|
|
@@ -71,6 +72,7 @@ const Accordion = (props) => {
|
|
|
71
72
|
url: item.url,
|
|
72
73
|
}}
|
|
73
74
|
data={data}
|
|
75
|
+
setShowChildren={setShowChildren}
|
|
74
76
|
/>
|
|
75
77
|
</SemanticAccordion.Content>
|
|
76
78
|
</SemanticAccordion>
|
|
@@ -10,6 +10,7 @@ const AccordionContent = (props) => {
|
|
|
10
10
|
main,
|
|
11
11
|
curent_location,
|
|
12
12
|
data: { types = [] },
|
|
13
|
+
setShowChildren,
|
|
13
14
|
} = props;
|
|
14
15
|
const location = main.url;
|
|
15
16
|
|
|
@@ -22,6 +23,14 @@ const AccordionContent = (props) => {
|
|
|
22
23
|
// (state) => state.content?.subrequests?.[location]?.data?.items || [],
|
|
23
24
|
// );
|
|
24
25
|
const items = useChildren(location);
|
|
26
|
+
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
const filteredItems = items.filter((item) =>
|
|
29
|
+
types.length ? types.includes(item['@type']) : item,
|
|
30
|
+
);
|
|
31
|
+
if (filteredItems.length) setShowChildren(true);
|
|
32
|
+
}, [items, setShowChildren, types]);
|
|
33
|
+
|
|
25
34
|
return (
|
|
26
35
|
<div className="dataset-content">
|
|
27
36
|
<div>
|
package/src/index.js
CHANGED
|
@@ -218,17 +218,17 @@ const applyConfig = (config) => {
|
|
|
218
218
|
return payload.location.pathname;
|
|
219
219
|
},
|
|
220
220
|
},
|
|
221
|
-
{
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
},
|
|
221
|
+
// {
|
|
222
|
+
// match: {
|
|
223
|
+
// path:
|
|
224
|
+
// '/(.*)marine(-new)?/policy-and-reporting/msfd-reports-and-assessments(.*)',
|
|
225
|
+
// exact: false,
|
|
226
|
+
// strict: false,
|
|
227
|
+
// },
|
|
228
|
+
// url(payload) {
|
|
229
|
+
// return payload.location.pathname;
|
|
230
|
+
// },
|
|
231
|
+
// },
|
|
232
232
|
{
|
|
233
233
|
match: {
|
|
234
234
|
path:
|
|
@@ -240,28 +240,28 @@ const applyConfig = (config) => {
|
|
|
240
240
|
return payload.location.pathname;
|
|
241
241
|
},
|
|
242
242
|
},
|
|
243
|
-
{
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
},
|
|
243
|
+
// {
|
|
244
|
+
// match: {
|
|
245
|
+
// path:
|
|
246
|
+
// '/(.*)marine(-new)?/policy-and-reporting/assessment-by-country(.*)',
|
|
247
|
+
// exact: false,
|
|
248
|
+
// strict: false,
|
|
249
|
+
// },
|
|
250
|
+
// url(payload) {
|
|
251
|
+
// return payload.location.pathname;
|
|
252
|
+
// },
|
|
253
|
+
// },
|
|
254
|
+
// {
|
|
255
|
+
// match: {
|
|
256
|
+
// path:
|
|
257
|
+
// '/(.*)marine(-new)?/policy-and-reporting/assessment-by-region(.*)',
|
|
258
|
+
// exact: false,
|
|
259
|
+
// strict: false,
|
|
260
|
+
// },
|
|
261
|
+
// url(payload) {
|
|
262
|
+
// return payload.location.pathname;
|
|
263
|
+
// },
|
|
264
|
+
// },
|
|
265
265
|
];
|
|
266
266
|
|
|
267
267
|
config.settings.openExternalLinkInNewTab = true;
|
|
@@ -295,13 +295,21 @@ section .searchlib-block .ui.button.sui-button.basic {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
// Custom page header
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
298
|
+
body.custom-page-header {
|
|
299
|
+
#page-header {
|
|
300
|
+
.column-blocks-wrapper,
|
|
301
|
+
.content-box {
|
|
302
|
+
margin-bottom: 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.country-header-block {
|
|
306
|
+
padding-right: 1em;
|
|
307
|
+
}
|
|
301
308
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
309
|
+
.country-flag {
|
|
310
|
+
padding-left: 1.25rem;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
305
313
|
}
|
|
306
314
|
|
|
307
315
|
body.custom-page-header .breadcrumbs {
|
|
@@ -347,3 +355,10 @@ body.custom-page-header .breadcrumbs {
|
|
|
347
355
|
margin-bottom: 0;
|
|
348
356
|
}
|
|
349
357
|
}
|
|
358
|
+
|
|
359
|
+
// Fix block width when used as page header
|
|
360
|
+
#page-header .styled-group.has--useAsPageHeader--true {
|
|
361
|
+
margin-left: auto;
|
|
362
|
+
margin-right: auto;
|
|
363
|
+
width: 100%;
|
|
364
|
+
}
|