@rh-support/react-context 2.5.256 → 2.5.260
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 +10 -4
- package/lib/esm/components/AccountSelector/AccountSelectorInternal.d.ts +0 -2
- package/lib/esm/components/AccountSelector/AccountSelectorInternal.d.ts.map +1 -1
- package/lib/esm/components/AccountSelector/AccountSelectorInternal.js +85 -42
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.d.ts.map +1 -1
- package/lib/esm/components/EmbeddedServiceChat/EmbeddedServiceChat.js +3 -1
- package/lib/esm/context/GlobalTranslationProvider.d.ts.map +1 -1
- package/lib/esm/context/GlobalTranslationProvider.js +1 -1
- package/lib/esm/hooks/useChatInit.d.ts.map +1 -1
- package/lib/esm/reducers/GlobalMetadataReducer.d.ts +32 -8
- package/lib/esm/reducers/GlobalMetadataReducer.d.ts.map +1 -1
- package/lib/esm/reducers/GlobalMetadataReducer.js +169 -37
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalContextWrapper.d.ts","sourceRoot":"","sources":["../../src/GlobalContextWrapper.tsx"],"names":[],"mappings":"
|
|
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,YAAY,EAAE,GAAG,CAAC;QAClB,UAAU,EAAE,GAAG,CAAC;QAChB,mBAAmB,EAAE,GAAG,CAAC;KAC5B;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;CACJ;AA2GD,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,sBAKjD,CAAC"}
|
|
@@ -7,17 +7,19 @@ 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 { useApolloClient } from '@apollo/client/react';
|
|
10
11
|
import { accounts, Config } from '@cee-eng/hydrajs';
|
|
11
12
|
import { LoginModal } from '@rh-support/components';
|
|
12
|
-
import { getApiResourceObject, setSecuredSupport, setStrataHeaders } from '@rh-support/utils';
|
|
13
|
+
import { fetchAndSetSalesforceToken, getApiResourceObject, setSecuredSupport, setStrataHeaders, } from '@rh-support/utils';
|
|
13
14
|
import isEmpty from 'lodash/isEmpty';
|
|
14
15
|
import React, { useEffect, useState } from 'react';
|
|
15
16
|
import { GlobalMetadataContextProvider, GlobalMetadataDispatchContext } from './context/GlobalMetadataContext';
|
|
16
|
-
import { fetchAccountManagers, fetchLoggedInUser, fetchLoggedInUsersAccount, fetchManagedAccounts, fetchUserPreferences, GlobalMetadataReducerConstants, loadPCMConfig, setLoggedInUserJwtToken, } from './reducers/GlobalMetadataReducer';
|
|
17
|
+
import { fetchAccountManagers, fetchCaseRecordTypes, fetchLoggedInUser, fetchLoggedInUsersAccount, fetchManagedAccounts, fetchUserPreferences, GlobalMetadataReducerConstants, loadPCMConfig, setLoggedInUserJwtToken, } from './reducers/GlobalMetadataReducer';
|
|
17
18
|
function GlobalContextMetadataWrapper() {
|
|
18
19
|
const [showReLoginModal, setShowReLoginModal] = useState(false);
|
|
19
20
|
const [showSessionExpiredModal, setShowSessionExpiredModal] = useState(false);
|
|
20
21
|
const dispatchToGlobalMetadataReducer = React.useContext(GlobalMetadataDispatchContext);
|
|
22
|
+
const apolloClient = useApolloClient();
|
|
21
23
|
// Configuring callbacks to show modals in case of auth logout or session expiry
|
|
22
24
|
useEffect(() => {
|
|
23
25
|
const init = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -29,13 +31,17 @@ function GlobalContextMetadataWrapper() {
|
|
|
29
31
|
setShowSessionExpiredModal(true);
|
|
30
32
|
}
|
|
31
33
|
}));
|
|
34
|
+
session.on('AuthRefreshSuccess', () => {
|
|
35
|
+
fetchAndSetSalesforceToken(window.sessionjs.getEncodedToken());
|
|
36
|
+
});
|
|
32
37
|
});
|
|
33
38
|
init();
|
|
34
39
|
}, []);
|
|
35
40
|
const loadGlobalMetadata = (loggedInUserJwtToken) => {
|
|
36
41
|
setLoggedInUserJwtToken(dispatchToGlobalMetadataReducer, loggedInUserJwtToken);
|
|
42
|
+
fetchCaseRecordTypes(dispatchToGlobalMetadataReducer, apolloClient);
|
|
37
43
|
/**
|
|
38
|
-
* Even GS4 users can use strata's normal user and
|
|
44
|
+
* 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
|
|
39
45
|
*/
|
|
40
46
|
loadPCMConfig(dispatchToGlobalMetadataReducer).then((pcmConfig) => {
|
|
41
47
|
fetchLoggedInUser(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, pcmConfig);
|
|
@@ -43,7 +49,7 @@ function GlobalContextMetadataWrapper() {
|
|
|
43
49
|
fetchUserPreferences(dispatchToGlobalMetadataReducer, loggedInUserJwtToken);
|
|
44
50
|
fetchManagedAccounts(dispatchToGlobalMetadataReducer, loggedInUserJwtToken);
|
|
45
51
|
fetchAccountManagers(dispatchToGlobalMetadataReducer, loggedInUserJwtToken);
|
|
46
|
-
fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken).then((loggedInUserAccount) => {
|
|
52
|
+
fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, false, apolloClient).then((loggedInUserAccount) => {
|
|
47
53
|
setSecuredSupport(loggedInUserAccount === null || loggedInUserAccount === void 0 ? void 0 : loggedInUserAccount.secureSupport);
|
|
48
54
|
if (loggedInUserAccount === null || loggedInUserAccount === void 0 ? void 0 : loggedInUserAccount.secureSupport) {
|
|
49
55
|
Config.setUserConfig({ isLoggedInAccountGS4: true });
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IAccount } from '@cee-eng/hydrajs/@types/models/account';
|
|
2
|
-
import { IAccountListParams } from '@cee-eng/hydrajs/@types/models/csp/account';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
interface IProps {
|
|
5
4
|
selectedAccounts?: IAccount[];
|
|
@@ -8,7 +7,6 @@ interface IProps {
|
|
|
8
7
|
canBookmarkAccount?: boolean;
|
|
9
8
|
suggestBookmarkAccounts?: boolean;
|
|
10
9
|
onSelect?: (accounts: IAccount[]) => any;
|
|
11
|
-
accountListParams?: IAccountListParams;
|
|
12
10
|
multiple?: boolean;
|
|
13
11
|
isInValid?: boolean;
|
|
14
12
|
restrictedOnSubscriptionAbuse?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountSelectorInternal.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountSelector/AccountSelectorInternal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"AccountSelectorInternal.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountSelector/AccountSelectorInternal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AA2BlE,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,UAAU,MAAM;IACZ,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAkCD,iBAAS,uBAAuB,CAAC,KAAK,EAAE,MAAM,qBAoW7C;kBApWQ,uBAAuB;;;AAuWhC,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -7,16 +7,17 @@ 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 {
|
|
10
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
11
11
|
import { Button, Flex, FlexItem, MenuToggle, Select, SelectList, SelectOption, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
12
|
-
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
13
12
|
import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon';
|
|
14
|
-
import { LoadingIndicator
|
|
13
|
+
import { LoadingIndicator } from '@rh-support/components';
|
|
14
|
+
import { buildSearchAccountsWhere, handleGraphQLSearchAccountsResponse, SEARCH_ACCOUNTS, } from '@rh-support/utils';
|
|
15
|
+
import debounce from 'lodash/debounce';
|
|
15
16
|
import isEmpty from 'lodash/isEmpty';
|
|
16
17
|
import isNull from 'lodash/isNull';
|
|
17
18
|
import isUndefined from 'lodash/isUndefined';
|
|
18
19
|
import uniqBy from 'lodash/uniqBy';
|
|
19
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
20
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
20
21
|
import { Trans, useTranslation } from 'react-i18next';
|
|
21
22
|
import { sortAccountsByQuery } from '../../utils';
|
|
22
23
|
const defaultProps = {
|
|
@@ -50,24 +51,28 @@ const getDisplayName = (account) => {
|
|
|
50
51
|
: '';
|
|
51
52
|
};
|
|
52
53
|
function AccountSelectorInternal(props) {
|
|
53
|
-
const
|
|
54
|
+
const apolloClient = useApolloClient();
|
|
54
55
|
const [items, setItems] = useState([]);
|
|
55
56
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
56
57
|
const [isOpen, setIsOpen] = useState(false);
|
|
57
58
|
const [isQueryChanged, setIsQueryChanged] = useState(false);
|
|
59
|
+
const [isFetching, setIsFetching] = useState(false);
|
|
58
60
|
const [query, setQuery] = useState('');
|
|
59
61
|
const [focusedItemIndex, setFocusedItemIndex] = useState(null);
|
|
62
|
+
const [hasNextPage, setHasNextPage] = useState(false);
|
|
63
|
+
const [endCursor, setEndCursor] = useState('');
|
|
64
|
+
const [currentSearchQuery, setCurrentSearchQuery] = useState('');
|
|
60
65
|
const textInputRef = useRef();
|
|
61
66
|
const inputGroupRef = useRef();
|
|
67
|
+
const abortControllerRef = useRef();
|
|
62
68
|
const { t } = useTranslation();
|
|
63
69
|
const bookmarkedAccountsDeduped = uniqBy(props.bookmarkedAccounts, (b) => b.accountNumber);
|
|
64
70
|
const pageSize = 20;
|
|
65
|
-
const [resultSize, setResultSize] = useState(pageSize);
|
|
66
71
|
const setQueryLabel = (selectedItems) => {
|
|
67
72
|
const item = !isEmpty(selectedItems) && !props.multiple ? selectedItems[0] : {};
|
|
68
73
|
setQuery(getDisplayName(item));
|
|
69
74
|
};
|
|
70
|
-
const itemsToRender = useMemo(() => (isEmpty(items) ? bookmarkedAccountsDeduped : items
|
|
75
|
+
const itemsToRender = useMemo(() => (isEmpty(items) ? bookmarkedAccountsDeduped : items), [items, bookmarkedAccountsDeduped]);
|
|
71
76
|
useEffect(() => {
|
|
72
77
|
if (!props.multiple) {
|
|
73
78
|
const selectedItem = (props.selectedAccounts || [])[0];
|
|
@@ -81,11 +86,13 @@ function AccountSelectorInternal(props) {
|
|
|
81
86
|
setQueryLabel(selectedItems);
|
|
82
87
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
88
|
}, [selectedItems, props.multiple]);
|
|
84
|
-
const onDisplayMoreClick = (e) => {
|
|
89
|
+
const onDisplayMoreClick = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
85
90
|
e.stopPropagation();
|
|
86
|
-
setResultSize((pre) => Math.min(pre + pageSize, items.length));
|
|
87
91
|
setIsOpen(true);
|
|
88
|
-
|
|
92
|
+
if (!hasNextPage || !endCursor || !currentSearchQuery)
|
|
93
|
+
return;
|
|
94
|
+
yield fetchAccounts(currentSearchQuery, endCursor);
|
|
95
|
+
});
|
|
89
96
|
const dropdownOptions = useMemo(() => {
|
|
90
97
|
if (isFetching) {
|
|
91
98
|
return (React.createElement("div", { key: "searching", className: "pf-v6-u-px-md pf-v6-u-py-sm" },
|
|
@@ -96,13 +103,9 @@ function AccountSelectorInternal(props) {
|
|
|
96
103
|
React.createElement(Trans, null, "No results found")));
|
|
97
104
|
}
|
|
98
105
|
return [
|
|
99
|
-
...itemsToRender.map((item, index) => (React.createElement(SelectOption, { isFocused: focusedItemIndex === index, key: index, value: item, hasCheckbox: props.multiple, isSelected: selectedItems.some((account) => item.accountNumber === account.accountNumber) },
|
|
100
|
-
React.createElement(
|
|
101
|
-
|
|
102
|
-
React.createElement(InfoCircleIcon, null),
|
|
103
|
-
" ",
|
|
104
|
-
React.createElement(Trans, null, "Subscription abuse")))) : (React.createElement("span", null, getDisplayName(item)))))),
|
|
105
|
-
...(resultSize < items.length
|
|
106
|
+
...itemsToRender.map((item, index) => (React.createElement(SelectOption, { isFocused: focusedItemIndex === index, key: index, value: item, hasCheckbox: props.multiple, isSelected: selectedItems.some((account) => item.accountNumber === account.accountNumber) },
|
|
107
|
+
React.createElement("span", null, getDisplayName(item))))),
|
|
108
|
+
...(hasNextPage
|
|
106
109
|
? [
|
|
107
110
|
React.createElement("div", { className: "pf-v6-c-divider", role: "separator", key: "separator" }),
|
|
108
111
|
React.createElement(SelectOption, { key: 'diplay-more-option', onClick: onDisplayMoreClick, value: 'display-more' },
|
|
@@ -115,33 +118,62 @@ function AccountSelectorInternal(props) {
|
|
|
115
118
|
},
|
|
116
119
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
120
|
[items, bookmarkedAccountsDeduped, isFetching, itemsToRender, isQueryChanged]);
|
|
118
|
-
const fetchAccounts = (
|
|
119
|
-
if (isEmpty(
|
|
121
|
+
const fetchAccounts = useCallback((searchQuery, afterCursor) => __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
if (isEmpty(searchQuery)) {
|
|
120
123
|
return;
|
|
121
124
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
let params = {
|
|
125
|
-
fields,
|
|
126
|
-
limit: 60,
|
|
127
|
-
accountNumberNotNull: true,
|
|
128
|
-
};
|
|
129
|
-
let queryKey;
|
|
130
|
-
// query as number is a hack to get around TS, isNaN can take a string but it was throwing error here
|
|
131
|
-
if (isNaN(query)) {
|
|
132
|
-
params.nameLike = query;
|
|
133
|
-
queryKey = 'name';
|
|
125
|
+
if (abortControllerRef.current) {
|
|
126
|
+
abortControllerRef.current.abort();
|
|
134
127
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
abortControllerRef.current = new AbortController();
|
|
129
|
+
const isAppending = !!afterCursor;
|
|
130
|
+
if (!isAppending) {
|
|
131
|
+
setIsFetching(true);
|
|
138
132
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
133
|
+
try {
|
|
134
|
+
const where = buildSearchAccountsWhere(searchQuery);
|
|
135
|
+
const queryKey = isNaN(searchQuery) ? 'name' : 'accountNumber';
|
|
136
|
+
const { data } = yield apolloClient.query({
|
|
137
|
+
query: SEARCH_ACCOUNTS,
|
|
138
|
+
variables: Object.assign(Object.assign({ where, first: pageSize }, (afterCursor ? { after: afterCursor } : {})), { orderBy: { Name: { order: 'ASC' } } }),
|
|
139
|
+
context: { fetchOptions: { signal: abortControllerRef.current.signal } },
|
|
140
|
+
});
|
|
141
|
+
const result = handleGraphQLSearchAccountsResponse(data);
|
|
142
|
+
const newItems = result.items.map((item) => ({
|
|
143
|
+
accountNumber: item.accountNumber,
|
|
144
|
+
name: item.name,
|
|
145
|
+
}));
|
|
146
|
+
const sortedItems = sortAccountsByQuery(newItems, searchQuery, queryKey);
|
|
147
|
+
if (isAppending) {
|
|
148
|
+
setItems((prev) => [...prev, ...sortedItems]);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
setItems(sortedItems);
|
|
152
|
+
}
|
|
153
|
+
setHasNextPage(result.hasNextPage);
|
|
154
|
+
setEndCursor(result.endCursor);
|
|
155
|
+
setCurrentSearchQuery(searchQuery);
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
if ((err === null || err === void 0 ? void 0 : err.name) !== 'AbortError') {
|
|
159
|
+
console.error('Failed to search accounts via GraphQL', err);
|
|
160
|
+
setItems([]);
|
|
161
|
+
setHasNextPage(false);
|
|
162
|
+
setEndCursor('');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
setIsFetching(false);
|
|
167
|
+
}
|
|
168
|
+
}), [apolloClient]);
|
|
169
|
+
const fetchAccountsRef = useRef(fetchAccounts);
|
|
170
|
+
fetchAccountsRef.current = fetchAccounts;
|
|
171
|
+
const debouncedFetchAccounts = useMemo(() => { var _a; return debounce((value) => fetchAccountsRef.current(value), (_a = props.delay) !== null && _a !== void 0 ? _a : 300); }, [props.delay]);
|
|
172
|
+
useEffect(() => {
|
|
173
|
+
return () => {
|
|
174
|
+
debouncedFetchAccounts.cancel();
|
|
175
|
+
};
|
|
176
|
+
}, [debouncedFetchAccounts]);
|
|
145
177
|
const onOuterClick = () => {
|
|
146
178
|
setQueryLabel(props.selectedAccounts || []);
|
|
147
179
|
setSelectedItems(props.selectedAccounts || []);
|
|
@@ -179,9 +211,17 @@ function AccountSelectorInternal(props) {
|
|
|
179
211
|
const onFilter = (_event, value) => {
|
|
180
212
|
setQuery(value);
|
|
181
213
|
setIsQueryChanged(!isEmpty(value));
|
|
182
|
-
fetchAccounts(value);
|
|
183
|
-
setResultSize(pageSize);
|
|
184
214
|
setFocusedItemIndex(null);
|
|
215
|
+
if (isEmpty(value)) {
|
|
216
|
+
debouncedFetchAccounts.cancel();
|
|
217
|
+
setItems([]);
|
|
218
|
+
setIsFetching(false);
|
|
219
|
+
setHasNextPage(false);
|
|
220
|
+
setEndCursor('');
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
setIsFetching(true);
|
|
224
|
+
debouncedFetchAccounts(value);
|
|
185
225
|
};
|
|
186
226
|
const onToggleClick = () => {
|
|
187
227
|
setIsOpen((pre) => !pre);
|
|
@@ -193,6 +233,9 @@ function AccountSelectorInternal(props) {
|
|
|
193
233
|
setSelectedItems([]);
|
|
194
234
|
setItems([]);
|
|
195
235
|
setIsQueryChanged(false);
|
|
236
|
+
setHasNextPage(false);
|
|
237
|
+
setEndCursor('');
|
|
238
|
+
setCurrentSearchQuery('');
|
|
196
239
|
(_a = textInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
197
240
|
};
|
|
198
241
|
const onSelect = (selection) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmbeddedServiceChat.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/EmbeddedServiceChat.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAInC,OAAc,EAAE,EAAE,EAAoB,MAAM,OAAO,CAAC;AAMpD,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"EmbeddedServiceChat.d.ts","sourceRoot":"","sources":["../../../../src/components/EmbeddedServiceChat/EmbeddedServiceChat.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAInC,OAAc,EAAE,EAAE,EAAoB,MAAM,OAAO,CAAC;AAMpD,eAAO,MAAM,mBAAmB,EAAE,EA6HjC,CAAC"}
|
|
@@ -44,8 +44,10 @@ export const EmbeddedServiceChat = () => {
|
|
|
44
44
|
return React.createElement(React.Fragment, null);
|
|
45
45
|
return loadingChat ? (React.createElement("div", { className: "chatButton" },
|
|
46
46
|
React.createElement(Spinner, { diameter: "28px", className: "pf-v6-u-m-xs" }))) : hasBlockedByCookie && chatClicked && document.querySelector('#teconsent a[role="link"]') !== null ? (chatErrorMessagePopover('cookie')) : (hasBlockedByBrowser || hasChatDomainsBlocked || !sessionId) && chatClicked ? (chatErrorMessagePopover()) : !isChatStarted ? (React.createElement("div", { className: "chatButton", onClick: () => {
|
|
47
|
-
onStartChat();
|
|
48
47
|
setChatClicked(true);
|
|
48
|
+
if (sessionId) {
|
|
49
|
+
onStartChat();
|
|
50
|
+
}
|
|
49
51
|
}, "data-tracking-id": "embedded-service-chat", ref: componentRef, id: "chat-bot-wrapper" },
|
|
50
52
|
React.createElement(ChatSVGIcon, null),
|
|
51
53
|
React.createElement(NewFeaturePopoverAnnouncement, { "aria-label": t('Support now has a chatbot (beta). Try it if you need help with a case.'), featureName: FeatureAnnouncementKeys.CHAT_BOT, sectionRef: componentRef, bodyContent: React.createElement("div", null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalTranslationProvider.d.ts","sourceRoot":"","sources":["../../../src/context/GlobalTranslationProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAA8B,MAAM,mBAAmB,CAAC;AAGlF,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACtC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC/D;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAEjG,UAAU,mBAAmB;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,mBAAmB,EAAE,OAAO,CAAC;CAChC;AAWD,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,eAAO,MAAM,UAAU,2BAA4E,CAAC;AAEpG,eAAO,MAAM,wBAAwB,oCAAiD,CAAC;AAEvF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"GlobalTranslationProvider.d.ts","sourceRoot":"","sources":["../../../src/context/GlobalTranslationProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAA8B,MAAM,mBAAmB,CAAC;AAGlF,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,UAAU,MAAM;IACZ,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACtC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC/D;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAEjG,UAAU,mBAAmB;IACzB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,mBAAmB,EAAE,OAAO,CAAC;CAChC;AAWD,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,eAAO,MAAM,UAAU,2BAA4E,CAAC;AAEpG,eAAO,MAAM,wBAAwB,oCAAiD,CAAC;AAEvF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,qBAwEtD"}
|
|
@@ -72,7 +72,7 @@ export function GlobalTranslationProvider(props) {
|
|
|
72
72
|
// Currently we give precedence to cookie value(rh_locale) that is set by portal team if it's not en_US,
|
|
73
73
|
// i.e if user selects the either ja or ko or zh_cn that particular language will be loaded
|
|
74
74
|
// our stored language will be ignored even if that user has some stored language
|
|
75
|
-
const value = yield cacheTrans.getWithFullKey(window.sessionjs.getUserInfo().
|
|
75
|
+
const value = yield cacheTrans.getWithFullKey(window.sessionjs.getUserInfo().preferred_username);
|
|
76
76
|
if (getRhLocaleLang() === 'en' && (value === null || value === void 0 ? void 0 : value.value) !== 'en' && !!value) {
|
|
77
77
|
defaultLang = value.value;
|
|
78
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatInit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatInit.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAyB,MAAM,yBAAyB,CAAC;AAErF,UAAU,YAAY;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,6HAA6H;IAC7H,kBAAkB,EAAE,MAAM,mBAAmB,EAAE,CAAC;CACnD;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,eAAc,OAAe,KAAG,
|
|
1
|
+
{"version":3,"file":"useChatInit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatInit.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAyB,MAAM,yBAAyB,CAAC;AAErF,UAAU,YAAY;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,6HAA6H;IAC7H,kBAAkB,EAAE,MAAM,mBAAmB,EAAE,CAAC;CACnD;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,eAAc,OAAe,KAAG,YA4H3D,CAAC"}
|
|
@@ -5,7 +5,6 @@ import { IAccount, IPartnerManagedAccount } from '@cee-eng/hydrajs/@types/models
|
|
|
5
5
|
import { ISsoContact } from '@cee-eng/hydrajs/@types/models/contact';
|
|
6
6
|
import { IPreference } from '@cee-eng/hydrajs/@types/models/general';
|
|
7
7
|
import { IConfigurationResponse } from '@cee-eng/hydrajs/@types/models/maintenance';
|
|
8
|
-
import { ISEProductListParams } from '@cee-eng/hydrajs/@types/models/product';
|
|
9
8
|
import { IAction, IApiResponseDetails, IPortalJwtToken } from '@rh-support/types/shared';
|
|
10
9
|
import { UserAuth } from '@rh-support/user-permissions';
|
|
11
10
|
import { ITroubleshootProductResponse } from '@rh-support/utils';
|
|
@@ -78,7 +77,8 @@ export declare enum GlobalMetadataReducerConstants {
|
|
|
78
77
|
setReferrerUrl = "setReferrerUrl",
|
|
79
78
|
getNoclusteridreasons = "getNoclusteridreasons",
|
|
80
79
|
setIsSharingHostnameswithRHt = "setIsSharingHostnameswithRHt",
|
|
81
|
-
setCaseListTraditionalSupportAgreed = "setCaseListTraditionalSupportAgreed"
|
|
80
|
+
setCaseListTraditionalSupportAgreed = "setCaseListTraditionalSupportAgreed",
|
|
81
|
+
setCaseRecordTypes = "setCaseRecordTypes"
|
|
82
82
|
}
|
|
83
83
|
export type ICaseType = string;
|
|
84
84
|
export type ICaseSeverity = string;
|
|
@@ -99,6 +99,9 @@ export interface IBookmarkedGroupIds {
|
|
|
99
99
|
namespaceId: number;
|
|
100
100
|
valueTypeId: number;
|
|
101
101
|
}
|
|
102
|
+
export interface ICaseRecordTypeMap {
|
|
103
|
+
[name: string]: string;
|
|
104
|
+
}
|
|
102
105
|
export interface IGlobalMetadataState {
|
|
103
106
|
allCaseTypes: IApiResponseDetails<ICaseType[]>;
|
|
104
107
|
allCaseSeverities: IApiResponseDetails<ICaseSeverity[]>;
|
|
@@ -127,6 +130,7 @@ export interface IGlobalMetadataState {
|
|
|
127
130
|
accountCustomEmails: IApiResponseDetails<IAccountNotificationAddresses[]>;
|
|
128
131
|
referrerUrl: string;
|
|
129
132
|
caseNoClusterIdReasons: IApiResponseDetails<string[]>;
|
|
133
|
+
caseRecordTypes: IApiResponseDetails<ICaseRecordTypeMap>;
|
|
130
134
|
caseListTraditionalSupportAgreed: boolean;
|
|
131
135
|
}
|
|
132
136
|
export interface IGlobalMetadataPayloadType extends IGlobalMetadataState {
|
|
@@ -142,24 +146,44 @@ export declare const setReferrerUrl: (dispatch: GlobalMetadataReducerDispatchTyp
|
|
|
142
146
|
export declare const removeGroupedBookmarks: (dispatch: GlobalMetadataReducerDispatchType, allBookmarks: IBookmark[], removedAccountsId: number[]) => void;
|
|
143
147
|
export declare const removeWholeGroup: (dispatch: GlobalMetadataReducerDispatchType, allBookmarks: IBookmark[], rootBookmarIds: number[]) => void;
|
|
144
148
|
export declare const addEditbookmarks: (dispatch: GlobalMetadataReducerDispatchType, allBookmarks: IBookmark[], updatedAccounts: IBookmarkedAccounts, selectedAccounts: IBookmark[], group: string, accountsRemovedFromGroup?: IBookmark[]) => void;
|
|
145
|
-
export declare const fetchCaseTypes: (dispatch: GlobalMetadataReducerDispatchType,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
export declare const
|
|
149
|
+
export declare const fetchCaseTypes: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: {
|
|
150
|
+
query: (options: any) => Promise<any>;
|
|
151
|
+
}) => Promise<void>;
|
|
152
|
+
export declare const fetchCaseTypesHydra: (dispatch: GlobalMetadataReducerDispatchType, isSecureSupport: boolean) => Promise<void>;
|
|
153
|
+
export declare const fetchCaseSeverities: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: {
|
|
154
|
+
query: (options: any) => Promise<any>;
|
|
155
|
+
}) => Promise<void>;
|
|
156
|
+
export declare const fetchCaseSeveritiesHydra: (dispatch: GlobalMetadataReducerDispatchType, isSecureSupport: boolean) => Promise<void>;
|
|
157
|
+
export declare const fetchAllStatuses: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: {
|
|
158
|
+
query: (options: any) => Promise<any>;
|
|
159
|
+
}) => Promise<void>;
|
|
160
|
+
export declare const fetchProducts: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: {
|
|
161
|
+
query: (options: any) => Promise<any>;
|
|
162
|
+
}) => Promise<void>;
|
|
163
|
+
export declare const fetchCaseRecordTypes: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: {
|
|
164
|
+
query: (options: any) => Promise<any>;
|
|
165
|
+
}) => Promise<void>;
|
|
149
166
|
export declare const setAllProducts: (dispatch: GlobalMetadataReducerDispatchType, allProducts: ITroubleshootProductResponse) => void;
|
|
150
|
-
export declare const fetchLoggedInUsersAccount: (dispatch: GlobalMetadataReducerDispatchType, token: Partial<IPortalJwtToken>, silent?: boolean
|
|
167
|
+
export declare const fetchLoggedInUsersAccount: (dispatch: GlobalMetadataReducerDispatchType, token: Partial<IPortalJwtToken>, silent?: boolean, apolloClient?: {
|
|
168
|
+
query: (options: any) => Promise<any>;
|
|
169
|
+
}) => Promise<import("@rh-support/utils").IGraphQLAccountResult>;
|
|
151
170
|
export declare const fetchLoggedInUser: (dispatch: GlobalMetadataReducerDispatchType, token: Partial<IPortalJwtToken>, pcmConfig: any) => Promise<void>;
|
|
152
|
-
export declare const fetchLanguageMetadata: (dispatch: GlobalMetadataReducerDispatchType
|
|
171
|
+
export declare const fetchLanguageMetadata: (dispatch: GlobalMetadataReducerDispatchType, apolloClient: {
|
|
172
|
+
query: (options: any) => Promise<any>;
|
|
173
|
+
}) => Promise<void>;
|
|
153
174
|
export declare const fetchInternalStatusMetadata: (dispatch: GlobalMetadataReducerDispatchType) => Promise<void>;
|
|
154
175
|
export declare const fetchCaseSbrsMetadata: (dispatch: GlobalMetadataReducerDispatchType) => Promise<void>;
|
|
155
176
|
export declare const fetchCaseGroupsForSSO: (dispatch: GlobalMetadataReducerDispatchType, ssoUserName: string) => Promise<ICaseGroup[]>;
|
|
177
|
+
export declare const fetchCaseGroupsForAccount: (dispatch: GlobalMetadataReducerDispatchType, accountNumber: string) => Promise<ICaseGroup[]>;
|
|
156
178
|
export declare const fetchCaseGroups: (dispatch: GlobalMetadataReducerDispatchType) => Promise<void>;
|
|
157
179
|
export declare const setCaseGroups: (dispatch: GlobalMetadataReducerDispatchType, groups: ICaseGroup[]) => void;
|
|
158
180
|
export declare const setLoggedInUserJwtToken: (dispatch: GlobalMetadataReducerDispatchType, loggedInUserJwtToken: Partial<IPortalJwtToken>) => void;
|
|
159
181
|
export declare const loadPCMConfig: (dispatch: GlobalMetadataReducerDispatchType) => Promise<IConfigurationResponse>;
|
|
160
182
|
export declare const setLoggedInUserRoles: (dispatch: GlobalMetadataReducerDispatchType, loggedInUserRights: UserAuth) => void;
|
|
161
183
|
export declare const fetchManagedAccounts: (dispatch: GlobalMetadataReducerDispatchType, token: Partial<IPortalJwtToken>) => Promise<void>;
|
|
184
|
+
export declare const updateManagedAccounts: (dispatch: GlobalMetadataReducerDispatchType, managedAccounts: Partial<IPartnerManagedAccount>[]) => void;
|
|
162
185
|
export declare const fetchAccountManagers: (dispatch: GlobalMetadataReducerDispatchType, token: Partial<IPortalJwtToken>) => Promise<void>;
|
|
186
|
+
export declare const updateAccountManagers: (dispatch: GlobalMetadataReducerDispatchType, accountManagers: Partial<IPartnerManagedAccount>[]) => void;
|
|
163
187
|
export declare const fetchBookmarkedGroupAccounts: (dispatch: GlobalMetadataReducerDispatchType, username: string) => Promise<void>;
|
|
164
188
|
export declare const fetchBookmarkedAccounts: (dispatch: GlobalMetadataReducerDispatchType, bookmarkedAccounts: string[]) => Promise<void>;
|
|
165
189
|
export declare const setUserPreferences: (dispatch: GlobalMetadataReducerDispatchType, userPreferences: IUserPreferences) => void;
|
|
@@ -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":"AASA,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,O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C,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,8 +7,8 @@ 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, contacts, customEmail, maintenance,
|
|
11
|
-
import { getApiResourceObject,
|
|
10
|
+
import { accounts, caseMetadata, contacts, customEmail, maintenance, publicApi, userPreferences, } from '@cee-eng/hydrajs';
|
|
11
|
+
import { buildPicklistInput, fetchPicklistValues, GET_ACCOUNT, GET_CASE_RECORD_TYPES, GET_PRODUCTS, getAccountQueryVariables, getApiResourceObject, handleGraphQLAccountResponse, handleGraphQLProductsResponse, setCaseRecordTypes, severitySort, } from '@rh-support/utils';
|
|
12
12
|
import differenceBy from 'lodash/differenceBy';
|
|
13
13
|
import filter from 'lodash/filter';
|
|
14
14
|
import find from 'lodash/find';
|
|
@@ -80,6 +80,7 @@ export var GlobalMetadataReducerConstants;
|
|
|
80
80
|
GlobalMetadataReducerConstants["getNoclusteridreasons"] = "getNoclusteridreasons";
|
|
81
81
|
GlobalMetadataReducerConstants["setIsSharingHostnameswithRHt"] = "setIsSharingHostnameswithRHt";
|
|
82
82
|
GlobalMetadataReducerConstants["setCaseListTraditionalSupportAgreed"] = "setCaseListTraditionalSupportAgreed";
|
|
83
|
+
GlobalMetadataReducerConstants["setCaseRecordTypes"] = "setCaseRecordTypes";
|
|
83
84
|
})(GlobalMetadataReducerConstants || (GlobalMetadataReducerConstants = {}));
|
|
84
85
|
const initialProductResponse = {
|
|
85
86
|
topProducts: [],
|
|
@@ -118,6 +119,7 @@ export const initialGlobalMetadataState = {
|
|
|
118
119
|
},
|
|
119
120
|
referrerUrl: null,
|
|
120
121
|
caseNoClusterIdReasons: getApiResourceObject([]),
|
|
122
|
+
caseRecordTypes: getApiResourceObject({}),
|
|
121
123
|
caseListTraditionalSupportAgreed: false,
|
|
122
124
|
};
|
|
123
125
|
// Resucers
|
|
@@ -218,6 +220,9 @@ export const globalMetadataReducer = (pState, action) => {
|
|
|
218
220
|
case GlobalMetadataReducerConstants.setCaseListTraditionalSupportAgreed: {
|
|
219
221
|
return Object.assign(Object.assign({}, pState), { caseListTraditionalSupportAgreed: (_a = action.payload) === null || _a === void 0 ? void 0 : _a.caseListTraditionalSupportAgreed });
|
|
220
222
|
}
|
|
223
|
+
case GlobalMetadataReducerConstants.setCaseRecordTypes: {
|
|
224
|
+
return Object.assign(Object.assign({}, pState), { caseRecordTypes: action.payload.caseRecordTypes });
|
|
225
|
+
}
|
|
221
226
|
default: {
|
|
222
227
|
return pState;
|
|
223
228
|
}
|
|
@@ -278,7 +283,33 @@ export const addEditbookmarks = (dispatch, allBookmarks, updatedAccounts, select
|
|
|
278
283
|
payload: { bookmarkedGroupAccounts: getApiResourceObject(allBookmarksCopy, false) },
|
|
279
284
|
});
|
|
280
285
|
};
|
|
281
|
-
export const fetchCaseTypes = (dispatch,
|
|
286
|
+
export const fetchCaseTypes = (dispatch, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
287
|
+
var _a;
|
|
288
|
+
dispatch({
|
|
289
|
+
type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
290
|
+
payload: { allCaseTypes: getApiResourceObject([], true) },
|
|
291
|
+
});
|
|
292
|
+
try {
|
|
293
|
+
const picklists = yield fetchPicklistValues(apolloClient, buildPicklistInput(['Type']));
|
|
294
|
+
const allCaseTypes = getProcessedCaseTypes((_a = picklists.Type) !== null && _a !== void 0 ? _a : []);
|
|
295
|
+
dispatch({
|
|
296
|
+
type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
297
|
+
payload: { allCaseTypes: getApiResourceObject(allCaseTypes) },
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
catch (e) {
|
|
301
|
+
dispatch({
|
|
302
|
+
type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
303
|
+
payload: { allCaseTypes: getApiResourceObject([], false, true, e.message) },
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
// const caseTypes = await caseMetadata.getTypes(isSecureSupport);
|
|
307
|
+
// dispatch({
|
|
308
|
+
// type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
309
|
+
// payload: { allCaseTypes: getApiResourceObject(getProcessedCaseTypes(caseTypes.items)) },
|
|
310
|
+
// });
|
|
311
|
+
});
|
|
312
|
+
export const fetchCaseTypesHydra = (dispatch, isSecureSupport) => __awaiter(void 0, void 0, void 0, function* () {
|
|
282
313
|
dispatch({
|
|
283
314
|
type: GlobalMetadataReducerConstants.setCaseTypes,
|
|
284
315
|
payload: { allCaseTypes: getApiResourceObject([], true) },
|
|
@@ -297,7 +328,28 @@ export const fetchCaseTypes = (dispatch, isSecureSupport) => __awaiter(void 0, v
|
|
|
297
328
|
});
|
|
298
329
|
}
|
|
299
330
|
});
|
|
300
|
-
export const fetchCaseSeverities = (dispatch,
|
|
331
|
+
export const fetchCaseSeverities = (dispatch, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
332
|
+
var _a;
|
|
333
|
+
dispatch({
|
|
334
|
+
type: GlobalMetadataReducerConstants.setCaseSeverities,
|
|
335
|
+
payload: { allCaseSeverities: getApiResourceObject([], true) },
|
|
336
|
+
});
|
|
337
|
+
try {
|
|
338
|
+
const picklists = yield fetchPicklistValues(apolloClient, buildPicklistInput(['Priority']));
|
|
339
|
+
const allCaseSeverities = [...((_a = picklists.Priority) !== null && _a !== void 0 ? _a : [])].sort((sevA, sevB) => severitySort(sevA, sevB));
|
|
340
|
+
dispatch({
|
|
341
|
+
type: GlobalMetadataReducerConstants.setCaseSeverities,
|
|
342
|
+
payload: { allCaseSeverities: getApiResourceObject(allCaseSeverities) },
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
catch (e) {
|
|
346
|
+
dispatch({
|
|
347
|
+
type: GlobalMetadataReducerConstants.setCaseSeverities,
|
|
348
|
+
payload: { allCaseSeverities: getApiResourceObject([], false, true, e.message) },
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
export const fetchCaseSeveritiesHydra = (dispatch, isSecureSupport) => __awaiter(void 0, void 0, void 0, function* () {
|
|
301
353
|
dispatch({
|
|
302
354
|
type: GlobalMetadataReducerConstants.setCaseSeverities,
|
|
303
355
|
payload: { allCaseSeverities: getApiResourceObject([], true) },
|
|
@@ -317,16 +369,18 @@ export const fetchCaseSeverities = (dispatch, isSecureSupport) => __awaiter(void
|
|
|
317
369
|
});
|
|
318
370
|
}
|
|
319
371
|
});
|
|
320
|
-
export const fetchAllStatuses = (dispatch,
|
|
372
|
+
export const fetchAllStatuses = (dispatch, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
373
|
+
var _a;
|
|
321
374
|
dispatch({
|
|
322
375
|
type: GlobalMetadataReducerConstants.setCaseStatuses,
|
|
323
376
|
payload: { allCaseStatuses: getApiResourceObject([], true) },
|
|
324
377
|
});
|
|
325
378
|
try {
|
|
326
|
-
const
|
|
379
|
+
const picklists = yield fetchPicklistValues(apolloClient, buildPicklistInput(['Status']));
|
|
380
|
+
const allCaseStatuses = (_a = picklists.Status) !== null && _a !== void 0 ? _a : [];
|
|
327
381
|
dispatch({
|
|
328
382
|
type: GlobalMetadataReducerConstants.setCaseStatuses,
|
|
329
|
-
payload: { allCaseStatuses: getApiResourceObject(
|
|
383
|
+
payload: { allCaseStatuses: getApiResourceObject(allCaseStatuses) },
|
|
330
384
|
});
|
|
331
385
|
}
|
|
332
386
|
catch (e) {
|
|
@@ -336,25 +390,26 @@ export const fetchAllStatuses = (dispatch, isSecureSupport) => __awaiter(void 0,
|
|
|
336
390
|
});
|
|
337
391
|
}
|
|
338
392
|
});
|
|
339
|
-
export const fetchProducts = (
|
|
393
|
+
export const fetchProducts = (dispatch, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
394
|
+
var _a, _b, _c, _d;
|
|
340
395
|
try {
|
|
341
396
|
dispatch({
|
|
342
397
|
type: GlobalMetadataReducerConstants.setAllProducts,
|
|
343
398
|
payload: { allProducts: getApiResourceObject(initialProductResponse, true) },
|
|
344
399
|
});
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
400
|
+
const { data } = yield apolloClient.query({
|
|
401
|
+
query: GET_PRODUCTS,
|
|
402
|
+
variables: {
|
|
403
|
+
where: {
|
|
404
|
+
ParentProduct__c: { eq: null },
|
|
405
|
+
IsActive: { eq: true },
|
|
406
|
+
},
|
|
407
|
+
first: 200,
|
|
408
|
+
orderBy: { Name: { order: 'ASC' } },
|
|
409
|
+
},
|
|
410
|
+
});
|
|
411
|
+
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 : [];
|
|
412
|
+
const allProducts = handleGraphQLProductsResponse(edges);
|
|
358
413
|
dispatch({
|
|
359
414
|
type: GlobalMetadataReducerConstants.setAllProducts,
|
|
360
415
|
payload: { allProducts: getApiResourceObject(allProducts) },
|
|
@@ -367,18 +422,51 @@ export const fetchProducts = (dispatch_1, ownerSSOUsername_1, ...args_1) => __aw
|
|
|
367
422
|
});
|
|
368
423
|
}
|
|
369
424
|
});
|
|
425
|
+
export const fetchCaseRecordTypes = (dispatch, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
426
|
+
var _a, _b, _c, _d;
|
|
427
|
+
dispatch({
|
|
428
|
+
type: GlobalMetadataReducerConstants.setCaseRecordTypes,
|
|
429
|
+
payload: { caseRecordTypes: getApiResourceObject({}, true) },
|
|
430
|
+
});
|
|
431
|
+
try {
|
|
432
|
+
const { data } = yield apolloClient.query({
|
|
433
|
+
query: GET_CASE_RECORD_TYPES,
|
|
434
|
+
});
|
|
435
|
+
const recordTypeInfos = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.salesforce_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 : [];
|
|
436
|
+
const caseRecordTypes = {};
|
|
437
|
+
recordTypeInfos.forEach((info) => {
|
|
438
|
+
caseRecordTypes[info.name] = info.recordTypeId;
|
|
439
|
+
});
|
|
440
|
+
setCaseRecordTypes(caseRecordTypes);
|
|
441
|
+
dispatch({
|
|
442
|
+
type: GlobalMetadataReducerConstants.setCaseRecordTypes,
|
|
443
|
+
payload: { caseRecordTypes: getApiResourceObject(caseRecordTypes) },
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
catch (e) {
|
|
447
|
+
dispatch({
|
|
448
|
+
type: GlobalMetadataReducerConstants.setCaseRecordTypes,
|
|
449
|
+
payload: { caseRecordTypes: getApiResourceObject({}, false, true, e.message) },
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
});
|
|
370
453
|
export const setAllProducts = (dispatch, allProducts) => {
|
|
371
454
|
dispatch({
|
|
372
455
|
type: GlobalMetadataReducerConstants.setAllProducts,
|
|
373
456
|
payload: { allProducts: getApiResourceObject(allProducts) },
|
|
374
457
|
});
|
|
375
458
|
};
|
|
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;
|
|
459
|
+
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, apolloClient) {
|
|
460
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
378
461
|
let accountNumber = token.account_number;
|
|
379
462
|
if (silent) {
|
|
380
463
|
try {
|
|
381
|
-
const
|
|
464
|
+
const { data } = yield apolloClient.query({
|
|
465
|
+
query: GET_ACCOUNT,
|
|
466
|
+
variables: getAccountQueryVariables(accountNumber),
|
|
467
|
+
});
|
|
468
|
+
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.SalesforceSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
469
|
+
const loggedInUsersAccount = handleGraphQLAccountResponse(edges);
|
|
382
470
|
dispatch({
|
|
383
471
|
type: GlobalMetadataReducerConstants.setLoggedInUsersAccount,
|
|
384
472
|
payload: { loggedInUsersAccount: getApiResourceObject(loggedInUsersAccount) },
|
|
@@ -394,7 +482,13 @@ export const fetchLoggedInUsersAccount = (dispatch_1, token_1, ...args_1) => __a
|
|
|
394
482
|
type: GlobalMetadataReducerConstants.setLoggedInUsersAccount,
|
|
395
483
|
payload: { loggedInUsersAccount: getApiResourceObject({}, true) },
|
|
396
484
|
});
|
|
397
|
-
const
|
|
485
|
+
const { data } = yield apolloClient.query({
|
|
486
|
+
query: GET_ACCOUNT,
|
|
487
|
+
variables: getAccountQueryVariables(accountNumber),
|
|
488
|
+
fetchPolicy: 'network-only',
|
|
489
|
+
});
|
|
490
|
+
const edges = (_h = (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.salesforce_support_uiapi) === null || _e === void 0 ? void 0 : _e.query) === null || _f === void 0 ? void 0 : _f.SalesforceSupportAccount) === null || _g === void 0 ? void 0 : _g.edges) !== null && _h !== void 0 ? _h : [];
|
|
491
|
+
const loggedInUsersAccount = handleGraphQLAccountResponse(edges);
|
|
398
492
|
dispatch({
|
|
399
493
|
type: GlobalMetadataReducerConstants.setLoggedInUsersAccount,
|
|
400
494
|
payload: { loggedInUsersAccount: getApiResourceObject(loggedInUsersAccount) },
|
|
@@ -402,7 +496,7 @@ export const fetchLoggedInUsersAccount = (dispatch_1, token_1, ...args_1) => __a
|
|
|
402
496
|
return loggedInUsersAccount;
|
|
403
497
|
}
|
|
404
498
|
catch (e) {
|
|
405
|
-
(
|
|
499
|
+
(_j = window.sessionjs) === null || _j === void 0 ? void 0 : _j.reportProblem(e, {
|
|
406
500
|
tags: {
|
|
407
501
|
portal_app: window.app || 'Portal Case Management',
|
|
408
502
|
error_effect: 'PCM - App wide error',
|
|
@@ -424,15 +518,15 @@ export const fetchLoggedInUser = (dispatch, token, pcmConfig) => __awaiter(void
|
|
|
424
518
|
type: GlobalMetadataReducerConstants.setLoggedInUser,
|
|
425
519
|
payload: { loggedInUser: getApiResourceObject({}, true) },
|
|
426
520
|
});
|
|
427
|
-
|
|
428
|
-
userId: token.
|
|
521
|
+
const loggedInUser = yield contacts.getCurrentContact({
|
|
522
|
+
userId: token.sub,
|
|
429
523
|
assumeEntitledIfSubscriptionServiceUnavailable: true,
|
|
430
524
|
});
|
|
431
525
|
dispatch({
|
|
432
526
|
type: GlobalMetadataReducerConstants.setLoggedInUser,
|
|
433
527
|
payload: { loggedInUser: getApiResourceObject(loggedInUser) },
|
|
434
528
|
});
|
|
435
|
-
//
|
|
529
|
+
// TODO: migrate to GraphQL - bookmark accounts skipped for now
|
|
436
530
|
const canViewBookmarkAccounts = loggedInUser.isInternal;
|
|
437
531
|
if (canViewBookmarkAccounts) {
|
|
438
532
|
fetchBookmarkedGroupAccounts(dispatch, loggedInUser.ssoUsername);
|
|
@@ -455,16 +549,18 @@ export const fetchLoggedInUser = (dispatch, token, pcmConfig) => __awaiter(void
|
|
|
455
549
|
});
|
|
456
550
|
}
|
|
457
551
|
});
|
|
458
|
-
export const fetchLanguageMetadata = (dispatch) => __awaiter(void 0, void 0, void 0, function* () {
|
|
552
|
+
export const fetchLanguageMetadata = (dispatch, apolloClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
553
|
+
var _a;
|
|
554
|
+
dispatch({
|
|
555
|
+
type: GlobalMetadataReducerConstants.setCaseLanguages,
|
|
556
|
+
payload: { caseLanguages: getApiResourceObject([], true) },
|
|
557
|
+
});
|
|
459
558
|
try {
|
|
559
|
+
const picklists = yield fetchPicklistValues(apolloClient, buildPicklistInput(['Language']));
|
|
560
|
+
const caseLanguages = (_a = picklists.Language) !== null && _a !== void 0 ? _a : [];
|
|
460
561
|
dispatch({
|
|
461
562
|
type: GlobalMetadataReducerConstants.setCaseLanguages,
|
|
462
|
-
payload: { caseLanguages: getApiResourceObject(
|
|
463
|
-
});
|
|
464
|
-
const response = yield caseMetadata.getLanguagesMetadata();
|
|
465
|
-
dispatch({
|
|
466
|
-
type: GlobalMetadataReducerConstants.setCaseLanguages,
|
|
467
|
-
payload: { caseLanguages: getApiResourceObject(response.items) },
|
|
563
|
+
payload: { caseLanguages: getApiResourceObject(caseLanguages) },
|
|
468
564
|
});
|
|
469
565
|
}
|
|
470
566
|
catch (e) {
|
|
@@ -533,6 +629,26 @@ export const fetchCaseGroupsForSSO = (dispatch, ssoUserName) => __awaiter(void 0
|
|
|
533
629
|
});
|
|
534
630
|
}
|
|
535
631
|
});
|
|
632
|
+
export const fetchCaseGroupsForAccount = (dispatch, accountNumber) => __awaiter(void 0, void 0, void 0, function* () {
|
|
633
|
+
try {
|
|
634
|
+
dispatch({
|
|
635
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
636
|
+
payload: { caseGroups: getApiResourceObject([], true) },
|
|
637
|
+
});
|
|
638
|
+
const response = yield publicApi.caseGroups.getCaseGroupsForInternalUser(accountNumber);
|
|
639
|
+
dispatch({
|
|
640
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
641
|
+
payload: { caseGroups: getApiResourceObject(response, false) },
|
|
642
|
+
});
|
|
643
|
+
return response;
|
|
644
|
+
}
|
|
645
|
+
catch (e) {
|
|
646
|
+
dispatch({
|
|
647
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
648
|
+
payload: { caseGroups: getApiResourceObject([], false, true, e.message) },
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
});
|
|
536
652
|
export const fetchCaseGroups = (dispatch) => __awaiter(void 0, void 0, void 0, function* () {
|
|
537
653
|
try {
|
|
538
654
|
dispatch({
|
|
@@ -608,6 +724,14 @@ export const fetchManagedAccounts = (dispatch, token) => __awaiter(void 0, void
|
|
|
608
724
|
});
|
|
609
725
|
}
|
|
610
726
|
});
|
|
727
|
+
export const updateManagedAccounts = (dispatch, managedAccounts) => {
|
|
728
|
+
dispatch({
|
|
729
|
+
type: GlobalMetadataReducerConstants.setManagedAccounts,
|
|
730
|
+
payload: {
|
|
731
|
+
managedAccounts: getApiResourceObject(!isEmpty(managedAccounts) ? sortBy(managedAccounts, 'name') : []),
|
|
732
|
+
},
|
|
733
|
+
});
|
|
734
|
+
};
|
|
611
735
|
export const fetchAccountManagers = (dispatch, token) => __awaiter(void 0, void 0, void 0, function* () {
|
|
612
736
|
try {
|
|
613
737
|
dispatch({
|
|
@@ -629,6 +753,14 @@ export const fetchAccountManagers = (dispatch, token) => __awaiter(void 0, void
|
|
|
629
753
|
});
|
|
630
754
|
}
|
|
631
755
|
});
|
|
756
|
+
export const updateAccountManagers = (dispatch, accountManagers) => {
|
|
757
|
+
dispatch({
|
|
758
|
+
type: GlobalMetadataReducerConstants.setAccountManagers,
|
|
759
|
+
payload: {
|
|
760
|
+
accountManagers: getApiResourceObject(!isEmpty(accountManagers) ? accountManagers : []),
|
|
761
|
+
},
|
|
762
|
+
});
|
|
763
|
+
};
|
|
632
764
|
export const fetchBookmarkedGroupAccounts = (dispatch, username) => __awaiter(void 0, void 0, void 0, function* () {
|
|
633
765
|
var _a, _b, _c;
|
|
634
766
|
try {
|
|
@@ -759,7 +891,7 @@ export const fetchUserPreferences = (dispatch, token) => __awaiter(void 0, void
|
|
|
759
891
|
type: GlobalMetadataReducerConstants.setHydraUserPreferences,
|
|
760
892
|
payload: { managedAccounts: getApiResourceObject([], true) },
|
|
761
893
|
});
|
|
762
|
-
const preferences = yield userPreferences.getUserPreferences(token.
|
|
894
|
+
const preferences = yield userPreferences.getUserPreferences(token.preferred_username);
|
|
763
895
|
dispatch({
|
|
764
896
|
type: GlobalMetadataReducerConstants.setHydraUserPreferences,
|
|
765
897
|
payload: {
|
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.260",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@cee-eng/hydrajs": "4.18.111",
|
|
37
37
|
"@patternfly/react-core": "6.2.1",
|
|
38
38
|
"@patternfly/react-icons": "6.2.1",
|
|
39
|
-
"@rh-support/components": "2.5.
|
|
40
|
-
"@rh-support/types": "2.0.
|
|
41
|
-
"@rh-support/user-permissions": "2.5.
|
|
42
|
-
"@rh-support/utils": "2.5.
|
|
39
|
+
"@rh-support/components": "2.5.170",
|
|
40
|
+
"@rh-support/types": "2.0.26",
|
|
41
|
+
"@rh-support/user-permissions": "2.5.116",
|
|
42
|
+
"@rh-support/utils": "2.5.97",
|
|
43
43
|
"i18next": "^23.15.0",
|
|
44
44
|
"localforage": "^1.10.0",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"defaults and supports es6-module",
|
|
90
90
|
"maintained node versions"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "ce30b93ad7f17f61ba12a2cc643805a7d4043a71"
|
|
93
93
|
}
|