@eeacms/volto-clms-theme 1.1.108 → 1.1.109

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,12 @@ 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.109](https://github.com/eea/volto-clms-theme/compare/1.1.108...1.1.109) - 6 February 2024
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: CLMS-3041 ordered by projection number instead of projection string [Unai - [`9837662`](https://github.com/eea/volto-clms-theme/commit/983766235df360f3669b6551de42713705d39ff7)]
12
+
7
13
  ### [1.1.108](https://github.com/eea/volto-clms-theme/compare/1.1.107...1.1.108) - 6 February 2024
8
14
 
9
15
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.108",
3
+ "version": "1.1.109",
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",
@@ -418,37 +418,48 @@ const CLMSCartContent = (props) => {
418
418
  value={item?.projection}
419
419
  options={
420
420
  projections.length > 0 &&
421
- projections?.sort()?.map((projection) => {
422
- return {
423
- key: projection,
424
- value: projection,
425
- text: item?.original_projection
426
- .replaceAll(
427
- '/ ',
428
- ' ' +
429
- projection.substring(
430
- 0,
431
- projection.indexOf(':') + 1,
432
- ),
433
- )
434
- .includes(projection)
435
- ? projection +
436
- ' (Source system of the dataset)'
437
- : projection,
438
- className: item?.original_projection
439
- .replaceAll(
440
- '/ ',
441
- ' ' +
442
- projection.substring(
443
- 0,
444
- projection.indexOf(':') + 1,
445
- ),
446
- )
447
- .includes(projection)
448
- ? 'original_projection'
449
- : 'projection',
450
- };
451
- })
421
+ projections
422
+ ?.sort((a, b) => {
423
+ if (
424
+ Number(a.split(':')[1]) >
425
+ Number(b.split(':')[1])
426
+ ) {
427
+ return 1;
428
+ } else {
429
+ return -1;
430
+ }
431
+ })
432
+ ?.map((projection) => {
433
+ return {
434
+ key: projection,
435
+ value: projection,
436
+ text: item?.original_projection
437
+ .replaceAll(
438
+ '/ ',
439
+ ' ' +
440
+ projection.substring(
441
+ 0,
442
+ projection.indexOf(':') + 1,
443
+ ),
444
+ )
445
+ .includes(projection)
446
+ ? projection +
447
+ ' (Source system of the dataset)'
448
+ : projection,
449
+ className: item?.original_projection
450
+ .replaceAll(
451
+ '/ ',
452
+ ' ' +
453
+ projection.substring(
454
+ 0,
455
+ projection.indexOf(':') + 1,
456
+ ),
457
+ )
458
+ .includes(projection)
459
+ ? 'original_projection'
460
+ : 'projection',
461
+ };
462
+ })
452
463
  }
453
464
  onChange={(e, data) => {
454
465
  setProjectionValue(item?.unique_id, data.value);