@rh-support/cases 2.6.19 → 2.6.30

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TypeFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/TypeFilter.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBAkJvC"}
1
+ {"version":3,"file":"TypeFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/TypeFilter.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBAkIvC"}
@@ -21,20 +21,11 @@ export function TypeFilter(props) {
21
21
  key: type,
22
22
  }));
23
23
  const onSelectHandler = (option) => {
24
- const convertedSelectedType = toOldCaseTypeSwitcher([option.value]);
25
- const prevSelectedTypes = Object.keys(selectedItems).filter((item) => selectedItems[item] && item);
26
- if (selectedItems[option.value]) {
27
- setSelectedItems((prevData) => (Object.assign(Object.assign({}, prevData), { [option.value]: false })));
28
- const index = prevSelectedTypes.indexOf(option.value);
29
- prevSelectedTypes.splice(index, 1);
30
- }
31
- else {
32
- setSelectedItems((prevData) => (Object.assign(Object.assign({}, prevData), { [option.value]: true })));
33
- prevSelectedTypes.push(option.value);
34
- }
35
- const newState = filterInfo[SolrKeys.type].includes(convertedSelectedType[0])
36
- ? filterInfo[SolrKeys.type].filter((item) => item !== convertedSelectedType[0])
37
- : [...filterInfo[SolrKeys.type], convertedSelectedType[0]];
24
+ // To convert the selected type to old case type
25
+ const convertedSelectedType = toOldCaseTypeSwitcher(option.value);
26
+ const newState = filterInfo[SolrKeys.type].includes(convertedSelectedType)
27
+ ? filterInfo[SolrKeys.type].filter((item) => item !== convertedSelectedType)
28
+ : [...filterInfo[SolrKeys.type], convertedSelectedType];
38
29
  updateFilter(dispatch, {
39
30
  filterKey: SolrKeys.type,
40
31
  values: newState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/cases",
3
- "version": "2.6.19",
3
+ "version": "2.6.30",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -43,8 +43,8 @@
43
43
  "@patternfly/patternfly": "6.2.1",
44
44
  "@patternfly/react-core": "6.2.1",
45
45
  "@patternfly/react-table": "6.2.1",
46
- "@rh-support/components": "2.5.33",
47
- "@rh-support/react-context": "2.5.36",
46
+ "@rh-support/components": "2.5.45",
47
+ "@rh-support/react-context": "2.5.45",
48
48
  "@rh-support/types": "2.0.5",
49
49
  "@rh-support/user-permissions": "2.5.20",
50
50
  "@rh-support/utils": "2.5.19",
@@ -96,5 +96,5 @@
96
96
  "defaults and supports es6-module",
97
97
  "maintained node versions"
98
98
  ],
99
- "gitHead": "976f134e20f3bf65b6bf613d6f39060724683cf9"
99
+ "gitHead": "7c863ffbb7b897925e55fa610b76584e78c6accc"
100
100
  }