@rh-support/cases 2.6.170 → 2.6.178
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.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseList.js +43 -7
- package/lib/esm/components/case-list/CaseListContext.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListContext.js +5 -0
- package/lib/esm/components/case-list/CaseListFilterReducer.d.ts +1 -3
- package/lib/esm/components/case-list/CaseListFilterReducer.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListFilterReducer.js +1 -11
- package/lib/esm/components/case-list/CaseListReducer.d.ts +21 -3
- package/lib/esm/components/case-list/CaseListReducer.d.ts.map +1 -1
- package/lib/esm/components/case-list/CaseListReducer.js +31 -1
- package/lib/esm/components/case-list/case-list-table/CaseListTable.d.ts +7 -2
- 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 +69 -57
- package/lib/esm/css/caseList.css +99 -22
- package/lib/esm/utils/caseListGraphQLUtils.d.ts +12 -0
- package/lib/esm/utils/caseListGraphQLUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseListGraphQLUtils.js +53 -2
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAuClC,OAAO,KAAkD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseList.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseList.tsx"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,0BAA0B,CAAC;AAuClC,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAgC1C,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAMD,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,qBA0gBrC"}
|
|
@@ -19,11 +19,12 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
19
19
|
import some from 'lodash/some';
|
|
20
20
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
21
21
|
import { Trans, useTranslation } from 'react-i18next';
|
|
22
|
+
import { useInView } from 'react-intersection-observer';
|
|
22
23
|
import { useLocation } from 'react-router-dom';
|
|
23
24
|
import { CaseSearchQueryType } from '../../enums/caseSearch';
|
|
24
25
|
import { PageTitle } from '../../enums/pageTitle';
|
|
25
26
|
import { useFilterStateOnLoad } from '../../hooks/useFilterStateOnLoad';
|
|
26
|
-
import { clearPageCursors, getCaseListFromGraphQL } from '../../utils/caseListGraphQLUtils';
|
|
27
|
+
import { clearPageCursors, getCaseListFromGraphQL, loadMoreCases } from '../../utils/caseListGraphQLUtils';
|
|
27
28
|
import { createFilterStateFromUrlQuery, createURLQueryFromFilterState, FILTER_URL_CURRENT_PAGE_SEARCH_PARAM, FILTER_URL_PAGE_SIZE_SEARCH_PARAM, FILTER_URL_QUERY_SEARCH_PARAM, FILTER_URL_QUERY_TYPE, } from '../../utils/caseSearchUtils';
|
|
28
29
|
import { UpdatedCaseDataEvent } from '../../utils/constants';
|
|
29
30
|
import { NewCaseButton } from '../case/NewCaseButton';
|
|
@@ -35,13 +36,13 @@ import { useCaseListDispatchContext, useCaseListStateContext } from './CaseListC
|
|
|
35
36
|
import { CaseListFilterDispatchContext, CaseListFilterStateContext } from './CaseListFilterContext';
|
|
36
37
|
import { isNoFilterApplied, isOnlyDefaultFilterApplied } from './CaseListFilterHelpers';
|
|
37
38
|
import { updateFilterState } from './CaseListFilterReducer';
|
|
38
|
-
import { setCaseList, setCurrentQuery, setIsFetching } from './CaseListReducer';
|
|
39
|
+
import { appendCaseList, setCaseList, setCurrentQuery, setCursorInfo, setIsFetching, setIsLoadingMore, setLoadMoreError, } from './CaseListReducer';
|
|
39
40
|
export function CaseList(props) {
|
|
40
41
|
var _a, _b;
|
|
41
42
|
const { t } = useTranslation();
|
|
42
43
|
useDocumentTitle(PageTitle.CASE_LIST);
|
|
43
44
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
44
|
-
const { caseList, isFetching, currentQuery } = useCaseListStateContext();
|
|
45
|
+
const { caseList, isFetching, isLoadingMore, hasNextPage, endCursor, currentQuery, loadMoreError, loadMoreRetryCount, } = useCaseListStateContext();
|
|
45
46
|
const CaseListDispatch = useCaseListDispatchContext();
|
|
46
47
|
const breakPoint = useBreakpoint();
|
|
47
48
|
const { globalMetadataState, globalMetadataState: { caseGroups, loggedInUserJwtToken, loggedInUserRights, loggedInUsersAccount, userPreferences, managedAccounts, bookmarkedAccounts, allCaseTypes, allCaseSeverities, allCaseStatuses, allProducts, caseRecordTypes, caseListTraditionalSupportAgreed, }, } = useContext(GlobalMetadataStateContext);
|
|
@@ -67,6 +68,19 @@ export function CaseList(props) {
|
|
|
67
68
|
const [defaultSavedSearchName, setDefaultSavedSearchName] = useState('');
|
|
68
69
|
const [RHCDValue, setRHCDValue] = useState('');
|
|
69
70
|
const [isRHCDAlertShown, setIsRHCDAlertShown] = useState(true);
|
|
71
|
+
const loadMoreTriggeredRef = useRef(false);
|
|
72
|
+
const { ref: sentinelRef, inView } = useInView({ rootMargin: '100px' });
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!inView) {
|
|
75
|
+
loadMoreTriggeredRef.current = false;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (inView && hasNextPage && !isLoadingMore && !loadMoreError && !loadMoreTriggeredRef.current) {
|
|
79
|
+
loadMoreTriggeredRef.current = true;
|
|
80
|
+
loadMore();
|
|
81
|
+
}
|
|
82
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
|
+
}, [inView, hasNextPage, isLoadingMore, loadMoreError]);
|
|
70
84
|
function getCases(currentFilterState) {
|
|
71
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
86
|
var _a;
|
|
@@ -78,13 +92,14 @@ export function CaseList(props) {
|
|
|
78
92
|
abortControllerRef.current = controller;
|
|
79
93
|
setIsFetching(CaseListDispatch, true);
|
|
80
94
|
setHasError(false);
|
|
81
|
-
const
|
|
95
|
+
const result = yield getCaseListFromGraphQL(currentFilterState, apolloClient, undefined, controller.signal);
|
|
82
96
|
if (controller.signal.aborted) {
|
|
83
97
|
return;
|
|
84
98
|
}
|
|
85
|
-
setCaseList(CaseListDispatch, caseListResponse.response);
|
|
99
|
+
setCaseList(CaseListDispatch, result.caseListResponse.response);
|
|
100
|
+
setCursorInfo(CaseListDispatch, result.hasNextPage, result.endCursor);
|
|
86
101
|
setIsFetching(CaseListDispatch, false);
|
|
87
|
-
if (showErrorMessage) {
|
|
102
|
+
if (result.showErrorMessage) {
|
|
88
103
|
setHasError(true);
|
|
89
104
|
ToastNotification.addDangerMessage(t('There was an error loading case data. Please try again.'));
|
|
90
105
|
}
|
|
@@ -99,6 +114,27 @@ export function CaseList(props) {
|
|
|
99
114
|
}
|
|
100
115
|
});
|
|
101
116
|
}
|
|
117
|
+
function loadMore() {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
if (isLoadingMore || !hasNextPage || !endCursor || loadMoreError)
|
|
120
|
+
return;
|
|
121
|
+
setIsLoadingMore(CaseListDispatch, true);
|
|
122
|
+
try {
|
|
123
|
+
const result = yield loadMoreCases(filterState, apolloClient, endCursor);
|
|
124
|
+
setLoadMoreError(CaseListDispatch, false, 0);
|
|
125
|
+
appendCaseList(CaseListDispatch, result.docs, result.hasNextPage, result.endCursor);
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
const nextRetryCount = loadMoreRetryCount + 1;
|
|
129
|
+
setLoadMoreError(CaseListDispatch, true, nextRetryCount);
|
|
130
|
+
console.error('[CaseList] loadMore error:', err);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function retryLoadMore() {
|
|
135
|
+
loadMoreTriggeredRef.current = false;
|
|
136
|
+
setLoadMoreError(CaseListDispatch, false, loadMoreRetryCount);
|
|
137
|
+
}
|
|
102
138
|
const toggleFilterSection = (isExpanded) => {
|
|
103
139
|
if (!filterSectionRef.current)
|
|
104
140
|
return;
|
|
@@ -353,5 +389,5 @@ export function CaseList(props) {
|
|
|
353
389
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading filters') } },
|
|
354
390
|
React.createElement(CaseListFilters, { allCaseTypes: allCaseTypes, allCaseStatuses: allCaseStatuses, allCaseSeverities: allCaseSeverities, allProducts: allProducts }))))),
|
|
355
391
|
React.createElement("section", { className: "case-search-table pf-v6-u-display-flex pf-v6-u-flex-direction-column" },
|
|
356
|
-
React.createElement(CaseListTable, { caseList: caseList, caseGroups: caseGroups.data || [], loggedInUserRights: loggedInUserRights.data, sortInfo: filterState.sortInfo,
|
|
392
|
+
React.createElement(CaseListTable, { caseList: caseList, caseGroups: caseGroups.data || [], loggedInUserRights: loggedInUserRights.data, sortInfo: filterState.sortInfo, isCaseListPageLoading: isFetching, hasError: hasError, hasNextPage: hasNextPage, isLoadingMore: isLoadingMore, loadMoreError: loadMoreError, loadMoreRetryCount: loadMoreRetryCount, onRetryLoadMore: retryLoadMore, sentinelRef: sentinelRef }))))));
|
|
357
393
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseListContext.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseListContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1F,eAAO,MAAM,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"CaseListContext.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseListContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1F,eAAO,MAAM,oBAAoB,EAAE,cAclC,CAAC;AAIF,QAAA,MAAM,oBAAoB,+BAA4C,CAAC;AAEvE,QAAA,MAAM,uBAAuB,qCAAmE,CAAC;AAEjG,QAAA,MAAM,uBAAuB,sBAAyC,CAAC;AACvE,QAAA,MAAM,0BAA0B,4BAA4C,CAAC;AAE7E,iBAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE;;CAAA,qBAOrC;AAED,OAAO,EACH,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,GAC7B,CAAC"}
|
|
@@ -6,7 +6,6 @@ declare enum CaseListReducerEnum {
|
|
|
6
6
|
updateFilter = "UPDATE_FILTER",
|
|
7
7
|
updateFilters = "UPDATE_FILTERS",
|
|
8
8
|
updateSort = "UPDATE_SORT",
|
|
9
|
-
updatePagination = "UPDATE_PAGINATION",
|
|
10
9
|
updateFilterQuery = "UPDATE_FILTER_QUERY",
|
|
11
10
|
removeFilter = "REMOVE_FILTER",
|
|
12
11
|
clearFilters = "CLEAR_FILTERS",
|
|
@@ -61,7 +60,6 @@ type IActionType = IAction<CaseListReducerEnum, ICaseListFilterState>;
|
|
|
61
60
|
export type CaseListFilterDispatchType = (value: IActionType) => void;
|
|
62
61
|
declare const caseListFilterReducer: (pState: ICaseListFilterState, action: any) => ICaseListFilterState;
|
|
63
62
|
declare function updateSort(dispatch: CaseListFilterDispatchType, sortInfo: ISortInfo): void;
|
|
64
|
-
declare function updatePagination(dispatch: CaseListFilterDispatchType, paginationInfo: IPaginationInfo): void;
|
|
65
63
|
declare function updateFilter(dispatch: CaseListFilterDispatchType, { filterKey, values }: {
|
|
66
64
|
filterKey: any;
|
|
67
65
|
values: any;
|
|
@@ -75,5 +73,5 @@ declare const clearFilters: (dispatch: any, clearQueryString?: boolean) => void;
|
|
|
75
73
|
declare function resetFilterToDefaultState(dispatch: any): void;
|
|
76
74
|
declare function updateFilterQuery(dispatch: CaseListFilterDispatchType, filterQueryInfo: IFilterQueryInfo): void;
|
|
77
75
|
declare function updateFilterState(dispatch: CaseListFilterDispatchType, newState: Partial<ICaseListFilterState>): void;
|
|
78
|
-
export { updateSort,
|
|
76
|
+
export { updateSort, updateFilter, updateFilters, updateFilterQuery, removeFilterItem, clearFilters, updateFilterState, caseListFilterReducer, resetFilterToDefaultState, };
|
|
79
77
|
//# sourceMappingURL=CaseListFilterReducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseListFilterReducer.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseListFilterReducer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE9D,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,WAAW,CAYlD,CAAC;AAEF,aAAK,mBAAmB;IACpB,YAAY,kBAAkB;IAC9B,aAAa,mBAAmB;IAChC,UAAU,gBAAgB;IAC1B,
|
|
1
|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Enum["updateSort"] = "UPDATE_SORT";
|
|
21
|
-
CaseListReducerEnum["updatePagination"] = "UPDATE_PAGINATION";
|
|
22
21
|
CaseListReducerEnum["updateFilterQuery"] = "UPDATE_FILTER_QUERY";
|
|
23
22
|
CaseListReducerEnum["removeFilter"] = "REMOVE_FILTER";
|
|
24
23
|
CaseListReducerEnum["clearFilters"] = "CLEAR_FILTERS";
|
|
@@ -57,9 +56,6 @@ const caseListFilterReducer = (pState, action) => {
|
|
|
57
56
|
const newPaginationInfo = Object.assign(Object.assign({}, pState.paginationInfo), { currentPage: 1 });
|
|
58
57
|
return Object.assign(Object.assign({}, pState), { sortInfo: action.payload.sortInfo, paginationInfo: newPaginationInfo });
|
|
59
58
|
}
|
|
60
|
-
case CaseListReducerEnum.updatePagination: {
|
|
61
|
-
return Object.assign(Object.assign({}, pState), { paginationInfo: action.payload.paginationInfo });
|
|
62
|
-
}
|
|
63
59
|
case CaseListReducerEnum.removeFilter: {
|
|
64
60
|
const newValues = pState.filterInfo[action.payload.filterKey].filter((item) => {
|
|
65
61
|
return (typeof item === 'string' ? item : item.key) !== action.payload.value;
|
|
@@ -90,12 +86,6 @@ function updateSort(dispatch, sortInfo) {
|
|
|
90
86
|
payload: { sortInfo },
|
|
91
87
|
});
|
|
92
88
|
}
|
|
93
|
-
function updatePagination(dispatch, paginationInfo) {
|
|
94
|
-
dispatch({
|
|
95
|
-
type: CaseListReducerEnum.updatePagination,
|
|
96
|
-
payload: { paginationInfo },
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
89
|
function updateFilter(dispatch, { filterKey, values }) {
|
|
100
90
|
dispatch({
|
|
101
91
|
type: CaseListReducerEnum.updateFilter,
|
|
@@ -142,4 +132,4 @@ function updateFilterState(dispatch, newState) {
|
|
|
142
132
|
payload: newState,
|
|
143
133
|
});
|
|
144
134
|
}
|
|
145
|
-
export { updateSort,
|
|
135
|
+
export { updateSort, updateFilter, updateFilters, updateFilterQuery, removeFilterItem, clearFilters, updateFilterState, caseListFilterReducer, resetFilterToDefaultState, };
|
|
@@ -3,6 +3,11 @@ import { ICaseListResponse } from '../../models/caseList';
|
|
|
3
3
|
export interface ICaseListState {
|
|
4
4
|
caseList: ISolrResponse<ICaseListResponse>;
|
|
5
5
|
isFetching: boolean;
|
|
6
|
+
isLoadingMore: boolean;
|
|
7
|
+
hasNextPage: boolean;
|
|
8
|
+
endCursor: string | undefined;
|
|
9
|
+
loadMoreError: boolean;
|
|
10
|
+
loadMoreRetryCount: number;
|
|
6
11
|
chipsNameSsoMap?: IChipsNameSsoMap;
|
|
7
12
|
currentQuery: string;
|
|
8
13
|
}
|
|
@@ -17,14 +22,27 @@ export interface IChipsNameSsoMap {
|
|
|
17
22
|
[sso: string]: IChipsNameSso;
|
|
18
23
|
}
|
|
19
24
|
declare enum CaseListReducerEnum {
|
|
20
|
-
updateState = "SET_STATE"
|
|
25
|
+
updateState = "SET_STATE",
|
|
26
|
+
appendDocs = "APPEND_DOCS"
|
|
21
27
|
}
|
|
22
|
-
|
|
28
|
+
interface IAppendDocsPayload {
|
|
29
|
+
docs: ICaseListResponse[];
|
|
30
|
+
hasNextPage: boolean;
|
|
31
|
+
endCursor: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
type IActionType = IAction<CaseListReducerEnum, ICaseListState> | {
|
|
34
|
+
type: CaseListReducerEnum.appendDocs;
|
|
35
|
+
payload: IAppendDocsPayload;
|
|
36
|
+
};
|
|
23
37
|
export type CaseListDispatchType = (value: IActionType) => void;
|
|
24
38
|
declare const caseListReducer: (state: ICaseListState, action: IActionType) => ICaseListState;
|
|
25
39
|
declare const setCaseList: (dispatch: CaseListDispatchType, caseList: ISolrResponse<ICaseListResponse>) => void;
|
|
26
40
|
declare const setChipsNameSsoMap: (dispatch: CaseListDispatchType, chipsNameSsoMap: IChipsNameSsoMap) => void;
|
|
27
41
|
declare const setIsFetching: (dispatch: CaseListDispatchType, isFetching: boolean) => void;
|
|
28
42
|
declare const setCurrentQuery: (dispatch: CaseListDispatchType, currentQuery: string) => void;
|
|
29
|
-
|
|
43
|
+
declare const setIsLoadingMore: (dispatch: CaseListDispatchType, isLoadingMore: boolean) => void;
|
|
44
|
+
declare const appendCaseList: (dispatch: CaseListDispatchType, docs: ICaseListResponse[], hasNextPage: boolean, endCursor: string | undefined) => void;
|
|
45
|
+
declare const setCursorInfo: (dispatch: CaseListDispatchType, hasNextPage: boolean, endCursor: string | undefined) => void;
|
|
46
|
+
declare const setLoadMoreError: (dispatch: CaseListDispatchType, loadMoreError: boolean, loadMoreRetryCount: number) => void;
|
|
47
|
+
export { caseListReducer, setCaseList, setChipsNameSsoMap, setIsFetching, setCurrentQuery, setIsLoadingMore, appendCaseList, setCursorInfo, setLoadMoreError, };
|
|
30
48
|
//# sourceMappingURL=CaseListReducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseListReducer.d.ts","sourceRoot":"","sources":["../../../../src/components/case-list/CaseListReducer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC;AAED,aAAK,mBAAmB;IACpB,WAAW,cAAc;
|
|
1
|
+
{"version":3,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IAAI,CAAC;AAEhE,QAAA,MAAM,eAAe,GAAI,OAAO,cAAc,EAAE,QAAQ,WAAW,KAAG,cAmBrE,CAAC;AAEF,QAAA,MAAM,WAAW,GAAI,UAAU,oBAAoB,EAAE,UAAU,aAAa,CAAC,iBAAiB,CAAC,SAK9F,CAAC;AAEF,QAAA,MAAM,kBAAkB,GAAI,UAAU,oBAAoB,EAAE,iBAAiB,gBAAgB,SAK5F,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,UAAU,oBAAoB,EAAE,YAAY,OAAO,SAKzE,CAAC;AAEF,QAAA,MAAM,eAAe,GAAI,UAAU,oBAAoB,EAAE,cAAc,MAAM,SAK5E,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAI,UAAU,oBAAoB,EAAE,eAAe,OAAO,SAK/E,CAAC;AAEF,QAAA,MAAM,cAAc,GAChB,UAAU,oBAAoB,EAC9B,MAAM,iBAAiB,EAAE,EACzB,aAAa,OAAO,EACpB,WAAW,MAAM,GAAG,SAAS,SAMhC,CAAC;AAEF,QAAA,MAAM,aAAa,GAAI,UAAU,oBAAoB,EAAE,aAAa,OAAO,EAAE,WAAW,MAAM,GAAG,SAAS,SAKzG,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAI,UAAU,oBAAoB,EAAE,eAAe,OAAO,EAAE,oBAAoB,MAAM,SAK3G,CAAC;AAEF,OAAO,EACH,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,gBAAgB,GACnB,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
var CaseListReducerEnum;
|
|
2
2
|
(function (CaseListReducerEnum) {
|
|
3
3
|
CaseListReducerEnum["updateState"] = "SET_STATE";
|
|
4
|
+
CaseListReducerEnum["appendDocs"] = "APPEND_DOCS";
|
|
4
5
|
})(CaseListReducerEnum || (CaseListReducerEnum = {}));
|
|
5
6
|
const caseListReducer = (state, action) => {
|
|
6
7
|
switch (action.type) {
|
|
7
8
|
case CaseListReducerEnum.updateState: {
|
|
8
9
|
return Object.assign(Object.assign({}, state), action.payload);
|
|
9
10
|
}
|
|
11
|
+
case CaseListReducerEnum.appendDocs: {
|
|
12
|
+
const { docs, hasNextPage, endCursor } = action.payload;
|
|
13
|
+
return Object.assign(Object.assign({}, state), { caseList: Object.assign(Object.assign({}, state.caseList), { docs: [...state.caseList.docs, ...docs] }), hasNextPage,
|
|
14
|
+
endCursor, isLoadingMore: false });
|
|
15
|
+
}
|
|
10
16
|
}
|
|
11
17
|
};
|
|
12
18
|
const setCaseList = (dispatch, caseList) => {
|
|
@@ -33,4 +39,28 @@ const setCurrentQuery = (dispatch, currentQuery) => {
|
|
|
33
39
|
payload: { currentQuery },
|
|
34
40
|
});
|
|
35
41
|
};
|
|
36
|
-
|
|
42
|
+
const setIsLoadingMore = (dispatch, isLoadingMore) => {
|
|
43
|
+
dispatch({
|
|
44
|
+
type: CaseListReducerEnum.updateState,
|
|
45
|
+
payload: { isLoadingMore },
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const appendCaseList = (dispatch, docs, hasNextPage, endCursor) => {
|
|
49
|
+
dispatch({
|
|
50
|
+
type: CaseListReducerEnum.appendDocs,
|
|
51
|
+
payload: { docs, hasNextPage, endCursor },
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const setCursorInfo = (dispatch, hasNextPage, endCursor) => {
|
|
55
|
+
dispatch({
|
|
56
|
+
type: CaseListReducerEnum.updateState,
|
|
57
|
+
payload: { hasNextPage, endCursor },
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const setLoadMoreError = (dispatch, loadMoreError, loadMoreRetryCount) => {
|
|
61
|
+
dispatch({
|
|
62
|
+
type: CaseListReducerEnum.updateState,
|
|
63
|
+
payload: { loadMoreError, loadMoreRetryCount, isLoadingMore: false },
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
export { caseListReducer, setCaseList, setChipsNameSsoMap, setIsFetching, setCurrentQuery, setIsLoadingMore, appendCaseList, setCursorInfo, setLoadMoreError, };
|
|
@@ -3,15 +3,20 @@ import { ISolrResponse } from '@rh-support/types/shared';
|
|
|
3
3
|
import { UserAuth } from '@rh-support/user-permissions';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { ICaseListResponse } from '../../../models/caseList';
|
|
6
|
-
import {
|
|
6
|
+
import { ISortInfo } from '../CaseListFilterReducer';
|
|
7
7
|
interface IProps {
|
|
8
8
|
caseList: ISolrResponse<ICaseListResponse>;
|
|
9
9
|
caseGroups: ICaseGroup[];
|
|
10
10
|
loggedInUserRights: UserAuth;
|
|
11
11
|
sortInfo?: ISortInfo;
|
|
12
|
-
paginationInfo?: IPaginationInfo;
|
|
13
12
|
isCaseListPageLoading: boolean;
|
|
14
13
|
hasError: boolean;
|
|
14
|
+
hasNextPage: boolean;
|
|
15
|
+
isLoadingMore: boolean;
|
|
16
|
+
loadMoreError: boolean;
|
|
17
|
+
loadMoreRetryCount: number;
|
|
18
|
+
onRetryLoadMore: () => void;
|
|
19
|
+
sentinelRef?: (node?: Element | null) => void;
|
|
15
20
|
}
|
|
16
21
|
export declare function CaseListTable(props: IProps): React.JSX.Element;
|
|
17
22
|
export {};
|
|
@@ -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,EAAgB,SAAS,EAAyC,MAAM,0BAA0B,CAAC;AA4B1G,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,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD;AAsBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBAunB1C"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Bullseye, Button, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateVariant,
|
|
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
|
|
5
|
+
import { TableComponent } from '@rh-support/components';
|
|
5
6
|
import { GlobalMetadataDispatchContext, updateUserPreferences, useGlobalStateContext, UserPreferencesKeys, } from '@rh-support/react-context';
|
|
6
|
-
import { dtmTrackEventCaseStepEncountered, formatDate,
|
|
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';
|
|
@@ -14,9 +15,8 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
|
14
15
|
import { Trans, useTranslation } from 'react-i18next';
|
|
15
16
|
import { Link } from 'react-router-dom';
|
|
16
17
|
import { CaseListColumnIds } from '../../../enums/case';
|
|
17
|
-
import { mapSfdcStatusToPortalStatus } from '../../../utils/statusUtils';
|
|
18
18
|
import { CaseListFilterDispatchContext, CaseListFilterStateContext } from '../CaseListFilterContext';
|
|
19
|
-
import { clearFilters, resetFilterToDefaultState,
|
|
19
|
+
import { clearFilters, resetFilterToDefaultState, updateSort } from '../CaseListFilterReducer';
|
|
20
20
|
import SeverityLabel from './SeverityLabel';
|
|
21
21
|
import { TableColumnSelector } from './table-column-selector/TableColumnSelector';
|
|
22
22
|
import { TableActionsDropdown } from './TableActionsDropdown';
|
|
@@ -37,7 +37,7 @@ const EMPTY_STATE_NO_FILTERS_ERROR = (React.createElement(React.Fragment, null,
|
|
|
37
37
|
React.createElement("a", { href: "https://status.redhat.com/", target: "_blank", rel: "noopener noreferrer" }, "status page"),
|
|
38
38
|
"to see if there are any known issues"));
|
|
39
39
|
export function CaseListTable(props) {
|
|
40
|
-
var _a, _b
|
|
40
|
+
var _a, _b;
|
|
41
41
|
const [selectedColumns, setSelectedColumns] = useState([]);
|
|
42
42
|
const { t } = useTranslation();
|
|
43
43
|
const [selectedCases, setSelectedCases] = useState([]);
|
|
@@ -50,7 +50,7 @@ export function CaseListTable(props) {
|
|
|
50
50
|
const [activeSortIndex, setActiveSortIndex] = useState();
|
|
51
51
|
const [activeSortDirection, setActiveSortDirection] = useState();
|
|
52
52
|
const [sortedCaseListData, setSortedCaseListData] = useState(caseListData);
|
|
53
|
-
const { globalMetadataState: {
|
|
53
|
+
const { globalMetadataState: { hydraUserPreferences, loggedInUserRights }, } = useGlobalStateContext();
|
|
54
54
|
const dispatch = useContext(CaseListFilterDispatchContext);
|
|
55
55
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
56
56
|
const { filterInfo, filterQueryInfo } = useContext(CaseListFilterStateContext);
|
|
@@ -156,12 +156,6 @@ export function CaseListTable(props) {
|
|
|
156
156
|
console.error('Could not save selected columns in cache');
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
|
-
const onPerPageSelect = (paginationInfo) => {
|
|
160
|
-
updatePagination(dispatch, paginationInfo);
|
|
161
|
-
};
|
|
162
|
-
const onSetPage = (paginationInfo) => {
|
|
163
|
-
updatePagination(dispatch, paginationInfo);
|
|
164
|
-
};
|
|
165
159
|
const onRowClick = (ev, row) => {
|
|
166
160
|
// we dont want to call onRowClick if user changes the checkbox value
|
|
167
161
|
if (ev.target.tagName === 'INPUT') {
|
|
@@ -220,13 +214,11 @@ export function CaseListTable(props) {
|
|
|
220
214
|
if (props.isCaseListPageLoading)
|
|
221
215
|
return 0;
|
|
222
216
|
let paginationCount = (_b = (_a = props.caseList) === null || _a === void 0 ? void 0 : _a.numFound) !== null && _b !== void 0 ? _b : 0;
|
|
217
|
+
// Salesforce has a limit of 4000 cases per page
|
|
218
|
+
// So we need to limit the number of cases returned to 4000
|
|
223
219
|
paginationCount = paginationCount > 4000 ? 4000 : paginationCount;
|
|
224
220
|
return paginationCount;
|
|
225
221
|
};
|
|
226
|
-
const onBottomPaginationSetPage = (paginationInfo) => {
|
|
227
|
-
onSetPage(paginationInfo);
|
|
228
|
-
scrollIntoView(tableToolbarRef, { navBarRef, timeout: 0, onlyIfNotInViewport: true, offset: 30 });
|
|
229
|
-
};
|
|
230
222
|
const getSortableRowValues = (row) => {
|
|
231
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;
|
|
232
224
|
return [
|
|
@@ -277,7 +269,7 @@ export function CaseListTable(props) {
|
|
|
277
269
|
? formatDate(row.case_last_public_update_date)
|
|
278
270
|
: '',
|
|
279
271
|
case_severity: row.case_severity ? row.case_severity : '',
|
|
280
|
-
case_status:
|
|
272
|
+
case_status: row.case_status,
|
|
281
273
|
case_createdDate: formatDate(row.case_createdDate),
|
|
282
274
|
case_accountNumber: row.case_accountNumber,
|
|
283
275
|
case_alternate_id: row.case_alternate_id ? row.case_alternate_id : '',
|
|
@@ -348,8 +340,15 @@ export function CaseListTable(props) {
|
|
|
348
340
|
React.createElement("div", { className: "toolbar-actions pf-v6-l-flex" },
|
|
349
341
|
React.createElement(TableColumnSelector, { onColumnSelectorChange: onColumnSelectorChange, cachedColumns: selectedColumns }),
|
|
350
342
|
React.createElement(TableActionsDropdown, { caseList: caseListData, selectedCases: selectedCases, onCasesCloseSuccess: onCasesCloseSuccess, currentFilteredCaseList: props.caseList })),
|
|
351
|
-
React.createElement("span", { className: "
|
|
352
|
-
React.createElement(
|
|
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"))))),
|
|
353
352
|
React.createElement("div", { className: "pf-v6-c-scroll-inner-wrapper" },
|
|
354
353
|
React.createElement(Table, { variant: TableVariant.compact, "aria-label": "case-list", className: "case-list-table" },
|
|
355
354
|
React.createElement(Thead, null,
|
|
@@ -366,41 +365,54 @@ export function CaseListTable(props) {
|
|
|
366
365
|
? '0px'
|
|
367
366
|
: undefined,
|
|
368
367
|
}, id: column.id, sort: column.sortable ? onSort(index) : undefined, key: column.id }, column.title))))),
|
|
369
|
-
React.createElement(Tbody, null, !props.isCaseListPageLoading && (caseListData || []).length < 1
|
|
370
|
-
?
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
React.createElement("div", { className: "
|
|
381
|
-
React.createElement(
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
React.createElement(
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
React.createElement(
|
|
404
|
-
|
|
405
|
-
|
|
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"))))));
|
|
406
418
|
}
|
package/lib/esm/css/caseList.css
CHANGED
|
@@ -186,11 +186,17 @@
|
|
|
186
186
|
.cases-main .case-search-table {
|
|
187
187
|
-ms-flex: 1;
|
|
188
188
|
flex-grow: 1;
|
|
189
|
-
display:
|
|
190
|
-
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-direction: column;
|
|
191
|
+
min-width: 0;
|
|
191
192
|
border-radius: 0 0 16px !important;
|
|
192
193
|
}
|
|
193
194
|
|
|
195
|
+
.cases-main .case-search-table > .pf-v6-c-scroll-inner-wrapper {
|
|
196
|
+
overflow-x: auto;
|
|
197
|
+
flex: 1;
|
|
198
|
+
}
|
|
199
|
+
|
|
194
200
|
.case-search-bottom .case-list-table-toolbar {
|
|
195
201
|
-ms-flex-align: center;
|
|
196
202
|
align-items: center;
|
|
@@ -200,6 +206,10 @@
|
|
|
200
206
|
background-color: var(--pf-t--color--gray--10);
|
|
201
207
|
border-top: 1px solid var(--pf-t--global--border--color--100);
|
|
202
208
|
border-right: 1px solid var(--pf-t--global--border--color--100);
|
|
209
|
+
border-bottom: 1px solid var(--pf-t--global--border--color--100);
|
|
210
|
+
position: sticky;
|
|
211
|
+
top: 0;
|
|
212
|
+
z-index: 100;
|
|
203
213
|
}
|
|
204
214
|
|
|
205
215
|
.case-search-bottom .case-list-table-toolbar .toolbar-actions {
|
|
@@ -219,18 +229,21 @@
|
|
|
219
229
|
color: #06c !important;
|
|
220
230
|
}
|
|
221
231
|
|
|
222
|
-
.case-search-bottom .case-list-table-toolbar .toolbar-pagination button[disabled] {
|
|
223
|
-
color: #999;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
232
|
.case-search-bottom .case-list-table-toolbar button.pf-m-secondary:not([disabled]),
|
|
227
233
|
.case-search-bottom .case-list-table-toolbar button.pf-m-tertiary:not([disabled]),
|
|
228
234
|
.case-search-bottom .case-list-table-toolbar button.pf-m-control:not([disabled]) {
|
|
229
235
|
background-color: #fff;
|
|
230
236
|
}
|
|
231
237
|
|
|
238
|
+
.case-count-indicator {
|
|
239
|
+
font-size: 14px !important;
|
|
240
|
+
line-height: 1.5em;
|
|
241
|
+
white-space: nowrap;
|
|
242
|
+
padding-right: 1rem;
|
|
243
|
+
color: var(--pf-t--global--text--color--regular, #151515);
|
|
244
|
+
}
|
|
245
|
+
|
|
232
246
|
.cases-main .case-search-table .case-list-table {
|
|
233
|
-
border-top: 1px solid var(--pf-t--global--border--color--100);
|
|
234
247
|
border-right: 1px solid var(--pf-t--global--border--color--100);
|
|
235
248
|
border-bottom: 1px solid var(--pf-t--global--border--color--100);
|
|
236
249
|
}
|
|
@@ -277,17 +290,6 @@
|
|
|
277
290
|
text-transform: uppercase;
|
|
278
291
|
}
|
|
279
292
|
|
|
280
|
-
.case-search-bottom .case-search-table footer.toolbar-pagination {
|
|
281
|
-
margin-top: 0 !important;
|
|
282
|
-
border-right: 1px solid var(--pf-t--global--border--color--100);
|
|
283
|
-
border-bottom: 1px solid var(--pf-t--global--border--color--100);
|
|
284
|
-
border-radius: 16px !important;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.case-search-bottom .case-search-table footer.toolbar-pagination > :first-child {
|
|
288
|
-
padding: 1rem;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
293
|
.case-search-bottom #case-filters-panel {
|
|
292
294
|
-ms-flex: 100%;
|
|
293
295
|
flex-basis: 100%;
|
|
@@ -300,11 +302,13 @@
|
|
|
300
302
|
border-right: 1px solid var(--pf-t--global--border--color--100);
|
|
301
303
|
border-bottom: 1px solid var(--pf-t--global--border--color--100);
|
|
302
304
|
border-radius: 0 0 0 16px;
|
|
305
|
+
align-self: stretch;
|
|
303
306
|
}
|
|
304
307
|
|
|
305
308
|
.case-search-filters .filter-header {
|
|
306
309
|
min-height: 4rem;
|
|
307
310
|
margin: 0;
|
|
311
|
+
padding: 0;
|
|
308
312
|
}
|
|
309
313
|
|
|
310
314
|
.case-search-filters .filter-header .pf-v6-svg {
|
|
@@ -349,6 +353,10 @@
|
|
|
349
353
|
font-size: 1rem;
|
|
350
354
|
font-weight: 600;
|
|
351
355
|
height: 4.3rem;
|
|
356
|
+
position: sticky;
|
|
357
|
+
top: 0;
|
|
358
|
+
z-index: 100;
|
|
359
|
+
background-color: #f2f2f2;
|
|
352
360
|
|
|
353
361
|
.pf-v6-c-button__icon.pf-m-end {
|
|
354
362
|
margin-right: -4px !important;
|
|
@@ -359,6 +367,8 @@
|
|
|
359
367
|
.filter-wrapper {
|
|
360
368
|
padding: 24px;
|
|
361
369
|
background-color: var(--pf-t--color--gray--10);
|
|
370
|
+
position: relative;
|
|
371
|
+
z-index: 0;
|
|
362
372
|
}
|
|
363
373
|
|
|
364
374
|
.filter-wrapper .filter-group > * {
|
|
@@ -413,10 +423,6 @@
|
|
|
413
423
|
.case-search-bottom .case-list-table-toolbar .toolbar-actions > * {
|
|
414
424
|
margin-bottom: 0;
|
|
415
425
|
}
|
|
416
|
-
|
|
417
|
-
.case-search-bottom .case-list-table-toolbar .toolbar-pagination {
|
|
418
|
-
margin-top: 0;
|
|
419
|
-
}
|
|
420
426
|
}
|
|
421
427
|
|
|
422
428
|
@media (min-width: 768px) {
|
|
@@ -645,3 +651,74 @@ th#product.pf-v6-c-table__th {
|
|
|
645
651
|
.case-list-table .pf-v6-c-table__button {
|
|
646
652
|
margin-bottom: 0px !important;
|
|
647
653
|
}
|
|
654
|
+
|
|
655
|
+
.skeleton-loader-row {
|
|
656
|
+
height: 62px;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.skeleton-loader-row .skeleton-sentinel {
|
|
660
|
+
display: flex;
|
|
661
|
+
align-items: center;
|
|
662
|
+
height: 100%;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
.skeleton-loader-row .skeleton-bar {
|
|
666
|
+
display: block;
|
|
667
|
+
height: 24px;
|
|
668
|
+
border-radius: 4px;
|
|
669
|
+
background-color: #e0e0e0;
|
|
670
|
+
animation: skeleton-pulse 1.5s ease-in-out infinite;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.skeleton-loader-row .skeleton-bar--checkbox {
|
|
674
|
+
display: inline-block;
|
|
675
|
+
width: 16px;
|
|
676
|
+
height: 16px;
|
|
677
|
+
border-radius: 3px;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
@keyframes skeleton-pulse {
|
|
681
|
+
0% {
|
|
682
|
+
opacity: 1;
|
|
683
|
+
}
|
|
684
|
+
50% {
|
|
685
|
+
opacity: 0.4;
|
|
686
|
+
}
|
|
687
|
+
100% {
|
|
688
|
+
opacity: 1;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.infinite-scroll-footer-message {
|
|
693
|
+
display: flex;
|
|
694
|
+
justify-content: center;
|
|
695
|
+
align-items: center;
|
|
696
|
+
gap: 8px;
|
|
697
|
+
padding: 12px 0;
|
|
698
|
+
position: sticky;
|
|
699
|
+
left: 0;
|
|
700
|
+
background-color: #fff;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
.infinite-scroll-footer-text,
|
|
704
|
+
.infinite-scroll-alert,
|
|
705
|
+
.infinite-scroll-alert * {
|
|
706
|
+
font-size: 14px !important;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.infinite-scroll-footer-message .pf-v6-c-alert.pf-m-inline.pf-m-plain {
|
|
710
|
+
padding: 0;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.infinite-scroll-footer-message .pf-v6-c-button.pf-m-link.pf-m-inline {
|
|
714
|
+
text-decoration: none;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.infinite-scroll-retry-btn.pf-v6-c-button.pf-m-secondary {
|
|
718
|
+
border-radius: 999px;
|
|
719
|
+
padding: 8px 24px;
|
|
720
|
+
gap: 4px;
|
|
721
|
+
font-size: 14px;
|
|
722
|
+
font-weight: 400;
|
|
723
|
+
line-height: 1.5;
|
|
724
|
+
}
|
|
@@ -10,7 +10,19 @@ export interface IGraphQLCaseListResponse {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
showErrorMessage: boolean;
|
|
13
|
+
hasNextPage: boolean;
|
|
14
|
+
endCursor: string | undefined;
|
|
13
15
|
}
|
|
14
16
|
export declare function clearPageCursors(): void;
|
|
15
17
|
export declare function getCaseListFromGraphQL(filterState: ICaseListFilterState, apolloClient: ApolloClient, limitOverride?: number, signal?: AbortSignal, selectedCaseNumbers?: string[]): Promise<IGraphQLCaseListResponse>;
|
|
18
|
+
export interface ILoadMoreResult {
|
|
19
|
+
docs: ICaseListItem[];
|
|
20
|
+
hasNextPage: boolean;
|
|
21
|
+
endCursor: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Fetches the next page of cases for infinite scroll.
|
|
25
|
+
* Uses the provided `afterCursor` instead of the page-based cursor store.
|
|
26
|
+
*/
|
|
27
|
+
export declare function loadMoreCases(filterState: ICaseListFilterState, apolloClient: ApolloClient, afterCursor: string, signal?: AbortSignal): Promise<ILoadMoreResult>;
|
|
16
28
|
//# sourceMappingURL=caseListGraphQLUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseListGraphQLUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseListGraphQLUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAIH,aAAa,EAEhB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,oBAAoB,EAAkB,MAAM,+CAA+C,CAAC;AASrG,MAAM,WAAW,wBAAwB;IACrC,gBAAgB,EAAE;QACd,QAAQ,EAAE;YACN,IAAI,EAAE,aAAa,EAAE,CAAC;YACtB,QAAQ,EA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0C1B"}
|
|
@@ -117,7 +117,7 @@ function resolveVersionProductIds(filterState, apolloClient) {
|
|
|
117
117
|
}
|
|
118
118
|
export function getCaseListFromGraphQL(filterState, apolloClient, limitOverride, signal, selectedCaseNumbers) {
|
|
119
119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
var _a, _b, _c, _d, _e, _f;
|
|
120
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
121
121
|
try {
|
|
122
122
|
yield resolveVersionProductIds(filterState, apolloClient);
|
|
123
123
|
const federationIdsToResolve = getOwnerFederationIdsToResolve(filterState);
|
|
@@ -159,6 +159,8 @@ export function getCaseListFromGraphQL(filterState, apolloClient, limitOverride,
|
|
|
159
159
|
return {
|
|
160
160
|
caseListResponse: { response: { docs: [], numFound: 0, start: 0 } },
|
|
161
161
|
showErrorMessage: !!error,
|
|
162
|
+
hasNextPage: false,
|
|
163
|
+
endCursor: undefined,
|
|
162
164
|
};
|
|
163
165
|
}
|
|
164
166
|
if ((_e = connection.pageInfo) === null || _e === void 0 ? void 0 : _e.endCursor) {
|
|
@@ -174,20 +176,69 @@ export function getCaseListFromGraphQL(filterState, apolloClient, limitOverride,
|
|
|
174
176
|
},
|
|
175
177
|
},
|
|
176
178
|
showErrorMessage: false,
|
|
179
|
+
hasNextPage: (_g = (_f = connection.pageInfo) === null || _f === void 0 ? void 0 : _f.hasNextPage) !== null && _g !== void 0 ? _g : false,
|
|
180
|
+
endCursor: (_j = (_h = connection.pageInfo) === null || _h === void 0 ? void 0 : _h.endCursor) !== null && _j !== void 0 ? _j : undefined,
|
|
177
181
|
};
|
|
178
182
|
}
|
|
179
183
|
catch (error) {
|
|
180
|
-
if ((error === null || error === void 0 ? void 0 : error.name) === 'AbortError' || ((
|
|
184
|
+
if ((error === null || error === void 0 ? void 0 : error.name) === 'AbortError' || ((_k = error === null || error === void 0 ? void 0 : error.message) === null || _k === void 0 ? void 0 : _k.includes('aborted')) || (signal === null || signal === void 0 ? void 0 : signal.aborted)) {
|
|
181
185
|
return {
|
|
182
186
|
caseListResponse: { response: { docs: [], numFound: 0, start: 0 } },
|
|
183
187
|
showErrorMessage: false,
|
|
188
|
+
hasNextPage: false,
|
|
189
|
+
endCursor: undefined,
|
|
184
190
|
};
|
|
185
191
|
}
|
|
186
192
|
console.error('[GraphQL] getCaseListFromGraphQL error:', error);
|
|
187
193
|
return {
|
|
188
194
|
caseListResponse: { response: { docs: [], numFound: 0, start: 0 } },
|
|
189
195
|
showErrorMessage: true,
|
|
196
|
+
hasNextPage: false,
|
|
197
|
+
endCursor: undefined,
|
|
190
198
|
};
|
|
191
199
|
}
|
|
192
200
|
});
|
|
193
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Fetches the next page of cases for infinite scroll.
|
|
204
|
+
* Uses the provided `afterCursor` instead of the page-based cursor store.
|
|
205
|
+
*/
|
|
206
|
+
export function loadMoreCases(filterState, apolloClient, afterCursor, signal) {
|
|
207
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
209
|
+
try {
|
|
210
|
+
yield resolveVersionProductIds(filterState, apolloClient);
|
|
211
|
+
const federationIdsToResolve = getOwnerFederationIdsToResolve(filterState);
|
|
212
|
+
let resolvedUserIds;
|
|
213
|
+
if (federationIdsToResolve.length) {
|
|
214
|
+
const ownerUserIds = yield resolveOwnerUserIds(federationIdsToResolve, apolloClient);
|
|
215
|
+
resolvedUserIds = { ownerUserIds };
|
|
216
|
+
}
|
|
217
|
+
const variables = createGraphQLVariablesFromFilterState(filterState, resolvedUserIds);
|
|
218
|
+
variables.after = afterCursor;
|
|
219
|
+
const { data } = yield apolloClient.query({
|
|
220
|
+
query: GET_CASES_BY_FILTERS,
|
|
221
|
+
variables,
|
|
222
|
+
fetchPolicy: 'network-only',
|
|
223
|
+
context: signal ? { fetchOptions: { signal } } : undefined,
|
|
224
|
+
});
|
|
225
|
+
const connection = (_b = (_a = data === null || data === void 0 ? void 0 : data.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportCase;
|
|
226
|
+
if (!connection) {
|
|
227
|
+
return { docs: [], hasNextPage: false, endCursor: undefined };
|
|
228
|
+
}
|
|
229
|
+
const docs = mapGraphQLResponseToCaseList(connection.edges || []);
|
|
230
|
+
return {
|
|
231
|
+
docs,
|
|
232
|
+
hasNextPage: (_d = (_c = connection.pageInfo) === null || _c === void 0 ? void 0 : _c.hasNextPage) !== null && _d !== void 0 ? _d : false,
|
|
233
|
+
endCursor: (_f = (_e = connection.pageInfo) === null || _e === void 0 ? void 0 : _e.endCursor) !== null && _f !== void 0 ? _f : undefined,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
if ((error === null || error === void 0 ? void 0 : error.name) === 'AbortError' || ((_g = error === null || error === void 0 ? void 0 : error.message) === null || _g === void 0 ? void 0 : _g.includes('aborted')) || (signal === null || signal === void 0 ? void 0 : signal.aborted)) {
|
|
238
|
+
return { docs: [], hasNextPage: false, endCursor: undefined };
|
|
239
|
+
}
|
|
240
|
+
console.error('[GraphQL] loadMoreCases error:', error);
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/cases",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.178",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -39,17 +39,18 @@
|
|
|
39
39
|
"@patternfly/patternfly": "6.2.1",
|
|
40
40
|
"@patternfly/react-core": "6.2.1",
|
|
41
41
|
"@patternfly/react-table": "6.2.1",
|
|
42
|
-
"@rh-support/components": "2.5.
|
|
43
|
-
"@rh-support/react-context": "2.5.
|
|
42
|
+
"@rh-support/components": "2.5.165",
|
|
43
|
+
"@rh-support/react-context": "2.5.268",
|
|
44
44
|
"@rh-support/types": "2.0.26",
|
|
45
|
-
"@rh-support/user-permissions": "2.5.
|
|
46
|
-
"@rh-support/utils": "2.5.
|
|
45
|
+
"@rh-support/user-permissions": "2.5.122",
|
|
46
|
+
"@rh-support/utils": "2.5.105",
|
|
47
47
|
"localforage": "^1.10.0",
|
|
48
48
|
"lodash": "^4.17.21",
|
|
49
49
|
"pegjs": "^0.10.0",
|
|
50
50
|
"react": "18.2.0",
|
|
51
51
|
"react-dom": "18.2.0",
|
|
52
52
|
"react-i18next": "15.6.0",
|
|
53
|
+
"react-intersection-observer": "^10.0.3",
|
|
53
54
|
"react-router-dom": "^5.1.2",
|
|
54
55
|
"solr-query-builder": "1.0.1"
|
|
55
56
|
},
|
|
@@ -92,5 +93,5 @@
|
|
|
92
93
|
"defaults and supports es6-module",
|
|
93
94
|
"maintained node versions"
|
|
94
95
|
],
|
|
95
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "2b2c0e7650d4c5d94856ae246c3e5a6c7ae9e75d"
|
|
96
97
|
}
|