@eeacms/volto-clms-theme 1.1.27 → 1.1.28

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,13 @@ 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.27](https://github.com/eea/volto-clms-theme/compare/1.1.26...1.1.27) - 14 July 2023
7
+ ### [1.1.28](https://github.com/eea/volto-clms-theme/compare/1.1.27...1.1.28) - 14 July 2023
8
8
 
9
9
  #### :hammer_and_wrench: Others
10
10
 
11
- - bump dependency [Mikel Larreategi - [`2dea8b0`](https://github.com/eea/volto-clms-theme/commit/2dea8b0cebc6cbd954d4c3ed9bd111f306e5cc08)]
11
+ - add a new related items variation, using a direct query [Mikel Larreategi - [`708f32f`](https://github.com/eea/volto-clms-theme/commit/708f32fe10e75a159c10bda3401a406b7dab6d91)]
12
+ ### [1.1.27](https://github.com/eea/volto-clms-theme/compare/1.1.26...1.1.27) - 14 July 2023
13
+
12
14
  ### [1.1.26](https://github.com/eea/volto-clms-theme/compare/1.1.25...1.1.26) - 14 July 2023
13
15
 
14
16
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.27",
3
+ "version": "1.1.28",
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",
@@ -17,6 +17,8 @@ const CclRelatedListingView = (props) => {
17
17
  properties,
18
18
  metadata,
19
19
  associated_elements = 'products',
20
+ directQuery = {},
21
+ directRelation = false,
20
22
  searchParamsExecution = () => {},
21
23
  } = props;
22
24
  const use_pagination = useFilteredPagination(
@@ -34,10 +36,13 @@ const CclRelatedListingView = (props) => {
34
36
  (state) => state.search.subrequests?.[id],
35
37
  );
36
38
  const uid = metadata ? metadata['UID'] : properties['UID'];
37
- const associated =
38
- associated_elements === 'products'
39
- ? { associated_products: uid }
40
- : { associated_datasets: uid };
39
+
40
+ const associated = directRelation
41
+ ? directQuery
42
+ : associated_elements === 'products'
43
+ ? { associated_products: uid }
44
+ : { associated_datasets: uid };
45
+
41
46
  let libraries = searchSubrequests?.items || [];
42
47
  const variationsConfig =
43
48
  config.blocks.blocksConfig['relatedListing'].variations;
@@ -370,7 +370,11 @@ const DataSetInfoContent = (props) => {
370
370
  variation: 'CclCardsdoc',
371
371
  content_type: 'DataSet',
372
372
  }}
373
- associated_elements="dataset"
373
+ associated_elements="datasets"
374
+ directRelation={true}
375
+ directQuery={{
376
+ UID: props.datasets.map((item) => item.token),
377
+ }}
374
378
  searchParamsExecution={() => {
375
379
  const newIndex =
376
380
  activeIndex.indexOf(1) === -1