@eeacms/volto-clms-theme 1.0.80 → 1.0.83

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,8 +4,65 @@ 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.83](https://github.com/eea/volto-clms-theme/compare/1.0.82...1.0.83)
8
+
9
+ - new widget to edit the component controlpanel [`#237`](https://github.com/eea/volto-clms-theme/pull/237)
10
+ - use volto-react-table widget [`#238`](https://github.com/eea/volto-clms-theme/pull/238)
11
+ - Bugs n improvements [`#235`](https://github.com/eea/volto-clms-theme/pull/235)
12
+ - Develop [`#234`](https://github.com/eea/volto-clms-theme/pull/234)
13
+ - remove duplicated [`0739aef`](https://github.com/eea/volto-clms-theme/commit/0739aef163cac91233a936c49f488fbc9daec5be)
14
+ - add volto-react-table-widget [`f4b1e99`](https://github.com/eea/volto-clms-theme/commit/f4b1e998e38f31a63b475760d0bf2157451f9af4)
15
+ - fix packages.json [`44848a0`](https://github.com/eea/volto-clms-theme/commit/44848a0e07a0a960dc17ee6d0c08febac320688d)
16
+ - remove unneeded code [`e37e121`](https://github.com/eea/volto-clms-theme/commit/e37e121ca910b4fbaf2f9da80393fc577a6923c7)
17
+ - adjust dependnecies [`a7f67fe`](https://github.com/eea/volto-clms-theme/commit/a7f67fec4c56d09b038ce052e88b04a601da6db3)
18
+ - adjust import [`66bb59a`](https://github.com/eea/volto-clms-theme/commit/66bb59a22a1b623bc6dcf13996c98572b14526db)
19
+ - add VOLTO version to addon tests execution [`a94a491`](https://github.com/eea/volto-clms-theme/commit/a94a4918413aa5a2a75eea14ab837338d24d2e32)
20
+ - fix cart type selector [`47046b0`](https://github.com/eea/volto-clms-theme/commit/47046b0ba02400c572aee981cc52ad481d560b77)
21
+ - reorder cart modal buttons and remove duplicates of dataset titles from modal [`03171f2`](https://github.com/eea/volto-clms-theme/commit/03171f2e7b85878d1fac186130af2dc8a8813937)
22
+ - ESLint fix [`6e4faad`](https://github.com/eea/volto-clms-theme/commit/6e4faad26bbf412a691e827333541e6e8d302590)
23
+ - use ReactTableWidget [`18d8777`](https://github.com/eea/volto-clms-theme/commit/18d8777cc134a6d13ed0ab1324d38c2edc5f5426)
24
+ - Modal homogenization [`33d41b5`](https://github.com/eea/volto-clms-theme/commit/33d41b5d90094addf6d3e4301225727e801c45b5)
25
+ - use datset title instead of dataResourceTitle [`4a9dc98`](https://github.com/eea/volto-clms-theme/commit/4a9dc98c965d96d1d796a81b94ccf5c0283309d7)
26
+ - get header from schema [`8851314`](https://github.com/eea/volto-clms-theme/commit/8851314f92b1798428790dc4db02fd7688fbc5af)
27
+ - use onBlur [`bdfcc7e`](https://github.com/eea/volto-clms-theme/commit/bdfcc7ecc28c48d0c84261166b824ac20e746d4f)
28
+ - implement search and filtering [`8b748eb`](https://github.com/eea/volto-clms-theme/commit/8b748ebc17a3edbbf1e6b2d24df016f8bb86a333)
29
+ - use react-papaparse to import/export CSV files [`d07fe9d`](https://github.com/eea/volto-clms-theme/commit/d07fe9d17ef963b839bb98b22a008921b83f9f3d)
30
+ - add CSV export [`8bd1ea5`](https://github.com/eea/volto-clms-theme/commit/8bd1ea5451e2b2e8ce8ea1521a13acc1bfcfc7bb)
31
+ - modify the data in the props so Volto keeps its value [`6d5b19a`](https://github.com/eea/volto-clms-theme/commit/6d5b19a081a2487d2680696ba7c993ef8f3bd50e)
32
+ - remove styles [`c677afe`](https://github.com/eea/volto-clms-theme/commit/c677afe47ec10b0274311252941639d1ab3d326b)
33
+ - initial demo using react-table to edit downloadable files. right now without edit functionality [`dafa015`](https://github.com/eea/volto-clms-theme/commit/dafa015e43272101c141456200c75a4c0d65d3dc)
34
+
35
+ #### [1.0.82](https://github.com/eea/volto-clms-theme/compare/1.0.81...1.0.82)
36
+
37
+ > 11 March 2022
38
+
39
+ - Develop [`#233`](https://github.com/eea/volto-clms-theme/pull/233)
40
+ - add new field in prepackaged downloadable files [`#232`](https://github.com/eea/volto-clms-theme/pull/232)
41
+
42
+ #### [1.0.81](https://github.com/eea/volto-clms-theme/compare/1.0.80...1.0.81)
43
+
44
+ > 10 March 2022
45
+
46
+ - Develop [`#231`](https://github.com/eea/volto-clms-theme/pull/231)
47
+ - new status [`#230`](https://github.com/eea/volto-clms-theme/pull/230)
48
+ - Dataset extra formats [`#229`](https://github.com/eea/volto-clms-theme/pull/229)
49
+ - Prepackaged table columns [`#228`](https://github.com/eea/volto-clms-theme/pull/228)
50
+ - fix tests [`326f571`](https://github.com/eea/volto-clms-theme/commit/326f57114023154467af0357f56aa35feb21f66a)
51
+ - add new values to initial state [`2c2bff9`](https://github.com/eea/volto-clms-theme/commit/2c2bff92440565e9f5fe8ccb173a5f8f73ccc175)
52
+ - fix [`f91ae0b`](https://github.com/eea/volto-clms-theme/commit/f91ae0b9b4c041c865fde9cad1462c9d770454ee)
53
+ - tests [`2f6d48e`](https://github.com/eea/volto-clms-theme/commit/2f6d48ed551df5b1620b69f440d6c802216ab38b)
54
+ - Cart modifications for extra formats [`7406959`](https://github.com/eea/volto-clms-theme/commit/74069598e41d40ccfb411a166040be151829c970)
55
+ - new widget for extra formats [`0b8ed19`](https://github.com/eea/volto-clms-theme/commit/0b8ed19faba3bbe24fdb1ad9b29685d2ac7dc101)
56
+ - remove some fields [`fad800e`](https://github.com/eea/volto-clms-theme/commit/fad800e836686c847e5afbdfa8fc4c4729a9e8ff)
57
+ - conditioned columns [`e0c1126`](https://github.com/eea/volto-clms-theme/commit/e0c1126ce17359037d7e1ac8b7132006a242845f)
58
+ - widget modification [`17e991c`](https://github.com/eea/volto-clms-theme/commit/17e991ceed4b832fe8dc7292c20b8c6c33f2da1f)
59
+ - prepackaged cart modifications [`f9c72f0`](https://github.com/eea/volto-clms-theme/commit/f9c72f0b0893baaf6985cce4bfe623e1cb29e8af)
60
+
7
61
  #### [1.0.80](https://github.com/eea/volto-clms-theme/compare/1.0.79...1.0.80)
8
62
 
63
+ > 7 March 2022
64
+
65
+ - New release [`#227`](https://github.com/eea/volto-clms-theme/pull/227)
9
66
  - Card image border [`#226`](https://github.com/eea/volto-clms-theme/pull/226)
10
67
  - pre-download modal [`d91209f`](https://github.com/eea/volto-clms-theme/commit/d91209f1b01f47217eb7ca330f5bfdcae0d10c74)
11
68
  - hide text when not logged in [`c4b88e5`](https://github.com/eea/volto-clms-theme/commit/c4b88e5d4960d5b3d752d9d8852bfe1bb0911bca)
package/Jenkinsfile CHANGED
@@ -6,6 +6,7 @@ pipeline {
6
6
  NAMESPACE = "@eeacms"
7
7
  SONARQUBE_TAGS = "clms.land.copernicus.eu,volto.eea.europa.eu"
8
8
  DEPENDENCIES = ""
9
+ VOLTO = "14.10.0"
9
10
  }
10
11
 
11
12
  stages {
@@ -77,7 +78,7 @@ pipeline {
77
78
  script {
78
79
  try {
79
80
  sh '''docker pull plone/volto-addon-ci'''
80
- sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci'''
81
+ sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e VOLTO=$VOLTO -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci'''
81
82
  sh '''rm -rf xunit-reports'''
82
83
  sh '''mkdir -p xunit-reports'''
83
84
  sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/'''
@@ -125,7 +126,7 @@ pipeline {
125
126
  script {
126
127
  try {
127
128
  sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
128
- sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=test plone/volto-addon-ci cypress'''
129
+ sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e VOLTO=$VOLTO -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=test plone/volto-addon-ci cypress'''
129
130
  } finally {
130
131
  try {
131
132
  sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.0.80",
3
+ "version": "1.0.83",
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",
@@ -26,6 +26,7 @@
26
26
  "@eeacms/volto-resize-helper",
27
27
  "@eeacms/volto-tabs-block",
28
28
  "@eeacms/volto-clms-utils",
29
+ "@eeacms/volto-react-table-widget",
29
30
  "volto-form-block",
30
31
  "@eeacms/volto-taxonomy"
31
32
  ],
@@ -35,6 +36,7 @@
35
36
  "@eeacms/volto-clms-utils": "0.1.6",
36
37
  "@eeacms/volto-columns-block": "4.4.3",
37
38
  "@eeacms/volto-metadata-block": "^2.1.0",
39
+ "@eeacms/volto-react-table-widget": "0.1.1",
38
40
  "@eeacms/volto-resize-helper": "0.2.1",
39
41
  "@eeacms/volto-tabs-block": "1.2.7",
40
42
  "@eeacms/volto-taxonomy": "^1.0.0",
@@ -4,7 +4,7 @@
4
4
  * @module components/CLMSDownloadCartView/CLMSCartContent
5
5
  */
6
6
 
7
- import { Checkbox, Grid, Modal, Segment, Select } from 'semantic-ui-react';
7
+ import { Checkbox, Modal, Segment, Select } from 'semantic-ui-react';
8
8
  import React, { useEffect, useState } from 'react';
9
9
  import {
10
10
  getCartObjectFromMapviewer,
@@ -199,13 +199,49 @@ const CLMSCartContent = (props) => {
199
199
 
200
200
  const AreaNaming = (areaProps) => {
201
201
  const { item } = areaProps;
202
- function nutsName(nItem) {
203
- return nItem.area?.type === 'nuts'
204
- ? 'NUTS: ' + (nItem.area.valueName || nItem.area.value)
205
- : '-';
202
+ switch (item.area?.type) {
203
+ case 'polygon':
204
+ return 'Bounding Box';
205
+ case 'nuts':
206
+ return 'NUTS: ' + (item.area.valueName || item.area.value);
207
+ case undefined:
208
+ return item.area || '-';
209
+ default:
210
+ return '-';
206
211
  }
212
+ };
213
+
214
+ const TypeNaming = (typeProps) => {
215
+ const { item } = typeProps;
216
+ if (item.file_id) {
217
+ return (
218
+ <span className={'tag tag-' + item?.type?.toLowerCase()}>
219
+ {contentOrDash(item.type)}
220
+ </span>
221
+ );
222
+ } else if (!item.type) {
223
+ return '-';
224
+ }
225
+
207
226
  return (
208
- <>{item.area?.type === 'polygon' ? 'Bounding Box' : nutsName(item)}</>
227
+ <Select
228
+ placeholder="Select type"
229
+ value={
230
+ item.type
231
+ ? item.type
232
+ : item.type_options.length > 0 && item.type_options[0].id
233
+ }
234
+ options={item.type_options.map((option) => {
235
+ return { key: option.id, value: option.id, text: option.name };
236
+ })}
237
+ onChange={(e, data) => {
238
+ const objIndex = cartItems.findIndex(
239
+ (obj) => obj.unique_id === item.unique_id,
240
+ );
241
+ cartItems[objIndex].type = data.value;
242
+ setCartItems([...cartItems]);
243
+ }}
244
+ />
209
245
  );
210
246
  };
211
247
 
@@ -243,8 +279,6 @@ const CLMSCartContent = (props) => {
243
279
  <th>Type</th>
244
280
  <th>Format</th>
245
281
  <th>Projection</th>
246
- <th>Version</th>
247
- <th>Size</th>
248
282
  <th></th>
249
283
  </tr>
250
284
  </thead>
@@ -285,17 +319,19 @@ const CLMSCartContent = (props) => {
285
319
  </div>
286
320
  </div>
287
321
  </td>
288
- <td>{contentOrDash(item.name)}</td>
322
+ {item.title ? (
323
+ <td>
324
+ {item.title} ({contentOrDash(item.name)})
325
+ </td>
326
+ ) : (
327
+ <td>{contentOrDash(item.name)}</td>
328
+ )}
289
329
  <td>{contentOrDash(item.source)}</td>
290
330
  <td>
291
331
  <AreaNaming item={item} />
292
332
  </td>
293
333
  <td>
294
- <span
295
- className={'tag tag-' + item?.type?.toLowerCase()}
296
- >
297
- {contentOrDash(item.type)}
298
- </span>
334
+ <TypeNaming item={item} />
299
335
  </td>
300
336
  <td className="table-td-format">
301
337
  {!item.file_id ? (
@@ -335,11 +371,9 @@ const CLMSCartContent = (props) => {
335
371
  }}
336
372
  />
337
373
  ) : (
338
- item.projection
374
+ '-'
339
375
  )}
340
376
  </td>
341
- <td>{item.version}</td>
342
- <td>{item.size}</td>
343
377
  <td>
344
378
  {item.task_in_progress ? (
345
379
  <FontAwesomeIcon icon="spinner" spin />
@@ -406,36 +440,32 @@ const CLMSCartContent = (props) => {
406
440
  <br />
407
441
  <strong>Map viewer selection:</strong>
408
442
  <ul>
409
- {getSelectedCartItems()
410
- .filter((item) => item.area)
411
- .map((item, key) => (
412
- <li key={key}>{item.name}</li>
413
- ))}
443
+ {[
444
+ ...new Set(
445
+ getSelectedCartItems()
446
+ .filter((item) => !item.file_id)
447
+ .map((item) => item.name),
448
+ ),
449
+ ].map((item, key) => (
450
+ <li key={key}>{item}</li>
451
+ ))}
414
452
  </ul>
415
453
  </div>
416
454
  </div>
417
455
  </Modal.Content>
418
456
  <Modal.Actions>
419
- <Grid columns={2} stackable textAlign="center">
420
- <Grid.Row verticalAlign="middle">
421
- <Grid.Column>
422
- <CclButton
423
- mode={'filled'}
424
- onClick={() => {
425
- setOpenedModal(false);
426
- startDownloading();
427
- }}
428
- >
429
- Accept
430
- </CclButton>
431
- </Grid.Column>
432
- <Grid.Column>
433
- <CclButton onClick={() => setOpenedModal(false)}>
434
- Cancel
435
- </CclButton>
436
- </Grid.Column>
437
- </Grid.Row>
438
- </Grid>
457
+ <div className="modal-buttons">
458
+ <CclButton
459
+ mode={'filled'}
460
+ onClick={() => {
461
+ setOpenedModal(false);
462
+ startDownloading();
463
+ }}
464
+ >
465
+ Accept
466
+ </CclButton>
467
+ <CclButton onClick={() => setOpenedModal(false)}>Cancel</CclButton>
468
+ </div>
439
469
  </Modal.Actions>
440
470
  </Modal>
441
471
  </>
@@ -19,9 +19,12 @@ export const getDownloadToolPostBody = (selectedItems) => {
19
19
  if (item.format) {
20
20
  body_extras['OutputFormat'] = item.format;
21
21
  }
22
- if (item.format) {
22
+ if (item.projection) {
23
23
  body_extras['OutputGCS'] = item.projection;
24
24
  }
25
+ if (item.type) {
26
+ body_extras['DatasetDownloadInformationID'] = item.type;
27
+ }
25
28
  }
26
29
  return { DatasetID: item.dataset_uid, ...body_extras };
27
30
  });
@@ -33,6 +36,7 @@ export const getDownloadToolPostBody = (selectedItems) => {
33
36
  export const getCartObjectFromPrepackaged = (file_data, dataset_data) => {
34
37
  return {
35
38
  name: dataset_data.title,
39
+ title: file_data.title,
36
40
  area: file_data.area,
37
41
  format: file_data.format?.token || file_data.format,
38
42
  resolution: file_data.resolution,
@@ -59,8 +63,14 @@ export const getCartObjectFromMapviewer = (
59
63
  if (area?.type === 'nuts' && Object.keys(nutsnames).includes(area.value)) {
60
64
  area.valueName = nutsnames[area.value];
61
65
  }
66
+ const type_options = [];
67
+ if (dataset_data.dataset_download_information?.items.length > 0) {
68
+ dataset_data.dataset_download_information.items.forEach((item) => {
69
+ type_options.push({ id: item['@id'], name: item.name });
70
+ });
71
+ }
62
72
  return {
63
- name: dataset_data.dataResourceTitle || '-',
73
+ name: dataset_data.title || '-',
64
74
  area: area || '-',
65
75
  format:
66
76
  dataset_data.dataset_full_format?.token ||
@@ -69,7 +79,8 @@ export const getCartObjectFromMapviewer = (
69
79
  resolution: dataset_data.resolution || '-',
70
80
  size: dataset_data.size || '-',
71
81
  source: 'Map viewer',
72
- type: dataset_data.dataResourceType || '-',
82
+ type: type_options.length > 0 ? type_options[0].id : null,
83
+ type_options: type_options,
73
84
  version: dataset_data.version || '-',
74
85
  year: dataset_data.year || '-',
75
86
  id: local_cart_data.id,
@@ -13,13 +13,14 @@ import { Grid } from 'semantic-ui-react';
13
13
 
14
14
  const CLMSDownloadTasks = (props) => {
15
15
  const dispatch = useDispatch();
16
+ const [queued, setQueued] = useState([]);
16
17
  const [taskInProgress, setTaskInProgress] = useState([]);
17
18
  const [finishedOKTasks, setFinishedOKTasks] = useState([]);
18
19
  const [finishedNOKTasks, setFinishedNOKTasks] = useState([]);
19
20
  const [rejectedTasks, setRejectedTasks] = useState([]);
21
+ const [cancelled, setCancelled] = useState([]);
20
22
  const [showDeleteTaskLoading, setShowDeleteTaskLoading] = useState(false);
21
23
  const downloadtool = useSelector((state) => state.downloadtool);
22
-
23
24
  const user_id = useSelector((state) => state.users.user.id);
24
25
  const datasets = useSelector((state) => state.datasetsByUid.datasets.items);
25
26
  const nutsnames = useSelector((state) => state.nutsnames.nutsnames);
@@ -29,28 +30,34 @@ const CLMSDownloadTasks = (props) => {
29
30
  }, [dispatch]);
30
31
 
31
32
  useEffect(() => {
33
+ setQueued(downloadtool.download_queued);
32
34
  setTaskInProgress(downloadtool.download_in_progress);
33
35
  setFinishedOKTasks(downloadtool.download_finished_ok);
34
36
  setFinishedNOKTasks(downloadtool.download_finished_nok);
35
37
  setRejectedTasks(downloadtool.download_rejected);
38
+ setCancelled(downloadtool.download_cancelled);
36
39
  }, [downloadtool]);
37
40
 
38
41
  useEffect(() => {
39
42
  if (datasets?.length > 0) {
43
+ addDatasetName(queued, setQueued);
40
44
  addDatasetName(taskInProgress, setTaskInProgress);
41
45
  addDatasetName(finishedOKTasks, setFinishedOKTasks);
42
46
  addDatasetName(finishedNOKTasks, setFinishedNOKTasks);
43
47
  addDatasetName(rejectedTasks, setRejectedTasks);
48
+ addDatasetName(cancelled, setCancelled);
44
49
  }
45
50
  // eslint-disable-next-line react-hooks/exhaustive-deps
46
51
  }, [datasets]);
47
52
 
48
53
  useEffect(() => {
49
54
  if (Object.keys(nutsnames).length > 0) {
55
+ addNutsName(queued, setQueued);
50
56
  addNutsName(taskInProgress, setTaskInProgress);
51
57
  addNutsName(finishedOKTasks, setFinishedOKTasks);
52
58
  addNutsName(finishedNOKTasks, setFinishedNOKTasks);
53
59
  addNutsName(rejectedTasks, setRejectedTasks);
60
+ addNutsName(cancelled, setCancelled);
54
61
  }
55
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
56
63
  }, [nutsnames]);
@@ -111,6 +118,25 @@ const CLMSDownloadTasks = (props) => {
111
118
  };
112
119
  return (
113
120
  <Grid columns={1} stackable padded="vertically">
121
+ <Grid.Column>
122
+ <h2>
123
+ <FormattedMessage id="queued" defaultMessage="Queued" />
124
+ </h2>
125
+ {queued?.length !== 0 ? (
126
+ <MapTasks
127
+ tasks={queued}
128
+ showDel={showDeleteTaskLoading}
129
+ delTask={deleteTaskInProgress}
130
+ />
131
+ ) : (
132
+ <p>
133
+ <FormattedMessage
134
+ id="There are no tasks queued"
135
+ defaultMessage="There are no tasks queued"
136
+ />
137
+ </p>
138
+ )}
139
+ </Grid.Column>
114
140
  <Grid.Column>
115
141
  <h2>
116
142
  <FormattedMessage id="In progress" defaultMessage="In progress" />
@@ -190,6 +216,21 @@ const CLMSDownloadTasks = (props) => {
190
216
  </p>
191
217
  )}
192
218
  </Grid.Column>
219
+ <Grid.Column>
220
+ <h2>
221
+ <FormattedMessage id="Cancelled" defaultMessage="Cancelled" />
222
+ </h2>
223
+ {cancelled?.length !== 0 ? (
224
+ <MapTasks tasks={cancelled} showDel={showDeleteTaskLoading} />
225
+ ) : (
226
+ <p>
227
+ <FormattedMessage
228
+ id="There are no cancelled tasks"
229
+ defaultMessage="There are no cancelled tasks"
230
+ />
231
+ </p>
232
+ )}
233
+ </Grid.Column>
193
234
  </Grid>
194
235
  );
195
236
  };
@@ -71,22 +71,30 @@ const CLMSDownloadsView = (props) => {
71
71
 
72
72
  useEffect(() => {
73
73
  if (
74
+ downloadtool?.download_queued &&
74
75
  downloadtool?.download_in_progress &&
75
76
  downloadtool?.download_finished_ok &&
76
77
  downloadtool?.download_finished_nok &&
77
- downloadtool?.download_rejected
78
+ downloadtool?.download_rejected &&
79
+ downloadtool?.download_cancelled
78
80
  ) {
81
+ let queuedUidsList = getUIDList(downloadtool.download_queued);
79
82
  let downloadInProgressUidsList = getUIDList(
80
83
  downloadtool?.download_in_progress,
81
84
  );
82
85
  let finishedOKUidsList = getUIDList(downloadtool?.download_finished_ok);
83
86
  let finishedNOKUidsList = getUIDList(downloadtool?.download_finished_nok);
84
87
  let rejectedUidsList = getUIDList(downloadtool?.download_rejected);
88
+ let cancelledUidsList = getUIDList(downloadtool?.download_cancelled);
85
89
  let uidsList = [
86
90
  ...new Set(
87
91
  rejectedUidsList.concat(
88
92
  finishedNOKUidsList.concat(
89
- finishedOKUidsList.concat(downloadInProgressUidsList),
93
+ finishedOKUidsList.concat(
94
+ downloadInProgressUidsList.concat(
95
+ queuedUidsList.concat(cancelledUidsList),
96
+ ),
97
+ ),
90
98
  ),
91
99
  ),
92
100
  ),
@@ -64,15 +64,15 @@ const FileCard = (props) => {
64
64
  <Grid
65
65
  divided
66
66
  centered
67
- columns={item?.Status !== 'In_progress' ? 2 : 3}
67
+ columns={['In_progress', 'Queued'].includes(item?.Status) ? 2 : 3}
68
68
  padded
69
69
  className="filecard"
70
70
  >
71
71
  <Grid.Row>
72
72
  <Grid.Column verticalAlign="middle" textAlign="center" width={2}>
73
- {item?.Status === 'In_progress' && (
73
+ {['In_progress', 'Queued'].includes(item?.Status) && (
74
74
  <Popup
75
- content="In progress"
75
+ content="Preparing download files"
76
76
  size="small"
77
77
  trigger={<Loader active inline indeterminate size="medium" />}
78
78
  />
@@ -120,7 +120,9 @@ const FileCard = (props) => {
120
120
  />
121
121
  )}
122
122
  </Grid.Column>
123
- <Grid.Column width={item?.Status === 'In_progress' ? 8 : 10}>
123
+ <Grid.Column
124
+ width={['In_progress', 'Queued'].includes(item?.Status) ? 8 : 10}
125
+ >
124
126
  <Header as="h3">{`Task ID: ${item?.TaskID}`}</Header>
125
127
  <Segment basic className="file-datetimes">
126
128
  Start date:{' '}
@@ -176,7 +178,7 @@ const FileCard = (props) => {
176
178
  </Segment>
177
179
  )}
178
180
  </Grid.Column>
179
- {item?.Status === 'In_progress' && (
181
+ {['In_progress', 'Queued'].includes(item?.Status) && (
180
182
  <Grid.Column
181
183
  width={2}
182
184
  verticalAlign="middle"
@@ -193,7 +195,7 @@ const FileCard = (props) => {
193
195
  />
194
196
  ) : (
195
197
  <Popup
196
- content="Remove in progress task"
198
+ content="Remove task"
197
199
  size="small"
198
200
  trigger={
199
201
  <button
@@ -214,7 +216,7 @@ const FileCard = (props) => {
214
216
  name={removeSVG}
215
217
  size={30}
216
218
  color="#e40166"
217
- title={'Remove in progress task'}
219
+ title={'Remove task'}
218
220
  />
219
221
  </button>
220
222
  }
@@ -128,6 +128,7 @@ function CclDownloadTable(props) {
128
128
  .map((item) => ({
129
129
  UID: item.UID,
130
130
  file_id: item['@id'],
131
+ area: item.area,
131
132
  unique_id: item.unique_id,
132
133
  }));
133
134
  addCartItem(selectedCartItems);
@@ -151,6 +152,27 @@ function CclDownloadTable(props) {
151
152
  );
152
153
  };
153
154
 
155
+ const contentOrDash = (content) => {
156
+ return content || '-';
157
+ };
158
+
159
+ const hasSome = (field) => {
160
+ return prePackagedCollection.filter((ppItem) => ppItem[field]).length > 0
161
+ ? field
162
+ : '';
163
+ };
164
+
165
+ const columns = [
166
+ hasSome('title'),
167
+ hasSome('area'),
168
+ hasSome('year'),
169
+ hasSome('version'),
170
+ hasSome('resolution'),
171
+ hasSome('type'),
172
+ hasSome('format'),
173
+ hasSome('size'),
174
+ ];
175
+
154
176
  return (
155
177
  <div className="dataset-download-table">
156
178
  <Toast message="Added to cart" time={5000}></Toast>
@@ -203,12 +225,14 @@ function CclDownloadTable(props) {
203
225
  <HeaderCheckbox />{' '}
204
226
  </th>
205
227
  )}
206
- <th>Year</th>
207
- <th>Resolution</th>
208
- <th>Type</th>
209
- <th>Format</th>
210
- <th>Version</th>
211
- <th>Size</th>
228
+ {columns.includes('title') && <th>Title</th>}
229
+ {columns.includes('area') && <th>Area of interest</th>}
230
+ {columns.includes('year') && <th>Year</th>}
231
+ {columns.includes('version') && <th>Version</th>}
232
+ {columns.includes('resolution') && <th>Resolution</th>}
233
+ {columns.includes('type') && <th>Type</th>}
234
+ {columns.includes('format') && <th>Format</th>}
235
+ {columns.includes('size') && <th>Size</th>}
212
236
  </tr>
213
237
  </thead>
214
238
  <tbody>
@@ -229,21 +253,39 @@ function CclDownloadTable(props) {
229
253
  />
230
254
  </td>
231
255
  )}
232
- <td>{dataset_file?.year || 'YYYY'}</td>
233
- <td>{dataset_file?.resolution || '000m'}</td>
234
- <td>
235
- <span
236
- className={
237
- 'tag tag-' +
238
- (dataset_file?.type?.toLowerCase() || 'raster')
239
- }
240
- >
241
- {dataset_file?.type || 'Raster'}
242
- </span>
243
- </td>
244
- <td>{dataset_file?.format || 'Format'}</td>
245
- <td>{dataset_file?.version || 'v0.0'}</td>
246
- <td>{dataset_file?.size || '000.0MB'}</td>
256
+ {columns.includes('title') && (
257
+ <td>{contentOrDash(dataset_file?.title)}</td>
258
+ )}
259
+ {columns.includes('area') && (
260
+ <td>{contentOrDash(dataset_file?.area)}</td>
261
+ )}
262
+ {columns.includes('year') && (
263
+ <td>{contentOrDash(dataset_file?.year)}</td>
264
+ )}
265
+ {columns.includes('version') && (
266
+ <td>{contentOrDash(dataset_file?.version)}</td>
267
+ )}
268
+ {columns.includes('resolution') && (
269
+ <td>{contentOrDash(dataset_file?.resolution)}</td>
270
+ )}
271
+ {columns.includes('type') && (
272
+ <td>
273
+ <span
274
+ className={
275
+ 'tag tag-' +
276
+ (dataset_file?.type?.toLowerCase() || 'raster')
277
+ }
278
+ >
279
+ {contentOrDash(dataset_file?.type)}
280
+ </span>
281
+ </td>
282
+ )}
283
+ {columns.includes('format') && (
284
+ <td>{contentOrDash(dataset_file?.format)}</td>
285
+ )}
286
+ {columns.includes('size') && (
287
+ <td>{contentOrDash(dataset_file?.size)}</td>
288
+ )}
247
289
  </tr>
248
290
  );
249
291
  })
@@ -45,33 +45,39 @@ function CclLoginModal() {
45
45
  size="tiny"
46
46
  modalStatus={modalStatus}
47
47
  >
48
- <div className="modal-login-title">Registration / Login</div>
49
- <div className="modal-login-text">
50
- <p>
51
- This site uses EU Login to handle user registration and login. You can
52
- read more about this service in the{' '}
53
- <a href="https://ecas.ec.europa.eu/cas/about.html">
54
- EU Login site help
48
+ <div className="content">
49
+ <div className="modal-login-title">Registration / Login</div>
50
+ <div className="modal-login-text">
51
+ <p>
52
+ This site uses EU Login to handle user registration and login. You
53
+ can read more about this service in the{' '}
54
+ <a href="https://ecas.ec.europa.eu/cas/about.html">
55
+ EU Login site help
56
+ </a>
57
+ .
58
+ </p>
59
+ <p>
60
+ {' '}
61
+ When you clik on the following link, you will be sent to EU Login
62
+ and after a successful login there you will be redirected back to
63
+ this site.
64
+ </p>
65
+ <p>
66
+ If you have any issues or questions, please contact us using the
67
+ <a href="/en/contact-service-helpdesk"> helpdesk</a>.
68
+ </p>
69
+ </div>
70
+ </div>
71
+ <div className="actions">
72
+ <div className="modal-buttons">
73
+ <a
74
+ href={toPublicURL(loginUrl) || '#'}
75
+ className="ccl-button ccl-button-green"
76
+ >
77
+ Login using EU Login
55
78
  </a>
56
- .
57
- </p>
58
- <p>
59
- {' '}
60
- When you clik on the following link, you will be sent to EU Login and
61
- after a successful login there you will be redirected back to this
62
- site.
63
- </p>
64
- <p>
65
- If you have any issues or questions, please contact us using the
66
- <a href="/en/contact-service-helpdesk"> helpdesk</a>.
67
- </p>
79
+ </div>
68
80
  </div>
69
- <a
70
- href={toPublicURL(loginUrl) || '#'}
71
- className="ccl-button ccl-button-green"
72
- >
73
- Login using EU Login
74
- </a>
75
81
  </CclModal>
76
82
  );
77
83
  }
@@ -30,21 +30,17 @@ function CclModal(props) {
30
30
  className={'modal-clms'}
31
31
  size={size}
32
32
  >
33
- <div className={'modal-clms-background'}>
34
- <div className={'modal-clms-container'}>
35
- <div className={'modal-close modal-clms-close'}>
36
- <span
37
- className="ccl-icon-close"
38
- aria-label="Close"
39
- onClick={() => closeModal()}
40
- onKeyDown={() => closeModal()}
41
- tabIndex="0"
42
- role="button"
43
- ></span>
44
- </div>
45
- {children}
46
- </div>
33
+ <div className={'modal-close modal-clms-close'}>
34
+ <span
35
+ className="ccl-icon-close"
36
+ aria-label="Close"
37
+ onClick={() => closeModal()}
38
+ onKeyDown={() => closeModal()}
39
+ tabIndex="0"
40
+ role="button"
41
+ ></span>
47
42
  </div>
43
+ {children}
48
44
  </Modal>
49
45
  );
50
46
  }
@@ -99,11 +99,6 @@
99
99
  text-align: right;
100
100
  }
101
101
 
102
- .modal-clms .ccl-button {
103
- width: 60%;
104
- margin: 2rem auto 0;
105
- }
106
-
107
102
  .modal-clms hr {
108
103
  height: 1px;
109
104
  padding: 0;
@@ -116,6 +111,28 @@
116
111
  line-height: 1.5rem;
117
112
  }
118
113
 
114
+ .modal-buttons {
115
+ display: flex;
116
+ justify-content: space-between;
117
+ margin: 0 1rem;
118
+ }
119
+
120
+ .modal-buttons .ccl-button {
121
+ width: auto;
122
+ margin: 0;
123
+ }
124
+
125
+ .modal-buttons .ccl-button:only-child {
126
+ margin: 0 auto;
127
+ }
128
+
129
+ @media only screen and (max-width: 767px) {
130
+ .modal-clms.ui.modal > .content,
131
+ .modal-clms.ui.modal > .actions {
132
+ padding: 1.5rem !important;
133
+ }
134
+ }
135
+
119
136
  /* Language modal */
120
137
  .modals.dimmer .ui.scrolling.modal.modal-clms {
121
138
  margin-top: 0;
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+ import ObjectListWidget from '@plone/volto/components/manage/Widgets/ObjectListWidget';
3
+
4
+ const ItemSchema = () => ({
5
+ title: 'Dataset Download Information',
6
+ properties: {
7
+ name: {
8
+ title: 'Name',
9
+ description: '',
10
+ type: 'string',
11
+ },
12
+ full_path: {
13
+ title: 'Enter the path to the full dataset download file',
14
+ description:
15
+ 'This is used when requesting the download from the map viewer',
16
+ type: 'string',
17
+ },
18
+ full_format: {
19
+ title: 'Enter the format of the full dataset file',
20
+ description: '',
21
+ choices: [
22
+ ['Shapefile', 'Shapefile'],
23
+ ['GDB', 'GDB'],
24
+ ['GPKG', 'GPKG'],
25
+ ['Geojson', 'Geojson'],
26
+ ['Geotiff', 'Geotiff'],
27
+ ['Netcdf', 'Netcdf'],
28
+ ['GML', 'GML'],
29
+ ['WFS', 'WFS'],
30
+ ],
31
+ },
32
+ full_source: {
33
+ title: 'Enter the source of the full dataset file',
34
+ description: '',
35
+ choices: [
36
+ ['WEKEO', 'WEKEO'],
37
+ ['EEA', 'EEA'],
38
+ ['LANDCOVER', 'LANDCOVER'],
39
+ ['LEGACY', 'LEGACY'],
40
+ ],
41
+ },
42
+ wekeo_choices: {
43
+ title: 'WEKEO choices',
44
+ description: '',
45
+ type: 'string',
46
+ },
47
+ },
48
+ fieldsets: [
49
+ {
50
+ id: 'default',
51
+ title: 'File',
52
+ fields: [
53
+ 'name',
54
+ 'full_path',
55
+ 'full_format',
56
+ 'full_source',
57
+ 'wekeo_choices',
58
+ ],
59
+ },
60
+ ],
61
+ required: [],
62
+ });
63
+
64
+ const DatasetDownloadInformationWidget = (props) => {
65
+ return (
66
+ <ObjectListWidget
67
+ schema={ItemSchema()}
68
+ {...props}
69
+ value={props.value?.items || props.default?.items || []}
70
+ onChange={(id, value) => props.onChange(id, { items: value })}
71
+ />
72
+ );
73
+ };
74
+
75
+ export default DatasetDownloadInformationWidget;
@@ -1,14 +1,16 @@
1
- import { getFormatConversionTable, getProjections } from '../../actions';
2
- import { useDispatch, useSelector } from 'react-redux';
3
-
4
- import ObjectListWidget from '@plone/volto/components/manage/Widgets/ObjectListWidget';
5
1
  import React from 'react';
2
+ import { ReactTableWidget } from '@eeacms/volto-react-table-widget';
6
3
 
7
- const ItemSchema = (format_choices, projection_choices) => ({
4
+ const ItemSchema = () => ({
8
5
  title: 'Downloadable File',
9
6
  properties: {
7
+ title: {
8
+ title: 'Title',
9
+ description: 'Enter the title of this file.',
10
+ type: 'string',
11
+ },
10
12
  area: {
11
- title: 'Area',
13
+ title: 'Area of interest',
12
14
  description: 'Enter the area of this file.',
13
15
  type: 'string',
14
16
  },
@@ -16,6 +18,12 @@ const ItemSchema = (format_choices, projection_choices) => ({
16
18
  title: 'Year',
17
19
  description: 'Enter the year of this file.',
18
20
  type: 'number',
21
+ minimum: 1900,
22
+ },
23
+ version: {
24
+ title: 'Version',
25
+ description: 'Enter the version of this file.',
26
+ type: 'string',
19
27
  },
20
28
  resolution: {
21
29
  title: 'Resolution',
@@ -29,22 +37,10 @@ const ItemSchema = (format_choices, projection_choices) => ({
29
37
  ['Raster', 'Raster'],
30
38
  ['Vector', 'Vector'],
31
39
  ],
32
- // type: 'string',
33
- // controlled vocabulary: 'raster' or 'vector'
34
40
  },
35
41
  format: {
36
42
  title: 'Format',
37
43
  description: 'Enter the format of this file.',
38
- choices: format_choices,
39
- },
40
- projection: {
41
- title: 'Projection',
42
- description: 'Enter the projection of this file.',
43
- choices: projection_choices,
44
- },
45
- version: {
46
- title: 'Version',
47
- description: 'Enter the version of this file.',
48
44
  type: 'string',
49
45
  },
50
46
  size: {
@@ -52,67 +48,52 @@ const ItemSchema = (format_choices, projection_choices) => ({
52
48
  description: 'Enter the size of this file. Ex.: 3.5 GB',
53
49
  type: 'string',
54
50
  },
55
- source: {
56
- title: 'Source',
57
- description: 'Enter the source of this file.',
58
- type: 'string',
59
- // controlled vocabulary: values to be provided by the user
60
- },
61
51
  path: {
62
52
  title: 'Path',
63
53
  description: 'Enter the absolute path of this file in the storage',
64
54
  type: 'string',
65
55
  },
56
+ source: {
57
+ title: 'Source',
58
+ description: 'Enter the source of this file (this is an internal).',
59
+ choices: [
60
+ ['EEA', 'EEA'],
61
+ ['HOTSPOTS', 'HOTSPOTS'],
62
+ ],
63
+ },
66
64
  },
67
65
  fieldsets: [
68
66
  {
69
67
  id: 'default',
70
68
  title: 'File',
71
69
  fields: [
70
+ 'title',
72
71
  'area',
73
72
  'year',
73
+ 'version',
74
74
  'resolution',
75
75
  'type',
76
76
  'format',
77
- 'projection',
78
- 'version',
79
77
  'size',
80
- 'source',
81
78
  'path',
79
+ 'source',
82
80
  ],
83
81
  },
84
82
  ],
85
83
  required: [],
86
84
  });
87
85
 
88
- const DownloadableFilesWidget = (props) => {
89
- // format_conversion_table_in_progress
90
- const dispatch = useDispatch();
91
- React.useEffect(() => {
92
- dispatch(getFormatConversionTable());
93
- dispatch(getProjections());
94
- }, [dispatch]);
95
- const format_conversion_table_in_progress = useSelector(
96
- (state) => state.downloadtool.format_conversion_table_in_progress,
97
- );
98
- const projections_in_progress = useSelector(
99
- (state) => state.downloadtool.projections_in_progress,
100
- );
101
- let format_choices = Object.keys(
102
- format_conversion_table_in_progress,
103
- ).map((key) => [key, key]);
104
- let projection_choices = [];
105
- if (projections_in_progress.length > 0) {
106
- projection_choices = projections_in_progress.map((key) => [key, key]);
107
- }
86
+ const DownloadableFilesTableWidget = (props) => {
108
87
  return (
109
- <ObjectListWidget
110
- schema={ItemSchema(format_choices, projection_choices)}
88
+ <ReactTableWidget
89
+ schema={ItemSchema()}
111
90
  {...props}
91
+ csvexport={true}
92
+ csvimport={true}
112
93
  value={props.value?.items || props.default?.items || []}
113
94
  onChange={(id, value) => props.onChange(id, { items: value })}
114
95
  />
115
96
  );
116
97
  };
117
98
 
118
- export default DownloadableFilesWidget;
99
+ export default DownloadableFilesTableWidget;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import ObjectListWidget from '@plone/volto/components/manage/Widgets/ObjectListWidget';
3
+
4
+ const ItemSchema = () => ({
5
+ title: 'Product component',
6
+ properties: {
7
+ name: {
8
+ title: 'Name',
9
+ description: 'Enter the name of this component.',
10
+ type: 'string',
11
+ },
12
+ description: {
13
+ title: 'Description',
14
+ description: 'Enter the description of this component.',
15
+ type: 'text',
16
+ },
17
+ },
18
+ fieldsets: [
19
+ {
20
+ id: 'default',
21
+ title: 'Component',
22
+ fields: ['name', 'description'],
23
+ },
24
+ ],
25
+ required: [],
26
+ });
27
+
28
+ const ProductComponentsWidget = (props) => {
29
+ return (
30
+ <ObjectListWidget
31
+ schema={ItemSchema()}
32
+ {...props}
33
+ value={props.value?.items || props.default?.items || []}
34
+ onChange={(id, value) => props.onChange(id, { items: value })}
35
+ />
36
+ );
37
+ };
38
+
39
+ export default ProductComponentsWidget;
package/src/index.js CHANGED
@@ -1,12 +1,11 @@
1
- // COMPONENTS FOR ROUTES
2
- import { ContactForm, Search, Sitemap } from '@plone/volto/components';
3
- // CUSTOMIZED BLOCKS IMPORTS
4
1
  import customBlocks, {
5
2
  customGroupBlocksOrder,
6
3
  } from '@eeacms/volto-clms-theme/components/Blocks/customBlocks';
7
4
 
8
- import BoundingWidget from './components/Widgets/BoundingWidget';
9
- // VIEWS IMPORTS
5
+ // ROUTE VIEWS
6
+ import { ContactForm, Search, Sitemap } from '@plone/volto/components';
7
+
8
+ // VIEWS
10
9
  import CLMSDatasetDetailView from '@eeacms/volto-clms-theme/components/CLMSDatasetDetailView/CLMSDatasetDetailView';
11
10
  import CLMSDownloadCartView from './components/CLMSDownloadCartView/CLMSDownloadCartView';
12
11
  import CLMSDownloadableFileView from '@eeacms/volto-clms-theme/components/CLMSDownloadableFileView/CLMSDownloadableFileView';
@@ -21,16 +20,21 @@ import CLMSNewsItemView from '@eeacms/volto-clms-theme/components/CLMSNewsItemVi
21
20
  import ConfirmSubscriptionView from './components/CLMSSubscriptionView/ConfirmSubscriptionView';
22
21
  import ProfileView from './components/CLMSProfileView/CLMSProfileView';
23
22
  import SubscriptionView from './components/CLMSSubscriptionView/SubscriptionView';
24
- // WIDGET IMPORTS
25
- import TabsWidget from './components/Blocks/CustomTemplates/VoltoTabsBlock/TabsWidget';
26
- import TextLinkWidget from './components/Widgets/TextLinkWidget';
23
+
24
+ // WIDGET
25
+ import BoundingWidget from './components/Widgets/BoundingWidget';
27
26
  import ContactWidget from './components/Widgets/ContactWidget';
27
+ import DatasetDownloadInformationWidget from './components/Widgets/DatasetDownloadInformationWidget';
28
28
  import DistributionInfoWidget from './components/Widgets/DistributionInfoWidget';
29
- import DownloadableFilesWidget from './components/Widgets/DownloadableFilesWidget';
29
+ import DownloadableFilesTableWidget from './components/Widgets/DownloadableFilesTableWidget';
30
30
  import GeonetworkIdentifiersWidget from './components/Widgets/GeonetworkIdentifiersWidget';
31
31
  import MapLayersWidget from './components/Widgets/MapLayersWidget';
32
+ import TabsWidget from './components/Blocks/CustomTemplates/VoltoTabsBlock/TabsWidget';
32
33
  import TaxonomyWidget from './components/Widgets/TaxonomyWidget';
34
+ import ProductComponentsWidget from './components/Widgets/ProductComponentsWidget';
33
35
  // CUSTOM REDUCERS IMPORT
36
+ import TextLinkWidget from './components/Widgets/TextLinkWidget';
37
+
34
38
  import reducers from './reducers';
35
39
 
36
40
  const applyConfig = (config) => {
@@ -62,15 +66,17 @@ const applyConfig = (config) => {
62
66
  ...config.widgets.widget,
63
67
  bounding_widget: BoundingWidget,
64
68
  layer_widget: MapLayersWidget,
65
- downloadable_files_widget: DownloadableFilesWidget,
69
+ downloadable_files_widget: DownloadableFilesTableWidget,
66
70
  contact_widget: ContactWidget,
67
71
  distribution_info_widget: DistributionInfoWidget,
68
72
  geonetwork_identifiers_widget: GeonetworkIdentifiersWidget,
69
73
  text_link_widget: TextLinkWidget,
74
+ dataset_download_information_widget: DatasetDownloadInformationWidget,
70
75
  };
71
76
  config.widgets.id = {
72
77
  ...config.widgets.id,
73
78
  taxonomy_technical_library_categorization: TaxonomyWidget,
79
+ product_components: ProductComponentsWidget,
74
80
  };
75
81
  config.settings = {
76
82
  ...config.settings,
@@ -15,10 +15,12 @@ const getInitialState = {
15
15
  error: null,
16
16
  loaded: false,
17
17
  loading: false,
18
+ download_queued: {},
18
19
  download_in_progress: {},
19
20
  download_finished_ok: {},
20
21
  download_finished_nok: {},
21
22
  download_rejected: {},
23
+ download_cancelled: {},
22
24
  delete_download_in_progress: {},
23
25
  post_download_in_progress: {},
24
26
  format_conversion_table_in_progress: {},
@@ -59,6 +61,7 @@ export const downloadtoolReducer = (state = getInitialState, action = {}) => {
59
61
  TaskID: progress_key,
60
62
  });
61
63
  });
64
+ var queued = tasks_array.filter((task) => task.Status === 'Queued');
62
65
  var in_progress = tasks_array.filter(
63
66
  (task) => task.Status === 'In_progress',
64
67
  );
@@ -69,15 +72,18 @@ export const downloadtoolReducer = (state = getInitialState, action = {}) => {
69
72
  (task) => task.Status === 'Finished_nok',
70
73
  );
71
74
  var rejected = tasks_array.filter((task) => task.Status === 'Rejected');
75
+ var cancelled = tasks_array.filter((task) => task.Status === 'Cancelled');
72
76
  return {
73
77
  ...state,
74
78
  error: null,
75
79
  loaded: true,
76
80
  loading: false,
81
+ download_queued: queued,
77
82
  download_in_progress: in_progress,
78
83
  download_finished_ok: finished_ok,
79
84
  download_finished_nok: finished_nok,
80
85
  download_rejected: rejected,
86
+ download_cancelled: cancelled,
81
87
  };
82
88
  case `${POST_DOWNLOADTOOL}_SUCCESS`:
83
89
  return {
@@ -14,8 +14,10 @@ describe('downloadtoolReducer', () => {
14
14
  error: null,
15
15
  loaded: false,
16
16
  loading: false,
17
+ download_queued: {},
17
18
  download_in_progress: {},
18
19
  download_finished_ok: {},
20
+ download_cancelled: {},
19
21
  download_finished_nok: {},
20
22
  download_rejected: {},
21
23
  delete_download_in_progress: {},
@@ -32,6 +34,7 @@ describe('downloadtoolReducer', () => {
32
34
  error: null,
33
35
  loaded: false,
34
36
  loading: false,
37
+ download_queued: {},
35
38
  download_in_progress: {},
36
39
  download_finished_ok: {
37
40
  '1': {
@@ -47,6 +50,7 @@ describe('downloadtoolReducer', () => {
47
50
  },
48
51
  download_finished_nok: {},
49
52
  download_rejected: {},
53
+ download_cancelled: {},
50
54
  delete_download_in_progress: {},
51
55
  post_download_in_progress: {},
52
56
  format_conversion_table_in_progress: {},
@@ -72,8 +76,10 @@ describe('downloadtoolReducer', () => {
72
76
  error: null,
73
77
  loaded: true,
74
78
  loading: false,
79
+ download_queued: [],
75
80
  download_in_progress: [],
76
81
  download_finished_ok: [],
82
+ download_cancelled: [],
77
83
  download_finished_nok: [],
78
84
  download_rejected: [],
79
85
  delete_download_in_progress: {},
@@ -122,6 +128,7 @@ describe('downloadtoolReducer', () => {
122
128
  error: null,
123
129
  loaded: false,
124
130
  loading: false,
131
+ download_queued: {},
125
132
  download_in_progress: {},
126
133
  download_finished_ok: {},
127
134
  download_finished_nok: {},
@@ -152,6 +159,7 @@ describe('downloadtoolReducer', () => {
152
159
  error: null,
153
160
  loaded: true,
154
161
  loading: false,
162
+ download_queued: {},
155
163
  download_in_progress: {},
156
164
  download_finished_ok: {},
157
165
  download_finished_nok: {},
@@ -1,5 +0,0 @@
1
- describe('Initial test', () => {
2
- it('Initial test', () => {
3
- expect(1).toBe(1);
4
- });
5
- });