@eeacms/volto-marine-policy 1.1.3 → 1.1.5

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,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
- ### [1.1.3](https://github.com/eea/volto-marine-policy/compare/1.1.2...1.1.3) - 24 April 2024
7
+ ### [1.1.5](https://github.com/eea/volto-marine-policy/compare/1.1.4...1.1.5) - 6 May 2024
8
8
 
9
9
  #### :bug: Bug Fixes
10
10
 
11
- - fix: add custom font-size to menu-items refs#268362 [nileshgulia1 - [`71abd79`](https://github.com/eea/volto-marine-policy/commit/71abd79cae07ec940fce0fc4e25687f8b99f6ed2)]
11
+ - fix: eslint . [nileshgulia1 - [`6280d19`](https://github.com/eea/volto-marine-policy/commit/6280d191037782ce11c491b681b9e20878da15f2)]
12
+ - fix(navigation): do not expand accordion without children [nileshgulia1 - [`057e1ca`](https://github.com/eea/volto-marine-policy/commit/057e1ca6966b023cb9354ba437c9879c8f1e14d4)]
13
+
14
+ ### [1.1.4](https://github.com/eea/volto-marine-policy/compare/1.1.3...1.1.4) - 29 April 2024
15
+
16
+ ### [1.1.3](https://github.com/eea/volto-marine-policy/compare/1.1.2...1.1.3) - 25 April 2024
12
17
 
13
18
  ### [1.1.2](https://github.com/eea/volto-marine-policy/compare/1.1.1...1.1.2) - 24 April 2024
14
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-marine-policy",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "@eeacms/volto-marine-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -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
@@ -348,6 +348,43 @@ const applyConfig = (config) => {
348
348
  { cssClass: 'poppins-regular', label: 'Poppins Regular' },
349
349
  { cssClass: 'poppins-light', label: 'Poppins Light' },
350
350
  { cssClass: 'poppins-bold', label: 'Poppins Bold' },
351
+ { cssClass: 'large-text', label: 'Large text' },
352
+ { cssClass: 'primary-big-text', label: 'Big text' },
353
+ { cssClass: 'medium-text', label: 'Medium text' },
354
+ { cssClass: 'small-text', label: 'Small text' },
355
+ { cssClass: 'blue-text', label: 'Blue text' },
356
+ { cssClass: 'blue-chart-text', label: 'Blue plot-chart text' },
357
+ { cssClass: 'green-chart-text', label: 'Green plot-chart text' },
358
+ { cssClass: 'yellow-chart-text', label: 'Yellow plot-chart text' },
359
+ { cssClass: 'orange-chart-text', label: 'Orange plot-chart text' },
360
+ { cssClass: 'red-chart-text', label: 'Red plot-chart text' },
361
+ { cssClass: 'blue-circle text-circle', label: 'Blue circle' },
362
+ { cssClass: 'green-circle text-circle', label: 'Green circle' },
363
+ { cssClass: 'orange-circle text-circle', label: 'Orange circle' },
364
+ { cssClass: 'yellow-circle text-circle', label: 'Yellow circle' },
365
+ { cssClass: 'grey-circle text-circle', label: 'Grey circle' },
366
+ { cssClass: 'black-text', label: 'Black text' },
367
+
368
+ {
369
+ cssClass: 'uwwt-empty-box blue-uwwt-background',
370
+ label: 'UWWT blue empty box',
371
+ },
372
+ {
373
+ cssClass: 'uwwt-empty-box green-uwwt-background',
374
+ label: 'UWWT green empty box',
375
+ },
376
+ {
377
+ cssClass: 'uwwt-empty-box yellow-uwwt-background',
378
+ label: 'UWWT yellow empty box',
379
+ },
380
+ {
381
+ cssClass: 'uwwt-empty-box orange-uwwt-background',
382
+ label: 'UWWT orange empty box',
383
+ },
384
+ {
385
+ cssClass: 'uwwt-empty-box red-uwwt-background',
386
+ label: 'UWWT red empty box',
387
+ },
351
388
  ];
352
389
 
353
390
  // EEA customizations
@@ -41,3 +41,114 @@
41
41
  font-family: @headerFont;
42
42
  font-weight: 600;
43
43
  }
44
+
45
+ @uwwt-blue: #0079cf;
46
+ @uwwt-green: #50b0a4;
47
+ @uwwt-yellow: #fad936;
48
+ @uwwt-orange: #ed763e;
49
+ @uwwt-red: #ff544d;
50
+ @uwwt-grey: #808080;
51
+
52
+ .large-text {
53
+ font-size: 4rem;
54
+ }
55
+
56
+ .primary-big-text {
57
+ font-size: 1.625rem;
58
+ }
59
+
60
+ .medium-text {
61
+ font-size: 1.25rem;
62
+ }
63
+
64
+ .small-text {
65
+ font-size: 0.8rem;
66
+ }
67
+
68
+ .blue-chart-text {
69
+ color: @uwwt-blue;
70
+ }
71
+
72
+ .green-chart-text {
73
+ color: @uwwt-green;
74
+ }
75
+
76
+ .yellow-chart-text {
77
+ color: @uwwt-yellow;
78
+ }
79
+
80
+ .orange-chart-text {
81
+ color: @uwwt-orange;
82
+ }
83
+
84
+ .red-chart-text {
85
+ color: @uwwt-red;
86
+ }
87
+
88
+ .black-text {
89
+ color: #333;
90
+ }
91
+
92
+ #view .text-circle {
93
+ display: inline-block;
94
+ width: 125px;
95
+ height: 125px;
96
+ border-radius: 50%;
97
+ font-family: 'Poppins', 'Helvetica Neue', Arial, Helvetica, sans-serif;
98
+ font-size: 35px !important;
99
+ font-weight: 600;
100
+ line-height: 125px !important;
101
+ text-align: center;
102
+ }
103
+
104
+ .grey-circle {
105
+ background-color: @uwwt-grey;
106
+ color: #fff;
107
+ }
108
+
109
+ .blue-circle {
110
+ background-color: @uwwt-blue;
111
+ color: #fff;
112
+ }
113
+
114
+ .green-circle {
115
+ background-color: @uwwt-green;
116
+ color: #fff;
117
+ }
118
+
119
+ .orange-circle {
120
+ background-color: @uwwt-orange;
121
+ color: #fff;
122
+ }
123
+
124
+ .yellow-circle {
125
+ background-color: @uwwt-yellow;
126
+ color: #fff;
127
+ }
128
+
129
+ .uwwt-empty-box {
130
+ display: inline-block;
131
+ width: 1em;
132
+ height: 1em;
133
+ margin: -2px 0 -2px 16px;
134
+ }
135
+
136
+ .blue-uwwt-background {
137
+ background-color: @uwwt-blue;
138
+ }
139
+
140
+ .green-uwwt-background {
141
+ background-color: @uwwt-green;
142
+ }
143
+
144
+ .yellow-uwwt-background {
145
+ background-color: @uwwt-yellow;
146
+ }
147
+
148
+ .orange-uwwt-background {
149
+ background-color: @uwwt-orange;
150
+ }
151
+
152
+ .red-uwwt-background {
153
+ background-color: @uwwt-red;
154
+ }