@eeacms/volto-clms-theme 1.1.21 → 1.1.23

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,18 @@ 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.21](https://github.com/eea/volto-clms-theme/compare/1.1.20...1.1.21) - 5 July 2023
7
+ ### [1.1.23](https://github.com/eea/volto-clms-theme/compare/1.1.22...1.1.23) - 12 July 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - show collections always [Mikel Larreategi - [`442d2d9`](https://github.com/eea/volto-clms-theme/commit/442d2d9eeb1bba511401b643b21a019b62580709)]
12
+ ### [1.1.22](https://github.com/eea/volto-clms-theme/compare/1.1.21...1.1.22) - 10 July 2023
8
13
 
9
14
  #### :hammer_and_wrench: Others
10
15
 
11
- - home products cards height control [ionlizarazu - [`b37d08b`](https://github.com/eea/volto-clms-theme/commit/b37d08bae7dff7f341e5a3c9f064837273f5b74d)]
16
+ - unneeded condition [ionlizarazu - [`da81a9c`](https://github.com/eea/volto-clms-theme/commit/da81a9c622d27b4e2706e1fd889e08070a5d3f25)]
17
+ ### [1.1.21](https://github.com/eea/volto-clms-theme/compare/1.1.20...1.1.21) - 5 July 2023
18
+
12
19
  ### [1.1.20](https://github.com/eea/volto-clms-theme/compare/1.1.19...1.1.20) - 5 July 2023
13
20
 
14
21
  #### :rocket: New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -45,10 +45,21 @@ const CclFAQBlockView = (props) => {
45
45
  )
46
46
  : [],
47
47
  );
48
- const [activeIndex, setActiveIndex] = useState([0]);
48
+ const [activeIndex, setActiveIndex] = useState([]);
49
49
  React.useEffect(() => {
50
50
  dispatch(getContextNavigation(path.replace('/edit', '')));
51
51
  }, [path, dispatch]);
52
+ React.useEffect(() => {
53
+ let indexes = [];
54
+ // eslint-disable-next-line no-unused-expressions
55
+ contextNavigation?.[cn_key]?.data?.items.forEach((i) => {
56
+ if (i.items.length > 0) {
57
+ indexes.push(i.items[0].normalized_id);
58
+ }
59
+ });
60
+ setActiveIndex(indexes);
61
+ // eslint-disable-next-line react-hooks/exhaustive-deps
62
+ }, [contextNavigation?.[cn_key]?.data?.items]);
52
63
 
53
64
  const titleIcons = config.blocks?.blocksConfig?.accordion?.titleIcons;
54
65
 
@@ -80,10 +91,12 @@ const CclFAQBlockView = (props) => {
80
91
  <Accordion fluid styled key={item_key}>
81
92
  <Accordion.Title
82
93
  as={'h2'}
83
- onClick={() => handleClick({ index: item_key })}
94
+ onClick={() =>
95
+ handleClick({ index: item.normalized_id })
96
+ }
84
97
  className={'accordion-title align-arrow-right'}
85
98
  >
86
- {activeIndex.includes(item_key) ? (
99
+ {activeIndex.includes(item.normalized_id) ? (
87
100
  <Icon name={titleIcons.opened.rightPosition} />
88
101
  ) : (
89
102
  <Icon name={titleIcons.closed.rightPosition} />
@@ -103,7 +116,7 @@ const CclFAQBlockView = (props) => {
103
116
  <span>{item.title}</span>
104
117
  </Accordion.Title>
105
118
  <Accordion.Content
106
- active={activeIndex.includes(item_key)}
119
+ active={activeIndex.includes(item.normalized_id)}
107
120
  >
108
121
  <AnimateHeight
109
122
  animateOpacity
@@ -222,7 +222,6 @@ const CLMSCartContent = (props) => {
222
222
  setCartItems([...cartItems]);
223
223
  };
224
224
 
225
- const hascollection = (collection) => collection.value > 0;
226
225
  const ref = React.useRef();
227
226
 
228
227
  const handleScroll = (ref) => {
@@ -313,11 +312,11 @@ const CLMSCartContent = (props) => {
313
312
  <div className="mb-2">
314
313
  <strong>Type: </strong>
315
314
  </div>
316
- {item?.type_options?.some(hascollection) && (
317
- <div className="mb-2">
318
- <strong>Collection: </strong>
319
- </div>
320
- )}
315
+
316
+ <div className="mb-2">
317
+ <strong>Collection: </strong>
318
+ </div>
319
+
321
320
  <div className="mb-2">
322
321
  <strong>Format: </strong>
323
322
  </div>
@@ -336,16 +335,16 @@ const CLMSCartContent = (props) => {
336
335
  setCartItems={setCartItems}
337
336
  />
338
337
  </div>
339
- {item?.type_options?.some(hascollection) && (
340
- <div className="mb-2">
341
- <CollectionNaming
342
- item={item}
343
- datasets_items={datasets_items}
344
- cartItems={cartItems}
345
- setCartItems={setCartItems}
346
- />
347
- </div>
348
- )}
338
+
339
+ <div className="mb-2">
340
+ <CollectionNaming
341
+ item={item}
342
+ datasets_items={datasets_items}
343
+ cartItems={cartItems}
344
+ setCartItems={setCartItems}
345
+ />
346
+ </div>
347
+
349
348
  <div className="mb-2">
350
349
  {formatConversionTable && item && (
351
350
  <FormatNaming