@rh-support/cases 2.6.182 → 2.6.186

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 (81) hide show
  1. package/lib/esm/components/case-list/CaseList.d.ts +7 -0
  2. package/lib/esm/components/case-list/CaseList.d.ts.map +1 -1
  3. package/lib/esm/components/case-list/CaseList.js +108 -143
  4. package/lib/esm/components/case-list/CaseListContext.d.ts.map +1 -1
  5. package/lib/esm/components/case-list/CaseListContext.js +2 -5
  6. package/lib/esm/components/case-list/CaseListFilterReducer.d.ts +4 -6
  7. package/lib/esm/components/case-list/CaseListFilterReducer.d.ts.map +1 -1
  8. package/lib/esm/components/case-list/CaseListFilterReducer.js +12 -3
  9. package/lib/esm/components/case-list/CaseListReducer.d.ts +10 -22
  10. package/lib/esm/components/case-list/CaseListReducer.d.ts.map +1 -1
  11. package/lib/esm/components/case-list/CaseListReducer.js +7 -25
  12. package/lib/esm/components/case-list/case-list-filters/AccountsFilter.d.ts.map +1 -1
  13. package/lib/esm/components/case-list/case-list-filters/AccountsFilter.js +11 -18
  14. package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.d.ts.map +1 -1
  15. package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.js +5 -4
  16. package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.d.ts +7 -1
  17. package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.d.ts.map +1 -1
  18. package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.js +15 -7
  19. package/lib/esm/components/case-list/case-list-filters/CaseListFilters.d.ts +5 -2
  20. package/lib/esm/components/case-list/case-list-filters/CaseListFilters.d.ts.map +1 -1
  21. package/lib/esm/components/case-list/case-list-filters/CaseListFilters.js +14 -14
  22. package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.d.ts +3 -1
  23. package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.d.ts.map +1 -1
  24. package/lib/esm/components/case-list/case-list-filters/ProductFilterChip.js +2 -2
  25. package/lib/esm/components/case-list/case-list-filters/ProductsFilter.d.ts +4 -5
  26. package/lib/esm/components/case-list/case-list-filters/ProductsFilter.d.ts.map +1 -1
  27. package/lib/esm/components/case-list/case-list-filters/ProductsFilter.js +54 -15
  28. package/lib/esm/components/case-list/case-list-filters/SeverityFilter.d.ts +3 -0
  29. package/lib/esm/components/case-list/case-list-filters/SeverityFilter.d.ts.map +1 -1
  30. package/lib/esm/components/case-list/case-list-filters/SeverityFilter.js +44 -18
  31. package/lib/esm/components/case-list/case-list-filters/StatusFilter.d.ts +3 -0
  32. package/lib/esm/components/case-list/case-list-filters/StatusFilter.d.ts.map +1 -1
  33. package/lib/esm/components/case-list/case-list-filters/StatusFilter.js +44 -14
  34. package/lib/esm/components/case-list/case-list-filters/VersionsFilter.d.ts +3 -1
  35. package/lib/esm/components/case-list/case-list-filters/VersionsFilter.d.ts.map +1 -1
  36. package/lib/esm/components/case-list/case-list-filters/VersionsFilter.js +32 -61
  37. package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts +3 -7
  38. package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts.map +1 -1
  39. package/lib/esm/components/case-list/case-list-table/CaseListTable.js +58 -69
  40. package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.d.ts +5 -0
  41. package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.d.ts.map +1 -1
  42. package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.js +68 -38
  43. package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.d.ts.map +1 -1
  44. package/lib/esm/components/case-list/case-list-table/ExportCaseListCSV.js +15 -5
  45. package/lib/esm/components/case-list/case-list-table/SeverityLabel.js +1 -1
  46. package/lib/esm/components/case-list/case-list-table/TableActionsDropdown.d.ts.map +1 -1
  47. package/lib/esm/components/case-list/case-list-table/TableActionsDropdown.js +3 -2
  48. package/lib/esm/components/case-list/case-search/AdvanceSearch.d.ts.map +1 -1
  49. package/lib/esm/components/case-list/case-search/AdvanceSearch.js +1 -1
  50. package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.d.ts.map +1 -1
  51. package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.js +0 -1
  52. package/lib/esm/components/case-list/case-search/CaseSearch.d.ts.map +1 -1
  53. package/lib/esm/components/case-list/case-search/CaseSearch.js +6 -6
  54. package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.d.ts.map +1 -1
  55. package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.js +1 -2
  56. package/lib/esm/css/caseList.css +22 -99
  57. package/lib/esm/enums/case.d.ts +1 -2
  58. package/lib/esm/enums/case.d.ts.map +1 -1
  59. package/lib/esm/enums/case.js +1 -14
  60. package/lib/esm/hooks/useExportCaseListCSV.d.ts.map +1 -1
  61. package/lib/esm/hooks/useExportCaseListCSV.js +9 -1
  62. package/lib/esm/test-utils/mockData.js +1 -1
  63. package/lib/esm/utils/caseSearchUtils.d.ts.map +1 -1
  64. package/lib/esm/utils/caseSearchUtils.js +6 -28
  65. package/lib/esm/utils/constants.d.ts +1 -2
  66. package/lib/esm/utils/constants.d.ts.map +1 -1
  67. package/lib/esm/utils/constants.js +3 -14
  68. package/lib/esm/utils/mockSolrResponse.js +1 -1
  69. package/package.json +6 -7
  70. package/lib/esm/utils/caseListGraphQLUtils.d.ts +0 -28
  71. package/lib/esm/utils/caseListGraphQLUtils.d.ts.map +0 -1
  72. package/lib/esm/utils/caseListGraphQLUtils.js +0 -244
  73. package/lib/esm/utils/caseListMapper.d.ts +0 -6
  74. package/lib/esm/utils/caseListMapper.d.ts.map +0 -1
  75. package/lib/esm/utils/caseListMapper.js +0 -36
  76. package/lib/esm/utils/caseListVariablesBuilder.d.ts +0 -14
  77. package/lib/esm/utils/caseListVariablesBuilder.d.ts.map +0 -1
  78. package/lib/esm/utils/caseListVariablesBuilder.js +0 -193
  79. package/lib/esm/utils/statusUtils.d.ts +0 -3
  80. package/lib/esm/utils/statusUtils.d.ts.map +0 -1
  81. package/lib/esm/utils/statusUtils.js +0 -22
