@rh-support/react-context 2.5.322 → 2.5.327
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/GlobalContextWrapper.d.ts +3 -1
- package/lib/esm/GlobalContextWrapper.d.ts.map +1 -1
- package/lib/esm/GlobalContextWrapper.js +8 -26
- package/lib/esm/components/AccountSelector/AccountSelectorInternal.d.ts +2 -1
- package/lib/esm/components/AccountSelector/AccountSelectorInternal.d.ts.map +1 -1
- package/lib/esm/components/AccountSelector/AccountSelectorInternal.js +37 -93
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts +0 -6
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts.map +1 -1
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.js +51 -17
- package/lib/esm/components/EmbeddedServiceChat/ExtraPreChatInfo.d.ts +12 -0
- package/lib/esm/components/EmbeddedServiceChat/ExtraPreChatInfo.d.ts.map +1 -0
- package/lib/esm/components/EmbeddedServiceChat/ExtraPreChatInfo.js +29 -0
- package/lib/esm/components/EmbeddedServiceChat/embeddedServiceChat.css +51 -1
- package/lib/esm/components/SharedModals/CSSUserModal.d.ts.map +1 -1
- package/lib/esm/components/SharedModals/CSSUserModal.js +1 -2
- package/lib/esm/components/SharedModals/CloseCaseModal.js +1 -1
- package/lib/esm/hooks/index.d.ts +1 -0
- package/lib/esm/hooks/index.d.ts.map +1 -1
- package/lib/esm/hooks/index.js +1 -0
- package/lib/esm/hooks/useCanEditCase.d.ts +1 -2
- package/lib/esm/hooks/useCanEditCase.d.ts.map +1 -1
- package/lib/esm/hooks/useCanEditCase.js +3 -20
- package/lib/esm/hooks/useChatConfig.d.ts +17 -9
- package/lib/esm/hooks/useChatConfig.d.ts.map +1 -1
- package/lib/esm/hooks/useChatConfig.js +43 -11
- package/lib/esm/hooks/useChatInit.d.ts +13 -9
- package/lib/esm/hooks/useChatInit.d.ts.map +1 -1
- package/lib/esm/hooks/useChatInit.js +119 -63
- package/lib/esm/hooks/usePreChatFormDetails.d.ts +12 -0
- package/lib/esm/hooks/usePreChatFormDetails.d.ts.map +1 -0
- package/lib/esm/hooks/usePreChatFormDetails.js +61 -0
- package/lib/esm/index.d.ts +0 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +0 -2
- package/lib/esm/reducers/GlobalMetadataHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/GlobalMetadataHelpers.js +6 -2
- package/lib/esm/reducers/GlobalMetadataReducer.d.ts +16 -51
- package/lib/esm/reducers/GlobalMetadataReducer.d.ts.map +1 -1
- package/lib/esm/reducers/GlobalMetadataReducer.js +89 -265
- package/package.json +7 -10
- package/lib/esm/context/CaseStatusContext.d.ts +0 -9
- package/lib/esm/context/CaseStatusContext.d.ts.map +0 -1
- package/lib/esm/context/CaseStatusContext.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalMetadataReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/GlobalMetadataReducer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GlobalMetadataReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/GlobalMetadataReducer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAA0B,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACtG,OAAO,E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,uBAAuB,OAAO,kBAiCjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC1B,UAAU,iCAAiC,EAC3C,cAAc,OAAO,CAAC,aAAa,CAAC,SAMvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAU,UAAU,iCAAiC,EAAE,eAAe,MAAM,kBAiBhH,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAC/B,UAAU,iCAAiC,EAC3C,qBAAqB,6BAA6B,EAAE,SAMvD,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAU,UAAU,iCAAiC,kBAkBhG,CAAC;AAEF,eAAO,MAAM,sCAAsC,GAAI,UAAU,iCAAiC,EAAE,OAAO,OAAO,SAKjH,CAAC;AAEF,eAAO,MAAM,+BAA+B,GACxC,UAAU,iCAAiC,EAC3C,sBAAsB,OAAO,CAAC,QAAQ,CAAC,EACvC,sBAAsB,OAAO,SAMhC,CAAC"}
|
|
@@ -7,16 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { accounts, caseMetadata, customEmail, maintenance, publicApi, userPreferences } from '@cee-eng/hydrajs';
|
|
11
|
-
import {
|
|
12
|
-
import { beginCaseRecordTypesLoad, buildPicklistInput, CSS_ACCESS_RESTRICTION_ERROR_DETAIL, fetchCaseDetailsByCaseNumber, fetchLoggedInUserFromGraphQL, fetchPicklistValues, GET_ACCOUNT, GET_CASE_GROUP, GET_CASE_RECORD_TYPES, GET_PRODUCTS, getAccountQueryVariables, getApiResourceObject, getCaseRecordTypes, getTechnicalSupportRecordTypeId, handleGraphQLAccountResponse, handleGraphQLProductsResponse, isCssRestrictedAccess, mapGraphQLCaseContactToOwnerState, mapGraphQLCaseDetailsToCasePayload, mapGraphQLContactPhoneToCasePhoneFields, setCaseRecordTypes, severitySort, } from '@rh-support/utils';
|
|
10
|
+
import { accounts, caseMetadata, contacts, customEmail, maintenance, products, publicApi, userPreferences, } from '@cee-eng/hydrajs';
|
|
11
|
+
import { getApiResourceObject, handleEntitledProductResponse, handleProductSearchResponse, severitySort, } from '@rh-support/utils';
|
|
13
12
|
import differenceBy from 'lodash/differenceBy';
|
|
14
13
|
import filter from 'lodash/filter';
|
|
15
14
|
import find from 'lodash/find';
|
|
16
15
|
import isEmpty from 'lodash/isEmpty';
|
|
17
16
|
import reduce from 'lodash/reduce';
|
|
18
17
|
import sortBy from 'lodash/sortBy';
|
|
19
|
-
import unescape from 'lodash/unescape';
|
|
20
18
|
import unionBy from 'lodash/unionBy';
|
|
21
19
|
import { getProcessedCaseTypes } from './GlobalMetadataHelpers';
|
|
22
20
|
export var UserPreferencesKeys;
|
|
@@ -81,8 +79,7 @@ export var GlobalMetadataReducerConstants;
|
|
|
81
79
|
GlobalMetadataReducerConstants["setReferrerUrl"] = "setReferrerUrl";
|
|
82
80
|
GlobalMetadataReducerConstants["getNoclusteridreasons"] = "getNoclusteridreasons";
|
|
83
81
|
GlobalMetadataReducerConstants["setIsSharingHostnameswithRHt"] = "setIsSharingHostnameswithRHt";
|
|
84
|
-
GlobalMetadataReducerConstants["
|
|
85
|
-
GlobalMetadataReducerConstants["setCaseRecordTypes"] = "setCaseRecordTypes";
|
|
82
|
+
GlobalMetadataReducerConstants["setCaseListTraditionalSupportAgreed"] = "setCaseListTraditionalSupportAgreed";
|
|
86
83
|
})(GlobalMetadataReducerConstants || (GlobalMetadataReducerConstants = {}));
|
|
87
84
|
const initialProductResponse = {
|
|
88
85
|
topProducts: [],
|
|
@@ -121,13 +118,11 @@ export const initialGlobalMetadataState = {
|
|
|
121
118
|
},
|
|
122
119
|
referrerUrl: null,
|
|
123
120
|
caseNoClusterIdReasons: getApiResourceObject([]),
|
|
124
|
-
caseRecordTypes: getApiResourceObject({}),
|
|
125
121
|
caseListTraditionalSupportAgreed: false,
|
|
126
|
-
troubleshootTraditionalSupportAgreed: false,
|
|
127
122
|
};
|
|
128
123
|
// Resucers
|
|
129
124
|
export const globalMetadataReducer = (pState, action) => {
|
|
130
|
-
var _a
|
|
125
|
+
var _a;
|
|
131
126
|
switch (action.type) {
|
|
132
127
|
case GlobalMetadataReducerConstants.setCaseTypes: {
|
|
133
128
|
return Object.assign(Object.assign({}, pState), { allCaseTypes: action.payload.allCaseTypes });
|
|
@@ -220,11 +215,8 @@ export const globalMetadataReducer = (pState, action) => {
|
|
|
220
215
|
case GlobalMetadataReducerConstants.getNoclusteridreasons: {
|
|
221
216
|
return Object.assign(Object.assign({}, pState), { caseNoClusterIdReasons: action.payload.caseNoClusterIdReasons });
|
|
222
217
|
}
|
|
223
|
-
case GlobalMetadataReducerConstants.
|
|
224
|
-
return Object.assign(Object.assign({}, pState), { caseListTraditionalSupportAgreed: (_a = action.payload) === null || _a === void 0 ? void 0 : _a.caseListTraditionalSupportAgreed
|
|
225
|
-
}
|
|
226
|
-
case GlobalMetadataReducerConstants.setCaseRecordTypes: {
|
|
227
|
-
return Object.assign(Object.assign({}, pState), { caseRecordTypes: action.payload.caseRecordTypes });
|
|
218
|
+
case GlobalMetadataReducerConstants.setCaseListTraditionalSupportAgreed: {
|
|
219
|
+
return Object.assign(Object.assign({}, pState), { caseListTraditionalSupportAgreed: (_a = action.payload) === null || _a === void 0 ? void 0 : _a.caseListTraditionalSupportAgreed });
|
|
228
220
|
}
|
|
229
221
|
default: {
|
|
230
222
|
return pState;
|
|
@@ -286,35 +278,7 @@ export const addEditbookmarks = (dispatch, allBookmarks, updatedAccounts, select
|
|
|
286
278
|
payload: { bookmarkedGroupAccounts: getApiResourceObject(allBookmarksCopy, false) },
|
|
287
279
|
});
|
|
288
280
|
};
|
|
289
|
-
export const fetchCaseTypes = (dispatch,
|
|
290
|
-
var _a;
|
|
291
|
-
dispatch({
|
|
292
|
-
type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
293
|
-
payload: { allCaseTypes: getApiResourceObject([], true) },
|
|
294
|
-
});
|
|
295
|
-
try {
|
|
296
|
-
// Picklists require Technical Support record type ID - await it to avoid race on first load
|
|
297
|
-
yield fetchCaseRecordTypes(dispatch, apolloClient);
|
|
298
|
-
const picklists = yield fetchPicklistValues(apolloClient, buildPicklistInput(['Type']));
|
|
299
|
-
const allCaseTypes = getProcessedCaseTypes((_a = picklists.Type) !== null && _a !== void 0 ? _a : []);
|
|
300
|
-
dispatch({
|
|
301
|
-
type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
302
|
-
payload: { allCaseTypes: getApiResourceObject(allCaseTypes) },
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
catch (e) {
|
|
306
|
-
dispatch({
|
|
307
|
-
type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
308
|
-
payload: { allCaseTypes: getApiResourceObject([], false, true, e.message) },
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
// const caseTypes = await caseMetadata.getTypes(isSecureSupport);
|
|
312
|
-
// dispatch({
|
|
313
|
-
// type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
314
|
-
// payload: { allCaseTypes: getApiResourceObject(getProcessedCaseTypes(caseTypes.items)) },
|
|
315
|
-
// });
|
|
316
|
-
});
|
|
317
|
-
export const fetchCaseTypesHydra = (dispatch, isSecureSupport) => __awaiter(void 0, void 0, void 0, function* () {
|
|
281
|
+
export const fetchCaseTypes = (dispatch, isSecureSupport) => __awaiter(void 0, void 0, void 0, function* () {
|
|
318
282
|
dispatch({
|
|
319
283
|
type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
320
284
|
payload: { allCaseTypes: getApiResourceObject([], true) },
|
|
@@ -333,29 +297,7 @@ export const fetchCaseTypesHydra = (dispatch, isSecureSupport) => __awaiter(void
|
|
|
333
297
|
});
|
|
334
298
|
}
|
|
335
299
|
});
|
|
336
|
-
export const fetchCaseSeverities = (dispatch,
|
|
337
|
-
var _a;
|
|
338
|
-
dispatch({
|
|
339
|
-
type: GlobalMetadataReducerConstants.setCaseSeverities,
|
|
340
|
-
payload: { allCaseSeverities: getApiResourceObject([], true) },
|
|
341
|
-
});
|
|
342
|
-
try {
|
|
343
|
-
yield fetchCaseRecordTypes(dispatch, apolloClient);
|
|
344
|
-
const picklists = yield fetchPicklistValues(apolloClient, buildPicklistInput(['Priority']));
|
|
345
|
-
const allCaseSeverities = [...((_a = picklists.Priority) !== null && _a !== void 0 ? _a : [])].sort((sevA, sevB) => severitySort(sevA, sevB));
|
|
346
|
-
dispatch({
|
|
347
|
-
type: GlobalMetadataReducerConstants.setCaseSeverities,
|
|
348
|
-
payload: { allCaseSeverities: getApiResourceObject(allCaseSeverities) },
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
catch (e) {
|
|
352
|
-
dispatch({
|
|
353
|
-
type: GlobalMetadataReducerConstants.setCaseSeverities,
|
|
354
|
-
payload: { allCaseSeverities: getApiResourceObject([], false, true, e.message) },
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
export const fetchCaseSeveritiesHydra = (dispatch, isSecureSupport) => __awaiter(void 0, void 0, void 0, function* () {
|
|
300
|
+
export const fetchCaseSeverities = (dispatch, isSecureSupport) => __awaiter(void 0, void 0, void 0, function* () {
|
|
359
301
|
dispatch({
|
|
360
302
|
type: GlobalMetadataReducerConstants.setCaseSeverities,
|
|
361
303
|
payload: { allCaseSeverities: getApiResourceObject([], true) },
|
|
@@ -375,71 +317,16 @@ export const fetchCaseSeveritiesHydra = (dispatch, isSecureSupport) => __awaiter
|
|
|
375
317
|
});
|
|
376
318
|
}
|
|
377
319
|
});
|
|
378
|
-
|
|
379
|
-
const CaseDetailsFetchActions = {
|
|
380
|
-
requestCaseDetails: 'requestCaseDetails',
|
|
381
|
-
receivedCaseDetails: 'receivedCaseDetails',
|
|
382
|
-
receivedCaseDetailsError: 'receivedCaseDetailsError',
|
|
383
|
-
};
|
|
384
|
-
export const fetchCaseDetails = (caseDispatch_1, apolloClient_1, caseNumber_1, setCaseAccountNumber_1, ...args_1) => __awaiter(void 0, [caseDispatch_1, apolloClient_1, caseNumber_1, setCaseAccountNumber_1, ...args_1], void 0, function* (caseDispatch, apolloClient, caseNumber, setCaseAccountNumber, includeSecureSupport = false) {
|
|
385
|
-
var _a, _b;
|
|
386
|
-
caseDispatch({
|
|
387
|
-
type: CaseDetailsFetchActions.requestCaseDetails,
|
|
388
|
-
payload: { caseDetails: { caseNumber } },
|
|
389
|
-
});
|
|
390
|
-
try {
|
|
391
|
-
const graphqlCaseDetails = yield fetchCaseDetailsByCaseNumber(apolloClient, caseNumber, includeSecureSupport);
|
|
392
|
-
if (!graphqlCaseDetails) {
|
|
393
|
-
throw new Error('You don’t have permission to access this case. Please contact your administrator if you believe you should have access.');
|
|
394
|
-
}
|
|
395
|
-
if (isCssRestrictedAccess(graphqlCaseDetails.accessRestriction)) {
|
|
396
|
-
caseDispatch({
|
|
397
|
-
type: CaseDetailsFetchActions.receivedCaseDetailsError,
|
|
398
|
-
payload: {
|
|
399
|
-
caseDetailsError: {
|
|
400
|
-
status: 403,
|
|
401
|
-
detailMessage: CSS_ACCESS_RESTRICTION_ERROR_DETAIL,
|
|
402
|
-
message: CSS_ACCESS_RESTRICTION_ERROR_DETAIL,
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
});
|
|
406
|
-
return undefined;
|
|
407
|
-
}
|
|
408
|
-
const phoneToUse = graphqlCaseDetails.suppliedPhone || graphqlCaseDetails.contactPhone;
|
|
409
|
-
const caseDetails = Object.assign(Object.assign({}, mapGraphQLCaseDetailsToCasePayload(graphqlCaseDetails)), mapGraphQLContactPhoneToCasePhoneFields(phoneToUse, (phone) => {
|
|
410
|
-
const { countryCode, phoneLine } = getPhoneObj(phone);
|
|
411
|
-
return { countryCode, phoneLine: phoneLine || '' };
|
|
412
|
-
}));
|
|
413
|
-
const ownerFromGraphQL = mapGraphQLCaseContactToOwnerState(graphqlCaseDetails);
|
|
414
|
-
caseDispatch({
|
|
415
|
-
type: CaseDetailsFetchActions.receivedCaseDetails,
|
|
416
|
-
payload: Object.assign(Object.assign({ caseDetails }, (ownerFromGraphQL ? { selectedOwner: getApiResourceObject(ownerFromGraphQL) } : {})), { isClosed: (_a = graphqlCaseDetails.isClosed) !== null && _a !== void 0 ? _a : ((_b = graphqlCaseDetails.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'closed', caseNoOfCreatedCase: caseNumber }),
|
|
417
|
-
});
|
|
418
|
-
if (setCaseAccountNumber) {
|
|
419
|
-
yield setCaseAccountNumber(caseDispatch, graphqlCaseDetails.accountNumberRef, false, {}, apolloClient);
|
|
420
|
-
}
|
|
421
|
-
return caseDetails;
|
|
422
|
-
}
|
|
423
|
-
catch (error) {
|
|
424
|
-
caseDispatch({
|
|
425
|
-
type: CaseDetailsFetchActions.receivedCaseDetailsError,
|
|
426
|
-
payload: { caseDetailsError: error },
|
|
427
|
-
});
|
|
428
|
-
return undefined;
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
export const fetchAllStatuses = (dispatch, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
432
|
-
var _a;
|
|
320
|
+
export const fetchAllStatuses = (dispatch, isSecureSupport) => __awaiter(void 0, void 0, void 0, function* () {
|
|
433
321
|
dispatch({
|
|
434
322
|
type: GlobalMetadataReducerConstants.setCaseStatuses,
|
|
435
323
|
payload: { allCaseStatuses: getApiResourceObject([], true) },
|
|
436
324
|
});
|
|
437
325
|
try {
|
|
438
|
-
const
|
|
439
|
-
const allCaseStatuses = (_a = picklists.Status) !== null && _a !== void 0 ? _a : [];
|
|
326
|
+
const caseStatusesResponse = yield caseMetadata.getStatuses(isSecureSupport);
|
|
440
327
|
dispatch({
|
|
441
328
|
type: GlobalMetadataReducerConstants.setCaseStatuses,
|
|
442
|
-
payload: { allCaseStatuses: getApiResourceObject(
|
|
329
|
+
payload: { allCaseStatuses: getApiResourceObject(caseStatusesResponse.items) },
|
|
443
330
|
});
|
|
444
331
|
}
|
|
445
332
|
catch (e) {
|
|
@@ -449,26 +336,25 @@ export const fetchAllStatuses = (dispatch, apolloClient) => __awaiter(void 0, vo
|
|
|
449
336
|
});
|
|
450
337
|
}
|
|
451
338
|
});
|
|
452
|
-
export const fetchProducts = (
|
|
453
|
-
var _a, _b, _c, _d;
|
|
339
|
+
export const fetchProducts = (dispatch_1, ownerSSOUsername_1, ...args_1) => __awaiter(void 0, [dispatch_1, ownerSSOUsername_1, ...args_1], void 0, function* (dispatch, ownerSSOUsername, params = {}) {
|
|
454
340
|
try {
|
|
455
341
|
dispatch({
|
|
456
342
|
type: GlobalMetadataReducerConstants.setAllProducts,
|
|
457
343
|
payload: { allProducts: getApiResourceObject(initialProductResponse, true) },
|
|
458
344
|
});
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
345
|
+
/**
|
|
346
|
+
* Here we are trying to fetch products from two sources (getSEProductsList and getProducts) and if even first source (getSEProductsList) fail to deliver product information
|
|
347
|
+
* we still need to use second source (getProducts) to parse and list product
|
|
348
|
+
*/
|
|
349
|
+
const response = yield Promise.allSettled([
|
|
350
|
+
products.getSEProductsList(params),
|
|
351
|
+
products.getProducts(ownerSSOUsername),
|
|
352
|
+
]);
|
|
353
|
+
const productsResultAll = response[0].status === 'fulfilled' ? response[0].value : [];
|
|
354
|
+
const productsResultEntitled = response[1].status === 'fulfilled' ? response[1].value : [];
|
|
355
|
+
const allProducts = productsResultAll.length
|
|
356
|
+
? handleProductSearchResponse(productsResultAll, productsResultEntitled)
|
|
357
|
+
: handleEntitledProductResponse(productsResultEntitled);
|
|
472
358
|
dispatch({
|
|
473
359
|
type: GlobalMetadataReducerConstants.setAllProducts,
|
|
474
360
|
payload: { allProducts: getApiResourceObject(allProducts) },
|
|
@@ -481,63 +367,18 @@ export const fetchProducts = (dispatch, apolloClient) => __awaiter(void 0, void
|
|
|
481
367
|
});
|
|
482
368
|
}
|
|
483
369
|
});
|
|
484
|
-
export const fetchCaseRecordTypes = (dispatch, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
485
|
-
if (getTechnicalSupportRecordTypeId()) {
|
|
486
|
-
const cached = getCaseRecordTypes();
|
|
487
|
-
dispatch({
|
|
488
|
-
type: GlobalMetadataReducerConstants.setCaseRecordTypes,
|
|
489
|
-
payload: { caseRecordTypes: getApiResourceObject(cached) },
|
|
490
|
-
});
|
|
491
|
-
return cached;
|
|
492
|
-
}
|
|
493
|
-
return beginCaseRecordTypesLoad(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
494
|
-
var _a, _b, _c, _d;
|
|
495
|
-
dispatch({
|
|
496
|
-
type: GlobalMetadataReducerConstants.setCaseRecordTypes,
|
|
497
|
-
payload: { caseRecordTypes: getApiResourceObject({}, true) },
|
|
498
|
-
});
|
|
499
|
-
try {
|
|
500
|
-
const { data } = yield apolloClient.query({
|
|
501
|
-
query: GET_CASE_RECORD_TYPES,
|
|
502
|
-
});
|
|
503
|
-
const recordTypeInfos = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.objectInfos) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.recordTypeInfos) !== null && _d !== void 0 ? _d : [];
|
|
504
|
-
const caseRecordTypes = {};
|
|
505
|
-
recordTypeInfos.forEach((info) => {
|
|
506
|
-
caseRecordTypes[info.name] = info.recordTypeId;
|
|
507
|
-
});
|
|
508
|
-
setCaseRecordTypes(caseRecordTypes);
|
|
509
|
-
dispatch({
|
|
510
|
-
type: GlobalMetadataReducerConstants.setCaseRecordTypes,
|
|
511
|
-
payload: { caseRecordTypes: getApiResourceObject(caseRecordTypes) },
|
|
512
|
-
});
|
|
513
|
-
return caseRecordTypes;
|
|
514
|
-
}
|
|
515
|
-
catch (e) {
|
|
516
|
-
dispatch({
|
|
517
|
-
type: GlobalMetadataReducerConstants.setCaseRecordTypes,
|
|
518
|
-
payload: { caseRecordTypes: getApiResourceObject({}, false, true, e.message) },
|
|
519
|
-
});
|
|
520
|
-
throw e;
|
|
521
|
-
}
|
|
522
|
-
}));
|
|
523
|
-
});
|
|
524
370
|
export const setAllProducts = (dispatch, allProducts) => {
|
|
525
371
|
dispatch({
|
|
526
372
|
type: GlobalMetadataReducerConstants.setAllProducts,
|
|
527
373
|
payload: { allProducts: getApiResourceObject(allProducts) },
|
|
528
374
|
});
|
|
529
375
|
};
|
|
530
|
-
export const fetchLoggedInUsersAccount = (dispatch_1, token_1, ...args_1) => __awaiter(void 0, [dispatch_1, token_1, ...args_1], void 0, function* (dispatch, token, silent = false
|
|
531
|
-
var _a
|
|
376
|
+
export const fetchLoggedInUsersAccount = (dispatch_1, token_1, ...args_1) => __awaiter(void 0, [dispatch_1, token_1, ...args_1], void 0, function* (dispatch, token, silent = false) {
|
|
377
|
+
var _a;
|
|
532
378
|
let accountNumber = token.account_number;
|
|
533
379
|
if (silent) {
|
|
534
380
|
try {
|
|
535
|
-
const
|
|
536
|
-
query: GET_ACCOUNT,
|
|
537
|
-
variables: getAccountQueryVariables(accountNumber),
|
|
538
|
-
});
|
|
539
|
-
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
540
|
-
const loggedInUsersAccount = handleGraphQLAccountResponse(edges);
|
|
381
|
+
const loggedInUsersAccount = yield accounts.getAccount(accountNumber);
|
|
541
382
|
dispatch({
|
|
542
383
|
type: GlobalMetadataReducerConstants.setLoggedInUsersAccount,
|
|
543
384
|
payload: { loggedInUsersAccount: getApiResourceObject(loggedInUsersAccount) },
|
|
@@ -553,13 +394,7 @@ export const fetchLoggedInUsersAccount = (dispatch_1, token_1, ...args_1) => __a
|
|
|
553
394
|
type: GlobalMetadataReducerConstants.setLoggedInUsersAccount,
|
|
554
395
|
payload: { loggedInUsersAccount: getApiResourceObject({}, true) },
|
|
555
396
|
});
|
|
556
|
-
const
|
|
557
|
-
query: GET_ACCOUNT,
|
|
558
|
-
variables: getAccountQueryVariables(accountNumber),
|
|
559
|
-
fetchPolicy: 'network-only',
|
|
560
|
-
});
|
|
561
|
-
const edges = (_h = (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _e === void 0 ? void 0 : _e.query) === null || _f === void 0 ? void 0 : _f.RedHatSupportAccount) === null || _g === void 0 ? void 0 : _g.edges) !== null && _h !== void 0 ? _h : [];
|
|
562
|
-
const loggedInUsersAccount = handleGraphQLAccountResponse(edges);
|
|
397
|
+
const loggedInUsersAccount = yield accounts.getAccount(accountNumber);
|
|
563
398
|
dispatch({
|
|
564
399
|
type: GlobalMetadataReducerConstants.setLoggedInUsersAccount,
|
|
565
400
|
payload: { loggedInUsersAccount: getApiResourceObject(loggedInUsersAccount) },
|
|
@@ -567,7 +402,7 @@ export const fetchLoggedInUsersAccount = (dispatch_1, token_1, ...args_1) => __a
|
|
|
567
402
|
return loggedInUsersAccount;
|
|
568
403
|
}
|
|
569
404
|
catch (e) {
|
|
570
|
-
(
|
|
405
|
+
(_a = window.sessionjs) === null || _a === void 0 ? void 0 : _a.reportProblem(e, {
|
|
571
406
|
tags: {
|
|
572
407
|
portal_app: window.app || 'Portal Case Management',
|
|
573
408
|
error_effect: 'PCM - App wide error',
|
|
@@ -577,30 +412,27 @@ export const fetchLoggedInUsersAccount = (dispatch_1, token_1, ...args_1) => __a
|
|
|
577
412
|
});
|
|
578
413
|
dispatch({
|
|
579
414
|
type: GlobalMetadataReducerConstants.setLoggedInUsersAccount,
|
|
580
|
-
payload: {
|
|
581
|
-
loggedInUsersAccount: getApiResourceObject({}, false, true, e === null || e === void 0 ? void 0 : e.message, e),
|
|
582
|
-
},
|
|
415
|
+
payload: { loggedInUsersAccount: getApiResourceObject({}, false, true, e === null || e === void 0 ? void 0 : e.message, e) },
|
|
583
416
|
});
|
|
584
417
|
}
|
|
585
418
|
}
|
|
586
419
|
});
|
|
587
|
-
export const fetchLoggedInUser = (dispatch, token, pcmConfig
|
|
420
|
+
export const fetchLoggedInUser = (dispatch, token, pcmConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
588
421
|
var _a;
|
|
589
422
|
try {
|
|
590
423
|
dispatch({
|
|
591
424
|
type: GlobalMetadataReducerConstants.setLoggedInUser,
|
|
592
425
|
payload: { loggedInUser: getApiResourceObject({}, true) },
|
|
593
426
|
});
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
const loggedInUser = yield fetchLoggedInUserFromGraphQL(apolloClient, ssoUsername);
|
|
427
|
+
let loggedInUser = yield contacts.getCurrentContact({
|
|
428
|
+
userId: token.sub,
|
|
429
|
+
assumeEntitledIfSubscriptionServiceUnavailable: true,
|
|
430
|
+
});
|
|
599
431
|
dispatch({
|
|
600
432
|
type: GlobalMetadataReducerConstants.setLoggedInUser,
|
|
601
433
|
payload: { loggedInUser: getApiResourceObject(loggedInUser) },
|
|
602
434
|
});
|
|
603
|
-
//
|
|
435
|
+
// Saving bookmarked accounts separately.
|
|
604
436
|
const canViewBookmarkAccounts = loggedInUser.isInternal;
|
|
605
437
|
if (canViewBookmarkAccounts) {
|
|
606
438
|
fetchBookmarkedGroupAccounts(dispatch, loggedInUser.ssoUsername);
|
|
@@ -623,19 +455,16 @@ export const fetchLoggedInUser = (dispatch, token, pcmConfig, apolloClient) => _
|
|
|
623
455
|
});
|
|
624
456
|
}
|
|
625
457
|
});
|
|
626
|
-
export const fetchLanguageMetadata = (dispatch
|
|
627
|
-
var _a;
|
|
628
|
-
dispatch({
|
|
629
|
-
type: GlobalMetadataReducerConstants.setCaseLanguages,
|
|
630
|
-
payload: { caseLanguages: getApiResourceObject([], true) },
|
|
631
|
-
});
|
|
458
|
+
export const fetchLanguageMetadata = (dispatch) => __awaiter(void 0, void 0, void 0, function* () {
|
|
632
459
|
try {
|
|
633
|
-
yield fetchCaseRecordTypes(dispatch, apolloClient);
|
|
634
|
-
const picklists = yield fetchPicklistValues(apolloClient, buildPicklistInput(['Language']));
|
|
635
|
-
const caseLanguages = (_a = picklists.Language) !== null && _a !== void 0 ? _a : [];
|
|
636
460
|
dispatch({
|
|
637
461
|
type: GlobalMetadataReducerConstants.setCaseLanguages,
|
|
638
|
-
payload: { caseLanguages: getApiResourceObject(
|
|
462
|
+
payload: { caseLanguages: getApiResourceObject([], true) },
|
|
463
|
+
});
|
|
464
|
+
const response = yield caseMetadata.getLanguagesMetadata();
|
|
465
|
+
dispatch({
|
|
466
|
+
type: GlobalMetadataReducerConstants.setCaseLanguages,
|
|
467
|
+
payload: { caseLanguages: getApiResourceObject(response.items) },
|
|
639
468
|
});
|
|
640
469
|
}
|
|
641
470
|
catch (e) {
|
|
@@ -683,59 +512,58 @@ export const fetchCaseSbrsMetadata = (dispatch) => __awaiter(void 0, void 0, voi
|
|
|
683
512
|
});
|
|
684
513
|
}
|
|
685
514
|
});
|
|
686
|
-
export const fetchCaseGroupsForSSO = (dispatch,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
515
|
+
export const fetchCaseGroupsForSSO = (dispatch, ssoUserName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
516
|
+
try {
|
|
517
|
+
dispatch({
|
|
518
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
519
|
+
payload: { caseGroups: getApiResourceObject([], true) },
|
|
520
|
+
});
|
|
521
|
+
const response = yield publicApi.caseGroups.getCaseGroupsForSSO(ssoUserName);
|
|
522
|
+
(response || []).sort((a, b) => a.name.localeCompare(b.name));
|
|
523
|
+
dispatch({
|
|
524
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
525
|
+
payload: { caseGroups: getApiResourceObject(response, false) },
|
|
526
|
+
});
|
|
527
|
+
return response;
|
|
528
|
+
}
|
|
529
|
+
catch (e) {
|
|
530
|
+
dispatch({
|
|
531
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
532
|
+
payload: { caseGroups: getApiResourceObject([], false, true, e.message) },
|
|
533
|
+
});
|
|
534
|
+
}
|
|
691
535
|
});
|
|
692
|
-
|
|
693
|
-
const fetchCaseGroupsByAccountId = (dispatch, apolloClient, accountId, defaultCaseGroupId, contactId, isOrgAdmin) => __awaiter(void 0, void 0, void 0, function* () {
|
|
694
|
-
var _a, _b, _c, _d, _e, _f;
|
|
536
|
+
export const fetchCaseGroupsForAccount = (dispatch, accountNumber) => __awaiter(void 0, void 0, void 0, function* () {
|
|
695
537
|
try {
|
|
696
538
|
dispatch({
|
|
697
539
|
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
698
540
|
payload: { caseGroups: getApiResourceObject([], true) },
|
|
699
541
|
});
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
while (hasNextPage) {
|
|
705
|
-
const { data } = yield apolloClient.query({
|
|
706
|
-
query: GET_CASE_GROUP,
|
|
707
|
-
variables: Object.assign({ where: { Account__c: { eq: accountId } }, first: PAGE_SIZE }, (afterCursor ? { after: afterCursor } : {})),
|
|
708
|
-
fetchPolicy: 'network-only',
|
|
709
|
-
});
|
|
710
|
-
const connection = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCaseGroup__c;
|
|
711
|
-
const edges = (connection === null || connection === void 0 ? void 0 : connection.edges) || [];
|
|
712
|
-
allEdges = allEdges.concat(edges);
|
|
713
|
-
hasNextPage = (_d = (_c = connection === null || connection === void 0 ? void 0 : connection.pageInfo) === null || _c === void 0 ? void 0 : _c.hasNextPage) !== null && _d !== void 0 ? _d : false;
|
|
714
|
-
afterCursor = (_f = (_e = connection === null || connection === void 0 ? void 0 : connection.pageInfo) === null || _e === void 0 ? void 0 : _e.endCursor) !== null && _f !== void 0 ? _f : undefined;
|
|
715
|
-
}
|
|
716
|
-
const filteredEdges = contactId && isOrgAdmin === false
|
|
717
|
-
? allEdges.filter(({ node }) => {
|
|
718
|
-
var _a, _b;
|
|
719
|
-
return (_b = (_a = node.CaseGroupMembers__r) === null || _a === void 0 ? void 0 : _a.edges) === null || _b === void 0 ? void 0 : _b.some(({ node: member }) => { var _a; return ((_a = member.Contact__c) === null || _a === void 0 ? void 0 : _a.value) === contactId; });
|
|
720
|
-
})
|
|
721
|
-
: allEdges;
|
|
722
|
-
const groups = filteredEdges.map(({ node }) => {
|
|
723
|
-
var _a;
|
|
724
|
-
return ({
|
|
725
|
-
groupNum: node.Id,
|
|
726
|
-
name: unescape((_a = node.Name.displayValue) !== null && _a !== void 0 ? _a : node.Name.value),
|
|
727
|
-
isPrivate: false,
|
|
728
|
-
isDefault: defaultCaseGroupId ? node.Id === defaultCaseGroupId : false,
|
|
729
|
-
defaultMembers: [],
|
|
730
|
-
members: [],
|
|
731
|
-
});
|
|
542
|
+
const response = yield publicApi.caseGroups.getCaseGroupsForInternalUser(accountNumber);
|
|
543
|
+
dispatch({
|
|
544
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
545
|
+
payload: { caseGroups: getApiResourceObject(response, false) },
|
|
732
546
|
});
|
|
733
|
-
|
|
547
|
+
return response;
|
|
548
|
+
}
|
|
549
|
+
catch (e) {
|
|
734
550
|
dispatch({
|
|
735
551
|
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
736
|
-
payload: { caseGroups: getApiResourceObject(
|
|
552
|
+
payload: { caseGroups: getApiResourceObject([], false, true, e.message) },
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
export const fetchCaseGroups = (dispatch) => __awaiter(void 0, void 0, void 0, function* () {
|
|
557
|
+
try {
|
|
558
|
+
dispatch({
|
|
559
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
560
|
+
payload: { caseGroups: getApiResourceObject([], true) },
|
|
561
|
+
});
|
|
562
|
+
const response = yield publicApi.caseGroups.getCaseGroups();
|
|
563
|
+
dispatch({
|
|
564
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
565
|
+
payload: { caseGroups: getApiResourceObject(response, false) },
|
|
737
566
|
});
|
|
738
|
-
return groups;
|
|
739
567
|
}
|
|
740
568
|
catch (e) {
|
|
741
569
|
dispatch({
|
|
@@ -1065,14 +893,10 @@ export const fetchNoClusterIdReasonsMetadata = (dispatch) => __awaiter(void 0, v
|
|
|
1065
893
|
});
|
|
1066
894
|
}
|
|
1067
895
|
});
|
|
1068
|
-
|
|
1069
|
-
export const setTraditionalSupportSessionAgreed = (dispatch, value) => {
|
|
896
|
+
export const updateCaseListTraditionalSupportAgreed = (dispatch, value) => {
|
|
1070
897
|
dispatch({
|
|
1071
|
-
type: GlobalMetadataReducerConstants.
|
|
1072
|
-
payload: {
|
|
1073
|
-
caseListTraditionalSupportAgreed: value,
|
|
1074
|
-
troubleshootTraditionalSupportAgreed: value,
|
|
1075
|
-
},
|
|
898
|
+
type: GlobalMetadataReducerConstants.setCaseListTraditionalSupportAgreed,
|
|
899
|
+
payload: { caseListTraditionalSupportAgreed: value },
|
|
1076
900
|
});
|
|
1077
901
|
};
|
|
1078
902
|
export const updateShareHostnameWithRHTState = (dispatch, loggedInUsersAccount, shareHostnameWithRHT) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/react-context",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.327",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"lib/**/*"
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@cee-eng/hydrajs": "^4.18.114",
|
|
25
|
+
"@cee-eng/hydrajs": "4.18.111",
|
|
27
26
|
"@patternfly/react-core": "6.2.1",
|
|
28
27
|
"@patternfly/react-icons": "6.2.1",
|
|
29
28
|
"i18next": "^23.15.0",
|
|
@@ -34,13 +33,13 @@
|
|
|
34
33
|
"react-test-renderer": "18.2.0"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
|
-
"@cee-eng/hydrajs": "
|
|
36
|
+
"@cee-eng/hydrajs": "4.18.111",
|
|
38
37
|
"@patternfly/react-core": "6.2.1",
|
|
39
38
|
"@patternfly/react-icons": "6.2.1",
|
|
40
|
-
"@rh-support/components": "2.5.
|
|
39
|
+
"@rh-support/components": "2.5.231",
|
|
41
40
|
"@rh-support/types": "2.0.26",
|
|
42
|
-
"@rh-support/user-permissions": "2.5.
|
|
43
|
-
"@rh-support/utils": "2.5.
|
|
41
|
+
"@rh-support/user-permissions": "2.5.170",
|
|
42
|
+
"@rh-support/utils": "2.5.149",
|
|
44
43
|
"i18next": "^23.15.0",
|
|
45
44
|
"localforage": "^1.10.0",
|
|
46
45
|
"lodash": "^4.17.21",
|
|
@@ -51,8 +50,6 @@
|
|
|
51
50
|
"react-test-renderer": "18.2.0"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
|
-
"@patternfly/react-styles": "^6.2.1",
|
|
55
|
-
"@patternfly/react-tokens": "^6.2.1",
|
|
56
53
|
"@testing-library/jest-dom": "^6.2.0",
|
|
57
54
|
"@testing-library/react": "^14.1.2",
|
|
58
55
|
"@testing-library/react-hooks": "^5.1.2",
|
|
@@ -92,5 +89,5 @@
|
|
|
92
89
|
"defaults and supports es6-module",
|
|
93
90
|
"maintained node versions"
|
|
94
91
|
],
|
|
95
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "a4db33129a9d9f0d6a6907d1c48df34784e57021"
|
|
96
93
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
export declare const CaseStatusContext: React.Context<string>;
|
|
3
|
-
interface CaseStatusProviderProps {
|
|
4
|
-
caseStatus?: string;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare function CaseStatusProvider({ caseStatus, children }: CaseStatusProviderProps): React.JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=CaseStatusContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseStatusContext.d.ts","sourceRoot":"","sources":["../../../src/context/CaseStatusContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAExD,eAAO,MAAM,iBAAiB,uBAA+C,CAAC;AAE9E,UAAU,uBAAuB;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,uBAAuB,qBAEnF"}
|