@rh-support/cases 1.0.43 → 1.0.100-beta.0

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.
Files changed (40) hide show
  1. package/lib/esm/components/case/NewCaseButton.d.ts.map +1 -1
  2. package/lib/esm/components/case/NewCaseButton.js +4 -3
  3. package/lib/esm/components/case-list/CaseListFilterHelpers.js +1 -1
  4. package/lib/esm/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.d.ts.map +1 -1
  5. package/lib/esm/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.js +63 -61
  6. package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.d.ts.map +1 -1
  7. package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.js +5 -2
  8. package/lib/esm/components/case-list/case-list-filters/ProductsFilter.d.ts.map +1 -1
  9. package/lib/esm/components/case-list/case-list-filters/ProductsFilter.js +42 -17
  10. package/lib/esm/components/case-list/case-list-filters/TypeFilter.d.ts.map +1 -1
  11. package/lib/esm/components/case-list/case-list-filters/TypeFilter.js +10 -5
  12. package/lib/esm/components/case-list/case-list-table/CaseListTable.js +4 -4
  13. package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.d.ts.map +1 -1
  14. package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.js +14 -8
  15. package/lib/esm/components/case-list/case-search/AdvanceSearch.js +1 -1
  16. package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.d.ts.map +1 -1
  17. package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.js +1 -1
  18. package/lib/esm/components/case-list/case-search/CaseSearch.d.ts +1 -1
  19. package/lib/esm/components/case-list/case-search/CaseSearch.d.ts.map +1 -1
  20. package/lib/esm/components/case-list/case-search/CaseSearch.js +1 -1
  21. package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.d.ts.map +1 -1
  22. package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.js +6 -3
  23. package/lib/esm/css/caseList.css +1 -1
  24. package/lib/esm/enums/case.js +2 -2
  25. package/lib/esm/enums/caseSearch.js +2 -2
  26. package/lib/esm/enums/filters.d.ts +2 -2
  27. package/lib/esm/enums/filters.d.ts.map +1 -1
  28. package/lib/esm/enums/filters.js +3 -3
  29. package/lib/esm/i18n/template-de.js +1 -1
  30. package/lib/esm/i18n/template-fr.js +1 -1
  31. package/lib/esm/i18n/template-jp.js +1 -1
  32. package/lib/esm/i18n/template-ko.js +1 -1
  33. package/lib/esm/i18n/template-pt.js +1 -1
  34. package/lib/esm/i18n/template-ru.js +1 -1
  35. package/lib/esm/i18n/template-zh.js +1 -1
  36. package/lib/esm/utils/caseListUtils.js +1 -1
  37. package/lib/esm/utils/caseSearchUtils.d.ts.map +1 -1
  38. package/lib/esm/utils/caseSearchUtils.js +10 -3
  39. package/lib/esm/utils/constants.js +1 -1
  40. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"NewCaseButton.d.ts","sourceRoot":"","sources":["../../../../src/components/case/NewCaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AACD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,eAmB1C"}
1
+ {"version":3,"file":"NewCaseButton.d.ts","sourceRoot":"","sources":["../../../../src/components/case/NewCaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AACD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,eAyB1C"}
@@ -2,8 +2,9 @@ import { Button, ButtonVariant } from '@patternfly/react-core';
2
2
  import { useCanCreateCase } from '@rh-support/react-context';
3
3
  import { getStringifiedParams } from '@rh-support/utils';
4
4
  import React from 'react';
5
- import { Trans } from 'react-i18next';
5
+ import { Trans, useTranslation } from 'react-i18next';
6
6
  export function NewCaseButton(props) {
7
+ const { t } = useTranslation();
7
8
  const canCreateCase = useCanCreateCase();
8
9
  const onNew = () => {
9
10
  if (canCreateCase.alert()) {
@@ -15,6 +16,6 @@ export function NewCaseButton(props) {
15
16
  }
16
17
  };
17
18
  return (React.createElement(React.Fragment, null,
18
- React.createElement(Button, { variant: ButtonVariant.tertiary, onClick: onNew, "data-tracking-id": "open-new-case" },
19
- React.createElement(Trans, null, "Open a case"))));
19
+ React.createElement(Button, { variant: ButtonVariant.tertiary, onClick: onNew, "data-tracking-id": "get-support-new-case", "aria-label": t('Get support') },
20
+ React.createElement(Trans, null, "Get support"))));
20
21
  }
@@ -37,7 +37,7 @@ const isStatusFilterWithSFDCSupportedValues = ({ case_status = [] }) => {
37
37
  return statusLength !== 2 || (statusLength === 2 && !case_status.includes(CaseStatus.Closed));
38
38
  };
39
39
  // SFDC on most fields including case_status only accept one value
40
- // on case type field if 'closed' is selected then, we can have 2 filters selected
40
+ // on support type field if 'closed' is selected then, we can have 2 filters selected
41
41
  // because closed in SFDC passes as a seperate param
42
42
  // if closed not selected then only one filter can be selected
