@rh-support/troubleshoot 2.2.1851-beta.0 → 2.3.0-alpha.0
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/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +3 -3
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +22 -28
- package/lib/esm/hooks/useWizard.js +1 -1
- package/lib/esm/reducers/CaseReducer.d.ts +1 -1
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +9 -13
- package/lib/esm/reducers/SessionRestoreReducer.d.ts +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +121 -14
- package/package.json +8 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBA0OnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -105,7 +105,7 @@ function OwnerSelector(props) {
|
|
|
105
105
|
firstName: newOwner.firstName,
|
|
106
106
|
lastName: newOwner.lastName,
|
|
107
107
|
fullNameCustom: newOwner.fullNameCustom,
|
|
108
|
-
}, '', abortSignal
|
|
108
|
+
}, '', abortSignal);
|
|
109
109
|
setLocalOwnerChange(true);
|
|
110
110
|
updateNotifyUsersList(newOwner);
|
|
111
111
|
ToastNotification.addSuccessMessage(t(`Owner has been successfully updated`));
|
|
@@ -85,7 +85,7 @@ export default function Recommendations(props) {
|
|
|
85
85
|
// recreate a new AbortController for each call
|
|
86
86
|
let controller = new AbortController();
|
|
87
87
|
abortControllerRef.current = controller;
|
|
88
|
-
if (!isEmpty(issue)
|
|
88
|
+
if (!isEmpty(issue)) {
|
|
89
89
|
!loggedInUsersAccount.data.secureSupport
|
|
90
90
|
? fetchWatsonXRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, queryFilters, controller.signal)
|
|
91
91
|
: fetchRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, caseNumber, isSecureSupportAccount, queryFilters, controller.signal);
|
|
@@ -106,9 +106,9 @@ export default function Recommendations(props) {
|
|
|
106
106
|
recommendationState.insightsKcsIds,
|
|
107
107
|
], 1000);
|
|
108
108
|
useEffect(() => {
|
|
109
|
-
props.userSeenRecommendations && props.userSeenRecommendations(!recommendationState.isLoadingRecommendations);
|
|
109
|
+
props.userSeenRecommendations && props.userSeenRecommendations(!recommendationState.isLoadingRecommendations);
|
|
110
110
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
|
-
}, [recommendationState
|
|
111
|
+
}, [recommendationState]);
|
|
112
112
|
useEffect(() => {
|
|
113
113
|
if (recommendationState.isLoadingRecommendations)
|
|
114
114
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAA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BAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxE;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBA4OtC;kBA5OQ,gBAAgB;;;AA8OzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -70,30 +70,16 @@ function WizardNavigation(props) {
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
const observer = new IntersectionObserver(([entry]) => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// console.log('Intersection ratio:', entry.intersectionRatio);
|
|
76
|
-
// console.log({ hasUserScrolled });
|
|
77
|
-
const boundingRect = entry.boundingClientRect;
|
|
78
|
-
const isScrollingUp = boundingRect.top > 0;
|
|
79
|
-
const isAboveThreshold = entry.intersectionRatio >= 0.3;
|
|
80
|
-
isAboveThreshold && props.setUserCanNavigateToTroubleshoot(true);
|
|
81
|
-
isAboveThreshold && props.setUserSeenRecommendations(true);
|
|
82
|
-
// If scrolling up, always use the threshold check
|
|
83
|
-
if (isScrollingUp) {
|
|
84
|
-
setHasUserScrolled(isAboveThreshold);
|
|
85
|
-
props.setUserScrolledLabel(isAboveThreshold);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
// If scrolling down and we hit the threshold, set to true
|
|
89
|
-
if (isAboveThreshold) {
|
|
73
|
+
if (entry.isIntersecting) {
|
|
74
|
+
setHasUserScrolled(true);
|
|
90
75
|
props.setUserScrolledLabel(true);
|
|
91
|
-
|
|
76
|
+
if (props.userClickedNextonRecommendationsFn) {
|
|
77
|
+
props.userClickedNextonRecommendationsFn(true);
|
|
78
|
+
}
|
|
92
79
|
}
|
|
93
80
|
}, {
|
|
94
81
|
root: null,
|
|
95
|
-
threshold:
|
|
96
|
-
rootMargin: '0px',
|
|
82
|
+
threshold: 0.6, // trigger when 60% of element in view
|
|
97
83
|
});
|
|
98
84
|
const resultsRowElement = props.resultsRowRef.current;
|
|
99
85
|
if (resultsRowElement) {
|
|
@@ -104,22 +90,30 @@ function WizardNavigation(props) {
|
|
|
104
90
|
observer.unobserve(resultsRowElement);
|
|
105
91
|
}
|
|
106
92
|
};
|
|
107
|
-
}, [recommendationState.numFound,
|
|
93
|
+
}, [recommendationState.numFound, setHasUserScrolled, props]);
|
|
108
94
|
const onNext = () => {
|
|
109
95
|
var _a;
|
|
110
96
|
updateisNextBtnClickedToShowValidationError(dispatchToRouteReducer, true);
|
|
111
97
|
//handle the new changes for 13406:
|
|
112
98
|
if (props.activeStep.id === AppRouteSections.SUMMARIZE && recommendationState.numFound > 2) {
|
|
113
|
-
if (!
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
99
|
+
if (!props.userClickedNextonRecommendationsValue) {
|
|
100
|
+
if (!hasUserScrolled) {
|
|
101
|
+
scrollIntoView(props.resultsRowRef, {
|
|
102
|
+
navBarRef,
|
|
103
|
+
timeout: 0,
|
|
104
|
+
onlyIfNotInViewport: true,
|
|
105
|
+
offset: 120,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
120
108
|
props.userClickedNextonRecommendationsFn && props.userClickedNextonRecommendationsFn(true);
|
|
121
109
|
return;
|
|
122
110
|
}
|
|
111
|
+
else {
|
|
112
|
+
props.setUserCanNavigateToTroubleshoot(true);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
props.setUserCanNavigateToTroubleshoot(true);
|
|
123
117
|
}
|
|
124
118
|
const userCanNotOpenCase = props.activeStep.id === AppRouteSections.TROUBLESHOOT && canCreateCase.alert();
|
|
125
119
|
if (userCanNotOpenCase || !isSectionValidFn(props.activeStep.id))
|
|
@@ -50,7 +50,7 @@ export function useWizard(routeProps, props) {
|
|
|
50
50
|
: AlertType.DANGER, isInline: true, title: title, className: "pf-v5-u-mb-lg", "data-tracking-id": isLoading ? 'wait-recommendations-loading' : 'proceed-address-errors' }));
|
|
51
51
|
};
|
|
52
52
|
let summarizeNextButtonLabelLogic = () => {
|
|
53
|
-
return props.userScrolledLabel;
|
|
53
|
+
return props.userClickedNextonRecommendationsValue || props.userScrolledLabel;
|
|
54
54
|
};
|
|
55
55
|
// components that are used in wizard steps
|
|
56
56
|
const appRouteConfugurations = {
|
|
@@ -36,7 +36,7 @@ export declare const deleteNotifiedUsers: (dispatch: CaseReducerDispatchType, ca
|
|
|
36
36
|
export declare const addingNotifiedUsers: (dispatch: CaseReducerDispatchType, caseNumber: string, addedUsers: IContact[]) => Promise<void>;
|
|
37
37
|
export declare const clearSelectedAccount: (dispatch: CaseReducerDispatchType) => void;
|
|
38
38
|
export declare const setCaseAccountNumber: (dispatch: CaseReducerDispatchType, accountNumber: string, isLoggedInUsersAccount?: boolean, loggedInUserAccount?: Partial<IAccount>) => Promise<void>;
|
|
39
|
-
export declare const setCaseOwner: (dispatch: CaseReducerDispatchType, owner: IContact, product: string, abortSignalCaseGroup?: AbortSignal, abortSignalEntitlements?: AbortSignal, setCaseGroupToUngroupedOrDefault?: boolean, caseGroupNumberToRestore?: string | undefined, canChangeGroup?: boolean
|
|
39
|
+
export declare const setCaseOwner: (dispatch: CaseReducerDispatchType, owner: IContact, product: string, abortSignalCaseGroup?: AbortSignal, abortSignalEntitlements?: AbortSignal, setCaseGroupToUngroupedOrDefault?: boolean, caseGroupNumberToRestore?: string | undefined, canChangeGroup?: boolean) => Promise<void>;
|
|
40
40
|
export declare const fetchCaseGroupsForSSO: (dispatch: CaseReducerDispatchType, contactSsoUsername: string, setCaseGroupToUngroupedOrDefault?: boolean, abortSignal?: AbortSignal, caseGroupNumberToRestore?: string | undefined) => Promise<void>;
|
|
41
41
|
export declare const updateCaseWithSession: (dispatch: CaseReducerDispatchType, sessionItem: ISessionItem, loggedInUserAccountNumber: string, loggedInUserContact: IContact, loggedInUserAccount?: Partial<IAccount>) => Promise<void>;
|
|
42
42
|
export declare const fetchCaseDetails: (dispatch: CaseReducerDispatchType, caseNumber: string, loggedInUserRights: any, loggedInUser: any) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseReducer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAEtH,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAA+B,MAAM,qCAAqC,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E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C,aACxC,uBAAuB,cACrB,OAAO,iBACJ,MAAM,SAMxB,CAAC;AAIF,eAAO,MAAM,yBAAyB,aACxB,uBAAuB,iBAClB,MAAM,eACR,MAAM,sBACC,QAAQ,kBA6B/B,CAAC;AAEF,wBAAsB,2BAA2B,CAAC,QAAQ,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,iBAmBtG;AAGD,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,uBAAuB,EACjC,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAAC,EAC5E,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,0BAA0B,EAAE,QAO5D;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,iBAiB1F;AAED,eAAO,MAAM,kBAAkB,aAAc,uBAAuB,QAAQ,OAAO,SAKlF,CAAC"}
|
|
@@ -417,7 +417,7 @@ export const setCaseAccountNumber = (dispatch_1, accountNumber_1, ...args_1) =>
|
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
419
|
});
|
|
420
|
-
export const setCaseOwner = (dispatch_1, owner_1, product_1, abortSignalCaseGroup_1, abortSignalEntitlements_1, ...args_1) => __awaiter(void 0, [dispatch_1, owner_1, product_1, abortSignalCaseGroup_1, abortSignalEntitlements_1, ...args_1], void 0, function* (dispatch, owner, product, abortSignalCaseGroup, abortSignalEntitlements, setCaseGroupToUngroupedOrDefault = false, caseGroupNumberToRestore, canChangeGroup = true
|
|
420
|
+
export const setCaseOwner = (dispatch_1, owner_1, product_1, abortSignalCaseGroup_1, abortSignalEntitlements_1, ...args_1) => __awaiter(void 0, [dispatch_1, owner_1, product_1, abortSignalCaseGroup_1, abortSignalEntitlements_1, ...args_1], void 0, function* (dispatch, owner, product, abortSignalCaseGroup, abortSignalEntitlements, setCaseGroupToUngroupedOrDefault = false, caseGroupNumberToRestore, canChangeGroup = true) {
|
|
421
421
|
if (isEmpty(owner) || isEmpty(owner.ssoUsername)) {
|
|
422
422
|
dispatch({
|
|
423
423
|
type: CaseReducerConstants.caseDetailChanged,
|
|
@@ -451,7 +451,7 @@ export const setCaseOwner = (dispatch_1, owner_1, product_1, abortSignalCaseGrou
|
|
|
451
451
|
});
|
|
452
452
|
canChangeGroup &&
|
|
453
453
|
fetchCaseGroupsForSSO(dispatch, owner.ssoUsername, setCaseGroupToUngroupedOrDefault, abortSignalCaseGroup, caseGroupNumberToRestore);
|
|
454
|
-
|
|
454
|
+
fetchCaseEntitlements(dispatch, owner.ssoUsername, product, abortSignalEntitlements);
|
|
455
455
|
});
|
|
456
456
|
//changing the item values to uppercase to match the backend values
|
|
457
457
|
const slaOrder = Object.values(SupportLevelDisplay).map((item) => {
|
|
@@ -472,7 +472,7 @@ const getHighestSLASubscription = (subs) => {
|
|
|
472
472
|
return currentIndex > highestIndex ? current : highest;
|
|
473
473
|
});
|
|
474
474
|
};
|
|
475
|
-
const fetchCaseEntitlements = (dispatch, ssoUserName, product, abortSignal
|
|
475
|
+
const fetchCaseEntitlements = (dispatch, ssoUserName, product, abortSignal) => __awaiter(void 0, void 0, void 0, function* () {
|
|
476
476
|
dispatch({
|
|
477
477
|
type: CaseReducerConstants.caseStateChanged,
|
|
478
478
|
payload: { ownersEntitlements: getApiResourceObject([], true) },
|
|
@@ -485,16 +485,12 @@ const fetchCaseEntitlements = (dispatch, ssoUserName, product, abortSignal, isUs
|
|
|
485
485
|
type: CaseReducerConstants.caseStateChanged,
|
|
486
486
|
payload: { hasInvalidEntitlements, ownersEntitlements },
|
|
487
487
|
});
|
|
488
|
-
//
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
type: CaseReducerConstants.caseDetailChanged,
|
|
495
|
-
payload: { caseDetails: { entitlementSla: highest.slaProcessId } },
|
|
496
|
-
});
|
|
497
|
-
}
|
|
488
|
+
//checking for the highest available support level for the user
|
|
489
|
+
const highest = getHighestSLASubscription(ownersEntitlements.data);
|
|
490
|
+
dispatch({
|
|
491
|
+
type: CaseReducerConstants.caseDetailChanged,
|
|
492
|
+
payload: { caseDetails: { entitlementSla: highest.slaProcessId } },
|
|
493
|
+
});
|
|
498
494
|
}
|
|
499
495
|
catch (e) {
|
|
500
496
|
dispatch({
|
|
@@ -59,7 +59,7 @@ export type SessionRestoreDispatchType = (value: IActionType) => void;
|
|
|
59
59
|
export declare const sessionRestoreReducer: (state: ISessionRestoreState, action: IActionType) => ISessionRestoreState;
|
|
60
60
|
export declare const getIndividualSessionById: (dispatch: SessionReducerDispatchType, sessionId: string | undefined) => Promise<void>;
|
|
61
61
|
export declare const loadPreviousSessions: (dispatch: SessionReducerDispatchType, caseDispatch: CaseReducerDispatchType) => Promise<void>;
|
|
62
|
-
export declare const createSession: (dispatch: SessionReducerDispatchType, sessionDetails: ISessionDetails, session: ISession) => Promise<
|
|
62
|
+
export declare const createSession: (dispatch: SessionReducerDispatchType, sessionDetails: ISessionDetails, session: ISession) => Promise<any>;
|
|
63
63
|
export declare const updateSession: (dispatch: SessionReducerDispatchType, sessionId: string, sessionDetails: ISessionDetails, session?: ISession) => Promise<void>;
|
|
64
64
|
export declare const updateActiveSessionId: (dispatch: SessionReducerDispatchType, activeSessionId: string) => void;
|
|
65
65
|
export declare function getRelevantSessionFromSessions(dispatch: SessionReducerDispatchType, currentRelevantSessionId: string, previousSessions: IPrevSessions, caseDetails: Partial<ICasePayload>): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestoreReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/SessionRestoreReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,IAAI,sBAAsB,EAC/C,yBAAyB,IAAI,0BAA0B,EAC1D,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,M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AC9B,SAAS,EAAE,gBAAgB,EAAE,iBA8EhC;AAED,eAAO,MAAM,oBAAoB,eACjB,eAAe,oBACT,0BAA0B,SACtC,MAAM,KACb,gBAAgB,EAIlB,CAAC;AAEF,eAAO,MAAM,YAAY,OACjB,WAAW,oBACG,0BAA0B,SACtC,MAAM,KACb,gBAMD,CAAC;AAEH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,mBAAmB,EAAE,EAC3B,gBAAgB,EAAE,0BAA0B,EAC5C,QAAQ,GAAE,MAAU,EACpB,WAAW,GAAE,MAAU,GACxB,gBAAgB,EAAE,CAMpB;AAGD,eAAO,MAAM,iBAAiB,QACrB,mBAAmB,oBACN,0BAA0B,SACtC,MAAM,KACb,gBAMD,CAAC;AAEH,eAAO,MAAM,mBAAmB,QACvB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAEH,eAAO,MAAM,cAAc,gFAY1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,gFAYjC,CAAC;AAGF,eAAO,MAAM,gBAAgB,QACpB,MAAM,oBACO,0BAA0B,SACtC,MAAM,6BAEb,gBAMD,CAAC;AAIH,eAAO,MAAM,YAAY,eACT,mBAAmB,mBACd,mBAAmB,EAAE,YAC7B,mBAAmB,EAAE,uBAWjC,CAAC"}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { pcm } from '@cee-eng/hydrajs';
|
|
11
|
-
import { getApiCreationStatus, getApiResourceObject, getApiUpdationStatus, getPastUTCDateFromNow, getResTypeFromUrl, promiseReflection, } from '@rh-support/utils';
|
|
11
|
+
import { CREATE_SESSION, CREATE_SESSION_RESOURCE, GET_SESSION, getApiCreationStatus, getApiResourceObject, getApiUpdationStatus, getPastUTCDateFromNow, getResTypeFromUrl, graphqlFetch, promiseReflection, UPDATE_SESSION, UPDATE_SESSION_RESOURCE, } from '@rh-support/utils';
|
|
12
12
|
import cloneDeep from 'lodash/cloneDeep';
|
|
13
13
|
import differenceBy from 'lodash/differenceBy';
|
|
14
14
|
import filter from 'lodash/filter';
|
|
@@ -16,9 +16,17 @@ import findIndex from 'lodash/findIndex';
|
|
|
16
16
|
import forEach from 'lodash/forEach';
|
|
17
17
|
import isEmpty from 'lodash/isEmpty';
|
|
18
18
|
import map from 'lodash/map';
|
|
19
|
+
import omit from 'lodash/omit';
|
|
20
|
+
import pick from 'lodash/pick';
|
|
19
21
|
import uniqBy from 'lodash/uniqBy';
|
|
20
22
|
import { CaseReducerConstants } from './CaseConstNTypes';
|
|
21
|
-
const {
|
|
23
|
+
const {
|
|
24
|
+
// getSessions,
|
|
25
|
+
patchSession,
|
|
26
|
+
// createNewSession,
|
|
27
|
+
// createSessionResources,
|
|
28
|
+
// updateSessionResources,
|
|
29
|
+
createSessionCepDetails, SessionResourceVisibility, } = pcm.preCase.session;
|
|
22
30
|
// Constants
|
|
23
31
|
export var SessionRestoreConstants;
|
|
24
32
|
(function (SessionRestoreConstants) {
|
|
@@ -126,7 +134,10 @@ export const getIndividualSessionById = (dispatch, sessionId) => __awaiter(void
|
|
|
126
134
|
if (isEmpty(sessionId))
|
|
127
135
|
return;
|
|
128
136
|
try {
|
|
129
|
-
const sessions =
|
|
137
|
+
// const sessions = await getSessions({
|
|
138
|
+
// sessionId: sessionId,
|
|
139
|
+
// });
|
|
140
|
+
const sessions = yield getSessionByGraphql({
|
|
130
141
|
sessionId: sessionId,
|
|
131
142
|
});
|
|
132
143
|
if (!isEmpty(sessions)) {
|
|
@@ -135,6 +146,30 @@ export const getIndividualSessionById = (dispatch, sessionId) => __awaiter(void
|
|
|
135
146
|
}
|
|
136
147
|
catch (error) { }
|
|
137
148
|
});
|
|
149
|
+
// transform graphql session data as per rest API
|
|
150
|
+
const transformGraphqlSessionToRestSession = (sessionResponse, isNodeValue = false) => {
|
|
151
|
+
const result = map(sessionResponse, (s) => {
|
|
152
|
+
const response = isNodeValue ? s === null || s === void 0 ? void 0 : s.node : s;
|
|
153
|
+
return {
|
|
154
|
+
session: omit(response, ['pcmSessionDetails', 'pcmSessionResource']),
|
|
155
|
+
sessionDetails: pick(response, ['pcmSessionDetails']).pcmSessionDetails,
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
console.log('transformGraphqlSessionToRestSession', result);
|
|
159
|
+
return result;
|
|
160
|
+
};
|
|
161
|
+
const getSessionByGraphql = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
162
|
+
var _a, _b;
|
|
163
|
+
const response = yield graphqlFetch({
|
|
164
|
+
query: GET_SESSION,
|
|
165
|
+
variables: {
|
|
166
|
+
filters: Object.assign({}, payload),
|
|
167
|
+
first: 3,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
const sessions = transformGraphqlSessionToRestSession((_b = (_a = response === null || response === void 0 ? void 0 : response.pcm_session) === null || _a === void 0 ? void 0 : _a.edges) !== null && _b !== void 0 ? _b : [], true);
|
|
171
|
+
return sessions;
|
|
172
|
+
});
|
|
138
173
|
// Function to Load Previous Session
|
|
139
174
|
export const loadPreviousSessions = (dispatch, caseDispatch) => __awaiter(void 0, void 0, void 0, function* () {
|
|
140
175
|
dispatch({
|
|
@@ -142,11 +177,17 @@ export const loadPreviousSessions = (dispatch, caseDispatch) => __awaiter(void 0
|
|
|
142
177
|
payload: { previousSessions: getApiResourceObject({}, true), hasFetchedPreviousSessions: false },
|
|
143
178
|
});
|
|
144
179
|
try {
|
|
145
|
-
const sessions =
|
|
180
|
+
// const sessions = await getSessions({
|
|
181
|
+
// isResolved: false,
|
|
182
|
+
// isActive: true,
|
|
183
|
+
// modifiedAfter: getPastUTCDateFromNow(30),
|
|
184
|
+
// });
|
|
185
|
+
const sessions = yield getSessionByGraphql({
|
|
146
186
|
isResolved: false,
|
|
147
187
|
isActive: true,
|
|
148
188
|
modifiedAfter: getPastUTCDateFromNow(30),
|
|
149
189
|
});
|
|
190
|
+
console.log('sessions graphql', sessions);
|
|
150
191
|
const prevSessions = {};
|
|
151
192
|
let foundSessionWithCaseCreationError = {};
|
|
152
193
|
for (const s of sessions) {
|
|
@@ -185,12 +226,25 @@ export const loadPreviousSessions = (dispatch, caseDispatch) => __awaiter(void 0
|
|
|
185
226
|
});
|
|
186
227
|
// Function to Create Session
|
|
187
228
|
export const createSession = (dispatch, sessionDetails, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
229
|
+
var _a;
|
|
188
230
|
try {
|
|
189
231
|
dispatch({
|
|
190
232
|
type: SessionRestoreConstants.setSessionCreationState,
|
|
191
233
|
payload: { sessionCreationStatus: getApiCreationStatus(true) },
|
|
192
234
|
});
|
|
193
|
-
const newSessionDetails =
|
|
235
|
+
// const newSessionDetails = await createNewSession(sessionDetails, session);
|
|
236
|
+
const response = yield graphqlFetch({
|
|
237
|
+
query: CREATE_SESSION,
|
|
238
|
+
variables: {
|
|
239
|
+
input: {
|
|
240
|
+
session,
|
|
241
|
+
sessionDetails,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
console.log('CREATE_SESSION', response);
|
|
246
|
+
const newSession = transformGraphqlSessionToRestSession([(_a = response === null || response === void 0 ? void 0 : response.pcm_create_session) !== null && _a !== void 0 ? _a : []]);
|
|
247
|
+
const newSessionDetails = newSession === null || newSession === void 0 ? void 0 : newSession[0];
|
|
194
248
|
setTimeout(() => createSessionCepDetails(newSessionDetails.session.id, {}), 2000);
|
|
195
249
|
dispatch({ type: SessionRestoreConstants.createSession, payload: { sessionItem: newSessionDetails } });
|
|
196
250
|
return newSessionDetails.session.id;
|
|
@@ -204,13 +258,39 @@ export const createSession = (dispatch, sessionDetails, session) => __awaiter(vo
|
|
|
204
258
|
}
|
|
205
259
|
});
|
|
206
260
|
// Function to Update Session
|
|
261
|
+
const updateSessionByGraphql = (sessionId, sessionDetails, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
262
|
+
var _a;
|
|
263
|
+
const response = yield graphqlFetch({
|
|
264
|
+
query: UPDATE_SESSION,
|
|
265
|
+
variables: {
|
|
266
|
+
input: {
|
|
267
|
+
session: omit(session, [
|
|
268
|
+
'hasVisitedResources',
|
|
269
|
+
'modifiedBy',
|
|
270
|
+
'modifiedDate',
|
|
271
|
+
'createdBy',
|
|
272
|
+
'createdDate',
|
|
273
|
+
'id',
|
|
274
|
+
]),
|
|
275
|
+
sessionDetails,
|
|
276
|
+
sessionId,
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
console.log('UPDATE_SESSION', response === null || response === void 0 ? void 0 : response.pcm_updateSession);
|
|
281
|
+
const updatedNewSession = transformGraphqlSessionToRestSession([(_a = response === null || response === void 0 ? void 0 : response.pcm_update_session) !== null && _a !== void 0 ? _a : []]);
|
|
282
|
+
const updatedSession = updatedNewSession === null || updatedNewSession === void 0 ? void 0 : updatedNewSession[0];
|
|
283
|
+
return updatedSession;
|
|
284
|
+
});
|
|
207
285
|
export const updateSession = (dispatch, sessionId, sessionDetails, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
208
286
|
try {
|
|
209
287
|
dispatch({
|
|
210
288
|
type: SessionRestoreConstants.setSessionUpdationState,
|
|
211
289
|
payload: { sessionUpdationStatus: getApiUpdationStatus(true) },
|
|
212
290
|
});
|
|
213
|
-
const updatedSession =
|
|
291
|
+
// const updatedSession = await patchSession(sessionId, sessionDetails, session);
|
|
292
|
+
const updatedSession = yield updateSessionByGraphql(sessionId, sessionDetails, session);
|
|
293
|
+
console.log('updatedSession1 graphql', updatedSession);
|
|
214
294
|
// to set sessionDetails fn param used because the session api response removes the
|
|
215
295
|
// fields that have undefined value and it causes problem when we compare
|
|
216
296
|
// sessionDetails and caseDetails
|
|
@@ -252,7 +332,8 @@ export function getRelevantSessionFromSessions(dispatch, currentRelevantSessionI
|
|
|
252
332
|
}
|
|
253
333
|
else if (sessionItem && sessionItem.session.hasVisitedResources && sessionItem.session.isActive) {
|
|
254
334
|
// Mark session as inactive so that it doesn't bother us next time
|
|
255
|
-
patchSession(s, {}, { isActive: false });
|
|
335
|
+
// patchSession(s, {}, { isActive: false });
|
|
336
|
+
updateSessionByGraphql(s, {}, { isActive: false });
|
|
256
337
|
// Mocking it as we don't really care if and when this call is made as long as we ignore these sessions in next iteration
|
|
257
338
|
const updatedSession = Object.assign(Object.assign({}, sessionItem), { session: Object.assign(Object.assign({}, sessionItem.session), { isActive: false }) });
|
|
258
339
|
dispatch({ type: SessionRestoreConstants.patchSession, payload: { sessionItem: updatedSession } });
|
|
@@ -306,6 +387,7 @@ export function createOrUpdateSessionResources(dispatch_1, activeSessionId_1, cu
|
|
|
306
387
|
// Create Session Resource Helper
|
|
307
388
|
export function createSessionResourcesLocal(dispatch_1, activeSessionId_1, currentSessionResourceTracking_1, source_1, payload_1) {
|
|
308
389
|
return __awaiter(this, arguments, void 0, function* (dispatch, activeSessionId, currentSessionResourceTracking, source, payload, resources = []) {
|
|
390
|
+
var _a;
|
|
309
391
|
if (isEmpty(payload) || isEmpty(activeSessionId) || isEmpty(source))
|
|
310
392
|
return;
|
|
311
393
|
const resourceTracking = currentSessionResourceTracking[source];
|
|
@@ -323,12 +405,22 @@ export function createSessionResourcesLocal(dispatch_1, activeSessionId_1, curre
|
|
|
323
405
|
presentedTabResources: filter(resources, (res) => res.visibilityStatus === SessionResourceVisibility.PRESENTED_TAB),
|
|
324
406
|
},
|
|
325
407
|
});
|
|
326
|
-
const response =
|
|
408
|
+
//const response = await createSessionResources(activeSessionId, { source, payload }, resources);
|
|
409
|
+
const response = yield graphqlFetch({
|
|
410
|
+
query: CREATE_SESSION_RESOURCE,
|
|
411
|
+
variables: {
|
|
412
|
+
input: {
|
|
413
|
+
sessionResources: resources,
|
|
414
|
+
resourceOrigin: { source, payload },
|
|
415
|
+
sessionId: activeSessionId,
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
});
|
|
327
419
|
dispatch({
|
|
328
420
|
type: SessionRestoreConstants.updateSessionResourceTracking,
|
|
329
421
|
payload: {
|
|
330
422
|
resourceSource: source,
|
|
331
|
-
resourceOriginId: response.
|
|
423
|
+
resourceOriginId: (_a = response === null || response === void 0 ? void 0 : response.pcm_create_session_resource) === null || _a === void 0 ? void 0 : _a.resourceOriginId,
|
|
332
424
|
},
|
|
333
425
|
});
|
|
334
426
|
}
|
|
@@ -358,11 +450,26 @@ export function updateSessionResourcesLocal(dispatch, activeSessionId, currentSe
|
|
|
358
450
|
!nonPreviouslyPresentedTabResources.length)
|
|
359
451
|
return;
|
|
360
452
|
try {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
]);
|
|
453
|
+
// await updateSessionResources(activeSessionId, { id: resourceTracking.resourceOriginId }, [
|
|
454
|
+
// ...nonPreviouslyVisitedResources,
|
|
455
|
+
// ...nonPreviouslyPresentedResources,
|
|
456
|
+
// ...nonPreviouslyPresentedTabResources,
|
|
457
|
+
// ]);
|
|
458
|
+
const response1 = yield graphqlFetch({
|
|
459
|
+
query: UPDATE_SESSION_RESOURCE,
|
|
460
|
+
variables: {
|
|
461
|
+
input: {
|
|
462
|
+
sessionResources: [
|
|
463
|
+
...nonPreviouslyVisitedResources,
|
|
464
|
+
...nonPreviouslyPresentedResources,
|
|
465
|
+
...nonPreviouslyPresentedTabResources,
|
|
466
|
+
],
|
|
467
|
+
resourceOriginId: resourceTracking.resourceOriginId,
|
|
468
|
+
sessionId: activeSessionId,
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
});
|
|
472
|
+
console.log('updateSessionResources', response1);
|
|
366
473
|
const payloadToDispatch = {
|
|
367
474
|
resourceSource: source,
|
|
368
475
|
sessionResourceTracking: {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-alpha.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"react-virtualized": "^9.22.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
+
"@apollo/client": "^3.11.8",
|
|
54
55
|
"@cee-eng/hydrajs": "4.17.26",
|
|
55
56
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
56
57
|
"@patternfly/patternfly": "5.4.0",
|
|
@@ -60,16 +61,17 @@
|
|
|
60
61
|
"@progress/kendo-licensing": "1.3.5",
|
|
61
62
|
"@progress/kendo-react-pdf": "^5.16.0",
|
|
62
63
|
"@redux-devtools/extension": "^3.3.0",
|
|
63
|
-
"@rh-support/components": "2.
|
|
64
|
-
"@rh-support/react-context": "2.
|
|
64
|
+
"@rh-support/components": "2.2.0-alpha.0",
|
|
65
|
+
"@rh-support/react-context": "2.2.0-alpha.0",
|
|
65
66
|
"@rh-support/types": "2.0.5",
|
|
66
|
-
"@rh-support/user-permissions": "2.
|
|
67
|
-
"@rh-support/utils": "2.
|
|
67
|
+
"@rh-support/user-permissions": "2.2.0-alpha.0",
|
|
68
|
+
"@rh-support/utils": "2.2.0-alpha.0",
|
|
68
69
|
"@types/react-redux": "^7.1.33",
|
|
69
70
|
"@types/redux": "^3.6.0",
|
|
70
71
|
"dompurify": "^2.2.6",
|
|
71
72
|
"dot": "^1.1.3",
|
|
72
73
|
"downshift": "^6.0.5",
|
|
74
|
+
"graphql": "^16.9.0",
|
|
73
75
|
"history": "4.10.1",
|
|
74
76
|
"i18next": "^23.15.0",
|
|
75
77
|
"js-markdown-extra": "^1.2.4",
|
|
@@ -133,5 +135,5 @@
|
|
|
133
135
|
"defaults and supports es6-module",
|
|
134
136
|
"maintained node versions"
|
|
135
137
|
],
|
|
136
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "adbfb4aacbf67de864e57d292d02fedc7589567b"
|
|
137
139
|
}
|