@rh-support/cases 2.1.62 → 2.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/AdditionalFilters.js +17 -2
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilter.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-filters/CreatorSsoNameFilter.js +1 -1
- package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts.map +1 -1
- package/lib/esm/components/case-list/case-list-table/CaseListTable.js +16 -16
- package/lib/esm/components/case-list/case-list-table/DownloadCSVFileModal.js +2 -2
- package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.d.ts +9 -0
- package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.d.ts.map +1 -0
- package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.js +67 -0
- package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.scss +7 -0
- package/lib/esm/components/case-list/case-search/useAdvanceSearchParser.js +1 -1
- package/lib/esm/utils/constants.js +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdditionalFilters.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/AdditionalFilters.tsx"],"names":[],"mappings":"
|
|
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,sBAqDhC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Checkbox } from '@patternfly/react-core';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
2
4
|
import React, { useContext, useEffect, useState } from 'react';
|
|
3
5
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
6
|
import { AdditionalFilterLabels, SolrKeys } from '../../../enums/filters';
|
|
@@ -17,8 +19,21 @@ export function AdditionalFilters() {
|
|
|
17
19
|
setIsEscalated(checked);
|
|
18
20
|
};
|
|
19
21
|
useEffect(() => {
|
|
20
|
-
|
|
21
|
-
(
|
|
22
|
+
var _a, _b;
|
|
23
|
+
updateFilter(dispatch, {
|
|
24
|
+
filterKey: SolrKeys.escalation,
|
|
25
|
+
values: !isEmpty(case_customer_escalation) && isEqual((_a = case_customer_escalation[0]) === null || _a === void 0 ? void 0 : _a.key, 'true')
|
|
26
|
+
? [{ key: (_b = case_customer_escalation[0]) === null || _b === void 0 ? void 0 : _b.key, value: AdditionalFilterLabels[SolrKeys.escalation] }]
|
|
27
|
+
: [],
|
|
28
|
+
});
|
|
29
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
|
+
}, []);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
var _a;
|
|
33
|
+
isEmpty(case_customer_escalation) && escalated && setIsEscalated(false);
|
|
34
|
+
if (!isEmpty(case_customer_escalation)) {
|
|
35
|
+
isEqual((_a = case_customer_escalation[0]) === null || _a === void 0 ? void 0 : _a.key, 'true') ? setIsEscalated(true) : setIsEscalated(false);
|
|
36
|
+
}
|
|
22
37
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
38
|
}, [case_customer_escalation]);
|
|
24
39
|
return (React.createElement(React.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatorSsoNameFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CreatorSsoNameFilter.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAYhF,eAAO,MAAM,WAAW,0BAIvB,CAAC;AAYF,eAAO,MAAM,eAAe;;;;;;;GAA6E,CAAC;AAE1G,eAAO,MAAM,kBAAkB,iEAyC9B,CAAC;AAEF,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"CreatorSsoNameFilter.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-filters/CreatorSsoNameFilter.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAYhF,eAAO,MAAM,WAAW,0BAIvB,CAAC;AAYF,eAAO,MAAM,eAAe;;;;;;;GAA6E,CAAC;AAE1G,eAAO,MAAM,kBAAkB,iEAyC9B,CAAC;AAEF,wBAAgB,oBAAoB,sBA4OnC"}
|
|
@@ -206,7 +206,7 @@ export function CreatorSsoNameFilter() {
|
|
|
206
206
|
};
|
|
207
207
|
const externalToggle = (toggleRef) => (React.createElement(MenuToggle, { variant: "typeahead", onClick: onExternalToggle, innerRef: toggleRef, isExpanded: isExternalOpen, isFullWidth: true },
|
|
208
208
|
React.createElement(TextInputGroup, { isPlain: true },
|
|
209
|
-
React.createElement(TextInputGroupMain, { value: externalQuery, onClick: onExternalToggle, onKeyDown: onInputKeyDown, placeholder: getDropdownBtnPlaceholder(t('Search for a name'), selectedExternalContacts.map((i) => i.label), ' ', filteredOptions.length + dropdownHeader.length, t('All contacts')), onChange: onExternalQueryChange, isExpanded: isExternalOpen, innerRef: externalInputRef }),
|
|
209
|
+
React.createElement(TextInputGroupMain, { value: externalQuery, onClick: onExternalToggle, onKeyDown: onInputKeyDown, placeholder: getDropdownBtnPlaceholder(t('Search for a name'), selectedExternalContacts.map((i) => i.label), ' ', filteredOptions.length + dropdownHeader.length, t('All contacts')), onChange: onExternalQueryChange, isExpanded: isExternalOpen, innerRef: externalInputRef, "aria-controls": "external-ssousername-filter", role: "combobox" }),
|
|
210
210
|
React.createElement(TextInputGroupUtilities, null, !isEmpty(externalQuery) && (React.createElement(Button, { variant: "plain", onClick: () => setExternalQuery(''), isDisabled: isFetchingExternalContacts, "aria-label": t('Clear') }, isFetchingExternalContacts ? (React.createElement(LoadingIndicator, { show: true, size: "sm" })) : (React.createElement(TimesCircleIcon, { "aria-hidden": true }))))))));
|
|
211
211
|
return (React.createElement("div", null,
|
|
212
212
|
React.createElement("label", { htmlFor: "case-list-username-filter" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseListTable.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/CaseListTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseListTable.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/CaseListTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAuB3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAQxD,OAAO,KAAkD,MAAM,OAAO,CAAC;AAKvE,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAEH,eAAe,EACf,SAAS,EAIZ,MAAM,0BAA0B,CAAC;AA6BlC,UAAU,MAAM;IACZ,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAsBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBAujB1C"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Bullseye, Button, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateHeader, EmptyStateIcon, EmptyStateVariant, PaginationVariant, Spinner, } from '@patternfly/react-core';
|
|
2
2
|
import SearchIcon from '@patternfly/react-icons/dist/js/icons/search-icon';
|
|
3
3
|
import { Table, TableVariant, Tbody, Td, Th, Thead, Tr, Visibility } from '@patternfly/react-table';
|
|
4
|
-
import {
|
|
5
|
-
import { GlobalMetadataDispatchContext,
|
|
4
|
+
import { TableComponent, TablePagination } from '@rh-support/components';
|
|
5
|
+
import { GlobalMetadataDispatchContext, updateUserPreferences, useGlobalStateContext, UserPreferencesKeys, } from '@rh-support/react-context';
|
|
6
6
|
import { formatDate, scrollIntoView, toNewCaseTypeSwitcher } from '@rh-support/utils';
|
|
7
7
|
import find from 'lodash/find';
|
|
8
8
|
import flatMap from 'lodash/flatMap';
|
|
9
9
|
import includes from 'lodash/includes';
|
|
10
|
+
import isEmpty from 'lodash/isEmpty';
|
|
10
11
|
import isEqual from 'lodash/isEqual';
|
|
11
12
|
import isUndefined from 'lodash/isUndefined';
|
|
12
13
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
@@ -18,6 +19,7 @@ import { clearFilters, resetFilterToDefaultState, updatePagination, updateSort,
|
|
|
18
19
|
import CloseCaseBtn from './CloseCaseBtn';
|
|
19
20
|
import { ExportCaseListCSV } from './ExportCaseListCSV';
|
|
20
21
|
import SeverityLabel from './SeverityLabel';
|
|
22
|
+
import { TableColumnSelector } from './table-column-selector/TableColumnSelector';
|
|
21
23
|
// initially selected columns
|
|
22
24
|
const initialSelectedColumns = [
|
|
23
25
|
CaseListColumnIds.caseId,
|
|
@@ -48,16 +50,13 @@ export function CaseListTable(props) {
|
|
|
48
50
|
const [activeSortIndex, setActiveSortIndex] = useState();
|
|
49
51
|
const [activeSortDirection, setActiveSortDirection] = useState();
|
|
50
52
|
const [sortedCaseListData, setSortedCaseListData] = useState(caseListData);
|
|
51
|
-
const { globalMetadataState: { navBarRef, hydraUserPreferences }, } = useGlobalStateContext();
|
|
53
|
+
const { globalMetadataState: { navBarRef, hydraUserPreferences, loggedInUserRights }, } = useGlobalStateContext();
|
|
52
54
|
const dispatch = useContext(CaseListFilterDispatchContext);
|
|
53
55
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
54
|
-
const { filterInfo } = useContext(CaseListFilterStateContext);
|
|
56
|
+
const { filterInfo, filterQueryInfo } = useContext(CaseListFilterStateContext);
|
|
55
57
|
const currentFilterLength = flatMap(filterInfo).length;
|
|
56
58
|
const showingFilter = currentFilterLength > 0;
|
|
57
|
-
const filterState = useContext(CaseListFilterStateContext);
|
|
58
|
-
const { filterQueryInfo } = filterState;
|
|
59
59
|
const hasSearchQuery = !((filterQueryInfo === null || filterQueryInfo === void 0 ? void 0 : filterQueryInfo.queryString) === '');
|
|
60
|
-
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
61
60
|
const isInternal = loggedInUserRights.data.isInternal();
|
|
62
61
|
const tableToolbarRef = useRef(null);
|
|
63
62
|
const columns = [
|
|
@@ -143,10 +142,11 @@ export function CaseListTable(props) {
|
|
|
143
142
|
const selectAllRows = () => {
|
|
144
143
|
!isEqual(selectedCases, allRows) ? setSelectedCases(allRows) : setSelectedCases([]);
|
|
145
144
|
};
|
|
145
|
+
const savedSelectedColumnsKey = UserPreferencesKeys.caseListSelectedColumns;
|
|
146
|
+
const savedSelectedColumns = find(hydraUserPreferences === null || hydraUserPreferences === void 0 ? void 0 : hydraUserPreferences.data, (pref) => pref.key === savedSelectedColumnsKey);
|
|
147
|
+
const cachedColumns = (!isUndefined(savedSelectedColumns) && JSON.parse(savedSelectedColumns === null || savedSelectedColumns === void 0 ? void 0 : savedSelectedColumns.value)) || initialSelectedColumns;
|
|
146
148
|
const getSelectedColumnsListFromCache = () => {
|
|
147
|
-
|
|
148
|
-
const savedSelectedColumns = find(hydraUserPreferences.data, (pref) => pref.key === savedSelectedColumnsKey);
|
|
149
|
-
(savedSelectedColumns === null || savedSelectedColumns === void 0 ? void 0 : savedSelectedColumns.value) && setSelectedColumns(JSON.parse(savedSelectedColumns.value));
|
|
149
|
+
(savedSelectedColumns === null || savedSelectedColumns === void 0 ? void 0 : savedSelectedColumns.value) && setSelectedColumns(cachedColumns);
|
|
150
150
|
};
|
|
151
151
|
const onColumnSelectorChange = (selectedColumnsList) => {
|
|
152
152
|
setSelectedColumns(selectedColumnsList);
|
|
@@ -278,7 +278,7 @@ export function CaseListTable(props) {
|
|
|
278
278
|
return (group === null || group === void 0 ? void 0 : group.name) || '';
|
|
279
279
|
};
|
|
280
280
|
const localRows = [
|
|
281
|
-
...caseListData.map((row, index) => ({
|
|
281
|
+
...caseListData === null || caseListData === void 0 ? void 0 : caseListData.map((row, index) => ({
|
|
282
282
|
case_number: row.case_number,
|
|
283
283
|
case_summary: row.case_summary,
|
|
284
284
|
case_createdByName: row.case_createdByName,
|
|
@@ -302,7 +302,7 @@ export function CaseListTable(props) {
|
|
|
302
302
|
useEffect(() => {
|
|
303
303
|
var _a;
|
|
304
304
|
setSelectedCases([]);
|
|
305
|
-
setSortedCaseListData((_a = props.caseList) === null || _a === void 0 ? void 0 : _a.docs);
|
|
305
|
+
!isEmpty(localRows) ? setSortedCaseListData(localRows) : setSortedCaseListData((_a = props.caseList) === null || _a === void 0 ? void 0 : _a.docs);
|
|
306
306
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
307
307
|
}, [props.caseList]);
|
|
308
308
|
useEffect(() => {
|
|
@@ -316,7 +316,7 @@ export function CaseListTable(props) {
|
|
|
316
316
|
direction: activeSortDirection,
|
|
317
317
|
column: visibleCaseListColumns[activeSortIndex].id,
|
|
318
318
|
});
|
|
319
|
-
sortedRows = localRows.sort((a, b) => {
|
|
319
|
+
sortedRows = localRows === null || localRows === void 0 ? void 0 : localRows.sort((a, b) => {
|
|
320
320
|
const aValue = getSortableRowValues(a)[activeSortIndex];
|
|
321
321
|
const bValue = getSortableRowValues(b)[activeSortIndex];
|
|
322
322
|
if (typeof aValue === 'number') {
|
|
@@ -342,7 +342,7 @@ export function CaseListTable(props) {
|
|
|
342
342
|
React.createElement(TableComponent, { columns: columns, data: caseListData, selectedColumns: selectedColumns },
|
|
343
343
|
React.createElement("div", { className: "case-list-table-toolbar pf-v5-l-flex", ref: tableToolbarRef },
|
|
344
344
|
React.createElement("div", { className: "toolbar-actions pf-v5-l-flex pf-m-space-items-sm" },
|
|
345
|
-
React.createElement(TableColumnSelector, { onColumnSelectorChange: onColumnSelectorChange }),
|
|
345
|
+
React.createElement(TableColumnSelector, { onColumnSelectorChange: onColumnSelectorChange, cachedColumns: cachedColumns }),
|
|
346
346
|
React.createElement(ExportCaseListCSV, { currentFilteredCaseList: props.caseList, isExportCsvDisabled: props.isSolrDown, selectedCases: selectedCases }),
|
|
347
347
|
React.createElement(CloseCaseBtn, { selectedCases: selectedCases, caseList: caseListData, onCasesCloseSuccess: onCasesCloseSuccess })),
|
|
348
348
|
React.createElement("span", { className: "toolbar-pagination" },
|
|
@@ -393,6 +393,6 @@ export function CaseListTable(props) {
|
|
|
393
393
|
React.createElement(Td, { className: !isColumnVisible('type') ? Visibility.hidden : '', "data-label": "Support type" }, row.case_type),
|
|
394
394
|
React.createElement(Td, { className: !isColumnVisible('closedDate') ? Visibility.hidden : '', "data-label": "Closed date" }, row.case_closedDate ? formatDate(row.case_closedDate) : ''),
|
|
395
395
|
React.createElement(Td, { className: !isColumnVisible('folderName') ? Visibility.hidden : '', "data-label": "Group" }, row.case_folderName ? row.case_folderName : ''))))))),
|
|
396
|
-
|
|
397
|
-
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() })))))
|
|
396
|
+
React.createElement("footer", { className: "toolbar-pagination", "data-tracking-id": "case-list-table-pagination" },
|
|
397
|
+
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() })))));
|
|
398
398
|
}
|
|
@@ -26,7 +26,7 @@ const csvHeadersSolr = [
|
|
|
26
26
|
label: 'Case link',
|
|
27
27
|
key: 'case_link',
|
|
28
28
|
},
|
|
29
|
-
{ label: '
|
|
29
|
+
{ label: 'Problem description', key: SolrKeys.caseSummary },
|
|
30
30
|
];
|
|
31
31
|
const csvHeadersSFDC = [
|
|
32
32
|
{ label: 'Case number', key: SFDCKeys.caseNumber },
|
|
@@ -34,7 +34,7 @@ const csvHeadersSFDC = [
|
|
|
34
34
|
label: 'Case link',
|
|
35
35
|
key: 'case_link',
|
|
36
36
|
},
|
|
37
|
-
{ label: '
|
|
37
|
+
{ label: 'Problem description', key: SFDCKeys.caseSummary },
|
|
38
38
|
];
|
|
39
39
|
export default function DownloadCSVFileModal(props) {
|
|
40
40
|
const { onClose, onModalshow, isDisabled, loggedInUserRights, loggedInUsersAccount, filterState, selectedCases, filteredCaseCount, } = props;
|
package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './TableColumnSelector.scss';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface IProps {
|
|
4
|
+
onColumnSelectorChange: (columns: string[]) => void;
|
|
5
|
+
cachedColumns: string[] | [];
|
|
6
|
+
}
|
|
7
|
+
export declare function TableColumnSelector({ onColumnSelectorChange, cachedColumns }: IProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=TableColumnSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableColumnSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/case-list/case-list-table/table-column-selector/TableColumnSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AAWpC,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,UAAU,MAAM;IACZ,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpD,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;CAChC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,sBAAsB,EAAE,aAAa,EAAE,EAAE,MAAM,qBAuHpF"}
|
package/lib/esm/components/case-list/case-list-table/table-column-selector/TableColumnSelector.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import './TableColumnSelector.scss';
|
|
2
|
+
import { Checkbox, Dropdown, DropdownList, Grid, GridItem, MenuToggle, } from '@patternfly/react-core';
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
export function TableColumnSelector({ onColumnSelectorChange, cachedColumns }) {
|
|
6
|
+
const { t } = useTranslation();
|
|
7
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
8
|
+
const [checkboxes, setCheckboxes] = useState({
|
|
9
|
+
contactName: false,
|
|
10
|
+
lastModifiedDate: false,
|
|
11
|
+
severity: false,
|
|
12
|
+
status: false,
|
|
13
|
+
createdDate: false,
|
|
14
|
+
product: false,
|
|
15
|
+
accountNumber: false,
|
|
16
|
+
alternateCaseId: false,
|
|
17
|
+
type: false,
|
|
18
|
+
closedDate: false,
|
|
19
|
+
folderName: false,
|
|
20
|
+
});
|
|
21
|
+
const handleCheckboxChange = (key) => {
|
|
22
|
+
setCheckboxes((prevCheckboxes) => (Object.assign(Object.assign({}, prevCheckboxes), { [key]: !prevCheckboxes[key] })));
|
|
23
|
+
};
|
|
24
|
+
const onToggleClick = () => {
|
|
25
|
+
setIsOpen(!isOpen);
|
|
26
|
+
};
|
|
27
|
+
const caseListColumnHeaderOne = [
|
|
28
|
+
{ label: 'Owner', key: 'contactName' },
|
|
29
|
+
{ label: 'Severity', key: 'severity' },
|
|
30
|
+
{ label: 'Created by', key: 'createdDate' },
|
|
31
|
+
{ label: 'Account number', key: 'accountNumber' },
|
|
32
|
+
{ label: 'Support type', key: 'type' },
|
|
33
|
+
{ label: 'Group', key: 'folderName' },
|
|
34
|
+
];
|
|
35
|
+
const caseListColumnHeaderTwo = [
|
|
36
|
+
{ label: 'Modified by', key: 'lastModifiedDate' },
|
|
37
|
+
{ label: 'Status', key: 'status' },
|
|
38
|
+
{ label: 'Product and version', key: 'product' },
|
|
39
|
+
{ label: 'Personal reference number', key: 'alternateCaseId' },
|
|
40
|
+
{ label: 'Closed date', key: 'closedDate' },
|
|
41
|
+
];
|
|
42
|
+
const generateCheckboxes = (fieldDefinitions) => {
|
|
43
|
+
return fieldDefinitions === null || fieldDefinitions === void 0 ? void 0 : fieldDefinitions.map((field) => (React.createElement(Checkbox, { key: field.key, className: "case-column-selector", label: t(field.label), isChecked: checkboxes[field.key], onChange: () => {
|
|
44
|
+
handleCheckboxChange(field.key);
|
|
45
|
+
}, id: field.key, name: field.key })));
|
|
46
|
+
};
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const selectedColumns = Object.keys(checkboxes).filter((key) => checkboxes[key]);
|
|
49
|
+
onColumnSelectorChange(selectedColumns);
|
|
50
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
|
+
}, [checkboxes]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
cachedColumns === null || cachedColumns === void 0 ? void 0 : cachedColumns.forEach((key) => {
|
|
54
|
+
setCheckboxes((prevCheckboxes) => (Object.assign(Object.assign({}, prevCheckboxes), { [key]: true })));
|
|
55
|
+
});
|
|
56
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
+
}, []);
|
|
58
|
+
return (React.createElement(Dropdown, { isOpen: isOpen, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen }, "Columns")), shouldFocusToggleOnSelect: true, id: "case-list-table-column-dropdown", "data-tracking-id": "case-list-table-column-dropdown", className: "column-selector" },
|
|
59
|
+
React.createElement(DropdownList, null,
|
|
60
|
+
React.createElement(Grid, { hasGutter: true },
|
|
61
|
+
React.createElement(GridItem, { span: 6 },
|
|
62
|
+
React.createElement(Checkbox, { className: "case-column-selector", label: t('Case ID'), defaultChecked: true, isDisabled: true, id: "case-id-check", name: "caseIDCheck" }),
|
|
63
|
+
generateCheckboxes(caseListColumnHeaderOne)),
|
|
64
|
+
React.createElement(GridItem, { span: 6 },
|
|
65
|
+
React.createElement(Checkbox, { className: "case-column-selector", label: t('Problem description'), defaultChecked: true, isDisabled: true, id: "problem-description-check", name: "problemDescriptionCheck" }),
|
|
66
|
+
generateCheckboxes(caseListColumnHeaderTwo))))));
|
|
67
|
+
}
|
|
@@ -101,7 +101,7 @@ export default function useAdvanceSearchParser({ onInit }) {
|
|
|
101
101
|
/ "createdDate" {return "${SolrKeys.createdDate}";}
|
|
102
102
|
/ "closedDate" {return "${SolrKeys.caseClosedDate}";}
|
|
103
103
|
/ "description" {return "${SolrKeys.description}";}
|
|
104
|
-
/ "
|
|
104
|
+
/ "ProblemDescription" {return "${SolrKeys.caseSummary}";}
|
|
105
105
|
/ "lastModifiedDate" {return "${SolrKeys.modifiedDate}";}
|
|
106
106
|
/ "lastModifiedByName" {return "${SolrKeys.modifiedBy}";}
|
|
107
107
|
/ "ownerName" {return "${SolrKeys.contactName}";}
|
|
@@ -5,7 +5,7 @@ export const filterNamesMap = {
|
|
|
5
5
|
[SolrKeys.severity]: 'Severity',
|
|
6
6
|
[SolrKeys.group]: 'Groups',
|
|
7
7
|
[SolrKeys.accountNumber]: 'Bookmarks',
|
|
8
|
-
[SolrKeys.caseSummary]: '
|
|
8
|
+
[SolrKeys.caseSummary]: 'Problem description',
|
|
9
9
|
[SolrKeys.escalation]: 'Escalated',
|
|
10
10
|
[SolrKeys.contactName]: 'Owner',
|
|
11
11
|
[SolrKeys.product]: 'Products',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/cases",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.64",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@patternfly/patternfly": "5.1.0",
|
|
44
44
|
"@patternfly/react-core": "5.1.1",
|
|
45
45
|
"@patternfly/react-table": "5.1.1",
|
|
46
|
-
"@rh-support/components": "2.1.
|
|
47
|
-
"@rh-support/react-context": "2.1.
|
|
46
|
+
"@rh-support/components": "2.1.49",
|
|
47
|
+
"@rh-support/react-context": "2.1.55",
|
|
48
48
|
"@rh-support/types": "2.0.3",
|
|
49
|
-
"@rh-support/user-permissions": "2.1.
|
|
50
|
-
"@rh-support/utils": "2.1.
|
|
49
|
+
"@rh-support/user-permissions": "2.1.36",
|
|
50
|
+
"@rh-support/utils": "2.1.26",
|
|
51
51
|
"localforage": "^1.10.0",
|
|
52
52
|
"lodash": "^4.17.21",
|
|
53
53
|
"pegjs": "^0.10.0",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"defaults and supports es6-module",
|
|
97
97
|
"maintained node versions"
|
|
98
98
|
],
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "860400c585c5440fafa0bdeeeed2bfbbf6e0fbd6"
|
|
100
100
|
}
|