@eeacms/volto-clms-theme 1.1.128 → 1.1.129

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,8 @@ 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.129](https://github.com/eea/volto-clms-theme/compare/1.1.128...1.1.129) - 25 March 2024
8
+
7
9
  ### [1.1.128](https://github.com/eea/volto-clms-theme/compare/1.1.127...1.1.128) - 25 March 2024
8
10
 
9
11
  #### :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.128",
3
+ "version": "1.1.129",
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",
@@ -88,6 +88,7 @@ export const getCartObjectFromMapviewer = (
88
88
  dataset_data,
89
89
  projections,
90
90
  nutsnames,
91
+ cartRequestedItem,
91
92
  ) => {
92
93
  let area = local_cart_data.area;
93
94
  const file = local_cart_data.file;
@@ -109,15 +110,24 @@ export const getCartObjectFromMapviewer = (
109
110
 
110
111
  return {
111
112
  name: dataset_data.title || '-',
113
+ TemporalFilter: cartRequestedItem?.TemporalFilter || null,
112
114
  area: area || '-',
113
115
  file: file || '-',
114
- format: type_options.length > 0 ? type_options[0].full_format : null,
116
+ format: cartRequestedItem?.format
117
+ ? cartRequestedItem?.format
118
+ : type_options.length > 0
119
+ ? type_options[0].full_format
120
+ : null,
115
121
  original_format:
116
122
  type_options.length > 0 ? type_options[0].full_format : null,
117
123
  resolution: dataset_data.resolution || '-',
118
124
  size: dataset_data.size || '-',
119
125
  source: 'Data viewer',
120
- type: type_options.length > 0 ? type_options[0].id : null,
126
+ type: cartRequestedItem?.type
127
+ ? cartRequestedItem?.type
128
+ : type_options.length > 0
129
+ ? type_options[0].id
130
+ : null,
121
131
  type_options: type_options,
122
132
  version: dataset_data.version || '-',
123
133
  year: dataset_data.year || '-',
@@ -125,7 +135,10 @@ export const getCartObjectFromMapviewer = (
125
135
  unique_id: local_cart_data.unique_id,
126
136
  dataset_uid: dataset_data.UID,
127
137
  task_in_progress: false,
128
- projection: dataset_data.projection || projections[0],
138
+ projection:
139
+ cartRequestedItem?.projection ||
140
+ dataset_data.projection ||
141
+ projections[0],
129
142
  original_projection: dataset_data.original_projection || '',
130
143
  timeExtent: local_cart_data.timeExtent || [],
131
144
  layer:
@@ -150,10 +163,15 @@ export const duplicateCartItem = (
150
163
  unique_id: cartItems[itemIndex].unique_id + '-copy',
151
164
  },
152
165
  );
153
- delete new_item.TemporalFilter;
154
166
  while (cartItems.some((c_i) => c_i.unique_id === new_item?.unique_id)) {
155
167
  new_item['unique_id'] = new_item?.unique_id + '-copy';
156
168
  }
169
+ new_item['projection'] = null;
170
+ new_item['type'] = null;
171
+ new_item['format'] = null;
172
+ if (new_item['TemporalFilter']) {
173
+ new_item['TemporalFilter'] = null;
174
+ }
157
175
  cartItems.splice(itemIndex + 1, 0, new_item);
158
176
  refreshCart(cartItems, setCartItems, updateCart);
159
177
  }
@@ -198,6 +216,9 @@ export const concatRequestedCartItem = (
198
216
  const requestedItem = datasets_items
199
217
  ? datasets_items.find((req) => req.UID === localItem?.UID)
200
218
  : false;
219
+ const cartRequestedItem = cartItems
220
+ ? cartItems.find((req) => req.unique_id === localItem?.unique_id)
221
+ : false;
201
222
  const file_data = requestedItem?.downloadable_files?.items.find(
202
223
  (item) => item['@id'] === localItem?.file_id,
203
224
  );
@@ -209,6 +230,7 @@ export const concatRequestedCartItem = (
209
230
  requestedItem,
210
231
  projections,
211
232
  nutsnames,
233
+ cartRequestedItem,
212
234
  );
213
235
  }
214
236
  }),