@eeacms/volto-clms-theme 1.0.118 → 1.0.119

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,14 @@ 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.119](https://github.com/eea/volto-clms-theme/compare/1.0.118...1.0.119) - 1 September 2022
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: restore taxonomy item ordering [Mikel Larreategi - [`5080a9f`](https://github.com/eea/volto-clms-theme/commit/5080a9f456888bba77042b673f62e3db5cfe86fb)]
12
+ - fix: reverse checkbox label ordering [ionlizarazu - [`cd2ea37`](https://github.com/eea/volto-clms-theme/commit/cd2ea377f9f6c4cdd584dd9c5df41e3574fcd686)]
13
+ - fix: search facet checkbox functionality. Order by title and replace starting text 00# from the checkbox labels [ionlizarazu - [`df69da5`](https://github.com/eea/volto-clms-theme/commit/df69da5124b25ac098b4204e20663524c2ebb91a)]
14
+
7
15
  ### [1.0.118](https://github.com/eea/volto-clms-theme/compare/1.0.117...1.0.118) - 1 September 2022
8
16
 
9
17
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.0.118",
3
+ "version": "1.0.119",
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",
@@ -10,7 +10,7 @@ import {
10
10
  selectFacetStateToValue,
11
11
  selectFacetValueToQuery,
12
12
  } from '@plone/volto/components/manage/Blocks/Search/components/base';
13
- import { checkAllChildren } from './utils';
13
+ import { checkAllChildren, uncheckOptionAndChildren } from './utils';
14
14
 
15
15
  const hasAllChildrensSelected = (value, childrens) => {
16
16
  var result = true;
@@ -92,16 +92,9 @@ const CheckboxListParent = ({ option, key, onChange, value, id }) => {
92
92
  ...checkAllChildren(value, option).map((f) => f.value),
93
93
  ])
94
94
  : onChange(id, [
95
- ...value
96
- .filter((item) => item.value !== option.value)
97
- .filter(
98
- (item) =>
99
- option.childrens?.length > 0 &&
100
- !option.childrens
101
- .map((ch) => ch.value)
102
- .includes(item.value),
103
- )
104
- .map((f) => f.value),
95
+ ...uncheckOptionAndChildren(value, option).map(
96
+ (f) => f.value,
97
+ ),
105
98
  ]);
106
99
  }}
107
100
  label={
@@ -80,6 +80,20 @@ const rewriteOptions = (name, choices) => {
80
80
  return 0;
81
81
  });
82
82
  }
83
+ if (name === 'taxonomy_technical_library_categorization') {
84
+ result = choices
85
+ .sort((a, b) => {
86
+ if (a.label < b.label) {
87
+ return -1;
88
+ } else if (a.label > b.label) {
89
+ return 1;
90
+ }
91
+ return 0;
92
+ })
93
+ .map((opt) => {
94
+ return { ...opt, label: opt.label.replace(/^[0-9][0-9]#/, '') };
95
+ });
96
+ }
83
97
  return result;
84
98
  };
85
99
 
@@ -7,5 +7,17 @@ export const checkAllChildren = (value, option) => {
7
7
  value.push(ch);
8
8
  }
9
9
  });
10
- return value;
10
+ return [...value, { label: option.label, value: option.value }];
11
+ };
12
+
13
+ export const uncheckOptionAndChildren = (value, option) => {
14
+ return value
15
+ .filter((item) => item.value !== option.value)
16
+ .filter((item) => {
17
+ if (option.childrens?.length > 0) {
18
+ return !option.childrens.map((ch) => ch.value).includes(item.value);
19
+ } else {
20
+ return true;
21
+ }
22
+ });
11
23
  };
@@ -180,7 +180,7 @@ const CheckboxListParent = ({ option, key, onChange, value, id }) => {
180
180
  }}
181
181
  label={
182
182
  <label htmlFor={`field-${option.value}`}>
183
- {option.label}
183
+ {option.label.replace(/^[0-9][0-9]#/, '')}
184
184
  </label>
185
185
  }
186
186
  checked={
@@ -46,5 +46,6 @@ export const structure_taxonomy_terms = (choices) => {
46
46
  // });
47
47
 
48
48
  // return sort_array_items_by_key(options, 'label');
49
- return options.reverse();
49
+ //return options.reverse();
50
+ return options;
50
51
  };