@rh-support/cases 2.6.173 → 2.6.181

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 (79) hide show
  1. package/lib/esm/components/case-list/CaseList.d.ts +0 -7
  2. package/lib/esm/components/case-list/CaseList.d.ts.map +1 -1
  3. package/lib/esm/components/case-list/CaseList.js +143 -108
  4. package/lib/esm/components/case-list/CaseListContext.d.ts.map +1 -1
  5. package/lib/esm/components/case-list/CaseListContext.js +5 -2
  6. package/lib/esm/components/case-list/CaseListFilterReducer.d.ts +6 -4
  7. package/lib/esm/components/case-list/CaseListFilterReducer.d.ts.map +1 -1
  8. package/lib/esm/components/case-list/CaseListFilterReducer.js +3 -12
  9. package/lib/esm/components/case-list/CaseListReducer.d.ts +22 -10
  10. package/lib/esm/components/case-list/CaseListReducer.d.ts.map +1 -1
  11. package/lib/esm/components/case-list/CaseListReducer.js +25 -7
  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 +18 -11
  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 +4 -2
  16. package/lib/esm/components/case-list/case-list-filters/CaseListFilterChips.d.ts +1 -7
  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 +7 -15
  19. package/lib/esm/components/case-list/case-list-filters/CaseListFilters.d.ts +2 -5
  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 +1 -3
  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 +5 -4
  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 +15 -54
  28. package/lib/esm/components/case-list/case-list-filters/SeverityFilter.d.ts +0 -3
  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 +18 -44
  31. package/lib/esm/components/case-list/case-list-filters/StatusFilter.d.ts +0 -3
  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 +14 -44
  34. package/lib/esm/components/case-list/case-list-filters/VersionsFilter.d.ts +1 -3
  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 +61 -32
  37. package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts +7 -3
  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 +69 -58
  40. package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.d.ts +0 -5
  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 +38 -68
  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 +5 -15
  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 +2 -3
  48. package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.d.ts.map +1 -1
  49. package/lib/esm/components/case-list/case-search/BookmarkedSearchesSelector.js +1 -0
  50. package/lib/esm/components/case-list/case-search/CaseSearch.d.ts.map +1 -1
  51. package/lib/esm/components/case-list/case-search/CaseSearch.js +6 -6
  52. package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.d.ts.map +1 -1
  53. package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.js +2 -1
  54. package/lib/esm/css/caseList.css +99 -22
  55. package/lib/esm/enums/case.d.ts +2 -1
  56. package/lib/esm/enums/case.d.ts.map +1 -1
  57. package/lib/esm/enums/case.js +14 -1
  58. package/lib/esm/hooks/useExportCaseListCSV.d.ts.map +1 -1
  59. package/lib/esm/hooks/useExportCaseListCSV.js +1 -9
  60. package/lib/esm/test-utils/mockData.js +1 -1
  61. package/lib/esm/utils/caseListGraphQLUtils.d.ts +28 -0
  62. package/lib/esm/utils/caseListGraphQLUtils.d.ts.map +1 -0
  63. package/lib/esm/utils/caseListGraphQLUtils.js +244 -0
  64. package/lib/esm/utils/caseListMapper.d.ts +6 -0
  65. package/lib/esm/utils/caseListMapper.d.ts.map +1 -0
  66. package/lib/esm/utils/caseListMapper.js +36 -0
  67. package/lib/esm/utils/caseListVariablesBuilder.d.ts +14 -0
  68. package/lib/esm/utils/caseListVariablesBuilder.d.ts.map +1 -0
  69. package/lib/esm/utils/caseListVariablesBuilder.js +193 -0
  70. package/lib/esm/utils/caseSearchUtils.d.ts.map +1 -1
  71. package/lib/esm/utils/caseSearchUtils.js +26 -1
  72. package/lib/esm/utils/constants.d.ts +2 -1
  73. package/lib/esm/utils/constants.d.ts.map +1 -1
  74. package/lib/esm/utils/constants.js +14 -3
  75. package/lib/esm/utils/mockSolrResponse.js +1 -1
  76. package/lib/esm/utils/statusUtils.d.ts +3 -0
  77. package/lib/esm/utils/statusUtils.d.ts.map +1 -0
  78. package/lib/esm/utils/statusUtils.js +22 -0
  79. package/package.json +6 -5
@@ -1,9 +1,10 @@
1
- import { Bullseye, Button, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateVariant, PaginationVariant, Spinner, } from '@patternfly/react-core';
1
+ import { Alert, AlertVariant, Bullseye, Button, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateVariant, Spinner, } from '@patternfly/react-core';
2
+ import RedoAltIcon from '@patternfly/react-icons/dist/js/icons/redo-alt-icon';
2
3
  import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
3
4
  import { Table, TableVariant, Tbody, Td, Th, Thead, Tr, Visibility } from '@patternfly/react-table';
4
- import { TableComponent, TablePagination } from '@rh-support/components';
5
+ import { TableComponent } from '@rh-support/components';
5
6
  import { GlobalMetadataDispatchContext, updateUserPreferences, useGlobalStateContext, UserPreferencesKeys, } from '@rh-support/react-context';
6
- import { dtmTrackEventCaseStepEncountered, formatDate, scrollIntoView, toNewCaseTypeSwitcher } from '@rh-support/utils';
7
+ import { dtmTrackEventCaseStepEncountered, formatDate, toNewCaseTypeSwitcher } from '@rh-support/utils';
7
8
  import find from 'lodash/find';
8
9
  import flatMap from 'lodash/flatMap';
9
10
  import includes from 'lodash/includes';
@@ -15,7 +16,7 @@ import { Trans, useTranslation } from 'react-i18next';
15
16
  import { Link } from 'react-router-dom';
16
17
  import { CaseListColumnIds } from '../../../enums/case';
17
18
  import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