43
43
  const isStatusFilterWithSFDCSupported = (filterKey, filterValue) => {
@@ -1 +1 @@
1
- {"version":3,"file":"AccountsBookmarkedGroupFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,YAAY,eAAgB,MAAM,gBAS9C,CAAC;AAEF,UAAU,MAAM;IACZ,uBAAuB,EAAE,OAAO,CAAC;IACjC,wBAAwB,EAAE,OAAO,CAAC;IAClC,yBAAyB,EAAE,OAAO,CAAC;CACtC;AAED,eAAO,MAAM,QAAQ,cAAe,MAAM,eAAe,MAAM,WACiB,CAAC;AAEjF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,eAkH1D"}
1
+ {"version":3,"file":"AccountsBookmarkedGroupFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AccountsBookmarkedGroupFilter.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY,eAAgB,MAAM,gBAS9C,CAAC;AAEF,UAAU,MAAM;IACZ,uBAAuB,EAAE,OAAO,CAAC;IACjC,wBAAwB,EAAE,OAAO,CAAC;IAClC,yBAAyB,EAAE,OAAO,CAAC;CACtC;AAOD,eAAO,MAAM,QAAQ,cAAe,MAAM,eAAe,MAAM,WACiB,CAAC;AAEjF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,eAgJ1D"}
@@ -1,15 +1,11 @@
1
- import { Label, Tooltip } from '@patternfly/react-core';
1
+ import { Label, Select, SelectOption, SelectVariant, Tooltip } from '@patternfly/react-core';
2
2
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
3
- import { MultiSelectDropDownList } from '@rh-support/components';
4
3
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
5
- import { getDropdownBtnPlaceholder, toOptions } from '@rh-support/utils';
6
- import groupBy from 'lodash/groupBy';
7
- import isEmpty from 'lodash/isEmpty';
8
- import sortBy from 'lodash/sortBy';
9
- import React, { useContext } from 'react';
4
+ import { getDropdownBtnPlaceholder } from '@rh-support/utils';
5
+ import { groupBy, isEmpty, isEqual, some, sortBy } from 'lodash';
6
+ import React, { useContext, useMemo, useState } from 'react';
10
7
  import { Trans, useTranslation } from 'react-i18next';
11
8
  import { Link } from 'react-router-dom';
12
- import { FILTER_SEARCHABLE_MODE_LIMIT } from '../../../enums/caseSearch';
13
9
  import { SolrKeys } from '../../../enums/filters';
14
10
  import { filterNamesMap } from '../../../utils/constants';
15
11
  import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
@@ -27,27 +23,22 @@ export function AccountsBookmarkedGroupFilter(props) {
27
23
  const { globalMetadataState: { managedAccounts, bookmarkedGroupAccounts }, } = useContext(GlobalMetadataStateContext);
28
24
  const { filterInfo } = useContext(CaseListFilterStateContext);
29
25
  const dispatch = useContext(CaseListFilterDispatchContext);
30
- const onAccountsFilterChange = (selectedAccounts) => {
31
- updateFilter(dispatch, {
32
- filterKey: SolrKeys.accountNumber,
33
- values: selectedAccounts.map((i) => ({ value: i.value.value, key: i.value.key })),
34
- });
35
- };
36
- const managedAccountsList = !isEmpty(managedAccounts.data) ? managedAccounts.data : [];
37
- const getBookmarkDropdownOptions = (accounts) => {
38
- return accounts.map((account) => ({
39
- children: React.createElement(React.Fragment, null,
40
- " ",
41
- getLabel(account.accountNumber || account.accountNum, account.name)),
42
- value: getLabel(account.accountNumber || account.accountNum, account.name),
43
- key: account.accountNumber || account.accountNum,
44
- isNotSearchable: false,
45
- isNonActionable: false,
46
- isNotSelectable: false,
47
- }));
48
- };
49
- const filterValues = canAccessManagedAccounts ? getBookmarkDropdownOptions(managedAccountsList) : [];
50
- const groupedBookmarks = groupBy(bookmarkedGroupAccounts.data.filter((item) => item.isBookmarkedAndHasGroup), 'bookmarkGroupName');
26
+ const [isOpen, setIsOpen] = useState(false);
27
+ const managedAccountsList = !isEmpty(managedAccounts.data)
28
+ ? managedAccounts.data.map((account) => ({
29
+ value: getLabel(account.accountNum, account.name),
30
+ key: account.accountNum,
31
+ }))
32
+ : [];
33
+ const groupedBookmarks = useMemo(() => groupBy(bookmarkedGroupAccounts.data.filter((item) => item.isBookmarkedAndHasGroup), 'bookmarkGroupName'), [bookmarkedGroupAccounts.data]);
34
+ const groupedBookmarksOptions = Object.keys(groupedBookmarks).map((groupName) => ({
35
+ value: groupName,
36
+ key: groupedBookmarks[groupName].map((item) => item.accountNumber),
37
+ }));
38
+ const groupedBookmarksOptionsSorted = sortBy(groupedBookmarksOptions, (g) => g.value);
39
+ const dropdownOptions = [...groupedBookmarksOptionsSorted, ...managedAccountsList];
40
+ const selectedBookmarks = filterInfo[SolrKeys.accountNumber].filter((item) => Array.isArray(item.key));
41
+ const selectedAccounts = filterInfo[SolrKeys.accountNumber].filter((item) => !Array.isArray(item.key));
51
42
  const getInfoToolTip = (groupName) => {
52
43
  const list = groupedBookmarks[groupName];
53
44
  return (React.createElement("ul", { className: "no-list-style pf-u-pl-0" }, list.map((b) => {
@@ -58,39 +49,50 @@ export function AccountsBookmarkedGroupFilter(props) {
58
49
  ")"));
59
50
  })));
60
51
  };
61
- const groupAccountsArrObj = Object.keys(groupedBookmarks).map((groupName) => ({
62
- children: React.createElement(React.Fragment, null, groupName),
63
- actionItem: (React.createElement(Tooltip, { content: getInfoToolTip(groupName) },
64
- React.createElement(Label, { color: "cyan", className: "pf-u-ml-auto pf-u-mr-sm", icon: React.createElement(InfoCircleIcon, null) }, groupedBookmarks[groupName].length))),
65
- value: groupName,
66
- key: groupedBookmarks[groupName].map((item) => item.accountNumber),
67
- isNotSearchable: false,
68
- isNonActionable: false,
69
- isNotSelectable: false,
70
- }));
71
- const groupAccountsArrObjSorted = sortBy(groupAccountsArrObj, (g) => g.value);
72
- const list = [
73
- ...groupAccountsArrObjSorted,
74
- ...filterValues,
75
- {
76
- children: canManageBookmarkAccounts ? appendToMenu((bookmarkedGroupAccounts.data || []).length) : React.createElement(React.Fragment, null),
77
- isNotSearchable: true,
78
- isNonActionable: true,
79
- isNotSelectable: true,
80
- },
81
- ];
52
+ const getBookmarksOptions = (options) => {
53
+ return [
54
+ ...options.map((b, id) => (React.createElement(SelectOption, { key: id, value: b, className: "pf-c-select__menu-wrapper", role: "presentation" },
55
+ React.createElement("div", { className: "pf-c-select__menu-item-main" },
56
+ React.createElement("input", { className: "pf-c-check__input pf-u-mr-sm", type: "checkbox", checked: some(filterInfo[SolrKeys.accountNumber], b) }),
57
+ React.createElement("span", null, b.value)),
58
+ Array.isArray(b.key) && (React.createElement(Tooltip, { content: getInfoToolTip(b.value), "aria-label": t('Bookmarked Accounts List') },
59
+ React.createElement(Label, { color: "cyan", className: "pf-u-ml-auto pf-u-mr-sm", icon: React.createElement(InfoCircleIcon, null), "aria-label": t('Bookmarked Accounts') }, b.key.length)))))),
60
+ ...(canManageBookmarkAccounts ? [appendToMenu((bookmarkedGroupAccounts.data || []).length)] : []),
61
+ ];
62
+ };
63
+ const onBookmarksToggle = (open) => {
64
+ setIsOpen(open);
65
+ };
66
+ const onBookmarksSelect = (e, selection) => {
67
+ let selected = filterInfo[SolrKeys.accountNumber];
68
+ if (some(selected, selection)) {
69
+ selected = selected.filter((b) => !isEqual(b, selection));
70
+ }
71
+ else {
72
+ selected = [...selected, selection];
73
+ }
74
+ updateFilter(dispatch, {
75
+ filterKey: SolrKeys.accountNumber,
76
+ values: selected.map((i) => ({ value: i.value, key: i.key })),
77
+ });
78
+ };
79
+ const onBookmarksClear = () => {
80
+ updateFilter(dispatch, {
81
+ filterKey: SolrKeys.accountNumber,
82
+ values: [],
83
+ });
84
+ };
85
+ const onBookmarksFilter = (_, value) => {
86
+ if (!value)
87
+ return getBookmarksOptions(dropdownOptions);
88
+ const input = new RegExp(value, 'i');
89
+ const newOptions = dropdownOptions.filter((b) => input.test(b.value));
90
+ return getBookmarksOptions(newOptions);
91
+ };
82
92
  if (!canReadBookmarkAccounts && !canAccessManagedAccounts) {
83
93
  return null;
84
94
  }
85
- const listLength = groupAccountsArrObj.length + filterValues.length;
86
- const selectedBookmarks = filterInfo[SolrKeys.accountNumber].filter((item) => Array.isArray(item.key));
87
- const selectedAccounts = filterInfo[SolrKeys.accountNumber].filter((item) => !Array.isArray(item.key));
88
- return (React.createElement(MultiSelectDropDownList, { searchable: listLength > FILTER_SEARCHABLE_MODE_LIMIT, selectedItems: toOptions(filterInfo[SolrKeys.accountNumber], { labelKey: 'value' }), placeholder: getDropdownBtnPlaceholder(t(canAccessManagedAccounts ? 'Search for an account' : 'Search for a bookmark'), canAccessManagedAccounts ? selectedAccounts : selectedBookmarks, '', listLength, canAccessManagedAccounts ? t('All accounts') : t('All bookmarks')), "data-tracking-id": "accounts-filter", id: "case-list-group-filter", title: canAccessManagedAccounts ? t('Accounts') : t(filterNamesMap[SolrKeys.accountNumber]), label: canAccessManagedAccounts ? t('Accounts') : t(filterNamesMap[SolrKeys.accountNumber]), onChange: onAccountsFilterChange, list: toOptions(list, {
89
- labelKey: 'value',
90
- childrenKey: 'children',
91
- actionItemKey: 'actionItem',
92
- nonSearchableItemKey: 'isNotSearchable',
93
- nonActionableItemKey: 'isNonActionable',
94
- nonSelectableItemKey: 'isNotSelectable',
95
- }) }));
95
+ return (React.createElement("div", { className: "pf-c-select" },
96
+ React.createElement("label", { htmlFor: "case-list-group-filter" }, canAccessManagedAccounts ? t('Accounts') : t(filterNamesMap[SolrKeys.accountNumber])),
97
+ React.createElement(Select, { variant: SelectVariant.typeaheadMulti, onToggle: onBookmarksToggle, onSelect: onBookmarksSelect, onClear: onBookmarksClear, isOpen: isOpen, onFilter: onBookmarksFilter, placeholderText: getDropdownBtnPlaceholder(t(canAccessManagedAccounts ? 'Search for an account' : 'Search for a bookmark'), canAccessManagedAccounts ? selectedAccounts : selectedBookmarks, '', dropdownOptions.length, canAccessManagedAccounts ? t('All accounts') : t('All bookmarks')), "data-tracking-id": "accounts-filter", id: "case-list-group-filter" }, getBookmarksOptions(dropdownOptions))));
96
98
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseListFilterChips.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilterChips.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMtD,UAAU,MAAM;IACZ,yBAAyB,EAAE,uBAAuB,EAAE,CAAC;IACrD,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA6HhD"}
1
+ {"version":3,"file":"CaseListFilterChips.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilterChips.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMtD,UAAU,MAAM;IACZ,yBAAyB,EAAE,uBAAuB,EAAE,CAAC;IACrD,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA+HhD"}
@@ -1,4 +1,5 @@
1
1
  import { Button, Chip, ChipGroup } from '@patternfly/react-core';
2
+ import { toNewCaseTypeMapper, toOldCaseTypeSwitcher } from '@rh-support/utils';
2
3
  import flatMap from 'lodash/flatMap';
3
4
  import remove from 'lodash/remove';
4
5
  import React, { useContext } from 'react';
@@ -19,7 +20,8 @@ export function CaseListFilterChips(props) {
19
20
  removeFilterItem(dispatch, { filterKey, value });
20
21
  };
21
22
  const getChipKey = (item) => {
22
- return typeof item === 'string' ? item : item.key;
23
+ const newCaseTypeFilterItem = toOldCaseTypeSwitcher(item);
24
+ return typeof item === 'string' ? newCaseTypeFilterItem : item.key;
23
25
  };
24
26
  const getChipValue = (item) => {
25
27
  return typeof item === 'string' ? item : item.value;
@@ -34,6 +36,7 @@ export function CaseListFilterChips(props) {
34
36
  return filterChips;
35
37
  };
36
38
  const getChipGroupForFilter = (filterKey, filterValues, groupName = '') => {
39
+ const caseTypeFilter = filterKey === 'case_type' ? toNewCaseTypeMapper(filterValues) : filterValues;
37
40
  if (props.isSolrSearchDown && !visibleFilterChipsWhenSolrDownSfdcUp.includes(filterKey)) {
38
41
  return React.createElement(React.Fragment, null);
39
42
  }
@@ -41,7 +44,7 @@ export function CaseListFilterChips(props) {
41
44
  return (React.createElement("div", { className: "filter-chip", key: `${filterKey}-bookmarks-${groupName}` },
42
45
  React.createElement("span", { className: "filter-chip__heading" },
43
46
  React.createElement(Trans, null, groupName || filterNamesMap[filterKey] || filterKey)),
44
- React.createElement(ChipGroup, { numChips: 7, className: "pf-c-chip-group__simple" }, renderFilterValueChips(filterKey, filterValues, groupName))));
47
+ React.createElement(ChipGroup, { numChips: 7, className: "pf-c-chip-group__simple" }, renderFilterValueChips(filterKey, caseTypeFilter, groupName))));
45
48
  }
46
49
  };
