@rh-support/cases 2.6.219 → 2.6.229
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/CaseList.js +2 -2
- package/lib/esm/components/case-list/case-list-table/ArchivedCaseLabel.d.ts +3 -0
- package/lib/esm/components/case-list/case-list-table/ArchivedCaseLabel.d.ts.map +1 -0
- package/lib/esm/components/case-list/case-list-table/ArchivedCaseLabel.js +8 -0
- 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 +18 -48
- package/lib/esm/components/case-list/case-list-table/CaseListTableRow.d.ts +33 -0
- package/lib/esm/components/case-list/case-list-table/CaseListTableRow.d.ts.map +1 -0
- package/lib/esm/components/case-list/case-list-table/CaseListTableRow.js +51 -0
- package/lib/esm/components/case-list/case-list-table/CaseListTableSkeletonRow.d.ts +9 -0
- package/lib/esm/components/case-list/case-list-table/CaseListTableSkeletonRow.d.ts.map +1 -0
- package/lib/esm/components/case-list/case-list-table/CaseListTableSkeletonRow.js +10 -0
- package/lib/esm/enums/case.js +1 -1
- package/lib/esm/hooks/useCaseLabels.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseLabels.js +2 -1
- package/lib/esm/utils/caseListMapper.d.ts.map +1 -1
- package/lib/esm/utils/caseListMapper.js +4 -1
- package/lib/esm/utils/caseListVariablesBuilder.d.ts.map +1 -1
- package/lib/esm/utils/caseListVariablesBuilder.js +20 -11
- package/package.json +6 -6
|
@@ -13,7 +13,7 @@ import { useApolloClient } from '@apollo/client/react';
|
|
|
13
13
|
import { Alert, AlertActionCloseButton, AlertVariant, Button } from '@patternfly/react-core';
|
|
14
14
|
import OpenDrawerRightIcon from '@patternfly/react-icons/dist/js/icons/open-drawer-right-icon';
|
|
15
15
|
import { ErrorBoundary, ToastNotification, useBreakpoint, useDocumentTitle, useForceUpdate, } from '@rh-support/components';
|
|
16
|
-
import { CSSUserModal, fetchAllStatuses, fetchCaseGroupsForAccount, fetchCaseGroupsForSSO, fetchCaseSeverities, fetchCaseTypes, fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext,
|
|
16
|
+
import { CSSUserModal, fetchAllStatuses, fetchCaseGroupsForAccount, fetchCaseGroupsForSSO, fetchCaseSeverities, fetchCaseTypes, fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext, setTraditionalSupportSessionAgreed, setUserPreferences, updateUserPreferences, useGlobalDispatchContext, UserPreferencesKeys, } from '@rh-support/react-context';
|
|
17
17
|
import { getStringifiedParams, getUrlParsedParams, haventLoadedMetadata, haventLoadedProductsMetadata, pendoTrackEvent, } from '@rh-support/utils';
|
|
18
18
|
import isEmpty from 'lodash/isEmpty';
|
|
19
19
|
import isEqual from 'lodash/isEqual';
|
|
@@ -540,7 +540,7 @@ export function CaseList(props) {
|
|
|
540
540
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
541
541
|
}, []);
|
|
542
542
|
const onConfirmTraditionalSupportAgreement = () => {
|
|
543
|
-
|
|
543
|
+
setTraditionalSupportSessionAgreed(globalDispatchContext, true);
|
|
544
544
|
};
|
|
545
545
|
const displayRHCDAlert = () => {
|
|
546
546
|
const openClosedCopy = `Only showing cases that were ${RHCDValue} during the selected time range specified in
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArchivedCaseLabel.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/ArchivedCaseLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,CAAC,OAAO,UAAU,iBAAiB,sBAMxC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Label } from '@patternfly/react-core';
|
|
2
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Trans } from 'react-i18next';
|
|
5
|
+
export default function ArchivedCaseLabel() {
|
|
6
|
+
return (React.createElement(Label, { className: "pf-v6-u-mt-xs", color: "purple", "data-testid": "archived-case-label", icon: React.createElement(InfoCircleIcon, null) },
|
|
7
|
+
React.createElement(Trans, null, "Archived")));
|
|
8
|
+
}
|
|
@@ -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;AAsB3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,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;AAsB3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAQxD,OAAO,KAAkD,MAAM,OAAO,CAAC;AAIvE,OAAO,EAAE,iBAAiB,EAAyB,MAAM,0BAA0B,CAAC;AAEpF,OAAO,EAAgB,SAAS,EAAc,MAAM,0BAA0B,CAAC;AA8B/E,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,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBA6iB1C"}
|
|
@@ -3,7 +3,7 @@ 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
4
|
import { TableComponent } from '@rh-support/components';
|
|
5
5
|
import { GlobalMetadataDispatchContext, updateUserPreferences, useGlobalStateContext, UserPreferencesKeys, } from '@rh-support/react-context';
|
|
6
|
-
import {
|
|
6
|
+
import { formatDate, mapSfdcStatusToPortalStatus, 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';
|
|
@@ -12,12 +12,11 @@ import isEqual from 'lodash/isEqual';
|
|
|
12
12
|
import isUndefined from 'lodash/isUndefined';
|
|
13
13
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
14
14
|
import { Trans, useTranslation } from 'react-i18next';
|
|
15
|
-
import { Link } from 'react-router-dom';
|
|
16
15
|
import { CaseListColumnIds } from '../../../enums/case';
|
|
17
16
|
import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
|
|
18
17
|
import { clearFilters, updateSort } from '../CaseListFilterReducer';
|
|
19
|
-
import
|
|
20
|
-
import
|
|
18
|
+
import { CaseListTableRow } from './CaseListTableRow';
|
|
19
|
+
import { CaseListTableSkeletonRow } from './CaseListTableSkeletonRow';
|
|
21
20
|
import { TableColumnSelector } from './table-column-selector/TableColumnSelector';
|
|
22
21
|
import { TableActionsDropdown } from './TableActionsDropdown';
|
|
23
22
|
// initially selected columns
|
|
@@ -344,6 +343,20 @@ export function CaseListTable(props) {
|
|
|
344
343
|
setSortedCaseListData(sortedRows);
|
|
345
344
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
346
345
|
}, [activeSortDirection, activeSortIndex]);
|
|
346
|
+
const showSkeletonLoaderRow = props.hasNextPage || props.isLoadingMore || props.loadMoreError;
|
|
347
|
+
const hasNoCaseListData = (caseListData || []).length < 1;
|
|
348
|
+
const renderCaseListRows = () => (React.createElement(React.Fragment, null, sortedCaseListData === null || sortedCaseListData === void 0 ? void 0 :
|
|
349
|
+
sortedCaseListData.map((row, rowIndex) => (React.createElement(CaseListTableRow, { key: row.case_number, row: row, rowIndex: rowIndex, isColumnVisible: isColumnVisible, isSelected: selectedCases.includes(row.case_number), onRowClick: onRowClick, onRowSelect: onRowSelect }))),
|
|
350
|
+
showSkeletonLoaderRow && (React.createElement(CaseListTableSkeletonRow, { visibleCaseListColumns: visibleCaseListColumns, sentinelRef: props.sentinelRef }))));
|
|
351
|
+
const renderTableBodyContent = () => {
|
|
352
|
+
if (!props.isCaseListPageLoading && hasNoCaseListData) {
|
|
353
|
+
return noResultFoundRow;
|
|
354
|
+
}
|
|
355
|
+
if (props.isCaseListPageLoading) {
|
|
356
|
+
return loadingRowDefault;
|
|
357
|
+
}
|
|
358
|
+
return renderCaseListRows();
|
|
359
|
+
};
|
|
347
360
|
return (React.createElement(React.Fragment, null,
|
|
348
361
|
React.createElement(TableComponent, { columns: columns, data: caseListData, selectedColumns: selectedColumns },
|
|
349
362
|
React.createElement("div", { className: "case-list-table-toolbar pf-v6-l-flex", ref: tableToolbarRef },
|
|
@@ -375,50 +388,7 @@ export function CaseListTable(props) {
|
|
|
375
388
|
? '0px'
|
|
376
389
|
: undefined,
|
|
377
390
|
}, id: column.id, sort: column.sortable ? onSort(index) : undefined, key: column.id }, column.title))))),
|
|
378
|
-
React.createElement(Tbody, null,
|
|
379
|
-
sortedCaseListData.map((row, rowIndex) => {
|
|
380
|
-
var _a;
|
|
381
|
-
return (React.createElement(Tr, { onRowClick: (event) => (onRowClick ? onRowClick(event, row) : ''), key: row === null || row === void 0 ? void 0 : row.case_number },
|
|
382
|
-
React.createElement(Td, { className: "pf-v6-u-pl-md", select: {
|
|
383
|
-
rowIndex: rowIndex,
|
|
384
|
-
onSelect: (_event, _idx) => onRowSelect(_event, row === null || row === void 0 ? void 0 : row.case_number),
|
|
385
|
-
isSelected: selectedCases.includes(row === null || row === void 0 ? void 0 : row.case_number),
|
|
386
|
-
} }),
|
|
387
|
-
React.createElement(Td, { dataLabel: "Case ID", id: row.case_number, scope: "row" },
|
|
388
|
-
React.createElement("div", { className: "case-number-section" },
|
|
389
|
-
React.createElement(Link, { to: `/case/${row.case_number}`, onClick: () => dtmTrackEventCaseStepEncountered('review', row.case_number, row.case_product, row.case_version) },
|
|
390
|
-
React.createElement("span", { className: "case-number" }, row.case_number)),
|
|
391
|
-
row.case_customer_escalation ? (React.createElement("div", { className: "escalation-label" },
|
|
392
|
-
React.createElement(Trans, null, "Escalated"))) : (''))),
|
|
393
|
-
React.createElement(Td, { dataLabel: "Title" }, row.case_summary),
|
|
394
|
-
React.createElement(Td, { className: !isColumnVisible('contactName') ? Visibility.hidden : '', dataLabel: "Owner" }, row.case_contactName),
|
|
395
|
-
React.createElement(Td, { className: !isColumnVisible('lastModifiedDate') ? Visibility.hidden : '', dataLabel: "Modified by" },
|
|
396
|
-
React.createElement("span", { className: "modified-name" }, row.case_lastModifiedByName),
|
|
397
|
-
row.case_lastModifiedDate ? formatDate(row.case_lastModifiedDate) : ''),
|
|
398
|
-
React.createElement(Td, { className: !isColumnVisible('severity') ? Visibility.hidden : '', dataLabel: "Severity" },
|
|
399
|
-
React.createElement(SeverityLabel, { sevValue: row.case_severity })),
|
|
400
|
-
React.createElement(Td, { className: !isColumnVisible('status') ? Visibility.hidden : '', dataLabel: "Status" }, row.case_status),
|
|
401
|
-
React.createElement(Td, { className: !isColumnVisible('createdDate') ? Visibility.hidden : '', dataLabel: "Created by" },
|
|
402
|
-
React.createElement("span", { className: "created-name" }, row.case_createdByName),
|
|
403
|
-
row.case_createdDate ? formatDate(row.case_createdDate) : ''),
|
|
404
|
-
React.createElement(Td, { className: !isColumnVisible('product') ? Visibility.hidden : '', dataLabel: "Product and Version" },
|
|
405
|
-
row.case_product,
|
|
406
|
-
React.createElement("span", { style: { display: 'block' } }, row.case_version)),
|
|
407
|
-
React.createElement(Td, { className: !isColumnVisible('accountNumber') ? Visibility.hidden : '', dataLabel: "Account number" }, row.case_accountNumber),
|
|
408
|
-
React.createElement(Td, { className: !isColumnVisible('alternateCaseId') ? Visibility.hidden : '', "data-label": "Personal reference number" }, row.case_alternate_id ? row.case_alternate_id : ''),
|
|
409
|
-
React.createElement(Td, { className: !isColumnVisible('type') ? Visibility.hidden : '', "data-label": "Support type" }, row.case_type),
|
|
410
|
-
React.createElement(Td, { className: !isColumnVisible('closedDate') ? Visibility.hidden : '', "data-label": "Closed date" }, row.case_closedDate ? formatDate(row.case_closedDate) : ''),
|
|
411
|
-
React.createElement(Td, { className: !isColumnVisible('folderName') ? Visibility.hidden : '', "data-label": "Group" }, row.case_folderName ? row.case_folderName : ''),
|
|
412
|
-
React.createElement(Td, { className: !isColumnVisible(CaseListColumnIds.caseLabel)
|
|
413
|
-
? Visibility.hidden
|
|
414
|
-
: '', dataLabel: "Case labels" }, ((_a = row.case_label) === null || _a === void 0 ? void 0 : _a.length) ? (React.createElement(CaseListLabelGroup, { labels: row.case_label })) : (''))));
|
|
415
|
-
}),
|
|
416
|
-
(props.hasNextPage || props.isLoadingMore || props.loadMoreError) && (React.createElement(Tr, { key: "skeleton-loader-row", className: "skeleton-loader-row" },
|
|
417
|
-
React.createElement(Td, { className: "pf-v6-u-pl-md" },
|
|
418
|
-
React.createElement("div", { ref: props.sentinelRef, className: "skeleton-sentinel" },
|
|
419
|
-
React.createElement("span", { className: "skeleton-bar skeleton-bar--checkbox" }))),
|
|
420
|
-
visibleCaseListColumns.map((col) => (React.createElement(Td, { key: `skeleton-${col.id}` },
|
|
421
|
-
React.createElement("span", { className: "skeleton-bar" }))))))))))),
|
|
391
|
+
React.createElement(Tbody, null, renderTableBodyContent()))),
|
|
422
392
|
props.loadMoreError && props.loadMoreRetryCount <= 1 && (React.createElement("div", { className: "infinite-scroll-footer-message" },
|
|
423
393
|
React.createElement(Button, { className: "infinite-scroll-retry-btn", variant: "secondary", onClick: props.onRetryLoadMore, icon: React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" },
|
|
424
394
|
React.createElement("polyline", { points: "23 4 23 10 17 10" }),
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ICaseListTableRow {
|
|
3
|
+
id: string;
|
|
4
|
+
case_summary: string;
|
|
5
|
+
case_number: string;
|
|
6
|
+
case_customer_escalation: boolean;
|
|
7
|
+
case_createdByName: string;
|
|
8
|
+
case_lastModifiedByName: string;
|
|
9
|
+
case_lastModifiedDate: string;
|
|
10
|
+
case_severity: string;
|
|
11
|
+
case_product: string[];
|
|
12
|
+
case_version: string;
|
|
13
|
+
case_type: string;
|
|
14
|
+
case_status: string;
|
|
15
|
+
case_createdDate: string;
|
|
16
|
+
case_accountNumber: string;
|
|
17
|
+
case_closedDate: string;
|
|
18
|
+
case_alternate_id: string;
|
|
19
|
+
case_folderName: string;
|
|
20
|
+
case_contactName: string;
|
|
21
|
+
case_label: string[];
|
|
22
|
+
}
|
|
23
|
+
interface IProps {
|
|
24
|
+
row: ICaseListTableRow;
|
|
25
|
+
rowIndex: number;
|
|
26
|
+
isColumnVisible: (columnId: string) => boolean;
|
|
27
|
+
isSelected: boolean;
|
|
28
|
+
onRowClick: (event: React.MouseEvent, row: ICaseListTableRow) => void;
|
|
29
|
+
onRowSelect: (event: React.FormEvent<HTMLInputElement>, caseNumber: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function CaseListTableRow({ row, rowIndex, isColumnVisible, isSelected, onRowClick, onRowSelect }: IProps): React.JSX.Element;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=CaseListTableRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseListTableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/CaseListTableRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB,EAAE,OAAO,CAAC;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,UAAU,MAAM;IACZ,GAAG,EAAE,iBAAiB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACtE,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACvF;AAMD,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,MAAM,qBA+E/G"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Td, Tr, Visibility } from '@patternfly/react-table';
|
|
2
|
+
import { dtmTrackEventCaseStepEncountered, formatDate } from '@rh-support/utils';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Trans } from 'react-i18next';
|
|
5
|
+
import { Link } from 'react-router-dom';
|
|
6
|
+
import { CaseListColumnIds } from '../../../enums/case';
|
|
7
|
+
import ArchivedCaseLabel from './ArchivedCaseLabel';
|
|
8
|
+
import CaseListLabelGroup from './CaseListLabelGroup';
|
|
9
|
+
import SeverityLabel from './SeverityLabel';
|
|
10
|
+
function getColumnCellClass(columnId, isColumnVisible) {
|
|
11
|
+
return isColumnVisible(columnId) ? '' : Visibility.hidden || '';
|
|
12
|
+
}
|
|
13
|
+
export function CaseListTableRow({ row, rowIndex, isColumnVisible, isSelected, onRowClick, onRowSelect }) {
|
|
14
|
+
var _a;
|
|
15
|
+
return (React.createElement(Tr, { onRowClick: (event) => event && onRowClick(event, row) },
|
|
16
|
+
React.createElement(Td, { className: "pf-v6-u-pl-md", select: {
|
|
17
|
+
rowIndex,
|
|
18
|
+
onSelect: (event) => onRowSelect(event, row.case_number),
|
|
19
|
+
isSelected,
|
|
20
|
+
} }),
|
|
21
|
+
React.createElement(Td, { dataLabel: "Case ID", id: row.case_number, scope: "row" },
|
|
22
|
+
React.createElement("div", { className: "case-number-section" },
|
|
23
|
+
React.createElement(Link, { to: `/case/${row.case_number}`, onClick: () => {
|
|
24
|
+
var _a;
|
|
25
|
+
return dtmTrackEventCaseStepEncountered('review', row.case_number, (_a = row.case_product) === null || _a === void 0 ? void 0 : _a[0], row.case_version);
|
|
26
|
+
} },
|
|
27
|
+
React.createElement("span", { className: "case-number" }, row.case_number)),
|
|
28
|
+
row.case_customer_escalation ? (React.createElement("div", { className: "escalation-label" },
|
|
29
|
+
React.createElement(Trans, null, "Escalated"))) : null,
|
|
30
|
+
row.case_status === 'Archived' ? React.createElement(ArchivedCaseLabel, null) : null)),
|
|
31
|
+
React.createElement(Td, { dataLabel: "Title" }, row.case_summary),
|
|
32
|
+
React.createElement(Td, { className: getColumnCellClass('contactName', isColumnVisible), dataLabel: "Owner" }, row.case_contactName),
|
|
33
|
+
React.createElement(Td, { className: getColumnCellClass('lastModifiedDate', isColumnVisible), dataLabel: "Modified by" },
|
|
34
|
+
React.createElement("span", { className: "modified-name" }, row.case_lastModifiedByName),
|
|
35
|
+
row.case_lastModifiedDate ? formatDate(row.case_lastModifiedDate) : ''),
|
|
36
|
+
React.createElement(Td, { className: getColumnCellClass('severity', isColumnVisible), dataLabel: "Severity" },
|
|
37
|
+
React.createElement(SeverityLabel, { sevValue: row.case_severity })),
|
|
38
|
+
React.createElement(Td, { className: getColumnCellClass('status', isColumnVisible), dataLabel: "Status" }, row.case_status),
|
|
39
|
+
React.createElement(Td, { className: getColumnCellClass('createdDate', isColumnVisible), dataLabel: "Created by" },
|
|
40
|
+
React.createElement("span", { className: "created-name" }, row.case_createdByName),
|
|
41
|
+
row.case_createdDate ? formatDate(row.case_createdDate) : ''),
|
|
42
|
+
React.createElement(Td, { className: getColumnCellClass('product', isColumnVisible), dataLabel: "Product and Version" },
|
|
43
|
+
row.case_product,
|
|
44
|
+
React.createElement("span", { className: "pf-v6-u-display-block" }, row.case_version)),
|
|
45
|
+
React.createElement(Td, { className: getColumnCellClass('accountNumber', isColumnVisible), dataLabel: "Account number" }, row.case_accountNumber),
|
|
46
|
+
React.createElement(Td, { className: getColumnCellClass('alternateCaseId', isColumnVisible), "data-label": "Personal reference number" }, row.case_alternate_id || ''),
|
|
47
|
+
React.createElement(Td, { className: getColumnCellClass('type', isColumnVisible), "data-label": "Support type" }, row.case_type),
|
|
48
|
+
React.createElement(Td, { className: getColumnCellClass('closedDate', isColumnVisible), "data-label": "Closed date" }, row.case_closedDate ? formatDate(row.case_closedDate) : ''),
|
|
49
|
+
React.createElement(Td, { className: getColumnCellClass('folderName', isColumnVisible), "data-label": "Group" }, row.case_folderName || ''),
|
|
50
|
+
React.createElement(Td, { className: getColumnCellClass(CaseListColumnIds.caseLabel, isColumnVisible), dataLabel: "Case labels" }, ((_a = row.case_label) === null || _a === void 0 ? void 0 : _a.length) ? React.createElement(CaseListLabelGroup, { labels: row.case_label }) : null)));
|
|
51
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IColumn } from '@rh-support/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface IProps {
|
|
4
|
+
visibleCaseListColumns: IColumn[];
|
|
5
|
+
sentinelRef?: (node?: Element | null) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function CaseListTableSkeletonRow({ visibleCaseListColumns, sentinelRef }: IProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=CaseListTableSkeletonRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseListTableSkeletonRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-list-table/CaseListTableSkeletonRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,MAAM;IACZ,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD;AAED,wBAAgB,wBAAwB,CAAC,EAAE,sBAAsB,EAAE,WAAW,EAAE,EAAE,MAAM,qBAevF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Td, Tr } from '@patternfly/react-table';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export function CaseListTableSkeletonRow({ visibleCaseListColumns, sentinelRef }) {
|
|
4
|
+
return (React.createElement(Tr, { key: "skeleton-loader-row", className: "skeleton-loader-row" },
|
|
5
|
+
React.createElement(Td, { className: "pf-v6-u-pl-md" },
|
|
6
|
+
React.createElement("div", { ref: sentinelRef, className: "skeleton-sentinel" },
|
|
7
|
+
React.createElement("span", { className: "skeleton-bar skeleton-bar--checkbox" }))),
|
|
8
|
+
visibleCaseListColumns.map((col) => (React.createElement(Td, { key: `skeleton-${col.id}` },
|
|
9
|
+
React.createElement("span", { className: "skeleton-bar" }))))));
|
|
10
|
+
}
|
package/lib/esm/enums/case.js
CHANGED
|
@@ -67,7 +67,7 @@ export const caseListSortColumnIdsToSFDCMap = {
|
|
|
67
67
|
};
|
|
68
68
|
// Maps CaseListColumnIds to GraphQL RedHatSupportCase_OrderBy field paths
|
|
69
69
|
export const caseListSortColumnIdsToGraphQLMap = {
|
|
70
|
-
[CaseListColumnIds.caseId]: '
|
|
70
|
+
[CaseListColumnIds.caseId]: 'CaseNumber__c',
|
|
71
71
|
[CaseListColumnIds.summary]: 'Subject',
|
|
72
72
|
[CaseListColumnIds.severity]: 'Priority',
|
|
73
73
|
[CaseListColumnIds.owner]: 'OwnerId',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCaseLabels.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseLabels.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCaseLabels.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseLabels.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB;AAOD,UAAU,mBAAmB;IACzB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAmCrE"}
|
|
@@ -9,12 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { useApolloClient } from '@apollo/client/react';
|
|
11
11
|
import { GET_CASE_LABELS, } from '@rh-support/utils';
|
|
12
|
+
import unescape from 'lodash/unescape';
|
|
12
13
|
import { useCallback, useEffect, useState } from 'react';
|
|
13
14
|
const mapCaseLabelNode = (node) => {
|
|
14
15
|
var _a, _b;
|
|
15
16
|
return ({
|
|
16
17
|
id: node.Id,
|
|
17
|
-
name: (_b = (_a = node.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '',
|
|
18
|
+
name: unescape((_b = (_a = node.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ''),
|
|
18
19
|
});
|
|
19
20
|
};
|
|
20
21
|
/** Fetches account-scoped case labels for the Case List Case labels filter. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseListMapper.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"caseListMapper.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAYhE,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,YAAY,GAAG,aAAa,CAiC9E;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,GAAG,aAAa,EAAE,CAElG"}
|
|
@@ -2,7 +2,10 @@ import unescape from 'lodash/unescape';
|
|
|
2
2
|
function mapCaseLabelNames(node) {
|
|
3
3
|
var _a, _b;
|
|
4
4
|
const edges = (_b = (_a = node.Case_Label_Links__r) === null || _a === void 0 ? void 0 : _a.edges) !== null && _b !== void 0 ? _b : [];
|
|
5
|
-
const names = edges
|
|
5
|
+
const names = edges
|
|
6
|
+
.map((edge) => { var _a, _b, _c; return (_c = (_b = (_a = edge.node) === null || _a === void 0 ? void 0 : _a.Label__r) === null || _b === void 0 ? void 0 : _b.Name) === null || _c === void 0 ? void 0 : _c.value; })
|
|
7
|
+
.filter((name) => Boolean(name))
|
|
8
|
+
.map((name) => unescape(name));
|
|
6
9
|
return [...new Set(names)];
|
|
7
10
|
}
|
|
8
11
|
export function mapGraphQLCaseToCaseListItem(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseListVariablesBuilder.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListVariablesBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAcnD,OAAO,EAEH,oBAAoB,EAEvB,MAAM,+CAA+C,CAAC;AAMvD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAM1F;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC7B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;
|
|
1
|
+
{"version":3,"file":"caseListVariablesBuilder.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListVariablesBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAcnD,OAAO,EAEH,oBAAoB,EAEvB,MAAM,+CAA+C,CAAC;AAMvD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAM1F;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC7B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAsbD,wBAAsB,qCAAqC,CACvD,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,YAAY,EAC1B,eAAe,CAAC,EAAE,gBAAgB,EAClC,yBAAyB,UAAQ,GAClC,OAAO,CAAC,yBAAyB,CAAC,CAuIpC"}
|
|
@@ -165,22 +165,31 @@ function resolveGroupIds(groups, apolloClient) {
|
|
|
165
165
|
*/
|
|
166
166
|
function resolveCaseNumbersByLabelIds(labelIds, apolloClient) {
|
|
167
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
var _a, _b, _c, _d;
|
|
168
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
169
169
|
if (!labelIds.length) {
|
|
170
170
|
return [];
|
|
171
171
|
}
|
|
172
172
|
const where = labelIds.length === 1 ? { Label__r: { Id: { eq: labelIds[0] } } } : { Label__r: { Id: { in: labelIds } } };
|
|
173
|
+
const PAGE_SIZE = 2000;
|
|
174
|
+
const allCaseNumbers = [];
|
|
175
|
+
let hasNextPage = true;
|
|
176
|
+
let afterCursor;
|
|
173
177
|
try {
|
|
174
|
-
|
|
175
|
-
query
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
.
|
|
183
|
-
|
|
178
|
+
while (hasNextPage) {
|
|
179
|
+
const { data } = yield apolloClient.query({
|
|
180
|
+
query: GET_CASE_NUMBERS_BY_CASE_LABEL,
|
|
181
|
+
variables: Object.assign({ where, first: PAGE_SIZE }, (afterCursor ? { after: afterCursor } : {})),
|
|
182
|
+
fetchPolicy: 'network-only',
|
|
183
|
+
});
|
|
184
|
+
const connection = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCaseLabelLink__c;
|
|
185
|
+
const edges = (_c = connection === null || connection === void 0 ? void 0 : connection.edges) !== null && _c !== void 0 ? _c : [];
|
|
186
|
+
allCaseNumbers.push(...edges
|
|
187
|
+
.map((edge) => { var _a, _b, _c; return (_c = (_b = (_a = edge.node) === null || _a === void 0 ? void 0 : _a.Case__r) === null || _b === void 0 ? void 0 : _b.CaseNumber__c) === null || _c === void 0 ? void 0 : _c.value; })
|
|
188
|
+
.filter((caseNumber) => Boolean(caseNumber)));
|
|
189
|
+
hasNextPage = (_e = (_d = connection === null || connection === void 0 ? void 0 : connection.pageInfo) === null || _d === void 0 ? void 0 : _d.hasNextPage) !== null && _e !== void 0 ? _e : false;
|
|
190
|
+
afterCursor = (_g = (_f = connection === null || connection === void 0 ? void 0 : connection.pageInfo) === null || _f === void 0 ? void 0 : _f.endCursor) !== null && _g !== void 0 ? _g : undefined;
|
|
191
|
+
}
|
|
192
|
+
return [...new Set(allCaseNumbers)];
|
|
184
193
|
}
|
|
185
194
|
catch (error) {
|
|
186
195
|
console.error('[GraphQL] Failed to resolve case numbers by case label:', error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/cases",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.229",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"@patternfly/patternfly": "6.2.1",
|
|
39
39
|
"@patternfly/react-core": "6.2.1",
|
|
40
40
|
"@patternfly/react-table": "6.2.1",
|
|
41
|
-
"@rh-support/components": "2.5.
|
|
42
|
-
"@rh-support/react-context": "2.5.
|
|
41
|
+
"@rh-support/components": "2.5.225",
|
|
42
|
+
"@rh-support/react-context": "2.5.321",
|
|
43
43
|
"@rh-support/types": "2.0.26",
|
|
44
|
-
"@rh-support/user-permissions": "2.5.
|
|
45
|
-
"@rh-support/utils": "2.5.
|
|
44
|
+
"@rh-support/user-permissions": "2.5.173",
|
|
45
|
+
"@rh-support/utils": "2.5.152",
|
|
46
46
|
"localforage": "^1.10.0",
|
|
47
47
|
"lodash": "^4.17.21",
|
|
48
48
|
"pegjs": "^0.10.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"defaults and supports es6-module",
|
|
95
95
|
"maintained node versions"
|
|
96
96
|
],
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "4cb198056cdf53141dcdf4d9b55d9cbb36940e05"
|
|
98
98
|
}
|