18
- import { clearFilters, resetFilterToDefaultState, updatePagination, updateSort, } from '../CaseListFilterReducer';
19
+ import { clearFilters, resetFilterToDefaultState, updateSort } from '../CaseListFilterReducer';
19
20
  import SeverityLabel from './SeverityLabel';
20
21
  import { TableColumnSelector } from './table-column-selector/TableColumnSelector';
21
22
  import { TableActionsDropdown } from './TableActionsDropdown';
@@ -36,7 +37,7 @@ const EMPTY_STATE_NO_FILTERS_ERROR = (React.createElement(React.Fragment, null,
36
37
  React.createElement("a", { href: "https://status.redhat.com/", target: "_blank", rel: "noopener noreferrer" }, "status page"),
37
38
  "to see if there are any known issues"));
38
39
  export function CaseListTable(props) {
39
- var _a, _b, _c, _d, _e, _f;
40
+ var _a, _b;
40
41
  const [selectedColumns, setSelectedColumns] = useState([]);
41
42
  const { t } = useTranslation();
42
43
  const [selectedCases, setSelectedCases] = useState([]);
@@ -49,7 +50,7 @@ export function CaseListTable(props) {
49
50
  const [activeSortIndex, setActiveSortIndex] = useState();
50
51
  const [activeSortDirection, setActiveSortDirection] = useState();
51
52
  const [sortedCaseListData, setSortedCaseListData] = useState(caseListData);
52
- const { globalMetadataState: { navBarRef, hydraUserPreferences, loggedInUserRights }, } = useGlobalStateContext();
53
+ const { globalMetadataState: { hydraUserPreferences, loggedInUserRights }, } = useGlobalStateContext();
53
54
  const dispatch = useContext(CaseListFilterDispatchContext);
54
55
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
55
56
  const { filterInfo, filterQueryInfo } = useContext(CaseListFilterStateContext);
@@ -155,12 +156,6 @@ export function CaseListTable(props) {
155
156
  console.error('Could not save selected columns in cache');
156
157
  }
157
158
  };
158
- const onPerPageSelect = (paginationInfo) => {
159
- updatePagination(dispatch, paginationInfo);
160
- };
161
- const onSetPage = (paginationInfo) => {
162
- updatePagination(dispatch, paginationInfo);
163
- };
164
159
  const onRowClick = (ev, row) => {
165
160
  // we dont want to call onRowClick if user changes the checkbox value
166
161
  if (ev.target.tagName === 'INPUT') {
@@ -219,15 +214,11 @@ export function CaseListTable(props) {
219
214
  if (props.isCaseListPageLoading)
220
215
  return 0;
221
216
  let paginationCount = (_b = (_a = props.caseList) === null || _a === void 0 ? void 0 : _a.numFound) !== null && _b !== void 0 ? _b : 0;
222
- // solr return 400 if we fetch the elements after 10000 limit
223
- // so we need to restrict the user from FE too
224
- paginationCount = paginationCount > 10000 ? 10000 : paginationCount;
217
+ // Salesforce has a limit of 4000 cases per page
218
+ // So we need to limit the number of cases returned to 4000
219
+ paginationCount = paginationCount > 4000 ? 4000 : paginationCount;
225
220
  return paginationCount;
226
221
  };
227
- const onBottomPaginationSetPage = (paginationInfo) => {
228
- onSetPage(paginationInfo);
229
- scrollIntoView(tableToolbarRef, { navBarRef, timeout: 0, onlyIfNotInViewport: true, offset: 30 });
230
- };
231
222
  const getSortableRowValues = (row) => {
232
223
  const { case_number, case_summary, case_contactName, case_lastModifiedDate, case_severity, case_status, case_createdDate, case_accountNumber, case_alternate_id, case_type, case_closedDate, case_folderName, case_lastModifiedByName, case_createdByName, case_version, id, case_customer_escalation, case_product, } = row;
233
224
  return [
@@ -349,8 +340,15 @@ export function CaseListTable(props) {
349
340
  React.createElement("div", { className: "toolbar-actions pf-v6-l-flex" },
350
341
  React.createElement(TableColumnSelector, { onColumnSelectorChange: onColumnSelectorChange, cachedColumns: selectedColumns }),
351
342
  React.createElement(TableActionsDropdown, { caseList: caseListData, selectedCases: selectedCases, onCasesCloseSuccess: onCasesCloseSuccess, currentFilteredCaseList: props.caseList })),
352
- React.createElement("span", { className: "toolbar-pagination" },
353
- React.createElement(TablePagination, { perPage: (_c = props.paginationInfo) === null || _c === void 0 ? void 0 : _c.pageSize, currentPage: (_d = props.paginationInfo) === null || _d === void 0 ? void 0 : _d.currentPage, onPerPageSelect: onPerPageSelect, onSetPage: onSetPage, variant: PaginationVariant.top, itemCount: getItemCount() }))),
343
+ !props.isCaseListPageLoading && caseListData.length > 0 && (React.createElement("span", { className: "case-count-indicator" },
344
+ React.createElement("strong", null, caseListData.length),
345
+ " ",
346
+ React.createElement(Trans, null, "of"),
347
+ ' ',
348
+ React.createElement("strong", null,
349
+ getItemCount(),
350
+ " ",
351
+ React.createElement(Trans, null, "loaded"))))),
354
352
  React.createElement("div", { className: "pf-v6-c-scroll-inner-wrapper" },
355
353
  React.createElement(Table, { variant: TableVariant.compact, "aria-label": "case-list", className: "case-list-table" },
356
354
  React.createElement(Thead, null,
@@ -367,41 +365,54 @@ export function CaseListTable(props) {
367
365
  ? '0px'
368
366
  : undefined,
369
367
  }, id: column.id, sort: column.sortable ? onSort(index) : undefined, key: column.id }, column.title))))),
370
- React.createElement(Tbody, null, !props.isCaseListPageLoading && (caseListData || []).length < 1
371
- ? noResultFoundRow
372
- : props.isCaseListPageLoading
373
- ? loadingRowDefault
374
- : sortedCaseListData === null || sortedCaseListData === void 0 ? void 0 : sortedCaseListData.map((row, index) => (React.createElement(Tr, { onRowClick: (event) => (onRowClick ? onRowClick(event, row) : ''), key: row === null || row === void 0 ? void 0 : row.case_number },
375
- React.createElement(Td, { className: "pf-v6-u-pl-md", select: {
376
- rowIndex: index,
377
- onSelect: (_event, index) => onRowSelect(_event, row === null || row === void 0 ? void 0 : row.case_number),
378
- isSelected: selectedCases.includes(row === null || row === void 0 ? void 0 : row.case_number),
379
- } }),
380
- React.createElement(Td, { dataLabel: "Case ID", id: row.case_number, scope: "row" },
381
- React.createElement("div", { className: "case-number-section" },
382
- React.createElement(Link, { to: `/case/${row.case_number}`, onClick: () => dtmTrackEventCaseStepEncountered('review', row.case_number, row.case_product, row.case_version) },
383
- React.createElement("span", { className: "case-number" }, row.case_number)),
384
- row.case_customer_escalation ? (React.createElement("div", { className: "escalation-label" },
385
- React.createElement(Trans, null, "Escalated"))) : (''))),
386
- React.createElement(Td, { dataLabel: "Title" }, row.case_summary),
387
- React.createElement(Td, { className: !isColumnVisible('contactName') ? Visibility.hidden : '', dataLabel: "Owner" }, row.case_contactName),
388
- React.createElement(Td, { className: !isColumnVisible('lastModifiedDate') ? Visibility.hidden : '', dataLabel: "Modified by" },
389
- React.createElement("span", { className: "modified-name" }, row.case_lastModifiedByName),
390
- row.case_lastModifiedDate ? formatDate(row.case_lastModifiedDate) : ''),
391
- React.createElement(Td, { className: !isColumnVisible('severity') ? Visibility.hidden : '', dataLabel: "Severity" },
392
- React.createElement(SeverityLabel, { sevValue: row.case_severity })),
393
- React.createElement(Td, { className: !isColumnVisible('status') ? Visibility.hidden : '', dataLabel: "Status" }, row.case_status),
394
- React.createElement(Td, { className: !isColumnVisible('createdDate') ? Visibility.hidden : '', dataLabel: "Created by" },
395
- React.createElement("span", { className: "created-name" }, row.case_createdByName),
396
- row.case_createdDate ? formatDate(row.case_createdDate) : ''),
397
- React.createElement(Td, { className: !isColumnVisible('product') ? Visibility.hidden : '', dataLabel: "Product and Version" },
398
- row.case_product,
399
- React.createElement("span", { style: { display: 'block' } }, row.case_version)),
400
- React.createElement(Td, { className: !isColumnVisible('accountNumber') ? Visibility.hidden : '', dataLabel: "Account number" }, row.case_accountNumber),
401
- React.createElement(Td, { className: !isColumnVisible('alternateCaseId') ? Visibility.hidden : '', "data-label": "Personal reference number" }, row.case_alternate_id ? row.case_alternate_id : ''),
402
- React.createElement(Td, { className: !isColumnVisible('type') ? Visibility.hidden : '', "data-label": "Support type" }, row.case_type),
403
- React.createElement(Td, { className: !isColumnVisible('closedDate') ? Visibility.hidden : '', "data-label": "Closed date" }, row.case_closedDate ? formatDate(row.case_closedDate) : ''),
404
- React.createElement(Td, { className: !isColumnVisible('folderName') ? Visibility.hidden : '', "data-label": "Group" }, row.case_folderName ? row.case_folderName : ''))))))),
405
- React.createElement("footer", { className: "toolbar-pagination", "data-tracking-id": "case-list-table-pagination" },
406
- React.createElement(TablePagination, { perPage: (_e = props === null || props === void 0 ? void 0 : props.paginationInfo) === null || _e === void 0 ? void 0 : _e.pageSize, currentPage: (_f = props === null || props === void 0 ? void 0 : props.paginationInfo) === null || _f === void 0 ? void 0 : _f.currentPage, onPerPageSelect: onPerPageSelect, onSetPage: onBottomPaginationSetPage, variant: PaginationVariant.bottom, itemCount: getItemCount() })))));
368
+ React.createElement(Tbody, null, !props.isCaseListPageLoading && (caseListData || []).length < 1 ? (noResultFoundRow) : props.isCaseListPageLoading ? (loadingRowDefault) : (React.createElement(React.Fragment, null, sortedCaseListData === null || sortedCaseListData === void 0 ? void 0 :
369
+ sortedCaseListData.map((row, rowIndex) => (React.createElement(Tr, { onRowClick: (event) => (onRowClick ? onRowClick(event, row) : ''), key: row === null || row === void 0 ? void 0 : row.case_number },
370
+ React.createElement(Td, { className: "pf-v6-u-pl-md", select: {
371
+ rowIndex: rowIndex,
372
+ onSelect: (_event, _idx) => onRowSelect(_event, row === null || row === void 0 ? void 0 : row.case_number),
373
+ isSelected: selectedCases.includes(row === null || row === void 0 ? void 0 : row.case_number),
374
+ } }),
375
+ React.createElement(Td, { dataLabel: "Case ID", id: row.case_number, scope: "row" },
376
+ React.createElement("div", { className: "case-number-section" },
377
+ React.createElement(Link, { to: `/case/${row.case_number}`, onClick: () => dtmTrackEventCaseStepEncountered('review', row.case_number, row.case_product, row.case_version) },
378
+ React.createElement("span", { className: "case-number" }, row.case_number)),
379
+ row.case_customer_escalation ? (React.createElement("div", { className: "escalation-label" },
380
+ React.createElement(Trans, null, "Escalated"))) : (''))),
381
+ React.createElement(Td, { dataLabel: "Title" }, row.case_summary),
382
+ React.createElement(Td, { className: !isColumnVisible('contactName') ? Visibility.hidden : '', dataLabel: "Owner" }, row.case_contactName),
383
+ React.createElement(Td, { className: !isColumnVisible('lastModifiedDate') ? Visibility.hidden : '', dataLabel: "Modified by" },
384
+ React.createElement("span", { className: "modified-name" }, row.case_lastModifiedByName),
385
+ row.case_lastModifiedDate ? formatDate(row.case_lastModifiedDate) : ''),
386
+ React.createElement(Td, { className: !isColumnVisible('severity') ? Visibility.hidden : '', dataLabel: "Severity" },
387
+ React.createElement(SeverityLabel, { sevValue: row.case_severity })),
388
+ React.createElement(Td, { className: !isColumnVisible('status') ? Visibility.hidden : '', dataLabel: "Status" }, row.case_status),
389
+ React.createElement(Td, { className: !isColumnVisible('createdDate') ? Visibility.hidden : '', dataLabel: "Created by" },
390
+ React.createElement("span", { className: "created-name" }, row.case_createdByName),
391
+ row.case_createdDate ? formatDate(row.case_createdDate) : ''),
392
+ React.createElement(Td, { className: !isColumnVisible('product') ? Visibility.hidden : '', dataLabel: "Product and Version" },
393
+ row.case_product,
394
+ React.createElement("span", { style: { display: 'block' } }, row.case_version)),
395
+ React.createElement(Td, { className: !isColumnVisible('accountNumber') ? Visibility.hidden : '', dataLabel: "Account number" }, row.case_accountNumber),
396
+ React.createElement(Td, { className: !isColumnVisible('alternateCaseId') ? Visibility.hidden : '', "data-label": "Personal reference number" }, row.case_alternate_id ? row.case_alternate_id : ''),
397
+ React.createElement(Td, { className: !isColumnVisible('type') ? Visibility.hidden : '', "data-label": "Support type" }, row.case_type),
398
+ React.createElement(Td, { className: !isColumnVisible('closedDate') ? Visibility.hidden : '', "data-label": "Closed date" }, row.case_closedDate ? formatDate(row.case_closedDate) : ''),
399
+ React.createElement(Td, { className: !isColumnVisible('folderName') ? Visibility.hidden : '', "data-label": "Group" }, row.case_folderName ? row.case_folderName : '')))),
400
+ (props.hasNextPage || props.isLoadingMore || props.loadMoreError) && (React.createElement(Tr, { key: "skeleton-loader-row", className: "skeleton-loader-row" },
401
+ React.createElement(Td, { className: "pf-v6-u-pl-md" },
402
+ React.createElement("div", { ref: props.sentinelRef, className: "skeleton-sentinel" },
403
+ React.createElement("span", { className: "skeleton-bar skeleton-bar--checkbox" }))),
404
+ visibleCaseListColumns.map((col) => (React.createElement(Td, { key: `skeleton-${col.id}` },
405
+ React.createElement("span", { className: "skeleton-bar" }))))))))))),
406
+ props.loadMoreError && props.loadMoreRetryCount <= 1 && (React.createElement("div", { className: "infinite-scroll-footer-message" },
407
+ React.createElement(Button, { className: "infinite-scroll-retry-btn", variant: "secondary", onClick: props.onRetryLoadMore, icon: React.createElement(RedoAltIcon, null) },
408
+ React.createElement(Trans, null, "try loading again")))),
409
+ props.loadMoreError && props.loadMoreRetryCount > 1 && (React.createElement("div", { className: "infinite-scroll-footer-message" },
410
+ React.createElement(Alert, { className: "infinite-scroll-alert pf-v6-u-font-weight-bold", variant: AlertVariant.danger, isInline: true, isPlain: true, title: React.createElement("span", null,
411
+ React.createElement(Trans, null, "We're having trouble loading your cases. Please refresh or"),
412
+ ' ',
413
+ React.createElement(Button, { variant: "link", isInline: true, onClick: props.onRetryLoadMore },
414
+ React.createElement(Trans, null, "try again")),
415
+ ".") }))),
416
+ !props.hasNextPage && !props.isLoadingMore && !props.loadMoreError && caseListData.length > 0 && (React.createElement("div", { className: "infinite-scroll-footer-message infinite-scroll-footer-text pf-v6-u-font-weight-bold pf-v6-u-color-200" },
417
+ React.createElement(Trans, null, "No more cases to load"))))));
407
418
  }
