@eeacms/volto-cca-policy 0.1.77 → 0.1.79

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,6 +4,25 @@ 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.1.79](https://github.com/eea/volto-cca-policy/compare/0.1.78...0.1.79) - 20 February 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Don't crash in root [Tiberiu Ichim - [`ed2eb04`](https://github.com/eea/volto-cca-policy/commit/ed2eb04841fa3adb737138f6d8d9f7e0aaf3d776)]
12
+ ### [0.1.78](https://github.com/eea/volto-cca-policy/compare/0.1.77...0.1.78) - 20 February 2024
13
+
14
+ #### :house: Internal changes
15
+
16
+ - style: Automated code fix [eea-jenkins - [`0b35fb5`](https://github.com/eea/volto-cca-policy/commit/0b35fb51fd604bdf18a05d687c795d1d2d8e161f)]
17
+
18
+ #### :hammer_and_wrench: Others
19
+
20
+ - Why did Jenkins become a gardener? Because he wanted to see if his plants could pass the green build! [GhitaB - [`4bf6c95`](https://github.com/eea/volto-cca-policy/commit/4bf6c9595563d24ea6a48363ec715d69fbca888f)]
21
+ - prettier ternary [Tiberiu Ichim - [`015e96a`](https://github.com/eea/volto-cca-policy/commit/015e96a9f38b2fe5cbc49e254227bb1243747250)]
22
+ - oops [Tiberiu Ichim - [`f3b9a55`](https://github.com/eea/volto-cca-policy/commit/f3b9a55009857148b26f2f74064c3ea3869e024a)]
23
+ - Code cleanup [Tiberiu Ichim - [`988c8d9`](https://github.com/eea/volto-cca-policy/commit/988c8d9f310cf9abdf62e588facc1c5693a3e7f6)]
24
+ - Styling for nonclickable menus [Tiberiu Ichim - [`1c33068`](https://github.com/eea/volto-cca-policy/commit/1c33068a85de60adc33d39c3ecf14496ed73d1fb)]
25
+ - Nonclickable menu WIP [Tiberiu Ichim - [`06bfa16`](https://github.com/eea/volto-cca-policy/commit/06bfa16362d0e1be40ed17cb6007814fafd2fe21)]
7
26
  ### [0.1.77](https://github.com/eea/volto-cca-policy/compare/0.1.76...0.1.77) - 19 February 2024
8
27
 
9
28
  #### :bug: Bug Fixes
@@ -347,10 +366,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
347
366
  - Refs #260715 rast-block wip [Tripon Eugen - [`f19d54e`](https://github.com/eea/volto-cca-policy/commit/f19d54e0b9a6a86bf344eb85b6a1cda7f3de91bf)]
348
367
  - Refs #260715 rast-block wip [Tripon Eugen - [`2828537`](https://github.com/eea/volto-cca-policy/commit/2828537b6c084cd1a82162d552fb4ef025b71f9f)]
349
368
  - Refs #260715 rast-block updates [Tripon Eugen - [`1e803e5`](https://github.com/eea/volto-cca-policy/commit/1e803e5bd3d3fb7558f261c76c68866be7beb8b5)]
369
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0a15e1b`](https://github.com/eea/volto-cca-policy/commit/0a15e1b2ad081233685e80d5b3c60a8663f6b896)]
370
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`9554e44`](https://github.com/eea/volto-cca-policy/commit/9554e44c92a621a52b2adb5a4830fb084ee5734b)]
350
371
  ### [0.1.49](https://github.com/eea/volto-cca-policy/compare/0.1.48...0.1.49) - 15 November 2023
351
372
 
352
373
  #### :house: Internal changes
353
374
 
375
+ - chore: [JENKINS] Refactor automated testing [valentinab25 - [`7b820a6`](https://github.com/eea/volto-cca-policy/commit/7b820a6369c2ddd5203b1a4abe352cb4bb43db7a)]
354
376
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`f0a8061`](https://github.com/eea/volto-cca-policy/commit/f0a8061c275c236deb00087c23fac9860a073106)]
355
377
 
356
378
  #### :hammer_and_wrench: Others
@@ -367,6 +389,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
367
389
  - Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
368
390
  - Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
369
391
  - Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
392
+ - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
393
+ - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
394
+ - test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
370
395
  - Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
371
396
  - 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)]
372
397
  - Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
@@ -583,6 +608,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
583
608
 
584
609
  #### :house: Internal changes
585
610
 
611
+ - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
586
612
 
587
613
  #### :hammer_and_wrench: Others
588
614
 
@@ -1063,6 +1089,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1063
1089
  #### :hammer_and_wrench: Others
1064
1090
 
1065
1091
  - Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
1092
+ - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
1066
1093
  ### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
1067
1094
 
1068
1095
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
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",
@@ -108,9 +108,9 @@ const EEAHeader = (props) => {
108
108
  }
109
109
  }, [token, dispatch, pathname, previousToken]);
110
110
 
111
+ const download = subsite?.subsite_logo?.scales?.preview?.download;
111
112
  const subsiteLogo = subsite?.subsite_logo
112
- ? subsite.subsite_logo.scales?.preview?.download ||
113
- toPublicURL(`${subsite['@id']}/@@images/subsite_logo`)
113
+ ? download || toPublicURL(`${subsite['@id']}/@@images/subsite_logo`)
114
114
  : null;
115
115
 
116
116
  return (
@@ -233,11 +233,12 @@ const EEAHeader = (props) => {
233
233
  renderMenuItem={(item, options, props) => (
234
234
  <UniversalLink
235
235
  openLinkInNewTab={false}
236
- href={item.url || '/'}
236
+ href={item.nonclickable ? null : item.url || '/'}
237
237
  title={item.nav_title || item.title}
238
238
  {...(options || {})}
239
239
  className={cx(options?.className, {
240
240
  active: item.url === router_pathname,
241
+ 'item-nonclickable': item.nonclickable,
241
242
  })}
242
243
  >
243
244
  {props?.iconPosition !== 'right' && props?.children}
@@ -187,9 +187,10 @@ const FirstLevelContent = ({ element, renderMenuItem, pathName }) => {
187
187
  overflow_item.title = 'See all';
188
188
  x.content = (
189
189
  <Accordion.Content>
190
- {renderMenuItem(overflow_item, {
191
- className: 'item title-item',
192
- })}
190
+ {!item.nonclickable &&
191
+ renderMenuItem(overflow_item, {
192
+ className: 'item title-item',
193
+ })}
193
194
  <SecondLevelContent
194
195
  element={item}
195
196
  renderMenuItem={renderMenuItem}
@@ -0,0 +1 @@
1
+ customized the `getRecursiveItems` to pass the entire object to the navigation component
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Navigation reducer.
3
+ * @module reducers/navigation/navigation
4
+ */
5
+
6
+ import { map } from 'lodash';
7
+ import {
8
+ flattenToAppURL,
9
+ getBaseUrl,
10
+ hasApiExpander,
11
+ } from '@plone/volto/helpers';
12
+
13
+ import {
14
+ GET_CONTENT,
15
+ GET_NAVIGATION,
16
+ } from '@plone/volto/constants/ActionTypes';
17
+
18
+ const initialState = {
19
+ error: null,
20
+ items: [],
21
+ loaded: false,
22
+ loading: false,
23
+ };
24
+
25
+ /**
26
+ * Recursive function that process the items returned by the navigation
27
+ * endpoint
28
+ * @function getRecursiveItems
29
+ * @param {array} items The items inside a navigation response.
30
+ * @returns {*} The navigation items object (recursive)
31
+ */
32
+ function getRecursiveItems(items) {
33
+ return map(items, (item) => ({
34
+ title: item.title,
35
+ description: item.description,
36
+ url: flattenToAppURL(item['@id']),
37
+ ...item,
38
+ ...(item.items && { items: getRecursiveItems(item.items) }),
39
+ }));
40
+ }
41
+
42
+ /**
43
+ * Navigation reducer.
44
+ * @function navigation
45
+ * @param {Object} state Current state.
46
+ * @param {Object} action Action to be handled.
47
+ * @returns {Object} New state.
48
+ */
49
+ export default function navigation(state = initialState, action = {}) {
50
+ let hasExpander;
51
+ switch (action.type) {
52
+ case `${GET_NAVIGATION}_PENDING`:
53
+ return {
54
+ ...state,
55
+ error: null,
56
+ loaded: false,
57
+ loading: true,
58
+ };
59
+ case `${GET_CONTENT}_SUCCESS`:
60
+ hasExpander = hasApiExpander(
61
+ 'navigation',
62
+ getBaseUrl(flattenToAppURL(action.result['@id'])),
63
+ );
64
+ if (hasExpander && !action.subrequest) {
65
+ return {
66
+ ...state,
67
+ error: null,
68
+ items: getRecursiveItems(
69
+ action.result['@components'].navigation.items,
70
+ ),
71
+ loaded: true,
72
+ loading: false,
73
+ };
74
+ }
75
+ return state;
76
+ case `${GET_NAVIGATION}_SUCCESS`:
77
+ // Even if the expander is set or not, if the GET_NAVIGATION is
78
+ // called, we want it to store the data if the actions data is
79
+ // not set in the expander data (['@components']) but in the "normal"
80
+ // action result (we look for the object property returned by the endpoint)
81
+ if (!action.result?.['@components'] && action.result?.items) {
82
+ return {
83
+ ...state,
84
+ error: null,
85
+ items: getRecursiveItems(action.result.items),
86
+ loaded: true,
87
+ loading: false,
88
+ };
89
+ }
90
+ return state;
91
+ case `${GET_NAVIGATION}_FAIL`:
92
+ return {
93
+ ...state,
94
+ error: action.error,
95
+ items: [],
96
+ loaded: false,
97
+ loading: false,
98
+ };
99
+ default:
100
+ return state;
101
+ }
102
+ }
@@ -12,3 +12,8 @@
12
12
  }
13
13
  }
14
14
  }
15
+
16
+
17
+ .item-nonclickable {
18
+ pointer-events: none;
19
+ }