@rh-support/troubleshoot 2.6.287 → 2.6.292
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/AccountSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/AccountSelector.js +28 -40
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +43 -12
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +7 -5
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +25 -8
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +14 -10
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +24 -18
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +38 -34
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +19 -59
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +5 -3
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +3 -2
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +7 -5
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +32 -55
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +4 -7
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +10 -10
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +19 -53
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +16 -18
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +1 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +50 -64
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +34 -9
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
- package/lib/esm/graphql/index.d.ts +4 -0
- package/lib/esm/graphql/index.d.ts.map +1 -0
- package/lib/esm/graphql/index.js +3 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
- package/lib/esm/graphql/mutations/index.d.ts +2 -0
- package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
- package/lib/esm/graphql/mutations/index.js +1 -0
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
- package/lib/esm/graphql/queries/getEscalationDetails.js +24 -0
- package/lib/esm/graphql/queries/getParentId.d.ts +2 -0
- package/lib/esm/graphql/queries/getParentId.d.ts.map +1 -0
- package/lib/esm/graphql/queries/getParentId.js +16 -0
- package/lib/esm/graphql/queries/index.d.ts +3 -0
- package/lib/esm/graphql/queries/index.d.ts.map +1 -0
- package/lib/esm/graphql/queries/index.js +2 -0
- package/lib/esm/graphql/schemas/escalation.d.ts +85 -0
- package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
- package/lib/esm/graphql/schemas/escalation.js +1 -0
- package/lib/esm/graphql/schemas/index.d.ts +2 -0
- package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
- package/lib/esm/graphql/schemas/index.js +1 -0
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +18 -11
- package/lib/esm/reducers/CaseConstNTypes.d.ts +86 -2
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +5 -0
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +22 -5
- package/lib/esm/reducers/CaseHelpers.d.ts +2 -1
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +39 -2
- package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
- package/lib/esm/reducers/CaseReducer.d.ts +27 -8
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +100 -23
- package/package.json +5 -5
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { accounts, contacts, kase, pcm, publicApi } from '@cee-eng/hydrajs';
|
|
11
11
|
import { formattedApiErrorMessage } from '@rh-support/components';
|
|
12
|
-
import { dtmTrackEventCaseCreationStepEncountered, getApiResourceObject, PreviousToNewCaseTypeMap, } from '@rh-support/utils';
|
|
13
|
-
import delay from 'lodash/delay';
|
|
12
|
+
import { CREATE_SUPPORT_CASE, dtmTrackEventCaseCreationStepEncountered, fetchCaseDetailsByCaseNumber, GET_ACCOUNT, GET_PRODUCTS, getAccountQueryVariables, getApiResourceObject, handleGraphQLAccountResponse, handleGraphQLVersionsResponse, mapGraphQLCaseDetailsToCasePayload, PreviousToNewCaseTypeMap, updateCaseDetailsGraphQLRequest, } from '@rh-support/utils';
|
|
13
|
+
// import delay from 'lodash/delay';
|
|
14
14
|
import filter from 'lodash/filter';
|
|
15
15
|
import find from 'lodash/find';
|
|
16
16
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -20,7 +20,7 @@ import uniq from 'lodash/uniq';
|
|
|
20
20
|
import uniqBy from 'lodash/uniqBy';
|
|
21
21
|
import { trimAndReplacePlus } from '../components/shared/utils';
|
|
22
22
|
import { CaseReducerConstants, DESCRIPTION_LENGTH_LIMIT, initialCaseState, SupportLevelDisplay, } from './CaseConstNTypes';
|
|
23
|
-
import { createCasePayload, getCaseFromSessionDetails, getCaseRecommendations, getCepCommentFromCepDetails, getHasInvalidEntitlements, getProcessedEntitlements, } from './CaseHelpers';
|
|
23
|
+
import { createCasePayload, createCasePayloadGraphQL, getCaseFromSessionDetails, getCaseRecommendations, getCepCommentFromCepDetails, getHasInvalidEntitlements, getProcessedEntitlements, } from './CaseHelpers';
|
|
24
24
|
import { updateSession } from './SessionRestoreReducer';
|
|
25
25
|
export const caseReducer = (pState, action) => {
|
|
26
26
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
@@ -29,17 +29,20 @@ export const caseReducer = (pState, action) => {
|
|
|
29
29
|
const hasLargeCaseDescription = action.payload.caseDetails.hasOwnProperty('description')
|
|
30
30
|
? (action.payload.caseDetails.description || '').length > DESCRIPTION_LENGTH_LIMIT
|
|
31
31
|
: pState.hasLargeCaseDescription;
|
|
32
|
+
let resetEntitlementId = false;
|
|
32
33
|
if (((_b = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.caseDetails) === null || _b === void 0 ? void 0 : _b.contactSSOName) &&
|
|
33
34
|
pState.caseDetails.contactSSOName !== ((_d = (_c = action.payload) === null || _c === void 0 ? void 0 : _c.caseDetails) === null || _d === void 0 ? void 0 : _d.contactSSOName)) {
|
|
34
35
|
// Need to reset casegroup and sla as they are dependent on selected owner
|
|
35
36
|
action.payload.caseDetails.entitlementSla = undefined;
|
|
37
|
+
resetEntitlementId = true;
|
|
36
38
|
}
|
|
37
39
|
if (((_f = (_e = action.payload) === null || _e === void 0 ? void 0 : _e.caseDetails) === null || _f === void 0 ? void 0 : _f.product) &&
|
|
38
40
|
pState.caseDetails.product !== ((_h = (_g = action.payload) === null || _g === void 0 ? void 0 : _g.caseDetails) === null || _h === void 0 ? void 0 : _h.product)) {
|
|
39
41
|
// need to reset sla on product change as individiual products can have independent sla
|
|
40
42
|
action.payload.caseDetails.entitlementSla = undefined;
|
|
43
|
+
resetEntitlementId = true;
|
|
41
44
|
}
|
|
42
|
-
return Object.assign(Object.assign({}, pState), { hasLargeCaseDescription, caseDetails: Object.assign(Object.assign({}, pState.caseDetails), action.payload.caseDetails), isCaseUpdating: false });
|
|
45
|
+
return Object.assign(Object.assign(Object.assign({}, pState), { hasLargeCaseDescription, caseDetails: Object.assign(Object.assign({}, pState.caseDetails), action.payload.caseDetails), isCaseUpdating: false }), (resetEntitlementId ? { selectedEntitlementId: undefined } : {}));
|
|
43
46
|
}
|
|
44
47
|
case CaseReducerConstants.caseStateChanged: {
|
|
45
48
|
return Object.assign(Object.assign({}, pState), action.payload);
|
|
@@ -167,15 +170,23 @@ export const setNotifiedUser = (dispatch, selectedNotificationContacts) => {
|
|
|
167
170
|
payload: { selectedNotificationContacts },
|
|
168
171
|
});
|
|
169
172
|
};
|
|
170
|
-
export const submitCase = (dispatch_1, sessionRestoreDispatch_1, caseDetails_1, isCaseCreate_1, errorMessage500_1, loggedInUserSsoUsername_1, ...args_1) => __awaiter(void 0, [dispatch_1, sessionRestoreDispatch_1, caseDetails_1, isCaseCreate_1, errorMessage500_1, loggedInUserSsoUsername_1, ...args_1], void 0, function* (dispatch, sessionRestoreDispatch, caseDetails, isCaseCreate, errorMessage500, loggedInUserSsoUsername, isSecureSupport = false, isResubmit, isCreatingCaseFlow, sessionItem) {
|
|
171
|
-
var _a, _b;
|
|
173
|
+
export const submitCase = (dispatch_1, sessionRestoreDispatch_1, caseDetails_1, isCaseCreate_1, errorMessage500_1, loggedInUserSsoUsername_1, ...args_1) => __awaiter(void 0, [dispatch_1, sessionRestoreDispatch_1, caseDetails_1, isCaseCreate_1, errorMessage500_1, loggedInUserSsoUsername_1, ...args_1], void 0, function* (dispatch, sessionRestoreDispatch, caseDetails, isCaseCreate, errorMessage500, loggedInUserSsoUsername, isSecureSupport = false, isResubmit, isCreatingCaseFlow, sessionItem, apolloClient) {
|
|
174
|
+
var _a, _b, _c, _d, _e, _f;
|
|
172
175
|
dispatch({ type: CaseReducerConstants.isCreatingCase });
|
|
173
176
|
try {
|
|
174
177
|
const casePayload = createCasePayload(caseDetails, sessionItem, isCaseCreate);
|
|
178
|
+
const graphQLPayload = createCasePayloadGraphQL(caseDetails, sessionItem, isCaseCreate);
|
|
175
179
|
dispatch({ type: CaseReducerConstants.resetCaseNoOfCreatedCase, payload: { caseNoOfCreatedCase: '' } });
|
|
176
|
-
const
|
|
180
|
+
const { data } = yield apolloClient.mutate({
|
|
181
|
+
mutation: CREATE_SUPPORT_CASE,
|
|
182
|
+
variables: {
|
|
183
|
+
caseInput: graphQLPayload,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
const caseRecord = (_b = (_a = data === null || data === void 0 ? void 0 : data.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.CaseCreate) === null || _b === void 0 ? void 0 : _b.SalesforceSupportRecord;
|
|
187
|
+
const caseNumber = (_c = caseRecord === null || caseRecord === void 0 ? void 0 : caseRecord.CaseNumber) === null || _c === void 0 ? void 0 : _c.value;
|
|
177
188
|
if (casePayload.contactSSOName === loggedInUserSsoUsername &&
|
|
178
|
-
!isEmpty((
|
|
189
|
+
!isEmpty((_d = casePayload.phoneAreaCodePrefixLineNumber) === null || _d === void 0 ? void 0 : _d.trim()) &&
|
|
179
190
|
!isEmpty(trimAndReplacePlus((casePayload === null || casePayload === void 0 ? void 0 : casePayload.phoneCountryCode) || ''))) {
|
|
180
191
|
contacts.updateContactBySSO(casePayload.contactSSOName, {
|
|
181
192
|
supportPhoneCountryCode: casePayload.phoneCountryCode,
|
|
@@ -184,7 +195,7 @@ export const submitCase = (dispatch_1, sessionRestoreDispatch_1, caseDetails_1,
|
|
|
184
195
|
}
|
|
185
196
|
// For updating the sessions and posting cep details after case creation
|
|
186
197
|
postCaseCreationProcessing(isSecureSupport, dispatch, sessionRestoreDispatch, caseNumber, caseDetails, sessionItem);
|
|
187
|
-
dtmTrackEventCaseCreationStepEncountered(isCreatingCaseFlow, 'Submit', false, caseNumber, PreviousToNewCaseTypeMap[(
|
|
198
|
+
dtmTrackEventCaseCreationStepEncountered(isCreatingCaseFlow, 'Submit', false, caseNumber, PreviousToNewCaseTypeMap[(_e = caseDetails.caseDetails) === null || _e === void 0 ? void 0 : _e.caseType], (_f = caseDetails.caseDetails.summary) !== null && _f !== void 0 ? _f : undefined, caseDetails.caseDetails.product, caseDetails.caseDetails.version);
|
|
188
199
|
dispatch({ type: CaseReducerConstants.caseCreated, payload: { caseNoOfCreatedCase: caseNumber } });
|
|
189
200
|
}
|
|
190
201
|
catch (error) {
|
|
@@ -376,8 +387,8 @@ export const clearSelectedAccount = (dispatch) => {
|
|
|
376
387
|
payload: { caseDetails: { accountNumberRef: '' } },
|
|
377
388
|
});
|
|
378
389
|
};
|
|
379
|
-
export const setCaseAccountNumber = (dispatch_1, accountNumber_1, ...args_1) => __awaiter(void 0, [dispatch_1, accountNumber_1, ...args_1], void 0, function* (dispatch, accountNumber, isLoggedInUsersAccount = false, loggedInUserAccount = {}) {
|
|
380
|
-
var _a;
|
|
390
|
+
export const setCaseAccountNumber = (dispatch_1, accountNumber_1, ...args_1) => __awaiter(void 0, [dispatch_1, accountNumber_1, ...args_1], void 0, function* (dispatch, accountNumber, isLoggedInUsersAccount = false, loggedInUserAccount = {}, apolloClient) {
|
|
391
|
+
var _a, _b, _c, _d, _e;
|
|
381
392
|
if (isLoggedInUsersAccount && !isEmpty(loggedInUserAccount) && !isEmpty(accountNumber)) {
|
|
382
393
|
dispatch({
|
|
383
394
|
type: CaseReducerConstants.caseStateChanged,
|
|
@@ -410,7 +421,12 @@ export const setCaseAccountNumber = (dispatch_1, accountNumber_1, ...args_1) =>
|
|
|
410
421
|
payload: { selectedAccountDetails: getApiResourceObject({}, true) },
|
|
411
422
|
});
|
|
412
423
|
try {
|
|
413
|
-
const
|
|
424
|
+
const { data } = yield apolloClient.query({
|
|
425
|
+
query: GET_ACCOUNT,
|
|
426
|
+
variables: getAccountQueryVariables(accountNumber),
|
|
427
|
+
});
|
|
428
|
+
const edges = (_e = (_d = (_c = (_b = data === null || data === void 0 ? void 0 : data.salesforce_support_uiapi) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.SalesforceSupportAccount) === null || _d === void 0 ? void 0 : _d.edges) !== null && _e !== void 0 ? _e : [];
|
|
429
|
+
const selectedAccountDetails = handleGraphQLAccountResponse(edges);
|
|
414
430
|
dispatch({
|
|
415
431
|
type: CaseReducerConstants.caseStateChanged,
|
|
416
432
|
payload: { selectedAccountDetails: getApiResourceObject(selectedAccountDetails) },
|
|
@@ -475,7 +491,7 @@ export const setCaseOwner = (dispatch_1, owner_1, product_1, abortSignalCaseGrou
|
|
|
475
491
|
}
|
|
476
492
|
dispatch({
|
|
477
493
|
type: CaseReducerConstants.caseStateChanged,
|
|
478
|
-
payload: { selectedOwner: getApiResourceObject(owner) },
|
|
494
|
+
payload: { selectedOwner: getApiResourceObject(owner), hasInvalidEntitlements: false },
|
|
479
495
|
});
|
|
480
496
|
dispatch({
|
|
481
497
|
type: CaseReducerConstants.caseDetailChanged,
|
|
@@ -489,9 +505,19 @@ export const setCaseOwner = (dispatch_1, owner_1, product_1, abortSignalCaseGrou
|
|
|
489
505
|
fetchCaseGroupsForSSO(dispatch, owner.ssoUsername, setCaseGroupToUngroupedOrDefault, abortSignalCaseGroup, caseGroupNumberToRestore);
|
|
490
506
|
}
|
|
491
507
|
}
|
|
492
|
-
delay(
|
|
493
|
-
|
|
494
|
-
|
|
508
|
+
// delay(
|
|
509
|
+
// async () =>
|
|
510
|
+
// await fetchCaseEntitlements(
|
|
511
|
+
// dispatch,
|
|
512
|
+
// owner.ssoUsername!,
|
|
513
|
+
// product,
|
|
514
|
+
// abortSignalEntitlements,
|
|
515
|
+
// isUserUpdate,
|
|
516
|
+
// caseNumber
|
|
517
|
+
// ),
|
|
518
|
+
// 5000,
|
|
519
|
+
// 'later'
|
|
520
|
+
// );
|
|
495
521
|
});
|
|
496
522
|
//changing the item values to uppercase to match the backend values
|
|
497
523
|
const slaOrder = Object.values(SupportLevelDisplay).map((item) => {
|
|
@@ -572,12 +598,12 @@ export const fetchCaseGroupsForSSO = (dispatch_1, contactSsoUsername_1, ...args_
|
|
|
572
598
|
const getSelectedNotificationContactsFromSession = (contacts, notifiedUsers) => {
|
|
573
599
|
return filter(contacts, (c) => notifiedUsers.includes(c.ssoUsername));
|
|
574
600
|
};
|
|
575
|
-
export const updateCaseWithSession = (dispatch_1, sessionItem_1, loggedInUserAccountNumber_1, loggedInUserContact_1, ...args_1) => __awaiter(void 0, [dispatch_1, sessionItem_1, loggedInUserAccountNumber_1, loggedInUserContact_1, ...args_1], void 0, function* (dispatch, sessionItem, loggedInUserAccountNumber, loggedInUserContact, loggedInUserAccount = {}) {
|
|
601
|
+
export const updateCaseWithSession = (dispatch_1, sessionItem_1, loggedInUserAccountNumber_1, loggedInUserContact_1, ...args_1) => __awaiter(void 0, [dispatch_1, sessionItem_1, loggedInUserAccountNumber_1, loggedInUserContact_1, ...args_1], void 0, function* (dispatch, sessionItem, loggedInUserAccountNumber, loggedInUserContact, loggedInUserAccount = {}, apolloClient) {
|
|
576
602
|
var _a, _b, _c, _d;
|
|
577
603
|
const caseDetails = getCaseFromSessionDetails(sessionItem, loggedInUserAccountNumber, loggedInUserContact.ssoUsername);
|
|
578
604
|
const { sessionDetails } = sessionItem;
|
|
579
605
|
setCaseDetails(dispatch, caseDetails);
|
|
580
|
-
setCaseAccountNumber(dispatch, caseDetails.accountNumberRef, caseDetails.accountNumberRef === loggedInUserAccountNumber, loggedInUserAccount);
|
|
606
|
+
setCaseAccountNumber(dispatch, caseDetails.accountNumberRef, caseDetails.accountNumberRef === loggedInUserAccountNumber, loggedInUserAccount, apolloClient);
|
|
581
607
|
// entitlementSla gets undefined when case group, owner or product is changed
|
|
582
608
|
// Please refer line 60
|
|
583
609
|
if (isUndefined(caseDetails.entitlementSla)) {
|
|
@@ -637,7 +663,7 @@ const getAllRelevantContacts = (loggedInUserContact, caseAccountNumber, contactS
|
|
|
637
663
|
return uniqBy(contactsToReturn, 'ssoUsername');
|
|
638
664
|
}
|
|
639
665
|
});
|
|
640
|
-
export const
|
|
666
|
+
export const fetchCaseDetailsHydra = (dispatch, caseNumber, loggedInUserRights, loggedInUser, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
641
667
|
var _a, _b;
|
|
642
668
|
dispatch({ type: CaseReducerConstants.requestCaseDetails, payload: { caseDetails: { caseNumber } } });
|
|
643
669
|
try {
|
|
@@ -707,7 +733,7 @@ export const fetchCaseDetails = (dispatch, caseNumber, loggedInUserRights, logge
|
|
|
707
733
|
caseNoOfCreatedCase: caseNumber,
|
|
708
734
|
};
|
|
709
735
|
dispatch({ type: CaseReducerConstants.receivedCaseDetails, payload: Object.assign(Object.assign({}, caseState), { caseDetails }) });
|
|
710
|
-
setCaseAccountNumber(dispatch, data.accountNumberRef);
|
|
736
|
+
setCaseAccountNumber(dispatch, data.accountNumberRef, false, {}, apolloClient);
|
|
711
737
|
const canChangeGroup = loggedInUserRights.isInternal() ||
|
|
712
738
|
loggedInUser.isOrgAdmin ||
|
|
713
739
|
loggedInUser.ssoUsername === caseDetails.contactSSOName ||
|
|
@@ -753,7 +779,46 @@ export const updateCaseDetails = (dispatch, caseNumber, caseDetails, dontSetDeta
|
|
|
753
779
|
}
|
|
754
780
|
catch (error) {
|
|
755
781
|
dispatch({ type: CaseReducerConstants.updateCaseDetailsError });
|
|
756
|
-
|
|
782
|
+
throw error;
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
export const updateCaseDetailsGraphQL = (dispatch, apolloClient, caseNumber, caseUpdate, dontSetDetails, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
786
|
+
var _a, _b;
|
|
787
|
+
try {
|
|
788
|
+
dispatch({ type: CaseReducerConstants.updateCaseDetailUpdating });
|
|
789
|
+
const salesforceCaseId = (_a = options === null || options === void 0 ? void 0 : options.salesforceCaseId) !== null && _a !== void 0 ? _a : (_b = options === null || options === void 0 ? void 0 : options.existingCaseDetails) === null || _b === void 0 ? void 0 : _b.id;
|
|
790
|
+
const graphqlDetails = yield updateCaseDetailsGraphQLRequest(apolloClient, caseNumber, caseUpdate, {
|
|
791
|
+
salesforceCaseId,
|
|
792
|
+
existingCaseDetails: (options === null || options === void 0 ? void 0 : options.existingCaseDetails)
|
|
793
|
+
? {
|
|
794
|
+
product: options.existingCaseDetails.product,
|
|
795
|
+
version: options.existingCaseDetails.version,
|
|
796
|
+
}
|
|
797
|
+
: undefined,
|
|
798
|
+
});
|
|
799
|
+
if (dontSetDetails) {
|
|
800
|
+
dispatch({ type: CaseReducerConstants.updateCaseDetailCompleted });
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
let updatedCaseDetails = Object.assign({}, caseUpdate);
|
|
804
|
+
if (graphqlDetails) {
|
|
805
|
+
const mappedGraphQLDetails = mapGraphQLCaseDetailsToCasePayload(graphqlDetails);
|
|
806
|
+
updatedCaseDetails = Object.assign(Object.assign({}, updatedCaseDetails), Object.fromEntries(Object.entries(mappedGraphQLDetails).filter(([, value]) => value !== null && value !== undefined && value !== '')));
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
const refreshedDetails = yield fetchCaseDetailsByCaseNumber(apolloClient, caseNumber);
|
|
810
|
+
if (refreshedDetails) {
|
|
811
|
+
updatedCaseDetails = Object.assign(Object.assign({}, updatedCaseDetails), mapGraphQLCaseDetailsToCasePayload(refreshedDetails));
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
dispatch({
|
|
815
|
+
type: CaseReducerConstants.caseDetailChanged,
|
|
816
|
+
payload: { caseDetails: updatedCaseDetails, isCaseUpdating: false },
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
catch (error) {
|
|
820
|
+
dispatch({ type: CaseReducerConstants.updateCaseDetailsError });
|
|
821
|
+
throw error;
|
|
757
822
|
}
|
|
758
823
|
});
|
|
759
824
|
export const getNotificationContacts4InternalUser = (dispatch, users, caseOwnerSSO) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -935,14 +1000,26 @@ export function updateEmailListState(dispatch, email, customEmailsList, callback
|
|
|
935
1000
|
payload: { customEmailsList: Object.assign(Object.assign({}, customEmailsList), { data: newEmail }) },
|
|
936
1001
|
});
|
|
937
1002
|
}
|
|
938
|
-
export function getVersionsDetails(dispatch,
|
|
1003
|
+
export function getVersionsDetails(dispatch, apolloClient, parentProductId, parentProductName) {
|
|
939
1004
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1005
|
+
var _a, _b, _c, _d;
|
|
940
1006
|
try {
|
|
941
1007
|
dispatch({
|
|
942
1008
|
type: CaseReducerConstants.getVersionDetails,
|
|
943
1009
|
payload: { versionsDetails: getApiResourceObject([], true) },
|
|
944
1010
|
});
|
|
945
|
-
const
|
|
1011
|
+
const { data } = yield apolloClient.query({
|
|
1012
|
+
query: GET_PRODUCTS,
|
|
1013
|
+
variables: {
|
|
1014
|
+
where: {
|
|
1015
|
+
ParentProduct__c: { eq: parentProductId },
|
|
1016
|
+
IsActive: { eq: true },
|
|
1017
|
+
},
|
|
1018
|
+
first: 200,
|
|
1019
|
+
},
|
|
1020
|
+
});
|
|
1021
|
+
const edges = (_d = (_c = (_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.SalesforceSupportProduct2) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
1022
|
+
const versionsDetails = handleGraphQLVersionsResponse(edges, parentProductName);
|
|
946
1023
|
dispatch({
|
|
947
1024
|
type: CaseReducerConstants.getVersionDetails,
|
|
948
1025
|
payload: { versionsDetails: getApiResourceObject(versionsDetails) },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.292",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"@progress/kendo-react-pdf": "^5.16.0",
|
|
55
55
|
"@redux-devtools/extension": "^3.3.0",
|
|
56
56
|
"@rh-support/components": "2.5.165",
|
|
57
|
-
"@rh-support/react-context": "2.5.
|
|
57
|
+
"@rh-support/react-context": "2.5.268",
|
|
58
58
|
"@rh-support/types": "2.0.26",
|
|
59
|
-
"@rh-support/user-permissions": "2.5.
|
|
60
|
-
"@rh-support/utils": "2.5.
|
|
59
|
+
"@rh-support/user-permissions": "2.5.122",
|
|
60
|
+
"@rh-support/utils": "2.5.105",
|
|
61
61
|
"@types/react-redux": "^7.1.33",
|
|
62
62
|
"@types/redux": "^3.6.0",
|
|
63
63
|
"date-fns": "3.6.0",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"defaults and supports es6-module",
|
|
128
128
|
"maintained node versions"
|
|
129
129
|
],
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "2b2c0e7650d4c5d94856ae246c3e5a6c7ae9e75d"
|
|
131
131
|
}
|