@@ -1,15 +1,10 @@
1
1
  import './DownloadCSVFileModal.scss';
2
- import { IAccount } from '@cee-eng/hydrajs/@types/models/account';
3
- import { IApiResponseDetails } from '@rh-support/types/shared';
4
- import { UserAuth } from '@rh-support/user-permissions';
5
2
  import React from 'react';
6
3
  import { ICaseListFilterState } from '../CaseListFilterReducer';
7
4
  interface IProps {
8
5
  isDisabled?: boolean;
9
6
  onModalshow: boolean;
10
7
  onClose: () => void;
11
- loggedInUserRights: IApiResponseDetails<UserAuth>;
12
- loggedInUsersAccount: IApiResponseDetails<Partial<IAccount>>;
13
8
  filterState: ICaseListFilterState;
14
9
  selectedCases: string[];
15
10
  filteredCaseCount: number;
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadCSVFileModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/DownloadCSVFileModal.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AAGrC,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAqBlE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,oBAAoB,EAAE,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC7D,WAAW,EAAE,oBAAoB,CAAC;IAClC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAoBD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBA4ZzD"}
1
+ {"version":3,"file":"DownloadCSVFileModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/DownloadCSVFileModal.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AAyBrC,OAAO,KAAuC,MAAM,OAAO,CAAC;AAM5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,oBAAoB,CAAC;IAClC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAWD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBA8WzD"}
@@ -8,19 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import './DownloadCSVFileModal.scss';
11
- import { publicApi } from '@cee-eng/hydrajs';
11
+ import { useApolloClient } from '@apollo/client/react';
12
12
  import { Button, Checkbox, Form, FormGroup, Grid, GridItem, InputGroup, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, Spinner, TextInput, ValidatedOptions, } from '@patternfly/react-core';
13
13
  import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
14
14
  import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon';
15
- import { ToastNotification, useFetch } from '@rh-support/components';
15
+ import { ToastNotification } from '@rh-support/components';
16
16
  import { downloadCSV, formatDateTime, toNewCaseTypeSwitcher } from '@rh-support/utils';
17
17
  import { isEmpty } from 'lodash';
18
18
  import React, { useEffect, useMemo, useState } from 'react';
19
19
  import { useTranslation } from 'react-i18next';
20
- import { SFDCKeys, SolrKeys } from '../../../enums/filters';
21
- import { getCaseListFromSolr } from '../../../utils/caseListUtils';
22
- import { createQueryForCSVDownload } from '../../../utils/caseSearchUtils';
23
- const csvHeadersSolr = [
20
+ import { SolrKeys } from '../../../enums/filters';
21
+ import { getCaseListFromGraphQL } from '../../../utils/caseListGraphQLUtils';
22
+ import { mapSfdcStatusToPortalStatus } from '../../../utils/statusUtils';
23
+ const csvHeaders = [
24
24
  { label: 'Case number', key: SolrKeys.caseNumber },
25
25
  {
26
26
  label: 'Case link',
@@ -28,20 +28,12 @@ const csvHeadersSolr = [
28
28
  },
29
29
  { label: 'Title', key: SolrKeys.caseSummary },
30
30
  ];
31
- const csvHeadersSFDC = [
32
- { label: 'Case number', key: SFDCKeys.caseNumber },
33
- {
34
- label: 'Case link',
35
- key: 'case_link',
36
- },
37
- { label: 'Title', key: SFDCKeys.caseSummary },
38
- ];
39
31
  export default function DownloadCSVFileModal(props) {
40
- const { onClose, onModalshow, isDisabled, loggedInUserRights, loggedInUsersAccount, filterState, selectedCases, filteredCaseCount, } = props;
32
+ const { onClose, onModalshow, isDisabled, filterState, selectedCases, filteredCaseCount } = props;
41
33
  const { t } = useTranslation();
42
- const { isFetching, request } = useFetch(getCaseListFromSolr, { propgateErrors: true });
34
+ const apolloClient = useApolloClient();
35
+ const [isFetching, setIsFetching] = useState(false);
43
36
  const [downloadCSVFileName, setDownloadCSVFileName] = useState('CaseList.csv');
44
- const [isFetchingSFDC, setIsFetchingSFDC] = useState(false);
45
37
  const [checkboxes, setCheckboxes] = useState({
46
38
  selectAll: false,
47
39
  ownerName: false,
@@ -57,87 +49,87 @@ export default function DownloadCSVFileModal(props) {
57
49
  group: false,
58
50
  });
59
51
  const [isSaveClicked, setIsSavedClicked] = useState(false);
60
- function getKey(key, isSecureSupport) {
61
- return isSecureSupport ? SFDCKeys[key] : SolrKeys[key];
52
+ function getKey(key) {
53
+ return SolrKeys[key];
62
54
  }
63
- const isSecureSupportUser = loggedInUsersAccount.data.secureSupport;
64
55
  const headerDefinitions = useMemo(() => [
65
56
  {
66
57
  checkbox: checkboxes.ownerName,
67
- key: getKey('ownerName', isSecureSupportUser),
58
+ key: getKey('ownerName'),
68
59
  label: 'Owner name',
69
60
  },
70
61
  {
71
62
  checkbox: checkboxes.severity,
72
- key: getKey('severity', isSecureSupportUser),
63
+ key: getKey('severity'),
73
64
  label: 'Severity',
74
65
  },
75
66
  {
76
67
  checkbox: checkboxes.createdBy,
77
- key: getKey('createdBy', isSecureSupportUser),
68
+ key: getKey('createdBy'),
78
69
  label: 'Created by',
79
70
  },
80
71
  {
81
72
  checkbox: checkboxes.createdBy,
82
- key: getKey('createdDate', isSecureSupportUser),
73
+ key: getKey('createdDate'),
83
74
  label: 'Created date',
84
75
  transform: formatDateTime,
85
76
  },
86
77
  {
87
78
  checkbox: checkboxes.accountNumber,
88
- key: getKey('accountNumber', isSecureSupportUser),
79
+ key: getKey('accountNumber'),
89
80
  label: 'Account number',
90
81
  },
91
82
  {
92
83
  checkbox: checkboxes.type,
93
- key: getKey(isSecureSupportUser ? 'caseType' : 'type', isSecureSupportUser),
84
+ key: getKey('type'),
94
85
  label: 'Support type',
95
86
  },
96
87
  {
97
88
  checkbox: checkboxes.modifiedBy,
98
- key: getKey('modifiedBy', isSecureSupportUser),
89
+ key: getKey('modifiedBy'),
99
90
  label: 'Modified by',
100
91
  },
101
92
  {
102
93
  checkbox: checkboxes.modifiedBy,
103
- key: getKey('modifiedDate', isSecureSupportUser),
94
+ key: getKey('modifiedDate'),
104
95
  label: 'Modified date',
105
96
  transform: formatDateTime,
106
97
  },
107
98
  {
108
99
  checkbox: checkboxes.status,
109
- key: getKey('status', isSecureSupportUser),
100
+ key: getKey('status'),
110
101
  label: 'Status',
102
+ transform: mapSfdcStatusToPortalStatus,
111
103
  },
112
104
  {
113
105
  checkbox: checkboxes.productVersion,
114
- key: getKey('product', isSecureSupportUser),
106
+ key: getKey('product'),
115
107
  label: 'Product',
116
108
  },
117
109
  {
118
110
  checkbox: checkboxes.productVersion,
119
- key: getKey('version', isSecureSupportUser),
111
+ key: getKey('version'),
120
112
  label: 'Version',
121
113
  },
122
114
  {
123
115
  checkbox: checkboxes.alternateId,
124
- key: getKey('alternateId', isSecureSupportUser),
116
+ key: getKey('alternateId'),
125
117
  label: 'Alternate ID',
126
118
  },
127
119
  {
128
120
  checkbox: checkboxes.caseClosedDate,
129
- key: getKey('caseClosedDate', isSecureSupportUser),
121
+ key: getKey('caseClosedDate'),
130
122
  label: 'Closed date',
131
123
  transform: formatDateTime,
132
124
  },
133
125
  {
134
126
  checkbox: checkboxes.group,
135
- key: getKey('groupName', isSecureSupportUser),
127
+ key: getKey('groupName'),
136
128
  label: 'Group',
137
129
  },
138
- ], [checkboxes, isSecureSupportUser]);
130
+ ], [checkboxes]);
139
131
  const getHeaders = () => {
140
- const updatedCsvHeaders = isSecureSupportUser ? csvHeadersSFDC : csvHeadersSolr;
132
+ const updatedCsvHeaders = [...csvHeaders];
141
133
  headerDefinitions.forEach((headerDefinition) => {
142
134
  const { checkbox, key, label, transform } = headerDefinition;
143
135
  const index = updatedCsvHeaders.findIndex((header) => header.key === key);
@@ -154,9 +146,8 @@ export default function DownloadCSVFileModal(props) {
154
146
  });
155
147
  return updatedCsvHeaders;
156
148
  };
157
- const isFetchingCSVData = isFetching || isFetchingSFDC;
158
- const partnerSearch = loggedInUserRights.data.hasManagedAccounts();
159
- const splitExtensionName = downloadCSVFileName.split('.')[0].replace(/ +/g, ''); // To split and trim value before saving PDF
149
+ const isFetchingCSVData = isFetching;
150
+ const splitExtensionName = downloadCSVFileName.split('.')[0].replace(/ +/g, '');
160
151
  const onCancel = () => {
161
152
  onClose && onClose();
162
153
  setIsSavedClicked(false);
@@ -173,15 +164,16 @@ export default function DownloadCSVFileModal(props) {
173
164
  };
174
165
  const checkboxValues = Object.values(checkboxes).slice(1); // as we don't want selectAll value
175
166
  const allCheckBoxNotSelected = checkboxValues.includes(false);
176
- // For SOLR
177
167
  const onExportCSVClick = () => __awaiter(this, void 0, void 0, function* () {
178
168
  try {
179
169
  setIsSavedClicked(true);
180
170
  if (!isEmpty(splitExtensionName)) {
181
- const query = createQueryForCSVDownload(filterState, loggedInUserRights.data, loggedInUsersAccount.data, selectedCases);
182
- const res = yield request(query, partnerSearch, null, isSecureSupportUser);
183
- // To map the values in csv to new support type
184
- const updatedCsvData = res.response.docs.map((row) => (Object.assign(Object.assign({}, row), { case_type: toNewCaseTypeSwitcher(row.case_type), case_link: `https://${window.location.host}${window.location.pathname}/#/case/${row.case_number}` })));
171
+ setIsFetching(true);
172
+ const hasSelectedCases = selectedCases.length > 0;
173
+ const csvLimit = hasSelectedCases ? selectedCases.length : 1000;
174
+ const result = yield getCaseListFromGraphQL(filterState, apolloClient, csvLimit, undefined, hasSelectedCases ? selectedCases : undefined);
175
+ setIsFetching(false);
176
+ const updatedCsvData = result.caseListResponse.response.docs.map((row) => (Object.assign(Object.assign({}, row), { case_type: toNewCaseTypeSwitcher(row.case_type), case_link: `https://${window.location.host}${window.location.pathname}/#/case/${row.case_number}` })));
185
177
  downloadCSV(updatedCsvData, getHeaders(), splitExtensionName ? `${splitExtensionName}.csv` : 'CaseList.csv');
186
178
  onCancel();
187
179
  ToastNotification.addSuccessMessage(t('File downloaded successfully!'));
@@ -189,33 +181,11 @@ export default function DownloadCSVFileModal(props) {
189
181
  }
190
182
  }
191
183
  catch (e) {
184
+ setIsFetching(false);
192
185
  onCancel();
193
186
  ToastNotification.addDangerMessage(t('File could not be downloaded. Please try again! '));
194
187
  }
195
188
  });
196
- // For SFDC
197
- const onExportCSVClickSecureSupport = () => __awaiter(this, void 0, void 0, function* () {
198
- try {
199
- setIsSavedClicked(true);
200
- if (!isEmpty(splitExtensionName)) {
201
- const sfdcFilter = createQueryForCSVDownload(filterState, loggedInUserRights.data, loggedInUsersAccount.data, selectedCases);
202
- setIsFetchingSFDC(true);
203
- const sfdcResponse = yield publicApi.caseList.getCaseListFromSFDC(sfdcFilter, false, true);
204
- setIsFetchingSFDC(false);
205
- // To map the values in csv to new support type
206
- const updatedCsvData = sfdcResponse.cases.map((row) => (Object.assign(Object.assign({}, row), { caseType: toNewCaseTypeSwitcher(row.caseType), case_link: `https://${window.location.host}${window.location.pathname}/#/case/${row.caseNumber}` })));
207
- downloadCSV(updatedCsvData, getHeaders(), splitExtensionName ? `${splitExtensionName}.csv` : 'CaseList.csv');
208
- onCancel();
209
- ToastNotification.addSuccessMessage(t('File downloaded successfully!'));
210
- setIsSavedClicked(false);
211
- }
212
- }
213
- catch (e) {
214
- setIsFetchingSFDC(false);
215
- onCancel();
216
- ToastNotification.addDangerMessage(t('Could not export CSV'));
217
- }
218
- });
219
189
  const handleSelectAll = () => {
220
190
  const newSelectAllState = !checkboxes.selectAll;
221
191
  const updatedCheckboxes = {
@@ -294,6 +264,6 @@ export default function DownloadCSVFileModal(props) {
294
264
  React.createElement("p", null, downloadCSVModalDescription(selectedCases.length || filteredCaseCount)),
295
265
  downloadCSVModalBody()),
296
266
  React.createElement(ModalFooter, null,
297
- React.createElement(Button, { key: "submit", icon: isFetchingCSVData ? React.createElement(Spinner, { size: "md", "aria-label": "loading" }) : React.createElement(DownloadIcon, null), variant: "primary", "data-tracking-id": "download-csv-modal-submit", onClick: isSecureSupportUser ? onExportCSVClickSecureSupport : onExportCSVClick, isDisabled: (isSaveClicked && isEmpty(splitExtensionName)) || isDisabled || isFetchingCSVData }, t('Download')),
267
+ React.createElement(Button, { key: "submit", icon: isFetchingCSVData ? React.createElement(Spinner, { size: "md", "aria-label": "loading" }) : React.createElement(DownloadIcon, null), variant: "primary", "data-tracking-id": "download-csv-modal-submit", onClick: onExportCSVClick, isDisabled: (isSaveClicked && isEmpty(splitExtensionName)) || isDisabled || isFetchingCSVData }, t('Download')),
298
268
  React.createElement(Button, { key: "back", variant: "secondary", onClick: onCancel, isDisabled: isDisabled || isFetchingCSVData, "data-tracking-id": "download-csv-modal-cancel" }, t('Cancel')))));
299
269
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ExportCaseListCSV.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ExportCaseListCSV.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAK7D,UAAU,MAAM;IACZ,uBAAuB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B;AAID,wBAAgB,iBAAiB,CAAC,EAAE,uBAAuB,EAAE,aAAa,EAAE,mBAAmB,EAAE,EAAE,MAAM,qBAqExG"}
1
+ {"version":3,"file":"ExportCaseListCSV.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ExportCaseListCSV.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI7D,UAAU,MAAM;IACZ,uBAAuB,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,EAAE,MAAM,EAAE,CAAC;CAC3B;AAID,wBAAgB,iBAAiB,CAAC,EAAE,uBAAuB,EAAE,aAAa,EAAE,mBAAmB,EAAE,EAAE,MAAM,qBAoDxG"}
@@ -1,9 +1,6 @@
1
- import { Button, Spinner } from '@patternfly/react-core';
2
- import { useFetch } from '@rh-support/components';
3
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
1
+ import { Button } from '@patternfly/react-core';
4
2
  import React, { useContext, useState } from 'react';
5
3
  import { Trans, useTranslation } from 'react-i18next';
6
- import { getCaseListFromSolr } from '../../../utils/caseListUtils';
7
4
  import { CaseListFilterStateContext } from '../CaseListFilterContext';
8
5
  import DownloadCSVFileModal from './DownloadCSVFileModal';
9
6
  const MAX_LIMIT = 1000;
@@ -13,14 +10,10 @@ export function ExportCaseListCSV({ currentFilteredCaseList, selectedCases, isEx
13
10
  const btnToolTip = t('Export the current list of cases to CSV. Please note that exporting a large number of cases may take a while.');
14
11
  const maxLengthTooltip = t('Export the current list of cases to CSV. Please note that only the top {{limit}} cases will be exported and that it may take awhile.', { limit: MAX_LIMIT });
15
12
  const currentFilteredCaseCount = (_a = currentFilteredCaseList === null || currentFilteredCaseList === void 0 ? void 0 : currentFilteredCaseList.numFound) !== null && _a !== void 0 ? _a : 0;
16
- const { isFetching } = useFetch(getCaseListFromSolr, { propgateErrors: true });
17
13
  const [openUpdateSeverityModal, setOpenUpdateSeverityModal] = useState(false);
18
- const isFetchingCSVData = isFetching;
19
- const isBtnDisabled = isFetchingCSVData || currentFilteredCaseCount === 0;
14
+ const isBtnDisabled = currentFilteredCaseCount === 0;
20
15
  let btnTitle = currentFilteredCaseCount >= MAX_LIMIT ? maxLengthTooltip : btnToolTip;
21
16
  const filterState = useContext(CaseListFilterStateContext);
22
- const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
23
- // To show tooltip if export csv is disabled when SOLR is down
24
17
  const getTooltipContent = () => {
25
18
  let tooltipText = t('Export Cases');
26
19
  if (isExportCsvDisabled) {
@@ -28,15 +21,12 @@ export function ExportCaseListCSV({ currentFilteredCaseList, selectedCases, isEx
28
21
  }
29
22
  return tooltipText;
30
23
  };
31
- // To check if export csv button is disabled
32
24
  const isExportButtonDisabled = isBtnDisabled || isExportCsvDisabled;
33
- // To toggle download csv modal
34
25
  const toggleDownloadCSVModal = () => {
35
26
  setOpenUpdateSeverityModal((openUpdateSeverityModal) => !openUpdateSeverityModal);
36
27
  };
37
28
  return (React.createElement("span", { title: (isExportCsvDisabled && getTooltipContent()) || '' },
38
- React.createElement(Button, { variant: "tertiary", onClick: toggleDownloadCSVModal, title: btnTitle, "data-tracking-id": "case-list-toolbar-export-csv", isDisabled: isExportButtonDisabled }, isFetchingCSVData ? (React.createElement(React.Fragment, null,
39
- React.createElement(Trans, null, "Exporting CSV"),
40
- React.createElement(Spinner, { size: "md", "aria-label": "loading", className: "export-csv-loader pf-v6-u-ml-xs" }))) : (React.createElement(Trans, null, "Export CSV"))),
41
- React.createElement(DownloadCSVFileModal, { filterState: filterState, loggedInUserRights: loggedInUserRights, loggedInUsersAccount: loggedInUsersAccount, isDisabled: isExportButtonDisabled, onModalshow: openUpdateSeverityModal, onClose: toggleDownloadCSVModal, selectedCases: selectedCases, filteredCaseCount: currentFilteredCaseCount })));
29
+ React.createElement(Button, { variant: "tertiary", onClick: toggleDownloadCSVModal, title: btnTitle, "data-tracking-id": "case-list-toolbar-export-csv", isDisabled: isExportButtonDisabled },
30
+ React.createElement(Trans, null, "Export CSV")),
31
+ React.createElement(DownloadCSVFileModal, { filterState: filterState, isDisabled: isExportButtonDisabled, onModalshow: openUpdateSeverityModal, onClose: toggleDownloadCSVModal, selectedCases: selectedCases, filteredCaseCount: currentFilteredCaseCount })));
42
32
  }
@@ -12,7 +12,7 @@ export default function SeverityLabel({ sevValue }) {
12
12
  return 'danger';
13
13
  case '2 (High)':
14
14
  return 'warning';
15
- case '3 (Normal)':
15
+ case '3 (Medium)':
16
16
  return 'info';
17
17
  case '4 (Low)':
18
18
  return 'custom';
@@ -1 +1 @@
1
- {"version":3,"file":"TableActionsDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/TableActionsDropdown.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,kBAAkB,EAAgB,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAwB,MAAM,qCAAqC,CAAC;AASlG,UAAU,MAAO,SAAQ,kBAAkB,EAAE,qBAAqB;CAAG;AAErE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBA0HjD"}
1
+ {"version":3,"file":"TableActionsDropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/TableActionsDropdown.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,kBAAkB,EAAgB,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAwB,MAAM,qCAAqC,CAAC;AASlG,UAAU,MAAO,SAAQ,kBAAkB,EAAE,qBAAqB;CAAG;AAErE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAoHjD"}
@@ -3,7 +3,7 @@ import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclama
3
3
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
4
4
  import WarningTriangleIcon from '@patternfly/react-icons/dist/js/icons/warning-triangle-icon';
5
5
  import { SingleSelectDropdown } from '@rh-support/components';
6
- import { CloseCaseModal, GlobalMetadataStateContext } from '@rh-support/react-context';
6
+ import { CloseCaseModal } from '@rh-support/react-context';
7
7
  import React, { useContext } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { useCloseCase } from '../../../hooks/useCloseCase';
@@ -22,7 +22,6 @@ export function TableActionsDropdown(props) {
22
22
  const currentFilteredCaseCount = (_a = currentFilteredCaseList === null || currentFilteredCaseList === void 0 ? void 0 : currentFilteredCaseList.numFound) !== null && _a !== void 0 ? _a : 0;
23
23
  const filterState = useContext(CaseListFilterStateContext);
24
24
  const { isExportButtonDisabled, openUpdateSeverityModal, showError: showExportCSVError, getTooltipContent: getExportCSVTooltipContent, toggleDownloadCSVModal, } = useExportCaseListCSV(props);
25
- const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
26
25
  const { isModalOpen, isPostingComment, showError, showWarning, getTooltipContent, onCancel, onConfirm, onBtnClick, } = useCloseCase(props);
27
26
  let closeCaseIconStatus = 'danger';
28
27
  if (showWarning) {
@@ -70,6 +69,6 @@ export function TableActionsDropdown(props) {
70
69
  };
71
70
  return (React.createElement(React.Fragment, null,
72
71
  isModalOpen && React.createElement(CloseCaseModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: !!isPostingComment }),
73
- React.createElement(DownloadCSVFileModal, { filterState: filterState, loggedInUserRights: loggedInUserRights, loggedInUsersAccount: loggedInUsersAccount, isDisabled: isExportButtonDisabled, onModalshow: openUpdateSeverityModal, onClose: toggleDownloadCSVModal, selectedCases: selectedCases, filteredCaseCount: currentFilteredCaseCount }),
72
+ React.createElement(DownloadCSVFileModal, { filterState: filterState, isDisabled: isExportButtonDisabled, onModalshow: openUpdateSeverityModal, onClose: toggleDownloadCSVModal, selectedCases: selectedCases, filteredCaseCount: currentFilteredCaseCount }),
74
73
  React.createElement(SingleSelectDropdown, { hideToggleIcons: true, selected: { value: null, label: '' }, onSelect: onSelect, options: toolbarDropdownItems, id: "table-actions-dropdown", placeholder: t('Actions'), badge: React.createElement(Badge, null, selectedCases.length) })));
75
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BookmarkedSearchesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/BookmarkedSearchesSelector.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,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,qBAyTvD"}
1
+ {"version":3,"file":"BookmarkedSearchesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/BookmarkedSearchesSelector.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,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,qBA0TvD"}
@@ -163,6 +163,7 @@ export function BookmarkedSearchesSelector(props) {
163
163
  !isEmpty(props.defaultSavedSearchName) && setSelectedSearch(props.defaultSavedSearchName);
164
164
  }, [props.defaultSavedSearchName]);
165
165
  const renderSavedSearchItems = Object.keys(bookmarkedSearches)
166
+ .filter((key) => { var _a; return ((_a = bookmarkedSearches[key]) === null || _a === void 0 ? void 0 : _a.type) !== 'advanced'; })
166
167
  .sort()
167
168
  .map((bookmarkedSearch) => {
168
169
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/CaseSearch.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAkB5E,UAAU,MAAM;IACZ,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBA6LvC"}
1
+ {"version":3,"file":"CaseSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/CaseSearch.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAkB5E,UAAU,MAAM;IACZ,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBAmMvC"}