47
50
  const renderAccountFilterChip = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"ProductsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductsFilter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAe,MAAM,0BAA0B,CAAC;AAUvE,UAAU,MAAM;IACZ,YAAY,EAAE,cAAc,EAAE,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eA0E3C"}
1
+ {"version":3,"file":"ProductsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductsFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAW1D,UAAU,MAAM;IACZ,YAAY,EAAE,cAAc,EAAE,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eA8G3C"}
@@ -1,6 +1,6 @@
1
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
2
- import { MultiSelectDropDownList } from '@rh-support/components';
3
- import { getDropdownBtnPlaceholder, toOptions } from '@rh-support/utils';
1
+ import { Checkbox, Select, SelectOption, SelectVariant } from '@patternfly/react-core';
2
+ import { getDropdownBtnPlaceholder } from '@rh-support/utils';
3
+ import { isUndefined } from 'lodash';
4
4
  import React, { useContext, useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { SolrKeys, SolrPivotKeys } from '../../../enums/filters';
@@ -11,16 +11,17 @@ export function ProductsFilter(props) {
11
11
  const { t } = useTranslation();
12
12
  const dispatch = useContext(CaseListFilterDispatchContext);
13
13
  const { filterInfo } = useContext(CaseListFilterStateContext);
14
+ const { allProducts, filterValues, isSolrSearchDown } = props;
14
15
  const [isOpen, setIsOpen] = useState(false);
15
16
  const toggleIsOpen = (isExpanded) => setIsOpen(isExpanded);
16
- const onFilterChangeMultipleSelect = (selectedProducts) => {
17
- selectedProducts = selectedProducts.map((selectedProduct) => ({
18
- field: SolrKeys.product,
19
- value: selectedProduct.label,
20
- [SolrKeys.version]: [],
21
- }));
22
- updateFilter(dispatch, { filterKey: SolrPivotKeys.product_version, values: selectedProducts });
23
- };
17
+ const selectedProducts = !isUndefined(filterInfo) && !isUndefined(filterInfo[SolrPivotKeys.product_version])
18
+ ? filterInfo[SolrPivotKeys.product_version]
19
+ : [];
20
+ const productOptions = filterValues.map((product) => ({
21
+ field: SolrKeys.product,
22
+ value: product.value,
23
+ [SolrKeys.version]: [],
24
+ }));
24
25
  const onFilterChangeSingleSelect = (event, selectedProduct) => {
25
26
  updateFilter(dispatch, {
26
27
  filterKey: SolrPivotKeys.product_version,
@@ -33,12 +34,36 @@ export function ProductsFilter(props) {
33
34
  // we get filter values from hydra metadata api
34
35
  const singleSelectSolrIsDown = () => {
35
36
  var _a, _b;
36
- return (React.createElement(Select, { variant: SelectVariant.single, "aria-label": "Select Input", onToggle: toggleIsOpen, onSelect: onFilterChangeSingleSelect, selections: (_b = (_a = filterInfo[SolrPivotKeys.product_version]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value, isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Select a product'), "data-tracking-id": "products-filter" }, props.allProducts.map((product) => (React.createElement(SelectOption, { key: product, value: product })))));
37
+ return (React.createElement(Select, { variant: SelectVariant.single, "aria-label": t('Select Input'), onToggle: toggleIsOpen, onSelect: onFilterChangeSingleSelect, selections: (_b = (_a = filterInfo[SolrPivotKeys.product_version]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value, isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Select a product'), "data-tracking-id": "products-filter", id: "products-filter" }, allProducts.map((product) => (React.createElement(SelectOption, { key: product, value: product })))));
38
+ };
39
+ const onSelect = (e, selection) => {
40
+ let newSelectedProducts = [];
41
+ if (selectedProducts === null || selectedProducts === void 0 ? void 0 : selectedProducts.some((product) => selection.value === product.value)) {
42
+ newSelectedProducts = selectedProducts.filter((product) => selection.value !== product.value);
43
+ }
44
+ else {
45
+ newSelectedProducts = [
46
+ ...selectedProducts,
47
+ { field: SolrKeys.product, value: selection.value, [SolrKeys.version]: [] },
48
+ ];
49
+ }
50
+ updateFilter(dispatch, { filterKey: SolrPivotKeys.product_version, values: newSelectedProducts });
51
+ };
52
+ const getProductSelectOptions = (options) => {
53
+ return options.map((p, id) => (React.createElement(SelectOption, { key: id, value: p },
54
+ React.createElement("span", null,
55
+ React.createElement(Checkbox, { id: "product-option-check", checked: selectedProducts === null || selectedProducts === void 0 ? void 0 : selectedProducts.some((product) => p.value === product.value) })),
56
+ React.createElement("span", null, p.value))));
57
+ };
58
+ const onFilter = (_, value) => {
59
+ if (!value)
60
+ return getProductSelectOptions(productOptions);
61
+ const input = new RegExp(value, 'i');
62
+ const newOptions = productOptions.filter((product) => input.test(product.value));
63
+ return getProductSelectOptions(newOptions);
37
64
  };
38
- const multiSelect = () => (React.createElement(MultiSelectDropDownList, { placeholder: getDropdownBtnPlaceholder(t('Select a product'), filterInfo[SolrPivotKeys.product_version].map((i) => i.value), '', props.filterValues.length, t('All selected')), "data-tracking-id": "products-filter", id: "case-list-products-filter", title: t(filterNamesMap[SolrKeys.product]), onChange: onFilterChangeMultipleSelect, selectedItems: toOptions(filterInfo[SolrPivotKeys.product_version], { labelKey: 'value' }), list: toOptions(props.filterValues, {
39
- labelKey: 'value',
40
- }), searchable: true }));
65
+ const multiSelectNew = () => (React.createElement(Select, { "aria-label": t('Select Input'), id: titleId, variant: SelectVariant.typeaheadMulti, onToggle: toggleIsOpen, onSelect: onSelect, isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a product'), filterInfo[SolrPivotKeys.product_version].map((i) => i.value), '', props.filterValues.length, t('All selected')), onFilter: onFilter }, getProductSelectOptions(productOptions)));
41
66
  return (React.createElement("div", { className: "pf-c-select" },
42
- React.createElement("label", { id: titleId }, t(filterNamesMap[SolrKeys.product])),
43
- props.isSolrSearchDown ? singleSelectSolrIsDown() : multiSelect()));
67
+ React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.product])),
68
+ isSolrSearchDown ? singleSelectSolrIsDown() : multiSelectNew()));
44
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TypeFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/TypeFilter.tsx"],"names":[],"mappings":"AAUA,UAAU,MAAM;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAkDvC"}
1
+ {"version":3,"file":"TypeFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/TypeFilter.tsx"],"names":[],"mappings":"AAUA,UAAU,MAAM;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAyDvC"}
@@ -1,5 +1,5 @@
1
1
  import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
2
- import { getDropdownBtnPlaceholder } from '@rh-support/utils';
2
+ import { getDropdownBtnPlaceholder, toNewCaseTypeMapper, toOldCaseTypeSwitcher } from '@rh-support/utils';
3
3
  import React, { useContext, useState } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { SolrKeys } from '../../../enums/filters';
@@ -13,16 +13,21 @@ export function TypeFilter(props) {
13
13
  const [isOpen, setIsOpen] = useState(false);
14
14
  const toggleIsOpen = (isExpanded) => setIsOpen(isExpanded);
15
15
  const onFilterChangeMultipleSelect = (event, selectedTypes) => {
16
- const newState = filterInfo[SolrKeys.type].includes(selectedTypes)
17
- ? filterInfo[SolrKeys.type].filter((item) => item !== selectedTypes)
18
- : [...filterInfo[SolrKeys.type], selectedTypes];
16
+ // To convert the selected type to old case type
17
+ const convertedSelectedType = toOldCaseTypeSwitcher(selectedTypes);
18
+ const newState = filterInfo[SolrKeys.type].includes(convertedSelectedType)
19
+ ? filterInfo[SolrKeys.type].filter((item) => item !== convertedSelectedType)
20
+ : [...filterInfo[SolrKeys.type], convertedSelectedType];
19
21
  updateFilter(dispatch, {
20
22
  filterKey: SolrKeys.type,
21
23
  values: newState,
22
24
  });
23
25
  };
24
26
  const titleId = 'case-list-type-filter';
27
+ // To switch from old case type to new support type
28
+ const newCaseTypesArray = toNewCaseTypeMapper(props.allCaseTypes).sort();
29
+ const toNewCaseTypesFilter = toNewCaseTypeMapper(filterInfo[SolrKeys.type]);
25
30
  return (React.createElement("div", { className: "pf-c-select" },
26
31
  React.createElement("label", { htmlFor: titleId }, t(filterNamesMap[SolrKeys.type])),
27
- React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a case type'), onToggle: toggleIsOpen, onSelect: onFilterChangeMultipleSelect, selections: filterInfo[SolrKeys.type], isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a case type'), filterInfo[SolrKeys.type], ' ', props.allCaseTypes.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "type-filter", hasPlaceholderStyle: true }, props.allCaseTypes.map((filterValue) => (React.createElement(SelectOption, { key: filterValue, value: filterValue }))))));
32
+ React.createElement(Select, { id: titleId, variant: SelectVariant.checkbox, "aria-label": t('Select a support type'), onToggle: toggleIsOpen, onSelect: onFilterChangeMultipleSelect, selections: toNewCaseTypesFilter, isOpen: isOpen, placeholderText: getDropdownBtnPlaceholder(t('Select a support type'), toNewCaseTypesFilter, ' ', props.allCaseTypes.length, t('All selected')), isCheckboxSelectionBadgeHidden: true, "aria-labelledby": titleId, "data-tracking-id": "type-filter", hasPlaceholderStyle: true }, newCaseTypesArray.map((filterValue) => (React.createElement(SelectOption, { key: filterValue, value: filterValue }))))));
28
33
  }
@@ -2,7 +2,7 @@ import { Bullseye, Button, EmptyState, EmptyStateBody, EmptyStateIcon, EmptyStat
2
2
  import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
3
3
  import { PFTable, Table, TableColumnSelector, TablePagination, } from '@rh-support/components';
4
4
  import { GlobalMetadataDispatchContext, GlobalMetadataStateContext, updateUserPreferences, useGlobalStateContext, UserPreferencesKeys, } from '@rh-support/react-context';
5
- import { formatDate, scrollIntoView } from '@rh-support/utils';
5
+ import { formatDate, scrollIntoView, toNewCaseTypeSwitcher } from '@rh-support/utils';
6
6
  import find from 'lodash/find';
7
7
  import flatMap from 'lodash/flatMap';
8
8
  import get from 'lodash/get';
@@ -147,7 +147,7 @@ export function CaseListTable(props) {
147
147
  {
148
148
  id: CaseListColumnIds.alternateCaseId,
149
149
  cellWidth: 10,
150
- title: t('Alternate case ID'),
150
+ title: t('Personal reference number'),
151
151
  sortable: true,
152
152
  accessor: (data) => data.case_alternate_id,
153
153
  show: isColumnVisible(CaseListColumnIds.alternateCaseId),
@@ -155,9 +155,9 @@ export function CaseListTable(props) {
155
155
  {
156
156
  id: CaseListColumnIds.type,
157
157
  cellWidth: 10,
158
- title: t('Case type'),
158
+ title: t('Support type'),
159
159
  sortable: true,
160
- accessor: (data) => data.case_type,
160
+ accessor: (data) => toNewCaseTypeSwitcher(data.case_type),
161
161
  show: isColumnVisible(CaseListColumnIds.type),
162
162
  },
163
163
  {
@@ -1 +1 @@
1
- {"version":3,"file":"ExportCaseListCSV.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ExportCaseListCSV.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAgD7D,UAAU,MAAM;IACZ,uBAAuB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1D,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,eAuF9C"}
1
+ {"version":3,"file":"ExportCaseListCSV.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ExportCaseListCSV.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAgD7D,UAAU,MAAM;IACZ,uBAAuB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1D,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,eAoG9C"}
@@ -11,7 +11,7 @@ import { publicApi } from '@cee-eng/hydrajs';
11
11
  import { Button } from '@patternfly/react-core';
12
12
  import { ToastNotification, useFetch } from '@rh-support/components';
13
13
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
14
- import { downloadCSV, formatDateTime } from '@rh-support/utils';
14
+ import { downloadCSV, formatDateTime, toNewCaseTypeSwitcher } from '@rh-support/utils';
15
15
  import React, { useContext, useState } from 'react';
16
16
  import { Trans, useTranslation } from 'react-i18next';
17
17
  import { SFDCKeys, SolrKeys } from '../../../enums/filters';
@@ -33,8 +33,8 @@ const csvHeadersSolr = [
33
33
  { label: 'Modified by', key: SolrKeys.modifiedBy },
34
34
  { label: 'Modified date', key: SolrKeys.modifiedDate, transform: formatDateTime },
35
35
  { label: 'Uri', key: SolrKeys.uri },
36
- { label: 'Alternate case ID', key: SolrKeys.alternateId },
37
- { label: 'Type', key: SolrKeys.type },
36
+ { label: 'Personal reference number', key: SolrKeys.alternateId },
37
+ { label: 'Support type', key: SolrKeys.type },
38
38
  { label: 'Closed date', key: SolrKeys.caseClosedDate, transform: formatDateTime },
39
39
  ];
40
40
  const csvHeadersSFDC = [
@@ -52,8 +52,8 @@ const csvHeadersSFDC = [
52
52
  { label: 'Modified by', key: SFDCKeys.lastPublicUpdateDateBy },
53
53
  { label: 'Modified date', key: SFDCKeys.lastPublicUpdateDate, transform: formatDateTime },
54
54
  { label: 'Uri', key: SFDCKeys.uri },
55
- { label: 'Alternate case ID', key: SFDCKeys.alternateId },
56
- { label: 'Case type', key: SFDCKeys.caseType },
55
+ { label: 'Personal reference number', key: SFDCKeys.alternateId },
56
+ { label: 'Support type', key: SFDCKeys.caseType },
57
57
  { label: 'Closed date', key: SFDCKeys.caseClosedDate, transform: formatDateTime },
58
58
  ];
59
59
  const groupHeaderSOLR = { label: 'Group', key: SolrKeys.groupName };
@@ -73,6 +73,7 @@ export function ExportCaseListCSV(props) {
73
73
  const filterState = useContext(CaseListFilterStateContext);
74
74
  const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
75
75
  const isOrgAdmin = loggedInUserRights.data.isOrgAdmin();
76
+ // CSV For Secure Support Users
76
77
  const onExportCSVClickSecureSupport = () => __awaiter(this, void 0, void 0, function* () {
77
78
  try {
78
79
  const sfdcFilter = createQueryForCSVDownload(filterState, loggedInUserRights.data, loggedInUsersAccount.data);
@@ -80,19 +81,24 @@ export function ExportCaseListCSV(props) {
80
81
  const sfdcResponse = yield publicApi.caseList.getCaseListFromSFDC(sfdcFilter, false, true);
81
82
  setIsFetchingSFDC(false);
82
83
  const headers = isOrgAdmin ? [...csvHeadersSFDC, groupHeaderSFDC] : csvHeadersSFDC;
83
- downloadCSV(sfdcResponse.cases, headers, 'CaseList.csv');
84
+ // To map the values in csv to new support type
85
+ const updatedCsvData = sfdcResponse.cases.map((row) => (Object.assign(Object.assign({}, row), { caseType: toNewCaseTypeSwitcher(row.caseType) })));
86
+ downloadCSV(updatedCsvData, headers, 'CaseList.csv');
84
87
  }
85
88
  catch (e) {
86
89
  setIsFetchingSFDC(false);
87
90
  ToastNotification.addDangerMessage(t('Could not export CSV'));
88
91
  }
89
92
  });
90
- const partnerSearch = loggedInUserRights.data.hasManagedAccounts();
93
+ const partnerSearch = loggedInUserRights.data.isPartner();
94
+ // CSV For Normal Users
91
95
  const onExportCSVClick = () => __awaiter(this, void 0, void 0, function* () {
92
96
  try {
93
97
  const res = yield request(createQueryForCSVDownload(filterState, loggedInUserRights.data, loggedInUsersAccount.data), partnerSearch, null, loggedInUsersAccount.data.secureSupport);
94
98
  const headers = isOrgAdmin ? [...csvHeadersSolr, groupHeaderSOLR] : csvHeadersSolr;
95
- downloadCSV(res.response.docs, headers, 'CaseList.csv');
99
+ // To map the values in csv to new support type
100
+ const updatedCsvData = res.response.docs.map((row) => (Object.assign(Object.assign({}, row), { case_type: toNewCaseTypeSwitcher(row.case_type) })));
101
+ downloadCSV(updatedCsvData, headers, 'CaseList.csv');
96
102
  }
97
103
  catch (e) {
98
104
  ToastNotification.addDangerMessage(t('Could not export CSV'));
@@ -210,7 +210,7 @@ export function AdvanceSearch(props) {
210
210
  React.createElement("div", { className: "pf-c-select pf-m-expanded", ref: dropdownWrapperRef },
211
211
  React.createElement("div", { className: "pf-c-select__toggle pf-m-typeahead" },
212
212
  React.createElement("div", { className: "pf-c-select__toggle-wrapper" },
213
- React.createElement("input", { value: inputString, onChange: onQueryStringChange, onFocus: onInputFocus, ref: searchInputRef, onKeyDown: onKeyDown, placeholder: t('i18nEnterSolrQuery', 'Enter SOLR query, for example: severity:"1 (Urgent)" and -status:"Waiting on Customer"'), className: `pf-c-form-control pf-c-select__toggle-typeahead ${inputString && isParsingSuccessful ? 'pf-m-success' : ''}`, type: "text", "aria-invalid": isQueryInValid ? true : false, autoComplete: "off", id: "advance-search-typeahead", "aria-label": t('Enter search query'), "aria-describedby": "advance-query-error-helper" })),
213
+ React.createElement("input", { value: inputString, onChange: onQueryStringChange, onFocus: onInputFocus, ref: searchInputRef, onKeyDown: onKeyDown, placeholder: t('i18nEnterSolrQuery', 'Enter SOLR query, for example: severity:"1 (Urgent)" and status:"Waiting on Customer"'), className: `pf-c-form-control pf-c-select__toggle-typeahead ${inputString && isParsingSuccessful ? 'pf-m-success' : ''}`, type: "text", "aria-invalid": isQueryInValid ? true : false, autoComplete: "off", id: "advance-search-typeahead", "aria-label": t('Enter search query'), "aria-describedby": "advance-query-error-helper" })),
214
214
  inputString && (React.createElement(Button, { onClick: onClear, className: "pf-c-button pf-m-plain pf-c-select__toggle-clear", variant: "plain", "data-tracking-id": "clear-search", "aria-label": t('Clear this search') },
215
215
  React.createElement(TimesCircleIcon, null)))),
216
216
  isAutoCompleteListVisible && (React.createElement("ul", { className: "pf-c-select__menu", "aria-labelledby": "advance-search-typeahead-label", role: "listbox" }, autoCompleteList.map((item, index) => (React.createElement("li", { key: index, role: "presentation", className: `pf-c-select__menu-wrapper ${selectedItemIndex === index ? 'pf-m-focus' : ''}` },
@@ -1 +1 @@
1
- {"version":3,"file":"BookmarkedSearchesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/BookmarkedSearchesSelector.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAahE,UAAU,MAAM;IACZ,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,mBAAmB,CAAC;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;CAClC;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,eA6SvD"}
1
+ {"version":3,"file":"BookmarkedSearchesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/BookmarkedSearchesSelector.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAahE,UAAU,MAAM;IACZ,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,mBAAmB,CAAC;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;CAClC;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,eAgTvD"}
@@ -128,7 +128,7 @@ export function BookmarkedSearchesSelector(props) {
128
128
  setSelectedSearch(selectedItem);
129
129
  const { filterState: filterStateSaved, queryString, type, sortState } = searchQuery;
130
130
  if (type === CaseSearchQueryType.ADVANCED) {
131
- const newFilterState = createFilterStateFromAdvancedQuery((_a = parse(queryString)) === null || _a === void 0 ? void 0 : _a.replace(/ and /g, ' AND ').replace(/ or /g, ' OR '), globalMetadataState, initialCaseFilterState, queryString, type);
131
+ const newFilterState = createFilterStateFromAdvancedQuery((_a = parse(queryString)) === null || _a === void 0 ? void 0 : _a.replace(/ and /g, ' AND ').replace(/ or /g, ' OR ').replace('Bug OR defect', 'Bug or defect'), globalMetadataState, initialCaseFilterState, queryString, type);
132
132
  updateFilterState(dispatch, newFilterState);
133
133
  }
134
134
  else {
@@ -1,5 +1,5 @@
1
1
  interface IProps {
2
- defaultSavedSearchName: string;
2
+ defaultSavedSearchName?: string;
3
3
  }
4
4
  export declare function CaseSearch(props: IProps): JSX.Element;
5
5
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/CaseSearch.tsx"],"names":[],"mappings":"AAsBA,UAAU,MAAM;IACZ,sBAAsB,EAAE,MAAM,CAAC;CAClC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAoLvC"}
1
+ {"version":3,"file":"CaseSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/CaseSearch.tsx"],"names":[],"mappings":"AAsBA,UAAU,MAAM;IACZ,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAqLvC"}
@@ -53,7 +53,7 @@ export function CaseSearch(props) {
53
53
  updateFilterQuery(dispatch, { type: getType(), queryString, parsedQuery });
54
54
  };
55
55
  const onCaseSearchAdvanced = (type, parsedQuery = '', queryStringInputBox = searchVal) => {
56
- const newFilterState = createFilterStateFromAdvancedQuery(parsedQuery.replace(/ and /g, ' AND ').replace(/ or /g, ' OR '), globalMetadataState, filterState, queryStringInputBox, type);
56
+ const newFilterState = createFilterStateFromAdvancedQuery(parsedQuery.replace(/ and /g, ' AND ').replace(/ or /g, ' OR ').replace('Bug OR defect', 'Bug or defect'), globalMetadataState, filterState, queryStringInputBox, type);
57
57
  // here should create filter
58
58
  updateFilterState(dispatch, newFilterState);
59
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useAdvanceSearchParser.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/useAdvanceSearchParser.tsx"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,MAAM,EAAE;;CAAA;yBASzB,MAAM;6BAIF,MAAM;;EA2LzC"}
1
+ {"version":3,"file":"useAdvanceSearchParser.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/useAdvanceSearchParser.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,MAAM,EAAE;;CAAA;yBASzB,MAAM;6BAIF,MAAM;;EA6LzC"}
@@ -1,4 +1,5 @@
1
1
  import { useGlobalStateContext } from '@rh-support/react-context';
2
+ import { toNewCaseTypeMapper } from '@rh-support/utils';
2
3
  import PEG from 'pegjs';
3
4
  import { useEffect, useRef } from 'react';
4
5
  import { SolrKeys } from '../../../enums/filters';
@@ -106,7 +107,7 @@ export default function useAdvanceSearchParser({ onInit }) {
106
107
  / "ownerName" {return "${SolrKeys.contactName}";}
107
108
  / "caseNumber" {return "${SolrKeys.caseNumber}";}
108
109
  / "openshiftClusterId" {return "${SolrKeys.openshiftClusterId}";}
109
- / "alternateCaseId" {return "${SolrKeys.alternateId}";}
110
+ / "personalReferenceNumber" {return "${SolrKeys.alternateId}";}
110
111
 
111
112
  cepFieldName = "CEP" {return "${SolrKeys.cep}";}
112
113
  ftsFieldName = "FTS" {return "${SolrKeys.fts}";}
@@ -140,9 +141,11 @@ export default function useAdvanceSearchParser({ onInit }) {
140
141
  / groupMultipleValue / _
141
142
  groupMultipleValue = "(" val:(groupValue)+ ")" { return joinByOr(val); }
142
143
 
143
- caseTypeFieldName = "caseType" {return "${SolrKeys.type}";}
144
+ caseTypeFieldName = "supportType" {return "${SolrKeys.type}";}
144
145
  caseTypeValue = string
145
- / ${(allCaseTypes.data || []).map((caseType) => `'"${caseType}"' { return '"${caseType}"'; }`).join(' / ')}
146
+ / ${(toNewCaseTypeMapper(allCaseTypes.data).sort() || [])
147
+ .map((caseType) => `'"${caseType}"' { return '"${caseType}"'; }`)
148
+ .join(' / ')}
146
149
  / caseTypeMultipleValue / _
147
150
  caseTypeMultipleValue = "(" val:(caseTypeValue)+ ")" { return joinByOr(val); }
148
151
 
@@ -529,7 +529,7 @@
529
529
  th.pf-c-table__sort[data-label='Created by'],
530
530
  th.pf-m-width-15[data-label='Product and version'],
531
531
  th.pf-c-table__sort[data-label='Account number'],
532
- th.pf-c-table__sort[data-label='Alternate case ID'] {
532
+ th.pf-c-table__sort[data-label='Personal reference number'] {
533
533
  min-width: 220px;
534
534
  }
535
535
 
@@ -69,7 +69,7 @@ export const caseTableColumSortNamesMap = {
69
69
  [CaseListColumnIds.modified]: 'Last modified date',
70
70
  [CaseListColumnIds.accountNumber]: 'Account number',
71
71
  [CaseListColumnIds.group]: 'Groups',
72
- [CaseListColumnIds.alternateCaseId]: 'Alternate case Id',
73
- [CaseListColumnIds.type]: 'Case type',
72
+ [CaseListColumnIds.alternateCaseId]: 'Personal reference number',
73
+ [CaseListColumnIds.type]: 'Support type',
74
74
  [CaseListColumnIds.caseClosedDate]: 'Close date',
75
75
  };
@@ -16,6 +16,6 @@ export const fieldNameToSolrFieldMapping = {
16
16
  [SolrKeys.version]: 'productVersion',
17
17
  [SolrKeys.caseContactSSO]: 'ownedByMe',
18
18
  [SolrKeys.createdBySsoUsername]: 'createdBySsoUsername',
19
- [SolrKeys.type]: 'caseType',
19
+ [SolrKeys.type]: 'supportType',
20
20
  };
21
- export const advanceSearchFieldNameToSolrFieldMapping = Object.assign(Object.assign({}, fieldNameToSolrFieldMapping), { [SolrKeys.fts]: 'FTS', [SolrKeys.cep]: 'CEP', [SolrKeys.accountName]: 'accountName', [SolrKeys.caseNumber]: 'caseNumber', [SolrKeys.caseOwner]: 'ownerSSO', [SolrKeys.modifiedBy]: 'lastModifiedByName', [SolrKeys.createdBySsoUsername]: 'createdBySSO', [SolrKeys.createdBy]: 'createdByName', [SolrKeys.contactName]: 'contactName', [SolrKeys.caseContactSSO]: 'contactSSO', [SolrKeys.modifiedDate]: 'lastModifiedDate', [SolrKeys.createdDate]: 'createdDate', [SolrKeys.description]: 'description', [SolrKeys.caseSummary]: 'summary', [SolrKeys.alternateId]: 'alternateId', [SolrKeys.caseClosedDate]: 'closedDate' });
21
+ export const advanceSearchFieldNameToSolrFieldMapping = Object.assign(Object.assign({}, fieldNameToSolrFieldMapping), { [SolrKeys.fts]: 'FTS', [SolrKeys.cep]: 'CEP', [SolrKeys.accountName]: 'accountName', [SolrKeys.caseNumber]: 'caseNumber', [SolrKeys.caseOwner]: 'ownerSSO', [SolrKeys.modifiedBy]: 'lastModifiedByName', [SolrKeys.createdBySsoUsername]: 'createdBySSO', [SolrKeys.createdBy]: 'createdByName', [SolrKeys.contactName]: 'contactName', [SolrKeys.caseContactSSO]: 'contactSSO', [SolrKeys.modifiedDate]: 'lastModifiedDate', [SolrKeys.createdDate]: 'createdDate', [SolrKeys.description]: 'description', [SolrKeys.caseSummary]: 'summary', [SolrKeys.alternateId]: 'personalReferenceNumber', [SolrKeys.caseClosedDate]: 'closedDate' });
@@ -98,7 +98,7 @@ export declare enum SFDCKeys {
98
98
  groupNumber = "groupNumber",
99
99
  groupName = "groupName",
100
100
  alternateId = "alternateId",
101
- caseType = "caseType",
101
+ caseType = "supportType",
102
102
  caseClosedDate = "lastClosedAt"
103
103
  }
104
104
  export declare const sfdcFieldToSolrMap: {
@@ -121,7 +121,7 @@ export declare const sfdcFieldToSolrMap: {
121
121
  groupNumber: SolrKeys;
122
122
  groupName: SolrKeys;
123
123
  alternateId: SolrKeys;
124
- caseType: SolrKeys;
124
+ supportType: SolrKeys;
125
125
  lastClosedAt: SolrKeys;
126
126
  };
127
127
  export declare const AdditionalFilterLabels: {
@@ -1 +1 @@
1
- {"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../../src/enums/filters.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAChB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;CACpB;AAED,oBAAY,QAAQ;IAChB,UAAU,gBAAgB;IAC1B,WAAW,iBAAiB;IAC5B,OAAO,iBAAiB;IACxB,MAAM,gBAAgB;IACtB,aAAa,uBAAuB;IACpC,KAAK,sBAAsB;IAC3B,SAAS,oBAAoB;IAC7B,QAAQ,kBAAkB;IAC1B,SAAS,4BAA4B;IACrC,SAAS,eAAe;IACxB,WAAW,qBAAqB;IAChC,cAAc,8BAA8B;IAC5C,UAAU,6BAA6B;IACvC,OAAO,iBAAiB;IACxB,SAAS,uBAAuB;IAChC,oBAAoB,gCAAgC;IACpD,WAAW,qBAAqB;IAChC,UAAU,4BAA4B;IACtC,YAAY,0BAA0B;IACtC,oBAAoB,iCAAiC;IACrD,sBAAsB,+BAA+B;IACrD,WAAW,qBAAqB;IAChC,GAAG,QAAQ;IACX,GAAG,cAAc;IACjB,IAAI,cAAc;IAClB,GAAG,gBAAgB;IACnB,WAAW,sBAAsB;IACjC,WAAW,sBAAsB;IACjC,cAAc,oBAAoB;IAClC,kBAAkB,8BAA8B;CACnD;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA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',
67
67
  case_24_7: 'FTS',
68
- case_type: 'caseType',
68
+ case_type: 'supportType',
69
69
  case_is_cep: 'CEP',
70
- case_alternate_id: 'alternateCaseId',
70
+ case_alternate_id: 'personalReferenceNumber',
71
71
  case_closedDate: 'closedDate',
72
72
  case_openshift_cluster_id: 'openshiftClusterId',
73
73
  case_account_name: 'accountName',
@@ -103,7 +103,7 @@ export var SFDCKeys;
103
103
  SFDCKeys["groupNumber"] = "groupNumber";
104
104
  SFDCKeys["groupName"] = "groupName";
105
105
  SFDCKeys["alternateId"] = "alternateId";
106
- SFDCKeys["caseType"] = "caseType";
106
+ SFDCKeys["caseType"] = "supportType";
107
107
  SFDCKeys["caseClosedDate"] = "lastClosedAt";
108
108
  })(SFDCKeys || (SFDCKeys = {}));
109
109
  export const sfdcFieldToSolrMap = {
@@ -69,7 +69,7 @@ export default {
69
69
  'Search for an bookmark': 'Suche nach einem Lesezeichen',
70
70
  Username: 'Benutzername',
71
71
  Basic: 'Grundlegend',
72
- i18nEnterSolrQuery: 'Geben Sie die SOLR-Abfrage ein, zum Beispiel: severity: "1 (Dringend)" und -status: "Wartet auf den Kunden"',
72
+ i18nEnterSolrQuery: 'Geben Sie die SOLR-Abfrage ein, zum Beispiel: severity: "1 (Dringend)" und status: "Wartet auf den Kunden"',
73
73
  Export: 'Exportieren',
74
74
  'Close case': 'Fall schließen',
75
75
  Collapse: 'Reduzieren',
@@ -59,7 +59,7 @@ export default {
59
59
  Advanced: 'Avancé',
60
60
  Username: "Nom d'utilisateur",
61
61
  Basic: 'De base',
62
- i18nEnterSolrQuery: 'Entrez la requête SOLR, par exemple : sévérité : ""1 (Urgent)"" et -statut : ""Attente Client""',
62
+ i18nEnterSolrQuery: 'Entrez la requête SOLR, par exemple : sévérité : ""1 (Urgent)"" et statut : ""Attente Client""',
63
63
  Export: 'Exportation',
64
64
  'Close case': 'Clôturer le dossier',
65
65
  Collapse: 'Effondrement',
@@ -60,7 +60,7 @@ export default {
60
60
  Advanced: '詳細検索',
61
61
  Username: 'ユーザー名',
62
62
  Basic: '基本検索',
63
- i18nEnterSolrQuery: 'SOLR クエリーを入力します (例: severity:""1(Urgent)"" と -status:""Waiting on Customer""',
63
+ i18nEnterSolrQuery: 'SOLR クエリーを入力します (例: severity:""1(Urgent)"" と status:""Waiting on Customer""',
64
64
  Export: 'エクスポート',
65
65
  'Close case': 'ケースのクローズ',
66
66
  Collapse: '折りたたむ',
@@ -59,7 +59,7 @@ export default {
59
59
  Advanced: '고급 검색',
60
60
  Username: '사용자 이름',
61
61
  Basic: '기본 검색',
62
- i18nEnterSolrQuery: 'SOLR 쿼리를 입력합니다 (예: severity: ""1 (Urgent)"" 및 -status:""Waiting on Customer"")',
62
+ i18nEnterSolrQuery: 'SOLR 쿼리를 입력합니다 (예: severity: ""1 (Urgent)"" 및 status:""Waiting on Customer"")',
63
63
  Export: '내보내기',
64
64
  'Close case': '케이스 닫기',
65
65
  Collapse: '축소',
@@ -59,7 +59,7 @@ export default {
59
59
  Advanced: 'Avançado',
60
60
  Username: 'Nome de usuário',
61
61
  Basic: 'Básico',
62
- i18nEnterSolrQuery: 'Digite a consulta SOLR, por exemplo: severity:""1 (Urgent)"" and -status:""Waiting on Customer""',
62
+ i18nEnterSolrQuery: 'Digite a consulta SOLR, por exemplo: severity:""1 (Urgent)"" and status:""Waiting on Customer""',
63
63
  Export: 'Exportar',
64
64
  'Close case': 'Fechar caso',
65
65
  Collapse: 'Recolher',
@@ -59,7 +59,7 @@ export default {
59
59
  Advanced: 'Расширенный',
60
60
  Username: 'Имя пользователя',
61
61
  Basic: 'Простой',
62
- i18nEnterSolrQuery: 'Введите SOLR-запрос, например: severity:""1 (срочный)"" and -status:""Ожидание клиента""',
62
+ i18nEnterSolrQuery: 'Введите SOLR-запрос, например: severity:""1 (срочный)"" and status:""Ожидание клиента""',
63
63
  Export: 'Экспорт',
64
64
  'Close case': 'Закрыть обращение',
65
65
  Collapse: 'Свернуть',
@@ -61,7 +61,7 @@ export default {
61
61
  Advanced: '高级',
62
62
  Username: '用户名',
63
63
  Basic: '基本',
64
- i18nEnterSolrQuery: '输入 SOLR 查询,例如:severity:""1 (Urgent)"" and -status:""Waiting on Customer""',
64
+ i18nEnterSolrQuery: '输入 SOLR 查询,例如:severity:""1 (Urgent)"" and status:""Waiting on Customer""',
65
65
  Export: '导出',
66
66
  'Close case': '关闭问题单',
67
67
  Collapse: '折叠',
@@ -44,7 +44,7 @@ export function getCaseList(filterState, loggedInUser, loggedInUserAccount, abor
44
44
  let showErrorMessage = false;
45
45
  let caseListResponse;
46
46
  const solrFilter = createSolrQueryFromFilterState(filterState, loggedInUser);
47
- const partnerSearch = loggedInUser.hasManagedAccounts();
47
+ const partnerSearch = loggedInUser.isPartner();
48
48
  //sfdc returns wrong result, for now only call sfdc when we have no filter applied
49
49
  const isSfdcSearchRequired = isNoFilterApplied(filterState) &&
50
50
  !filterState.filterQueryInfo.queryString &&
@@ -1 +1 @@
1
- {"version":3,"file":"caseSearchUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseSearchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAUxD,OAAO,EACH,oBAAoB,EACpB,WAAW,EAId,MAAM,+CAA+C,CAAC;AAOvD,OAAO,EAEH,mBAAmB,EAEtB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,6BAA6B,UAAU,CAAC;AACrD,eAAO,MAAM,oCAAoC,MAAM,CAAC;AACxD,eAAO,MAAM,iCAAiC,SAAS,CAAC;AACxD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,iBAAS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EAAE,QAAQ,EAC5B,oBAAoB,KAAA,EACpB,UAAU,SAAI,EACd,UAAU,SAAO,OAcpB;AAkBD,iBAAS,8BAA8B,CACnC,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,QAAQ,EACtB,mBAAmB,EAAE,OAAO,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,eAAe,CAAC,CAuD1B;AAED,iBAAS,6BAA6B,CAAC,QAAQ,GAAE,qBAAqB,EAAO,GAAG,qBAAqB,EAAE,CAEtG;AAcD,iBAAS,6BAA6B,CAAC,WAAW,EAAE,oBAAoB,UAUvE;AAED,iBAAS,6BAA6B,CAClC,QAAQ,EAAE,MAAM,EAChB,mBAAmB,EAAE,oBAAoB,EACzC,QAAQ,CAAC,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,EACpB,UAAU,GAAE,mBAA+C,wBAsD9D;AAGD,iBAAS,kCAAkC,CACvC,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,oBAAoB,EACzC,kBAAkB,EAAE,oBAAoB,EACxC,WAAW,GAAE,MAAW,EACxB,IAAI,GAAE,mBAA+C,wBA+DxD;AAuKD,OAAO,EACH,8BAA8B,EAC9B,sCAAsC,EACtC,oDAAoD,EACpD,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,wCAAwC,EACxC,kCAAkC,GACrC,CAAC"}
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { areAllValidCaseNumbers, buildSolrQuery, isValidCaseNumber, parseSolrQuery, solr } from '@rh-support/utils';
12
+ import { areAllValidCaseNumbers, buildSolrQuery, isValidCaseNumber, parseSolrQuery, solr, toNewCaseTypeMapper, toOldCaseTypeMapper, } from '@rh-support/utils';
13
13
  import camelCase from 'lodash/camelCase';
14
14
  import flatMap from 'lodash/flatMap';
15
15
  import isEmpty from 'lodash/isEmpty';
@@ -84,7 +84,9 @@ function createUserFriendlyQueryFromFilterState(filterInfo, filterQuery, useKeyF
84
84
  : _filterKey;
85
85
  const fieldValue = isKeyValuePair(filterInfo[_filterKey])
86
86
  ? filterInfo[_filterKey].map((item) => (useKeyForKVPair ? item.key : item.value))
87
- : filterInfo[_filterKey];
87
+ : _filterKey === SolrKeys.type
88
+ ? toNewCaseTypeMapper(filterInfo[_filterKey])
89
+ : filterInfo[_filterKey];
88
90
  if (_filterKey !== ProductVersionKey) {
89
91
  Array.isArray(fieldValue) && fieldValue.length > 0 && solrQuery.where(fieldLabel).in(flatMap(fieldValue));
90
92
  }
@@ -106,7 +108,9 @@ function createUserFriendlyQueryFromFilterStateAdvancedSearch(filterInfo, filter
106
108
  : _filterKey;
107
109
  const fieldValue = isKeyValuePair(filterInfo[_filterKey])
108
110
  ? filterInfo[_filterKey].map((item) => (_filterKey === SolrKeys.accountNumber ? item.key : item.value))
109
- : filterInfo[_filterKey];
111
+ : _filterKey === SolrKeys.type
112
+ ? toNewCaseTypeMapper(filterInfo[_filterKey])
113
+ : filterInfo[_filterKey];
110
114
  if (_filterKey !== ProductVersionKey) {
111
115
  Array.isArray(fieldValue) && fieldValue.length > 0 && solrQuery.where(fieldLabel).in(flatMap(fieldValue));
112
116
  }
@@ -345,6 +349,9 @@ function createFilterStateFromAdvancedQuery(queryString, globalMetadataState, cu
345
349
  if (_key === SolrKeys.product) {
346
350
  newFilterInfo[SolrPivotKeys.product_version] = generateProductVersionPivotValue(filterObj[_key]);
347
351
  }
352
+ if (_key === SolrKeys.type) {
353
+ newFilterInfo[SolrKeys.type] = toOldCaseTypeMapper(filterObj[_key]);
354
+ }
348
355
  // if it's an unnamed field we should add it to free text querystring
349
356
  else if (_key === '<implicit>') {
350
357
  advanceToBasicQuery.push(filterObj[_key]);
@@ -17,7 +17,7 @@ export const filterNamesMap = {
17
17
  [SolrKeys.caseNumber]: 'Case number',
18
18
  [SolrKeys.createdBySsoUsername]: 'Created by me',
19
19
  [SolrKeys.caseContactSSO]: 'Owned by me',
20
- [SolrKeys.type]: 'Case type',
20
+ [SolrKeys.type]: 'Support type',
21
21
  usernameFilterTitle: 'Username',
22
22
  };
23
23
  export const UpdatedCaseDataEvent = 'PCM-Next > case-list-data-background-refresh';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/cases",
3
- "version": "1.0.43",
3
+ "version": "1.0.100-beta.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.15.64",
29
+ "@cee-eng/hydrajs": "4.15.71",
30
30
  "@patternfly/patternfly": "4.196.7",
31
31
  "@patternfly/pfe-collapse": "1.12.3",
32
32
  "@patternfly/react-core": "4.264.0",
@@ -46,16 +46,16 @@
46
46
  "solr-query-builder": "1.0.1"
47
47
  },
48
48
  "dependencies": {
49
- "@cee-eng/hydrajs": "4.15.64",
49
+ "@cee-eng/hydrajs": "4.15.71",
50
50
  "@patternfly/patternfly": "4.196.7",
51
51
  "@patternfly/pfe-collapse": "1.12.3",
52
52
  "@patternfly/react-core": "4.264.0",
53
53
  "@patternfly/react-table": "4.111.33",
54
- "@rh-support/components": "1.2.24",
55
- "@rh-support/react-context": "1.0.32",
56
- "@rh-support/types": "0.2.0",
57
- "@rh-support/user-permissions": "1.0.14",
58
- "@rh-support/utils": "1.0.12",
54
+ "@rh-support/components": "1.2.100-beta.0",
55
+ "@rh-support/react-context": "1.0.100-beta.0",
56
+ "@rh-support/types": "0.2.1-beta.58",
57
+ "@rh-support/user-permissions": "1.0.100-beta.0",
58
+ "@rh-support/utils": "1.0.10-beta.58",
59
59
  "i18next": "^19.0.1",
60
60
  "localforage": "^1.7.3",
61
61
  "lodash": "^4.17.21",
@@ -67,7 +67,7 @@
67
67
  "solr-query-builder": "1.0.1"
68
68
  },
69
69
  "devDependencies": {
70
- "@testing-library/jest-dom": "^5.14.1",
70
+ "@testing-library/jest-dom": "^5.16.5",
71
71
  "@testing-library/react": "^12.0.0",
72
72
  "@testing-library/user-event": "^13.1.9",
73
73
  "@types/i18next": "^12.1.0",
@@ -99,5 +99,5 @@
99
99
  "not ie <= 11",
100
100
  "not op_mini all"
101
101
  ],
102
- "gitHead": "415d159b0afb5dddc9247a314d138571433625a2"
102
+ "gitHead": "4c0ede0aaa49a13ac29080a408b32a10b09c1779"
103
103
  }