@@ -1,18 +1,12 @@
1
1
  var CaseListReducerEnum;
2
2
  (function (CaseListReducerEnum) {
3
3
  CaseListReducerEnum["updateState"] = "SET_STATE";
4
- CaseListReducerEnum["appendDocs"] = "APPEND_DOCS";
5
4
  })(CaseListReducerEnum || (CaseListReducerEnum = {}));
6
5
  const caseListReducer = (state, action) => {
7
6
  switch (action.type) {
8
7
  case CaseListReducerEnum.updateState: {
9
8
  return Object.assign(Object.assign({}, state), action.payload);
10
9
  }
11
- case CaseListReducerEnum.appendDocs: {
12
- const { docs, hasNextPage, endCursor } = action.payload;
13
- return Object.assign(Object.assign({}, state), { caseList: Object.assign(Object.assign({}, state.caseList), { docs: [...state.caseList.docs, ...docs] }), hasNextPage,
14
- endCursor, isLoadingMore: false });
15
- }
16
10
  }
17
11
  };
18
12
  const setCaseList = (dispatch, caseList) => {
@@ -33,34 +27,22 @@ const setIsFetching = (dispatch, isFetching) => {
33
27
  payload: { isFetching },
34
28
  });
35
29
  };
36
- const setCurrentQuery = (dispatch, currentQuery) => {
37
- dispatch({
38
- type: CaseListReducerEnum.updateState,
39
- payload: { currentQuery },
40
- });
41
- };
42
- const setIsLoadingMore = (dispatch, isLoadingMore) => {
30
+ const setFilterValuesFromFacetResponse = (dispatch, filterValuesFromFacetResponse) => {
43
31
  dispatch({
44
32
  type: CaseListReducerEnum.updateState,
45
- payload: { isLoadingMore },
46
- });
47
- };
48
- const appendCaseList = (dispatch, docs, hasNextPage, endCursor) => {
49
- dispatch({
50
- type: CaseListReducerEnum.appendDocs,
51
- payload: { docs, hasNextPage, endCursor },
33
+ payload: { filterValuesFromFacetResponse },
52
34
  });
53
35
  };
54
- const setCursorInfo = (dispatch, hasNextPage, endCursor) => {
36
+ const setPivotValues = (dispatch, pivotValues) => {
55
37
  dispatch({
56
38
  type: CaseListReducerEnum.updateState,
57
- payload: { hasNextPage, endCursor },
39
+ payload: { pivotValues },
58
40
  });
59
41
  };
60
- const setLoadMoreError = (dispatch, loadMoreError, loadMoreRetryCount) => {
42
+ const setCurrentQuery = (dispatch, currentQuery) => {
61
43
  dispatch({
62
44
  type: CaseListReducerEnum.updateState,
63
- payload: { loadMoreError, loadMoreRetryCount, isLoadingMore: false },
45
+ payload: { currentQuery },
64
46
  });
65
47
  };
66
- export { caseListReducer, setCaseList, setChipsNameSsoMap, setIsFetching, setCurrentQuery, setIsLoadingMore, appendCaseList, setCursorInfo, setLoadMoreError, };
48
+ export { caseListReducer, setCaseList, setChipsNameSsoMap, setIsFetching, setFilterValuesFromFacetResponse, setPivotValues, setCurrentQuery, };
@@ -1 +1 @@
1
- {"version":3,"file":"AccountsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AccountsFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAO1F,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,UAAU,MAAM;IACZ,uBAAuB,EAAE,OAAO,CAAC;CACpC;AAED,eAAO,MAAM,gCAAgC,GAAI,SAAS,QAAQ,WAMjE,CAAC;AACF,eAAO,MAAM,+BAA+B,GAAI,SAAS,OAAO,CAAC,sBAAsB,CAAC,WAEvF,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,cAAS,EAAE,eAAU,QACgC,CAAC;AAE/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBAqG3C"}
1
+ {"version":3,"file":"AccountsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AccountsFilter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAQ1F,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,UAAU,MAAM;IACZ,uBAAuB,EAAE,OAAO,CAAC;CACpC;AAED,eAAO,MAAM,gCAAgC,GAAI,SAAS,QAAQ,WAMjE,CAAC;AACF,eAAO,MAAM,+BAA+B,GAAI,SAAS,OAAO,CAAC,sBAAsB,CAAC,WAEvF,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,cAAS,EAAE,eAAU,QACgC,CAAC;AAE/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBA+F3C"}
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useApolloClient } from '@apollo/client/react';
10
+ import { accounts } from '@cee-eng/hydrajs';
11
11
  import { AccountSelectorInternal } from '@rh-support/react-context';
12
- import { getDropdownBtnPlaceholder, SEARCH_ACCOUNTS } from '@rh-support/utils';
12
+ import { getDropdownBtnPlaceholder } from '@rh-support/utils';
13
13
  import differenceBy from 'lodash/differenceBy';
14
14
  import filter from 'lodash/filter';
15
15
  import remove from 'lodash/remove';
@@ -35,7 +35,6 @@ export function AccountsFilter(props) {
35
35
  const { canReadBookmarkAccounts } = props;
36
36
  const { filterInfo } = useContext(CaseListFilterStateContext);
37
37
  const dispatch = useContext(CaseListFilterDispatchContext);
38
- const apolloClient = useApolloClient();
39
38
  const selectedAccounts = useMemo(() => filterInfo[SolrKeys.accountNumber]
40
39
  .filter((item) => !Array.isArray(item.key))
41
40
  .map((item) => ({
@@ -68,26 +67,20 @@ export function AccountsFilter(props) {
68
67
  return;
69
68
  function getAccountsWithoutNames() {
70
69
  return __awaiter(this, void 0, void 0, function* () {
71
- var _a, _b, _c, _d;
72
70
  const allSelected = [...filterInfo[SolrKeys.accountNumber]];
73
71
  const accountsWithoutNames = remove(allSelected, (item) => item.key === item.value);
74
72
  if (accountsWithoutNames.length < 1)
75
73
  return;
76
- const accountNumbers = accountsWithoutNames.map((item) => item.key);
74
+ const fields = ['accountNumber', 'accountId', 'name'].join(',');
75
+ const params = {
76
+ fields,
77
+ orderBy: 'name',
78
+ orderDirection: 'asc',
79
+ accountNumberIn: accountsWithoutNames.map((item) => item.key).join(','),
80
+ };
77
81
  try {
78
- const { data } = yield apolloClient.query({
79
- query: SEARCH_ACCOUNTS,
80
- variables: {
81
- where: { AccountNumber: { in: accountNumbers } },
82
- first: accountNumbers.length,
83
- },
84
- fetchPolicy: 'network-only',
85
- });
86
- const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
87
- const keyValueMap = edges.map((edge) => ({
88
- key: edge.node.AccountNumber.value,
89
- value: edge.node.Name.value,
90
- }));
82
+ const accountsDetail = yield accounts.getAccounts(params);
83
+ const keyValueMap = accountsDetail.items.map((item) => ({ key: item.accountNumber, value: item.name }));
91
84
  updateFilter(dispatch, {
92
85
  filterKey: SolrKeys.accountNumber,
93
86
  values: [...keyValueMap, ...allSelected],
@@ -1 +1 @@
1
- {"version":3,"file":"AdditionalFilters.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AdditionalFilters.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,wBAAgB,iBAAiB,sBA6FhC"}
1
+ {"version":3,"file":"AdditionalFilters.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AdditionalFilters.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,wBAAgB,iBAAiB,sBAgGhC"}
@@ -1,4 +1,5 @@
1
1
  import { Checkbox } from '@patternfly/react-core';
2
+ import { AbilityContext, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
2
3
  import isEmpty from 'lodash/isEmpty';
3
4
  import isEqual from 'lodash/isEqual';
4
5
  import React, { useContext, useEffect, useState } from 'react';
@@ -11,6 +12,8 @@ export function AdditionalFilters() {
11
12
  const [isPrivate, setIsPrivate] = useState(false);
12
13
  const { t } = useTranslation();
13
14
  const dispatch = useContext(CaseListFilterDispatchContext);
15
+ const ability = useContext(AbilityContext);
16
+ const canAccessPrivateCaseFilter = ability.can(resourceActions.PATCH, resources.CASE_LIST, CaseListFields.PRIVATE_CASE_FILTER);
14
17
  const { filterInfo: { case_customer_escalation, case_private }, } = useContext(CaseListFilterStateContext);
15
18
  const onEscalatedChange = (checked) => {
16
19
  updateFilter(dispatch, {
@@ -19,8 +22,6 @@ export function AdditionalFilters() {
19
22
  });
20
23
  setIsEscalated(checked);
21
24
  };
22
- // @ts-ignore - kept for future use when GraphQL supports private cases filter
23
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
24
25
  const onisPrivateChange = (checked) => {
25
26
  updateFilter(dispatch, {
26
27
  filterKey: SolrKeys.isPrivate,
@@ -28,7 +29,6 @@ export function AdditionalFilters() {
28
29
  });
29
30
  setIsPrivate(checked);
30
31
  };
31
- void onisPrivateChange;
32
32
  useEffect(() => {
33
33
  var _a, _b;
34
34
  updateFilter(dispatch, {
@@ -65,5 +65,6 @@ export function AdditionalFilters() {
65
65
  React.createElement("div", { className: "additional-filters" },
66
66
  React.createElement("h3", null,
67
67
  React.createElement(Trans, null, "More")),
68
- React.createElement(Checkbox, { label: t(AdditionalFilterLabels[SolrKeys.escalation]), isChecked: escalated, onChange: (_event, checked) => onEscalatedChange(checked), "aria-label": t(AdditionalFilterLabels[SolrKeys.escalation]), id: "escalated", name: "escalated", "data-tracking-id": "escalated-filter-selector" }))));
68
+ React.createElement(Checkbox, { label: t(AdditionalFilterLabels[SolrKeys.escalation]), isChecked: escalated, onChange: (_event, checked) => onEscalatedChange(checked), "aria-label": t(AdditionalFilterLabels[SolrKeys.escalation]), id: "escalated", name: "escalated", "data-tracking-id": "escalated-filter-selector" }),
69
+ canAccessPrivateCaseFilter && (React.createElement(Checkbox, { label: t(AdditionalFilterLabels[SolrKeys.isPrivate]), isChecked: isPrivate, onChange: (_event, checked) => onisPrivateChange(checked), "aria-label": t(AdditionalFilterLabels[SolrKeys.isPrivate]), id: "private", name: "private", "data-tracking-id": "private-filter-selector" })))));
69
70
  }
@@ -1,3 +1,9 @@
1
1
  import React from 'react';
2
- export declare function CaseListFilterChips(): React.JSX.Element;
2
+ import { IProductVersionPivotMap } from '../CaseList';
3
+ interface IProps {
4
+ productVersionPivotValues: IProductVersionPivotMap[];
5
+ isSolrSearchDown: boolean;
6
+ }
7
+ export declare function CaseListFilterChips(props: IProps): React.JSX.Element;
8
+ export {};
3
9
  //# sourceMappingURL=CaseListFilterChips.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseListFilterChips.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilterChips.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C,wBAAgB,mBAAmB,sBAwHlC"}
1
+ {"version":3,"file":"CaseListFilterChips.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilterChips.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,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,qBAmIhD"}
@@ -7,10 +7,11 @@ import { Trans } from 'react-i18next';
7
7
  import { ProductVersionKey, SolrKeys, SolrPivotKeys } from '../../../enums/filters';
8
8
  import { filterNamesMap } from '../../../utils/constants';
9
9
  import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
10
+ import { visibleFilterChipsWhenSolrDownSfdcUp } from '../CaseListFilterHelpers';
10
11
  import { clearFilters, removeFilterItem } from '../CaseListFilterReducer';
11
12
  import { CreatorSsoNameFilterChip } from './CreatorSsoNameFilterChip';
12
13
  import { ProductFilterChip } from './ProductFilterChip';
13
- export function CaseListFilterChips() {
14
+ export function CaseListFilterChips(props) {
14
15
  const { filterInfo } = useContext(CaseListFilterStateContext);
15
16
  const dispatch = useContext(CaseListFilterDispatchContext);
16
17
  const currentFilterLength = flatMap(filterInfo).length;
@@ -36,10 +37,15 @@ export function CaseListFilterChips() {
36
37
  };
37
38
  const getChipGroupForFilter = (filterKey, filterValues, groupName = '') => {
38
39
  const caseTypeFilter = filterKey === 'case_type' ? toNewCaseTypeMapper(filterValues) : filterValues;
39
- return (React.createElement("div", { className: "filter-chip", key: `${filterKey}-bookmarks-${groupName}` },
40
- React.createElement("span", { className: "filter-chip__heading" },
41
- React.createElement(Trans, null, groupName || filterNamesMap[filterKey] || filterKey)),
42
- React.createElement(LabelGroup, { numLabels: 7, className: "pf-v6-c-chip-group__simple" }, renderFilterValueChips(filterKey, caseTypeFilter, groupName))));
40
+ if (props.isSolrSearchDown && !visibleFilterChipsWhenSolrDownSfdcUp.includes(filterKey)) {
41
+ return React.createElement(React.Fragment, null);
42
+ }
43
+ else {
44
+ return (React.createElement("div", { className: "filter-chip", key: `${filterKey}-bookmarks-${groupName}` },
45
+ React.createElement("span", { className: "filter-chip__heading" },
46
+ React.createElement(Trans, null, groupName || filterNamesMap[filterKey] || filterKey)),
47
+ React.createElement(LabelGroup, { numLabels: 7, className: "pf-v6-c-chip-group__simple" }, renderFilterValueChips(filterKey, caseTypeFilter, groupName))));
48
+ }
43
49
  };
44
50
  const renderAccountFilterChip = () => {
45
51
  const visibleChips = [];
@@ -80,8 +86,10 @@ export function CaseListFilterChips() {
80
86
  return (React.createElement(React.Fragment, null, isAnyFilterApplied && (React.createElement("div", { className: "filter-chip-wrapper" },
81
87
  React.createElement("h2", null, "Filtering by"),
82
88
  React.createElement("div", { className: "filter-chips" },
83
- Array.isArray(filterInfo[ProductVersionKey]) && filterInfo[ProductVersionKey].length > 0 && (React.createElement(ProductFilterChip, { productList: filterInfo[ProductVersionKey] })),
84
- showUsernameFilter && React.createElement(CreatorSsoNameFilterChip, null),
89
+ Array.isArray(filterInfo[ProductVersionKey]) && filterInfo[ProductVersionKey].length > 0 && (React.createElement(ProductFilterChip, { productList: props.isSolrSearchDown && filterInfo[ProductVersionKey].length > 1
90
+ ? [filterInfo[ProductVersionKey][0]]
91
+ : filterInfo[ProductVersionKey], productVersionPivot: props.productVersionPivotValues })),
92
+ !props.isSolrSearchDown && showUsernameFilter && React.createElement(CreatorSsoNameFilterChip, null),
85
93
  renderChips(),
86
94
  currentFilterLength > 1 && (React.createElement(Button, { variant: "link", isInline: true, onClick: clearAllFilters, "data-tracking-id": "case-list-clear-filters", className: "clear-filters" },
87
95
  React.createElement(Trans, null, "Clear all filters"))))))));
@@ -1,12 +1,15 @@
1
1
  import { IApiResponseDetails } from '@rh-support/types/shared';
2
- import { ITroubleshootProductResponse } from '@rh-support/utils';
2
+ import { ISolrResponseToFacetFields, ITroubleshootProductResponse } from '@rh-support/utils';
3
3
  import React from 'react';
4
+ import { IFacetFields } from '../../../models/caseList';
4
5
  interface IProps {
6
+ filterValues: ISolrResponseToFacetFields<IFacetFields>;
7
+ isSolrSearchDown: boolean;
5
8
  allCaseTypes: IApiResponseDetails<string[]>;
6
9
  allCaseStatuses: IApiResponseDetails<string[]>;
7
10
  allCaseSeverities: IApiResponseDetails<string[]>;
8
11
  allProducts: IApiResponseDetails<ITroubleshootProductResponse>;
9
12
  }
10
- export declare const CaseListFilters: ({ allCaseTypes, allCaseSeverities, allCaseStatuses, allProducts }: IProps) => React.JSX.Element;
13
+ export declare const CaseListFilters: ({ filterValues, allCaseTypes, allCaseSeverities, allCaseStatuses, allProducts, isSolrSearchDown, }: IProps) => React.JSX.Element;
11
14
  export {};
12
15
  //# sourceMappingURL=CaseListFilters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CaseListFilters.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAqB,MAAM,OAAO,CAAC;AAY1C,UAAU,MAAM;IACZ,YAAY,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5C,eAAe,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/C,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IACjD,WAAW,EAAE,mBAAmB,CAAC,4BAA4B,CAAC,CAAC;CAClE;AAED,eAAO,MAAM,eAAe,GAAI,mEAAmE,MAAM,sBAmExG,CAAC"}
1
+ {"version":3,"file":"CaseListFilters.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CaseListFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAE7F,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAWxD,UAAU,MAAM;IACZ,YAAY,EAAE,0BAA0B,CAAC,YAAY,CAAC,CAAC;IACvD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5C,eAAe,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/C,iBAAiB,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IACjD,WAAW,EAAE,mBAAmB,CAAC,4BAA4B,CAAC,CAAC;CAClE;AAID,eAAO,MAAM,eAAe,GAAI,oGAO7B,MAAM,sBA2ER,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import { AbilityContext, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
2
+ import get from 'lodash/get';
2
3
  import React, { useContext } from 'react';
4
+ import { SolrKeys } from '../../../enums/filters';
3
5
  import { AccountsBookmarkedGroupFilter } from './AccountsBookmarkedGroupFilter';
4
6
  import { AccountsFilter } from './AccountsFilter';
5
7
  import { AdditionalFilters } from './AdditionalFilters';
@@ -9,7 +11,9 @@ import { ProductsFilter } from './ProductsFilter';
9
11
  import { SeverityFilter } from './SeverityFilter';
10
12
  import { StatusFilter } from './StatusFilter';
11
13
  import { TypeFilter } from './TypeFilter';
12
- export const CaseListFilters = ({ allCaseTypes, allCaseSeverities, allCaseStatuses, allProducts }) => {
14
+ // Adding a new filter here? Make sure you add in caseSearchUtils also so that
15
+ // it get included in the solr search query fq parameter
16
+ export const CaseListFilters = ({ filterValues, allCaseTypes, allCaseSeverities, allCaseStatuses, allProducts, isSolrSearchDown, }) => {
13
17
  var _a, _b;
14
18
  const ability = useContext(AbilityContext);
15
19
  const canReadAccountFilter = ability.can(resourceActions.READ, resources.ACCOUNTS_FILTER);
@@ -21,21 +25,17 @@ export const CaseListFilters = ({ allCaseTypes, allCaseSeverities, allCaseStatus
21
25
  const canAccessSeverityFilter = ability.can(resourceActions.PATCH, resources.CASE_LIST, CaseListFields.SEVERITY_FILTER);
22
26
  const canAccessAdditionalFilter = ability.can(resourceActions.PATCH, resources.CASE_LIST, CaseListFields.ADDITIONAL_FILTER);
23
27
  const canAccessGroupsFilter = ability.can(resourceActions.PATCH, resources.CASE_LIST, CaseListFields.GROUPS_FILTER);
24
- void canAccessGroupsFilter;
25
- void GroupsFilter;
26
28
  const canAccessCreatorFilter = ability.can(resourceActions.PATCH, resources.CASE_LIST, CaseListFields.CREATOR_FILTER);
27
29
  const canAccessTypeFilter = ability.can(resourceActions.PATCH, resources.CASE_LIST, CaseListFields.TYPE_FILTER);
28
30
  return (React.createElement(React.Fragment, null,
29
31
  React.createElement("div", { className: "filter-group" },
30
- canReadAccountFilter && React.createElement(AccountsFilter, { canReadBookmarkAccounts: canReadAccountFilter }),
31
- (canReadBookmarkAccounts || canAccessManagedAccounts) && (React.createElement(AccountsBookmarkedGroupFilter, { canManageBookmarkAccounts: canManageBookmarkAccounts, canReadBookmarkAccounts: canReadBookmarkAccounts, canAccessManagedAccounts: canAccessManagedAccounts })),
32
- canAccessProductsFilter && (React.createElement(ProductsFilter, { allProducts: ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) === null || _b === void 0 ? void 0 : _b.map((p) => ({
33
- name: p.product,
34
- productId: p.productId,
35
- }))) || [] })),
36
- canAccessSeverityFilter && React.createElement(SeverityFilter, { allCaseSeverities: allCaseSeverities.data }),
37
- canAccessStatusFilter && React.createElement(StatusFilter, { allCaseStatuses: allCaseStatuses.data }),
38
- canAccessTypeFilter && React.createElement(TypeFilter, { allCaseTypes: allCaseTypes.data }),
39
- canAccessCreatorFilter && React.createElement(CreatorSsoNameFilter, null),
40
- canAccessAdditionalFilter && React.createElement(AdditionalFilters, null))));
32
+ !isSolrSearchDown && canReadAccountFilter && (React.createElement(AccountsFilter, { canReadBookmarkAccounts: canReadAccountFilter })),
33
+ !isSolrSearchDown && (canReadBookmarkAccounts || canAccessManagedAccounts) && (React.createElement(AccountsBookmarkedGroupFilter, { canManageBookmarkAccounts: canManageBookmarkAccounts, canReadBookmarkAccounts: canReadBookmarkAccounts, canAccessManagedAccounts: canAccessManagedAccounts })),
34
+ canAccessGroupsFilter && React.createElement(GroupsFilter, null),
35
+ canAccessProductsFilter && (React.createElement(ProductsFilter, { filterValues: get(filterValues, SolrKeys.product, []), isSolrSearchDown: isSolrSearchDown, allProducts: ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) === null || _b === void 0 ? void 0 : _b.map((p) => p.product)) || [] })),
36
+ canAccessSeverityFilter && (React.createElement(SeverityFilter, { filterValues: get(filterValues, SolrKeys.severity, []), isSolrSearchDown: isSolrSearchDown, allCaseSeverities: allCaseSeverities.data })),
37
+ canAccessStatusFilter && (React.createElement(StatusFilter, { filterValues: get(filterValues, SolrKeys.status, []), allCaseStatuses: allCaseStatuses.data, isSolrSearchDown: isSolrSearchDown })),
38
+ !isSolrSearchDown && canAccessTypeFilter && React.createElement(TypeFilter, { allCaseTypes: allCaseTypes.data }),
39
+ !isSolrSearchDown && canAccessCreatorFilter && React.createElement(CreatorSsoNameFilter, null),
40
+ !isSolrSearchDown && canAccessAdditionalFilter && React.createElement(AdditionalFilters, null))));
41
41
  };
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
+ import { IProductVersionPivotMap } from '../CaseList';
2
3
  import { IProductFilter } from '../CaseListFilterReducer';
3
4
  interface IProps {
4
5
  productList: IProductFilter[];
6
+ productVersionPivot: IProductVersionPivotMap[];
5
7
  }
6
- export declare function ProductFilterChip({ productList }: IProps): React.JSX.Element;
8
+ export declare function ProductFilterChip({ productList, productVersionPivot }: IProps): React.JSX.Element;
7
9
  export {};
8
10
  //# sourceMappingURL=ProductFilterChip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductFilterChip.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductFilterChip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,cAAc,EAAgB,MAAM,0BAA0B,CAAC;AAGxE,UAAU,MAAM;IACZ,WAAW,EAAE,cAAc,EAAE,CAAC;CACjC;AAED,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,EAAE,MAAM,qBAsExD"}
1
+ {"version":3,"file":"ProductFilterChip.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductFilterChip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAgB,MAAM,0BAA0B,CAAC;AAGxE,UAAU,MAAM;IACZ,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,mBAAmB,EAAE,uBAAuB,EAAE,CAAC;CAClD;AAED,wBAAgB,iBAAiB,CAAC,EAAE,WAAW,EAAE,mBAAwB,EAAE,EAAE,MAAM,qBAsElF"}
@@ -7,7 +7,7 @@ import { filterNamesMap } from '../../../utils/constants';
7
7
  import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
8
8
  import { updateFilter } from '../CaseListFilterReducer';
9
9
  import { VersionsFilter } from './VersionsFilter';
10
- export function ProductFilterChip({ productList }) {
10
+ export function ProductFilterChip({ productList, productVersionPivot = [] }) {
11
11
  const { filterInfo } = useContext(CaseListFilterStateContext);
12
12
  const dispatch = useContext(CaseListFilterDispatchContext);
13
13
  const canAccessVersionsFilter = ability.can(resourceActions.PATCH, resources.CASE_LIST, CaseListFields.VERSIONS_FILTER);
@@ -26,7 +26,7 @@ export function ProductFilterChip({ productList }) {
26
26
  return (React.createElement("div", { className: "filter-chip" },
27
27
  React.createElement("span", { className: "filter-chip__heading" }, filterNamesMap[SolrKeys.product]),
28
28
  canAccessVersionsFilter ? (React.createElement(React.Fragment, null, productList.map((currentProduct, index) => (React.createElement(LabelGroup, { numLabels: 10, key: `${currentProduct.value}-${index}`, categoryName: currentProduct.value },
29
- React.createElement(VersionsFilter, { productInfo: currentProduct }),
29
+ React.createElement(VersionsFilter, { productInfo: currentProduct, productVersionPivot: productVersionPivot }),
30
30
  currentProduct[SolrKeys.version].map((chip) => (React.createElement(Label, { variant: "outline", key: chip.value, onClose: () => deleteVersion(currentProduct, chip) }, chip.value))),
31
31
  React.createElement(Button, { icon: React.createElement(TimesCircleIcon, { "aria-hidden": "true" }), className: "pf-v6-c-button__icon", variant: ButtonVariant.plain, "aria-label": "Remove product", onClick: () => deleteProduct(currentProduct) })))))) : (React.createElement(LabelGroup, { numLabels: 10, categoryName: "Product", key: "products" }, productList.map((currentProduct, index) => (React.createElement(Label, { variant: "outline", key: `${currentProduct.value}-${index}`, onClose: () => deleteProduct(currentProduct) }, currentProduct.value)))))));
32
32
  }
@@ -1,10 +1,9 @@
1
+ import { IFacetResponse } from '@rh-support/types/shared';
1
2
  import React from 'react';
2
- interface IProductOption {
3
- name: string;
4
- productId: string;
5
- }
6
3
  interface IProps {
7
- allProducts: IProductOption[];
4
+ filterValues: IFacetResponse[];
5
+ isSolrSearchDown: boolean;
6
+ allProducts: string[];
8
7
  }
9
8
  export declare function ProductsFilter(props: IProps): React.JSX.Element;
10
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ProductsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductsFilter.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAQvE,UAAU,cAAc;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,MAAM;IACZ,WAAW,EAAE,cAAc,EAAE,CAAC;CACjC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBAoL3C"}
1
+ {"version":3,"file":"ProductsFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/ProductsFilter.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAQvE,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,qBA+O3C"}
@@ -1,5 +1,5 @@
1
1
  import { MenuToggle, Select, SelectList, SelectOption, TextInputGroup, TextInputGroupMain, } from '@patternfly/react-core';
2
- import { useSelectKeyboardNavigator } from '@rh-support/components';
2
+ import { SingleSelectDropdown, useSelectKeyboardNavigator } from '@rh-support/components';
3
3
  import { getDropdownBtnPlaceholder } from '@rh-support/utils';
4
4
  import isEmpty from 'lodash/isEmpty';
5
5
  import isUndefined from 'lodash/isUndefined';
@@ -10,11 +10,11 @@ import { filterNamesMap } from '../../../utils/constants';
10
10
  import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
11
11
  import { updateFilter } from '../CaseListFilterReducer';
12
12
  export function ProductsFilter(props) {
13
- var _a;
13
+ var _a, _b, _c, _d, _f;
14
14
  const { t } = useTranslation();
15
15
  const dispatch = useContext(CaseListFilterDispatchContext);
16
16
  const { filterInfo } = useContext(CaseListFilterStateContext);
17
- const { allProducts } = props;
17
+ const { allProducts, filterValues, isSolrSearchDown } = props;
18
18
  const [isOpen, setIsOpen] = useState(false);
19
19
  const [selectedItems, setSelectedItems] = useState({});
20
20
  const [activeItem, setActiveItem] = useState(null);
@@ -23,24 +23,51 @@ export function ProductsFilter(props) {
23
23
  const selectedProducts = !isUndefined(filterInfo) && !isUndefined(filterInfo[SolrPivotKeys.product_version])
24
24
  ? filterInfo[SolrPivotKeys.product_version]
25
25
  : [];
26
- const productOptions = allProducts.map((product) => ({
26
+ const productOptions = filterValues.map((product) => ({
27
27
  field: SolrKeys.product,
28
- value: product.name,
29
- productId: product.productId,
28
+ value: product.value,
30
29
  [SolrKeys.version]: [],
31
30
  }));
31
+ const singleSelectOptions = allProducts.length > 0
32
+ ? allProducts.map((product) => ({
33
+ value: product,
34
+ label: product,
35
+ }))
36
+ : [{ value: '', label: t('No products available') }];
37
+ const selectedProduct = ((_b = (_a = filterInfo === null || filterInfo === void 0 ? void 0 : filterInfo[SolrPivotKeys.product_version]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value) || '';
38
+ const selectedOption = {
39
+ value: selectedProduct,
40
+ label: selectedProduct,
41
+ };
42
+ // Single select mode for when Solr is down
43
+ const onFilterChangeSingleSelect = (selection) => {
44
+ updateFilter(dispatch, {
45
+ filterKey: SolrPivotKeys.product_version,
46
+ values: [{ field: SolrKeys.product, value: selection.value, [SolrKeys.version]: [] }],
47
+ });
48
+ setIsOpen(false);
49
+ };
50
+ const onSingleSelectChange = (option) => {
51
+ // Don't update filter if no products are available
52
+ if (allProducts.length === 0 || option.value === '') {
53
+ return;
54
+ }
55
+ updateFilter(dispatch, {
56
+ filterKey: SolrPivotKeys.product_version,
57
+ values: [{ field: SolrKeys.product, value: option.value, [SolrKeys.version]: [] }],
58
+ });
59
+ };
60
+ // Multi-select mode
32
61
  const onSelect = (option) => {
33
- var _a;
34
62
  let newSelectedProducts = [];
35
63
  if (selectedProducts === null || selectedProducts === void 0 ? void 0 : selectedProducts.some((product) => option.value === product.value)) {
36
64
  newSelectedProducts = selectedProducts.filter((product) => option.value !== product.value);
37
65
  setSelectedItems((prevData) => (Object.assign(Object.assign({}, prevData), { [option.value]: false })));
38
66
  }
39
67
  else {
40
- const productId = option.productId || ((_a = allProducts.find((p) => p.name === option.value)) === null || _a === void 0 ? void 0 : _a.productId) || '';
41
68
  newSelectedProducts = [
42
69
  ...selectedProducts,
43
- { field: SolrKeys.product, value: option.value, productId, [SolrKeys.version]: [] },
70
+ { field: SolrKeys.product, value: option.value, [SolrKeys.version]: [] },
44
71
  ];
45
72
  setSelectedItems((prevData) => (Object.assign(Object.assign({}, prevData), { [option.value]: true })));
46
73
  }
@@ -66,12 +93,21 @@ export function ProductsFilter(props) {
66
93
  resetIndexOnClose: true,
67
94
  isDisabled: false,
68
95
  setIsOpen,
69
- onSelect,
96
+ onSelect: (item) => {
97
+ if (isSolrSearchDown) {
98
+ onFilterChangeSingleSelect(item);
99
+ }
100
+ else {
101
+ onSelect(item);
102
+ }
103
+ },
70
104
  });
71
105
  const onTextInputChange = (_event, value) => {
72
106
  setInputValue(value);
73
107
  };
74
- const placeholder = getDropdownBtnPlaceholder(t('Select a product'), ((_a = filterInfo === null || filterInfo === void 0 ? void 0 : filterInfo[SolrPivotKeys.product_version]) === null || _a === void 0 ? void 0 : _a.map((i) => i.value)) || [], '', (allProducts === null || allProducts === void 0 ? void 0 : allProducts.length) || 0, t('All selected'));
108
+ const placeholder = isSolrSearchDown
109
+ ? ((_d = (_c = filterInfo === null || filterInfo === void 0 ? void 0 : filterInfo[SolrPivotKeys.product_version]) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.value) || t('Select a product')
110
+ : getDropdownBtnPlaceholder(t('Select a product'), ((_f = filterInfo === null || filterInfo === void 0 ? void 0 : filterInfo[SolrPivotKeys.product_version]) === null || _f === void 0 ? void 0 : _f.map((i) => i.value)) || [], '', props.filterValues.length, t('All selected'));
75
111
  const toggleForMultiSelect = (toggleRef) => (React.createElement(MenuToggle, { variant: "typeahead", onClick: onToggleClick, innerRef: toggleRef, isExpanded: isOpen, isFullWidth: true },
76
112
  React.createElement(TextInputGroup, { isPlain: true },
77
113
  React.createElement(TextInputGroupMain, Object.assign({ value: inputValue, onClick: onToggleClick, onChange: onTextInputChange, onKeyDown: onInputKeyDown, id: "multi-typeahead-product-filter-input", autoComplete: "off", innerRef: textInputRef, placeholder: placeholder }, (activeItem && { 'aria-activedescendant': activeItem }), { role: "combobox", isExpanded: isOpen, "aria-controls": "select-multi-typeahead-product-listbox" })))));
@@ -93,6 +129,9 @@ export function ProductsFilter(props) {
93
129
  }, [inputValue]);
94
130
  useEffect(() => {
95
131
  var _a;
132
+ if (isSolrSearchDown) {
133
+ return;
134
+ }
96
135
  if (isEmpty(filterInfo === null || filterInfo === void 0 ? void 0 : filterInfo[SolrPivotKeys.product_version])) {
97
136
  setSelectedItems({});
98
137
  }
@@ -103,13 +142,13 @@ export function ProductsFilter(props) {
103
142
  }, {});
104
143
  setSelectedItems(selectedProductItems || {});
105
144
  }
106
- }, [filterInfo]);
145
+ }, [filterInfo, isSolrSearchDown]);
107
146
  const renderOptions = () => {
108
147
  const filteredOptions = getFilteredOptions();
109
- return filteredOptions.map((option, index) => (React.createElement(SelectOption, { key: `product-option-${index}`, value: option, hasCheckbox: true, isSelected: selectedItems[option.value], isFocused: focusedItemIndex !== null && focusedItemIndex === index, id: `select-product-${String(option.value).replace(/\s/g, '-')}` }, option.value)));
148
+ return filteredOptions.map((option, index) => (React.createElement(SelectOption, { key: `product-option-${index}`, value: option, hasCheckbox: !isSolrSearchDown, isSelected: selectedItems[option.value], isFocused: focusedItemIndex !== null && focusedItemIndex === index, id: `select-product-${String(option.value).replace(/\s/g, '-')}` }, option.value)));
110
149
  };
111
150
  return (React.createElement("div", { className: "product-filter" },
112
151
  React.createElement("label", { htmlFor: "case-list-products-filter", className: "pf-v6-u-mb-sm products-filter-label" }, t(filterNamesMap[SolrKeys.product])),
113
- React.createElement(Select, { shouldFocusToggleOnSelect: true, shouldPreventScrollOnItemFocus: true, id: "case-list-products-filter", "data-tracking-id": "products-filter", isOpen: isOpen, selected: selectedItems, onSelect: (_e, v) => onSelect(v), onOpenChange: (nextOpen) => setIsOpen(nextOpen), toggle: toggleForMultiSelect, isScrollable: true, popperProps: { direction: 'down', enableFlip: false, maxWidth: '30rem' } },
114
- React.createElement(SelectList, null, renderOptions()))));
152
+ isSolrSearchDown ? (React.createElement(SingleSelectDropdown, { id: "case-list-products-filter", selected: selectedOption, options: singleSelectOptions, placeholder: allProducts.length > 0 ? t('Select a product') : t('No products available'), onSelect: (options) => onSingleSelectChange(options[0]), dataTrackingId: "products-filter", isScrollable: true, isDisabled: allProducts.length === 0 })) : (React.createElement(Select, { shouldFocusToggleOnSelect: true, shouldPreventScrollOnItemFocus: true, id: "case-list-products-filter", "data-tracking-id": "products-filter", isOpen: isOpen, selected: selectedItems, onSelect: (_e, v) => onSelect(v), onOpenChange: (nextOpen) => setIsOpen(nextOpen), toggle: toggleForMultiSelect, isScrollable: true, popperProps: { direction: 'down', enableFlip: false, maxWidth: '30rem' } },
153
+ React.createElement(SelectList, null, renderOptions())))));
115
154
  }
@@ -1,6 +1,9 @@
1
+ import { IFacetResponse } from '@rh-support/types/shared';
1
2
  import React from 'react';
2
3
  interface IProps {
4
+ filterValues: IFacetResponse[];
3
5
  allCaseSeverities: string[];
6
+ isSolrSearchDown: boolean;
4
7
  }
5
8
  export declare function SeverityFilter(props: IProps): React.JSX.Element;
6
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"SeverityFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/SeverityFilter.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBA0I3C"}
1
+ {"version":3,"file":"SeverityFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/SeverityFilter.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,YAAY,EAAE,cAAc,EAAE,CAAC;IAC/B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBAoL3C"}