@eeacms/volto-clms-theme 1.0.203 → 1.0.204

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,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.0.204](https://github.com/eea/volto-clms-theme/compare/1.0.203...1.0.204) - 17 May 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: clms-2139 band selection [Mikel Larreategi - [`8d1d099`](https://github.com/eea/volto-clms-theme/commit/8d1d09968e7648ab90ac1567552aaa5b0bb3c6f9)]
12
+ - feat: CLMS-2199 style fix for block chooser happening inside tabs block [Unai - [`49f303e`](https://github.com/eea/volto-clms-theme/commit/49f303efb523b0a3d7c592c02df365ce082a60be)]
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - refactor last commit so style is only applyed inside tabs block [Unai - [`df12af5`](https://github.com/eea/volto-clms-theme/commit/df12af543eb61e743a403a5a1b8fad0abb49ce61)]
7
17
  ### [1.0.203](https://github.com/eea/volto-clms-theme/compare/1.0.202...1.0.203) - 12 May 2023
8
18
 
9
19
  #### :rocket: New Features
@@ -1106,7 +1116,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1106
1116
  #### :hammer_and_wrench: Others
1107
1117
 
1108
1118
  - related products and datasets added to news and meeting views and login-plone route created [Unai - [`5704a1a`](https://github.com/eea/volto-clms-theme/commit/5704a1a766148746162b60efaf232ea90dc20cf4)]
1109
- - Revert "[JENKINS] Use eeacms/plone-backend and Volto alpha version- Refs #151967" [Mikel Larreategi - [`46eb694`](https://github.com/eea/volto-clms-theme/commit/46eb69415280a3c982405299135027ae4221426a)]
1110
1119
  - sort items according to the lowercased label and put those with special meaning at the end [Mikel Larreategi - [`6410abe`](https://github.com/eea/volto-clms-theme/commit/6410abe096f60dcad54dced2026c9df9b7946d68)]
1111
1120
  - lint fix [Unai - [`1264a7a`](https://github.com/eea/volto-clms-theme/commit/1264a7adfe8d679fea1bd821ad087add20f4271d)]
1112
1121
  - footer newsletter subscription change, global search maxLength change from 8000 to 200 and /login design change [Unai - [`a09d24a`](https://github.com/eea/volto-clms-theme/commit/a09d24adbb6fa053fb2a2cc0071506b906593b42)]
@@ -1257,7 +1266,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1257
1266
  - search block new features [ionlizarazu - [`8e814cb`](https://github.com/eea/volto-clms-theme/commit/8e814cbd359782540c21fe37b37ef146d331f0d6)]
1258
1267
  - language selector cookie management [ionlizarazu - [`1385ac9`](https://github.com/eea/volto-clms-theme/commit/1385ac95795702206d3623ba6e780faa43a89e0a)]
1259
1268
  - toolbar cookie management [ionlizarazu - [`5c23200`](https://github.com/eea/volto-clms-theme/commit/5c23200790b20e1d4f1bc966463c37bf4c808f47)]
1260
- - Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`0316a0d`](https://github.com/eea/volto-clms-theme/commit/0316a0d8b6fb0fa14af13002415f3c95d9f8ede3)]
1261
1269
  ### [1.0.84](https://github.com/eea/volto-clms-theme/compare/1.0.83...1.0.84) - 18 March 2022
1262
1270
 
1263
1271
  #### :hammer_and_wrench: Others
@@ -2162,13 +2170,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2162
2170
  #### :hammer_and_wrench: Others
2163
2171
 
2164
2172
  - replace @collective/volto-dropdownmenu with volto-dropdownmenu [ionlizarazu - [`07f004f`](https://github.com/eea/volto-clms-theme/commit/07f004fe0219e403fb51bc045c83d34f3b981f76)]
2165
- - yarn.lock [ionlizarazu - [`fe1ca04`](https://github.com/eea/volto-clms-theme/commit/fe1ca04889d29fe7b653db4c69af2751b84b8a1a)]
2166
2173
  - add NODE_ENV parameter [ionlizarazu - [`101f27c`](https://github.com/eea/volto-clms-theme/commit/101f27c25b8fbd192e1b11865e95cf5ffee08c1b)]
2167
2174
  - upgrade volto-dropdownmenu version [ionlizarazu - [`2081855`](https://github.com/eea/volto-clms-theme/commit/2081855301f4c708776e0dbab39db143cee00dbc)]
2168
2175
  - HomeSearch block missing url behaviour [ionlizarazu - [`d20a378`](https://github.com/eea/volto-clms-theme/commit/d20a378ce3f254b8343692348f314bf281974542)]
2169
2176
  - babel configuration [ionlizarazu - [`203ea2d`](https://github.com/eea/volto-clms-theme/commit/203ea2de07f99ca3403e4ca220ca74d7ce69b61d)]
2170
2177
  - prettier [ionlizarazu - [`e79e26b`](https://github.com/eea/volto-clms-theme/commit/e79e26bf2fa40ba7b4eb53a24dabd87928221c28)]
2171
- - add yarn lock [ionlizarazu - [`e1ab28b`](https://github.com/eea/volto-clms-theme/commit/e1ab28b060d5a74431c368b0de82a68dabce1eab)]
2172
2178
  - Jenkinsfile cypress test [ionlizarazu - [`b385d65`](https://github.com/eea/volto-clms-theme/commit/b385d65986f717c60f8c434a08fc11b829d08eb4)]
2173
2179
  - cypress [ionlizarazu - [`a243cf0`](https://github.com/eea/volto-clms-theme/commit/a243cf0182fa3dd113c16ff495c71e310252d83b)]
2174
2180
  - some fixes [ionlizarazu - [`046279b`](https://github.com/eea/volto-clms-theme/commit/046279b9d05bea8a64eca03eed493e02621534c9)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.0.203",
3
+ "version": "1.0.204",
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",
@@ -141,13 +141,22 @@ const CLMSCartContent = (props) => {
141
141
  <Toast
142
142
  success
143
143
  autoClose={5000}
144
- title={'Selected file(s) added to the downloading process.'}
144
+ title={'Downloading process started'}
145
+ content={'Selected file(s) added to the downloading process.'}
145
146
  />,
146
147
  );
147
148
  })
148
149
  .catch(function (error) {
149
150
  setLoadingTable(false);
150
- toast.error(<Toast autoClose={5000} title={'Something went wrong.'} />);
151
+ toast.error(
152
+ <Toast
153
+ autoClose={5000}
154
+ title={'Something went wrong.'}
155
+ error={
156
+ 'There was an error when requesting the download, please try again.'
157
+ }
158
+ />,
159
+ );
151
160
  });
152
161
  };
153
162
 
@@ -189,12 +198,12 @@ const CLMSCartContent = (props) => {
189
198
  <>
190
199
  <span>Bounding Box</span>
191
200
  <br />
192
- <span class="cart-bounding-boxes">
193
- <span class="cart-bounding-box-row">
201
+ <span className="cart-bounding-boxes">
202
+ <span className="cart-bounding-box-row">
194
203
  <span>{`N: ${item.area.value[0].toFixed(1)}º `}</span>&nbsp;
195
204
  <span>{`E: ${item.area.value[1].toFixed(1)}º `}</span>
196
205
  </span>
197
- <span class="cart-bounding-box-row">
206
+ <span className="cart-bounding-box-row">
198
207
  <span>{`S: ${item.area.value[2].toFixed(1)}º `}</span>&nbsp;
199
208
  <span>{`W: ${item.area.value[3].toFixed(1)}º `}</span>
200
209
  </span>
@@ -343,6 +352,53 @@ const CLMSCartContent = (props) => {
343
352
  );
344
353
  };
345
354
 
355
+ const LayerNaming = ({ item }) => {
356
+ if (item.file_id) {
357
+ return '-';
358
+ } else if (!item.type) {
359
+ return '-';
360
+ }
361
+
362
+ const this_type_layers = item?.type_options.filter(
363
+ (o) =>
364
+ o.collection ===
365
+ item?.type_options.find((t_o) => t_o.id === item.type).collection,
366
+ );
367
+
368
+ return this_type_layers.length > 0 &&
369
+ this_type_layers[0].layers.length > 0 ? (
370
+ <Select
371
+ placeholder="Select layer"
372
+ value={
373
+ item.layer
374
+ ? item.layer
375
+ : this_type_layers[0].layers.length > 0 &&
376
+ this_type_layers[0].layers[0]
377
+ }
378
+ options={
379
+ this_type_layers[0]?.layers.length > 0 &&
380
+ this_type_layers[0].layers.map((option) => {
381
+ return {
382
+ key: option,
383
+ value: option,
384
+ text: option,
385
+ };
386
+ })
387
+ }
388
+ onChange={(e, data) => {
389
+ const new_cartItems = [...cartItems];
390
+ const objIndex = new_cartItems.findIndex(
391
+ (obj) => obj.unique_id === item.unique_id,
392
+ );
393
+ new_cartItems[objIndex].layer = data.value;
394
+ setCartItems([...new_cartItems]);
395
+ }}
396
+ />
397
+ ) : (
398
+ '-'
399
+ );
400
+ };
401
+
346
402
  const contentOrDash = (content) => {
347
403
  return content || '-';
348
404
  };
@@ -373,6 +429,7 @@ const CLMSCartContent = (props) => {
373
429
  <th>Type</th>
374
430
  <th>Collection</th>
375
431
  <th>Format</th>
432
+ <th>Layer/Band</th>
376
433
  <th>Projection</th>
377
434
  <th></th>
378
435
  <th></th>
@@ -440,6 +497,9 @@ const CLMSCartContent = (props) => {
440
497
  />
441
498
  )}
442
499
  </td>
500
+ <td className="table-td-format">
501
+ <LayerNaming item={item} />
502
+ </td>
443
503
  <td className="table-td-projections">
444
504
  {!item.file_id ? (
445
505
  <Select
@@ -491,7 +551,7 @@ const CLMSCartContent = (props) => {
491
551
  outline: 'inherit',
492
552
  }}
493
553
  >
494
- <Icon name={addDocumentSVG} size={25} />
554
+ <Icon name={addDocumentSVG} size={'41'} />
495
555
  </button>
496
556
  </span>
497
557
  ) : (
@@ -523,7 +583,7 @@ const CLMSCartContent = (props) => {
523
583
  >
524
584
  <Icon
525
585
  name={removeSVG}
526
- size={25}
586
+ size={'45'}
527
587
  color="#e40166"
528
588
  />
529
589
  </button>
@@ -20,6 +20,7 @@ export const getCollectionByItem = (item) => {
20
20
  export const getDownloadToolPostBody = (selectedItems) => {
21
21
  const datasetList = selectedItems.map((item) => {
22
22
  let body_extras = {};
23
+
23
24
  if (item.file_id) {
24
25
  body_extras['FileID'] = item.file_id;
25
26
  } else {
@@ -44,6 +45,9 @@ export const getDownloadToolPostBody = (selectedItems) => {
44
45
  if (item.type) {
45
46
  body_extras['DatasetDownloadInformationID'] = item.type;
46
47
  }
48
+ if (item.layer) {
49
+ body_extras['Layer'] = item.layer;
50
+ }
47
51
  }
48
52
  return { DatasetID: item.dataset_uid, ...body_extras };
49
53
  });
@@ -92,9 +96,11 @@ export const getCartObjectFromMapviewer = (
92
96
  name: item.name,
93
97
  full_format: item.full_format,
94
98
  collection: item.collection,
99
+ layers: item?.layers || [],
95
100
  });
96
101
  });
97
102
  }
103
+
98
104
  return {
99
105
  name: dataset_data.title || '-',
100
106
  area: area || '-',
@@ -49,6 +49,13 @@ const ItemSchema = () => ({
49
49
  description: '',
50
50
  type: 'string',
51
51
  },
52
+ layers: {
53
+ title: 'Layers / Bands',
54
+ description:
55
+ 'Some datasets provide options to download specific layers. Write here the layer names, one per line',
56
+ type: 'string',
57
+ widget: 'token',
58
+ },
52
59
  },
53
60
  fieldsets: [
54
61
  {
@@ -61,6 +68,7 @@ const ItemSchema = () => ({
61
68
  'full_format',
62
69
  'full_source',
63
70
  'wekeo_choices',
71
+ 'layers',
64
72
  ],
65
73
  },
66
74
  ],
@@ -389,3 +389,11 @@ body:not(.is-authenticated):not(.document_wide_view).stretch {
389
389
  margin: 0 -1.3vw;
390
390
  }
391
391
  }
392
+
393
+ .tabs-block {
394
+ .blocks-chooser {
395
+ right: 0;
396
+ left: auto !important;
397
+ margin-top: 50px;
398
+ }
399
+ }