@rh-support/react-context 2.5.286 → 2.5.288
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.map +1 -1
- package/lib/esm/GlobalContextWrapper.js +9 -5
- package/lib/esm/reducers/GlobalMetadataReducer.d.ts +9 -14
- package/lib/esm/reducers/GlobalMetadataReducer.d.ts.map +1 -1
- package/lib/esm/reducers/GlobalMetadataReducer.js +14 -75
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalContextWrapper.d.ts","sourceRoot":"","sources":["../../src/GlobalContextWrapper.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAenD,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACzC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,yBAAyB,EAAE,GAAG,CAAC;KAClC;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;
|
|
1
|
+
{"version":3,"file":"GlobalContextWrapper.d.ts","sourceRoot":"","sources":["../../src/GlobalContextWrapper.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAenD,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACzC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,yBAAyB,EAAE,GAAG,CAAC;KAClC;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AAgHD,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,sBAKjD,CAAC"}
|
|
@@ -37,15 +37,19 @@ function GlobalContextMetadataWrapper() {
|
|
|
37
37
|
});
|
|
38
38
|
init();
|
|
39
39
|
}, []);
|
|
40
|
-
const loadGlobalMetadata = (loggedInUserJwtToken) => {
|
|
40
|
+
const loadGlobalMetadata = (loggedInUserJwtToken) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b;
|
|
41
42
|
setLoggedInUserJwtToken(dispatchToGlobalMetadataReducer, loggedInUserJwtToken);
|
|
42
43
|
fetchCaseRecordTypes(dispatchToGlobalMetadataReducer, apolloClient);
|
|
43
44
|
/**
|
|
44
45
|
* Even GS4 users can use strata's normal user and account endpoints and thus fetching them before hand. This improves the load time by 4 seconds
|
|
45
46
|
*/
|
|
46
|
-
loadPCMConfig(dispatchToGlobalMetadataReducer)
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
loadPCMConfig(dispatchToGlobalMetadataReducer);
|
|
48
|
+
const encodedJwt = (_b = (_a = window.sessionjs) === null || _a === void 0 ? void 0 : _a.getEncodedToken) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
49
|
+
if (encodedJwt) {
|
|
50
|
+
yield fetchAndSetSalesforceToken(encodedJwt);
|
|
51
|
+
}
|
|
52
|
+
fetchLoggedInUser(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, null, apolloClient);
|
|
49
53
|
fetchUserPreferences(dispatchToGlobalMetadataReducer, loggedInUserJwtToken);
|
|
50
54
|
fetchManagedAccounts(dispatchToGlobalMetadataReducer, loggedInUserJwtToken);
|
|
51
55
|
fetchAccountManagers(dispatchToGlobalMetadataReducer, loggedInUserJwtToken);
|
|
@@ -57,7 +61,7 @@ function GlobalContextMetadataWrapper() {
|
|
|
57
61
|
element && element.classList.add('support-secured');
|
|
58
62
|
}
|
|
59
63
|
});
|
|
60
|
-
};
|
|
64
|
+
});
|
|
61
65
|
useEffect(() => {
|
|
62
66
|
const loggedInUserJwtToken = window.sessionjs.getToken();
|
|
63
67
|
const getAccountNumber = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -7,7 +7,7 @@ import { IPreference } from '@cee-eng/hydrajs/@types/models/general';
|
|
|
7
7
|
import { IConfigurationResponse } from '@cee-eng/hydrajs/@types/models/maintenance';
|
|
8
8
|
import { IAction, IApiResponseDetails, IPortalJwtToken } from '@rh-support/types/shared';
|
|
9
9
|
import { UserAuth } from '@rh-support/user-permissions';
|
|
10
|
-
import { ITroubleshootProductResponse } from '@rh-support/utils';
|
|
10
|
+
import { ApolloQueryClient, IGraphQLAccountResult, ITroubleshootProductResponse } from '@rh-support/utils';
|
|
11
11
|
import { MutableRefObject } from 'react';
|
|
12
12
|
export declare enum UserPreferencesKeys {
|
|
13
13
|
caseSavedSearchFilters = "PCM-CaseSavedSearchFilters",
|
|
@@ -107,7 +107,7 @@ export interface IGlobalMetadataState {
|
|
|
107
107
|
allCaseSeverities: IApiResponseDetails<ICaseSeverity[]>;
|
|
108
108
|
allCaseStatuses: IApiResponseDetails<ICaseStatus[]>;
|
|
109
109
|
allProducts: IApiResponseDetails<ITroubleshootProductResponse>;
|
|
110
|
-
loggedInUsersAccount: IApiResponseDetails<
|
|
110
|
+
loggedInUsersAccount: IApiResponseDetails<IGraphQLAccountResult>;
|
|
111
111
|
loggedInUsersAccountNumber: IApiResponseDetails<string>;
|
|
112
112
|
loggedInUser: IApiResponseDetails<Partial<ISsoContact>>;
|
|
113
113
|
loggedInUserJwtToken: Partial<IPortalJwtToken>;
|
|
@@ -177,22 +177,17 @@ export declare const fetchCaseRecordTypes: (dispatch: GlobalMetadataReducerDispa
|
|
|
177
177
|
export declare const setAllProducts: (dispatch: GlobalMetadataReducerDispatchType, allProducts: ITroubleshootProductResponse) => void;
|
|
178
178
|
export declare const fetchLoggedInUsersAccount: (dispatch: GlobalMetadataReducerDispatchType, token: Partial<IPortalJwtToken>, silent?: boolean, apolloClient?: {
|
|
179
179
|
query: (options: any) => Promise<any>;
|
|
180
|
-
}) => Promise<
|
|
181
|
-
export declare const fetchLoggedInUser: (dispatch: GlobalMetadataReducerDispatchType, token: Partial<IPortalJwtToken>, pcmConfig: any
|
|
180
|
+
}) => Promise<IGraphQLAccountResult>;
|
|
181
|
+
export declare const fetchLoggedInUser: (dispatch: GlobalMetadataReducerDispatchType, token: Partial<IPortalJwtToken>, pcmConfig: any, apolloClient?: {
|
|
182
|
+
query: (options: any) => Promise<any>;
|
|
183
|
+
}) => Promise<void>;
|
|
182
184
|
export declare const fetchLanguageMetadata: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: {
|
|
183
185
|
query: (options: any) => Promise<any>;
|
|
184
186
|
}) => Promise<void>;
|
|
185
187
|
export declare const fetchInternalStatusMetadata: (dispatch: GlobalMetadataReducerDispatchType) => Promise<void>;
|
|
186
188
|
export declare const fetchCaseSbrsMetadata: (dispatch: GlobalMetadataReducerDispatchType) => Promise<void>;
|
|
187
|
-
export declare const fetchCaseGroupsForSSO: (dispatch: GlobalMetadataReducerDispatchType,
|
|
188
|
-
|
|
189
|
-
}, accountId?: string, defaultCaseGroupId?: string | null) => Promise<ICaseGroup[]>;
|
|
190
|
-
export declare const fetchCaseGroupsForAccount: (dispatch: GlobalMetadataReducerDispatchType, accountNumber: string, apolloClient?: {
|
|
191
|
-
query: (options: any) => Promise<any>;
|
|
192
|
-
}, accountId?: string, defaultCaseGroupId?: string | null) => Promise<ICaseGroup[]>;
|
|
193
|
-
export declare const fetchCaseGroups: (dispatch: GlobalMetadataReducerDispatchType, apolloClient?: {
|
|
194
|
-
query: (options: any) => Promise<any>;
|
|
195
|
-
}, accountId?: string, defaultCaseGroupId?: string | null) => Promise<ICaseGroup[]>;
|
|
189
|
+
export declare const fetchCaseGroupsForSSO: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: ApolloQueryClient, accountId: string, defaultCaseGroupId?: string | null) => Promise<ICaseGroup[]>;
|
|
190
|
+
export declare const fetchCaseGroupsForAccount: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: ApolloQueryClient, accountId: string, defaultCaseGroupId?: string | null) => Promise<ICaseGroup[]>;
|
|
196
191
|
export declare const setCaseGroups: (dispatch: GlobalMetadataReducerDispatchType, groups: ICaseGroup[]) => void;
|
|
197
192
|
export declare const setLoggedInUserJwtToken: (dispatch: GlobalMetadataReducerDispatchType, loggedInUserJwtToken: Partial<IPortalJwtToken>) => void;
|
|
198
193
|
export declare const loadPCMConfig: (dispatch: GlobalMetadataReducerDispatchType) => Promise<IConfigurationResponse>;
|
|
@@ -213,6 +208,6 @@ export declare const fetchAccountCustomEmails: (dispatch: GlobalMetadataReducerD
|
|
|
213
208
|
export declare const setAccountCustomEmails: (dispatch: GlobalMetadataReducerDispatchType, accountCustomEmails: IAccountNotificationAddresses[]) => void;
|
|
214
209
|
export declare const fetchNoClusterIdReasonsMetadata: (dispatch: GlobalMetadataReducerDispatchType) => Promise<void>;
|
|
215
210
|
export declare const updateCaseListTraditionalSupportAgreed: (dispatch: GlobalMetadataReducerDispatchType, value: boolean) => void;
|
|
216
|
-
export declare const updateShareHostnameWithRHTState: (dispatch: GlobalMetadataReducerDispatchType, loggedInUsersAccount:
|
|
211
|
+
export declare const updateShareHostnameWithRHTState: (dispatch: GlobalMetadataReducerDispatchType, loggedInUsersAccount: IGraphQLAccountResult, shareHostnameWithRHT: boolean) => void;
|
|
217
212
|
export {};
|
|
218
213
|
//# sourceMappingURL=GlobalMetadataReducer.d.ts.map
|
|
@@ -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/GlobalMetadataReduc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M,+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,qBAAqB,EAC3C,sBAAsB,OAAO,SAMhC,CAAC"}
|
|
@@ -7,9 +7,9 @@ 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,
|
|
10
|
+
import { accounts, caseMetadata, customEmail, maintenance, publicApi, userPreferences } from '@cee-eng/hydrajs';
|
|
11
11
|
import { getPhoneObj } from '@rh-support/components';
|
|
12
|
-
import { buildPicklistInput, CSS_ACCESS_RESTRICTION_ERROR_DETAIL, fetchCaseDetailsByCaseNumber, fetchPicklistValues, GET_ACCOUNT, GET_CASE_GROUP, GET_CASE_RECORD_TYPES, GET_PRODUCTS, getAccountQueryVariables, getApiResourceObject, handleGraphQLAccountResponse, handleGraphQLProductsResponse, isCssRestrictedAccess, mapGraphQLCaseContactToOwnerState, mapGraphQLCaseDetailsToCasePayload, mapGraphQLContactPhoneToCasePhoneFields, setCaseRecordTypes, severitySort, } from '@rh-support/utils';
|
|
12
|
+
import { buildPicklistInput, CSS_ACCESS_RESTRICTION_ERROR_DETAIL, fetchCaseDetailsByCaseNumber, fetchLoggedInUserFromGraphQL, fetchPicklistValues, GET_ACCOUNT, GET_CASE_GROUP, GET_CASE_RECORD_TYPES, GET_PRODUCTS, getAccountQueryVariables, getApiResourceObject, handleGraphQLAccountResponse, handleGraphQLProductsResponse, isCssRestrictedAccess, mapGraphQLCaseContactToOwnerState, mapGraphQLCaseDetailsToCasePayload, mapGraphQLContactPhoneToCasePhoneFields, setCaseRecordTypes, severitySort, } from '@rh-support/utils';
|
|
13
13
|
import differenceBy from 'lodash/differenceBy';
|
|
14
14
|
import filter from 'lodash/filter';
|
|
15
15
|
import find from 'lodash/find';
|
|
@@ -561,22 +561,24 @@ export const fetchLoggedInUsersAccount = (dispatch_1, token_1, ...args_1) => __a
|
|
|
561
561
|
});
|
|
562
562
|
dispatch({
|
|
563
563
|
type: GlobalMetadataReducerConstants.setLoggedInUsersAccount,
|
|
564
|
-
payload: {
|
|
564
|
+
payload: {
|
|
565
|
+
loggedInUsersAccount: getApiResourceObject({}, false, true, e === null || e === void 0 ? void 0 : e.message, e),
|
|
566
|
+
},
|
|
565
567
|
});
|
|
566
568
|
}
|
|
567
569
|
}
|
|
568
570
|
});
|
|
569
|
-
export const fetchLoggedInUser = (dispatch, token, pcmConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
571
|
+
export const fetchLoggedInUser = (dispatch, token, pcmConfig, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
570
572
|
var _a;
|
|
571
573
|
try {
|
|
572
574
|
dispatch({
|
|
573
575
|
type: GlobalMetadataReducerConstants.setLoggedInUser,
|
|
574
576
|
payload: { loggedInUser: getApiResourceObject({}, true) },
|
|
575
577
|
});
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
578
|
+
if (!apolloClient) {
|
|
579
|
+
throw new Error('Apollo client is required to fetch logged-in user via GraphQL');
|
|
580
|
+
}
|
|
581
|
+
const loggedInUser = yield fetchLoggedInUserFromGraphQL(apolloClient);
|
|
580
582
|
dispatch({
|
|
581
583
|
type: GlobalMetadataReducerConstants.setLoggedInUser,
|
|
582
584
|
payload: { loggedInUser: getApiResourceObject(loggedInUser) },
|
|
@@ -663,74 +665,11 @@ export const fetchCaseSbrsMetadata = (dispatch) => __awaiter(void 0, void 0, voi
|
|
|
663
665
|
});
|
|
664
666
|
}
|
|
665
667
|
});
|
|
666
|
-
export const fetchCaseGroupsForSSO = (dispatch,
|
|
667
|
-
|
|
668
|
-
return fetchCaseGroupsByAccountId(dispatch, apolloClient, accountId, defaultCaseGroupId);
|
|
669
|
-
}
|
|
670
|
-
try {
|
|
671
|
-
dispatch({
|
|
672
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
673
|
-
payload: { caseGroups: getApiResourceObject([], true) },
|
|
674
|
-
});
|
|
675
|
-
const response = yield publicApi.caseGroups.getCaseGroupsForSSO(ssoUserName);
|
|
676
|
-
(response || []).sort((a, b) => a.name.localeCompare(b.name));
|
|
677
|
-
dispatch({
|
|
678
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
679
|
-
payload: { caseGroups: getApiResourceObject(response, false) },
|
|
680
|
-
});
|
|
681
|
-
return response;
|
|
682
|
-
}
|
|
683
|
-
catch (e) {
|
|
684
|
-
dispatch({
|
|
685
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
686
|
-
payload: { caseGroups: getApiResourceObject([], false, true, e.message) },
|
|
687
|
-
});
|
|
688
|
-
}
|
|
668
|
+
export const fetchCaseGroupsForSSO = (dispatch, apolloClient, accountId, defaultCaseGroupId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
669
|
+
return fetchCaseGroupsByAccountId(dispatch, apolloClient, accountId, defaultCaseGroupId);
|
|
689
670
|
});
|
|
690
|
-
export const fetchCaseGroupsForAccount = (dispatch,
|
|
691
|
-
|
|
692
|
-
return fetchCaseGroupsByAccountId(dispatch, apolloClient, accountId, defaultCaseGroupId);
|
|
693
|
-
}
|
|
694
|
-
try {
|
|
695
|
-
dispatch({
|
|
696
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
697
|
-
payload: { caseGroups: getApiResourceObject([], true) },
|
|
698
|
-
});
|
|
699
|
-
const response = yield publicApi.caseGroups.getCaseGroupsForInternalUser(accountNumber);
|
|
700
|
-
dispatch({
|
|
701
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
702
|
-
payload: { caseGroups: getApiResourceObject(response, false) },
|
|
703
|
-
});
|
|
704
|
-
return response;
|
|
705
|
-
}
|
|
706
|
-
catch (e) {
|
|
707
|
-
dispatch({
|
|
708
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
709
|
-
payload: { caseGroups: getApiResourceObject([], false, true, e.message) },
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
export const fetchCaseGroups = (dispatch, apolloClient, accountId, defaultCaseGroupId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
714
|
-
if (apolloClient && accountId) {
|
|
715
|
-
return fetchCaseGroupsByAccountId(dispatch, apolloClient, accountId, defaultCaseGroupId);
|
|
716
|
-
}
|
|
717
|
-
try {
|
|
718
|
-
dispatch({
|
|
719
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
720
|
-
payload: { caseGroups: getApiResourceObject([], true) },
|
|
721
|
-
});
|
|
722
|
-
const response = yield publicApi.caseGroups.getCaseGroups();
|
|
723
|
-
dispatch({
|
|
724
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
725
|
-
payload: { caseGroups: getApiResourceObject(response, false) },
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
catch (e) {
|
|
729
|
-
dispatch({
|
|
730
|
-
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
731
|
-
payload: { caseGroups: getApiResourceObject([], false, true, e.message) },
|
|
732
|
-
});
|
|
733
|
-
}
|
|
671
|
+
export const fetchCaseGroupsForAccount = (dispatch, apolloClient, accountId, defaultCaseGroupId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
672
|
+
return fetchCaseGroupsByAccountId(dispatch, apolloClient, accountId, defaultCaseGroupId);
|
|
734
673
|
});
|
|
735
674
|
/** Shared implementation that fetches case groups via GraphQL by Salesforce Account ID. */
|
|
736
675
|
const fetchCaseGroupsByAccountId = (dispatch, apolloClient, accountId, defaultCaseGroupId) => __awaiter(void 0, void 0, void 0, function* () {
|
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.288",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@cee-eng/hydrajs": "^4.18.113",
|
|
38
38
|
"@patternfly/react-core": "6.2.1",
|
|
39
39
|
"@patternfly/react-icons": "6.2.1",
|
|
40
|
-
"@rh-support/components": "2.5.
|
|
40
|
+
"@rh-support/components": "2.5.194",
|
|
41
41
|
"@rh-support/types": "2.0.26",
|
|
42
|
-
"@rh-support/user-permissions": "2.5.
|
|
43
|
-
"@rh-support/utils": "2.5.
|
|
42
|
+
"@rh-support/user-permissions": "2.5.140",
|
|
43
|
+
"@rh-support/utils": "2.5.122",
|
|
44
44
|
"i18next": "^23.15.0",
|
|
45
45
|
"localforage": "^1.10.0",
|
|
46
46
|
"lodash": "^4.17.21",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"defaults and supports es6-module",
|
|
91
91
|
"maintained node versions"
|
|
92
92
|
],
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "6166d112918583d5b9030b1e8cb1e7d2a27bcaa4"
|
|
94
94
|
}
|