@eeacms/volto-clms-theme 1.1.59 → 1.1.61

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,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.61](https://github.com/eea/volto-clms-theme/compare/1.1.60...1.1.61) - 18 October 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - CLMS-2641 use new field content for the grid image [Mikel Larreategi - [`d29a0e1`](https://github.com/eea/volto-clms-theme/commit/d29a0e142e8ff284232251b39b01b6761a9b1a7c)]
12
+ ### [1.1.60](https://github.com/eea/volto-clms-theme/compare/1.1.59...1.1.60) - 18 October 2023
13
+
7
14
  ### [1.1.59](https://github.com/eea/volto-clms-theme/compare/1.1.58...1.1.59) - 17 October 2023
8
15
 
9
16
  ### [1.1.58](https://github.com/eea/volto-clms-theme/compare/1.1.57...1.1.58) - 17 October 2023
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.59",
3
+ "version": "1.1.61",
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",
@@ -228,7 +228,24 @@ const CLMSCartContent = (props) => {
228
228
  ref.scrollIntoView({ behavior: 'smooth' });
229
229
  };
230
230
 
231
- const { tooManyInQueue } = props;
231
+ const { tooManyInQueue, howManyInQueue, maxInQueue } = props;
232
+
233
+ const tooManySelected = () => {
234
+ let selectedItems = getSelectedCartItems();
235
+ const hasPrepackaged =
236
+ selectedItems.filter((item) => item?.file_id).length > 0;
237
+ const hasMapSelection =
238
+ selectedItems.filter((item) => !item?.file_id).length > 0;
239
+ let count = 0;
240
+ if (hasPrepackaged) {
241
+ count = count + 1;
242
+ }
243
+ if (hasMapSelection) {
244
+ count = count + 1;
245
+ }
246
+
247
+ return howManyInQueue + count > maxInQueue;
248
+ };
232
249
 
233
250
  return (
234
251
  <>
@@ -530,13 +547,22 @@ const CLMSCartContent = (props) => {
530
547
  <>
531
548
  {tooManyInQueue && (
532
549
  <strong>
533
- You have 5 items in the download queue. Wait until the queue is
534
- reduced before requesting more.
550
+ You have {maxInQueue} items in the download queue. Wait until the
551
+ queue is reduced before requesting more.
552
+ </strong>
553
+ )}
554
+ {tooManySelected() && (
555
+ <strong>
556
+ With the selection that you have made, you will have {maxInQueue}{' '}
557
+ or more items in the download queue. Please change your selection
558
+ in order to request a download.
535
559
  </strong>
536
560
  )}
537
561
  <CclButton
538
562
  onClick={() => downloadModal()}
539
- disabled={cartSelection.length === 0 || tooManyInQueue}
563
+ disabled={
564
+ cartSelection.length === 0 || tooManyInQueue || tooManySelected()
565
+ }
540
566
  >
541
567
  Start downloading
542
568
  </CclButton>
@@ -102,11 +102,11 @@ const CLMSDownloadCartView = (props) => {
102
102
  }, [dispatch]);
103
103
 
104
104
  const downloadtool = useSelector((state) => state.downloadtool);
105
- const tooManyInQueue =
105
+ const maxInQueue = 5;
106
+ const howManyInQueue =
106
107
  Object.keys(downloadtool?.download_queued).length +
107
- Object.keys(downloadtool?.download_in_progress).length >=
108
- 5;
109
-
108
+ Object.keys(downloadtool?.download_in_progress).length;
109
+ const tooManyInQueue = howManyInQueue >= maxInQueue;
110
110
  return (
111
111
  <>
112
112
  <Helmet title={helmetTitle(formatMessage(messages.Cart), content)} />
@@ -167,6 +167,8 @@ const CLMSDownloadCartView = (props) => {
167
167
  localSessionCart={cart}
168
168
  getNutsIDList={getNutsIDList}
169
169
  tooManyInQueue={tooManyInQueue}
170
+ howManyInQueue={howManyInQueue}
171
+ maxInQueue={maxInQueue}
170
172
  />
171
173
  </div>
172
174
  </>
@@ -295,7 +295,10 @@ function CclDownloadTable(props) {
295
295
  <div className="image-modal">
296
296
  <img
297
297
  src={
298
- prepackage_grid_image
298
+ props.dataset.download_grid_image_for_prepackages
299
+ ? props.dataset.download_grid_image_for_prepackages
300
+ .download
301
+ : prepackage_grid_image
299
302
  ? prepackage_grid_image
300
303
  : PlaceHolder
301
304
  }