@rh-support/troubleshoot 2.7.19 → 2.7.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +7 -3
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +5 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +2 -2
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +2 -2
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +4 -2
- package/lib/esm/hooks/useAB.d.ts.map +1 -1
- package/lib/esm/hooks/useAB.js +23 -45
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAoBxE,UAAU,MAAM;CAAG;AAMnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAoBxE,UAAU,MAAM;CAAG;AAMnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBA+ZnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -32,6 +32,7 @@ function getOwnerDropdownOptions(contacts) {
|
|
|
32
32
|
return map(contacts, (contact) => ({ contact }));
|
|
33
33
|
}
|
|
34
34
|
function OwnerSelector(props) {
|
|
35
|
+
var _a;
|
|
35
36
|
const { t } = useTranslation();
|
|
36
37
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
37
38
|
const { accountNumber, caseNumber, contactSsoUsername, existingCaseDetails, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, selectedAccountDetails, isCaseOwnerUpdating, isCasePhoneUpdating, groupNumber, groupName, } = useCaseSelector((state) => ({
|
|
@@ -266,15 +267,18 @@ function OwnerSelector(props) {
|
|
|
266
267
|
showUsersWithSelectedGroupAccess && loggedInUsersAccount.data.hasGroupACLs ? (React.createElement(OwnerTypeaheadDropdown, { id: "get-support-owner", hasClearButton: true, contactSsoUsername: contactSsoUsername !== null && contactSsoUsername !== void 0 ? contactSsoUsername : '', selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], isDisabled: selectedCaseGroupUsers.isFetching ||
|
|
267
268
|
isCaseOwnerUpdating ||
|
|
268
269
|
isCasePhoneUpdating ||
|
|
269
|
-
canEditCase.isCaseNotEditable, onSelect: onCustomerContactSelect, onClearQuery: onClearQuery, onQueryUpdated: onQueryUpdated, options: ownerDropdownOptions, status: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data) ? 'danger' : undefined })) : (React.createElement(CaseContactsSelectorExternal, { loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, contactSsoUsername: contactSsoUsername !== null && contactSsoUsername !== void 0 ? contactSsoUsername : '', selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, onContactEnriched: (contact) => {
|
|
270
|
+
canEditCase.isCaseNotEditable, onSelect: onCustomerContactSelect, onClearQuery: onClearQuery, onQueryUpdated: onQueryUpdated, options: ownerDropdownOptions, status: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data) ? 'danger' : undefined })) : (React.createElement(CaseContactsSelectorExternal, { loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, salesforceAccountId: (_a = selectedAccountDetails.data) === null || _a === void 0 ? void 0 : _a.salesforceAccountId, contactSsoUsername: contactSsoUsername !== null && contactSsoUsername !== void 0 ? contactSsoUsername : '', selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, onContactEnriched: (contact) => {
|
|
270
271
|
var _a, _b;
|
|
271
272
|
setCaseState(caseDispatch, {
|
|
272
273
|
selectedOwner: { data: contact, isFetching: false, isError: false, errorMessage: '' },
|
|
273
274
|
});
|
|
274
|
-
if (!contact.id || !accountNumber
|
|
275
|
+
if (!contact.id || !accountNumber) {
|
|
275
276
|
return;
|
|
276
277
|
}
|
|
277
|
-
|
|
278
|
+
const defaultCaseGroupIdForFetch = caseNumber
|
|
279
|
+
? groupNumber || null
|
|
280
|
+
: (_a = contact.defaultCaseGroup) !== null && _a !== void 0 ? _a : null;
|
|
281
|
+
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, contact.id, accountNumber, defaultCaseGroupIdForFetch, (_b = contact.isOrgAdmin) !== null && _b !== void 0 ? _b : false, groupNumber !== null && groupNumber !== void 0 ? groupNumber : '', groupName || '');
|
|
278
282
|
}, placeholder: t(`Search by name or username`), clearButton: true, id: "get-support-owner", name: "get-support-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data), isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating || canEditCase.isCaseNotEditable }))));
|
|
279
283
|
}
|
|
280
284
|
export { OwnerSelector };
|
package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestEscalationModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestEscalationModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAuBnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAQD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBAkdnD"}
|
|
@@ -13,6 +13,7 @@ import { Button, Form, FormGroup, FormHelperText, Grid, GridItem, HelperText, He
|
|
|
13
13
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
14
14
|
import { AlertMessage, AlertType, LoadingIndicator, SingleSelectDropdown, ToastNotification, useFetch, } from '@rh-support/components';
|
|
15
15
|
import { fetchCaseDetails, useGlobalStateContext } from '@rh-support/react-context';
|
|
16
|
+
import { ensureEscalationRecordTypeId } from '@rh-support/utils';
|
|
16
17
|
import isEmpty from 'lodash/isEmpty';
|
|
17
18
|
import isEqual from 'lodash/isEqual';
|
|
18
19
|
import React, { useEffect, useState } from 'react';
|
|
@@ -119,6 +120,9 @@ export function RequestEscalationModal(props) {
|
|
|
119
120
|
setIsCreatingEscalation(true);
|
|
120
121
|
if (!caseSalesforceId)
|
|
121
122
|
throw new Error('Could not find parent case ID');
|
|
123
|
+
const recordTypeId = yield ensureEscalationRecordTypeId();
|
|
124
|
+
if (!recordTypeId)
|
|
125
|
+
throw new Error('Could not find Escalation record type');
|
|
122
126
|
// GraphQL CaseCreate has no Expectations field; serialize into Description for the payload.
|
|
123
127
|
const serializedDescription = `${formState.description}${ESCALATION_DESCRIPTION_EXPECTATIONS_SEPARATOR}${formState.expectations}`;
|
|
124
128
|
const { data: escalationData } = yield apolloClient.mutate({
|
|
@@ -131,7 +135,7 @@ export function RequestEscalationModal(props) {
|
|
|
131
135
|
Origin: 'Portal RME',
|
|
132
136
|
Priority: props.severity || '3 (Medium)',
|
|
133
137
|
Type: 'RME',
|
|
134
|
-
RecordTypeId:
|
|
138
|
+
RecordTypeId: recordTypeId,
|
|
135
139
|
ParentId: caseSalesforceId,
|
|
136
140
|
EscalationCategory__c: formState.rmeCategory,
|
|
137
141
|
ImpactOnUserOrBusiness__c: formState.businessImpactDescription,
|
|
@@ -15,7 +15,7 @@ import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon
|
|
|
15
15
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
16
16
|
import { getPhoneObj, PhoneInput, ToastNotification } from '@rh-support/components';
|
|
17
17
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
18
|
-
import { GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
|
|
18
|
+
import { buildAccountWhereForContacts, GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
|
|
19
19
|
import isEmpty from 'lodash/isEmpty';
|
|
20
20
|
import isEqual from 'lodash/isEqual';
|
|
21
21
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -34,7 +34,7 @@ function fetchContactBySSO(apolloClient, accountNumber, ssoUsername) {
|
|
|
34
34
|
const { data } = yield apolloClient.query({
|
|
35
35
|
query: GET_ACCOUNT_CONTACTS,
|
|
36
36
|
variables: {
|
|
37
|
-
|
|
37
|
+
accountWhere: buildAccountWhereForContacts(undefined, accountNumber),
|
|
38
38
|
contactsWhere: { SSOUserName__c: { eq: ssoUsername } },
|
|
39
39
|
first: 1,
|
|
40
40
|
},
|
|
@@ -11,7 +11,7 @@ import { useApolloClient } from '@apollo/client/react';
|
|
|
11
11
|
import { ValidatedOptions } from '@patternfly/react-core';
|
|
12
12
|
import { getPhoneObj, PhoneInput } from '@rh-support/components';
|
|
13
13
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
14
|
-
import { GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
|
|
14
|
+
import { buildAccountWhereForContacts, GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
|
|
15
15
|
import isEmpty from 'lodash/isEmpty';
|
|
16
16
|
import isEqual from 'lodash/isEqual';
|
|
17
17
|
import isUndefined from 'lodash/isUndefined';
|
|
@@ -31,7 +31,7 @@ function fetchContactBySSO(apolloClient, accountNumber, ssoUsername) {
|
|
|
31
31
|
const { data } = yield apolloClient.query({
|
|
32
32
|
query: GET_ACCOUNT_CONTACTS,
|
|
33
33
|
variables: {
|
|
34
|
-
|
|
34
|
+
accountWhere: buildAccountWhereForContacts(undefined, accountNumber),
|
|
35
35
|
contactsWhere: { SSOUserName__c: { eq: ssoUsername } },
|
|
36
36
|
first: 1,
|
|
37
37
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAiBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAiBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA4dzC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -35,12 +35,13 @@ import { useCustomEmails } from '../../CaseEditView/Tabs/CaseDetails/useCustomEm
|
|
|
35
35
|
import { AddContactToGroupModal } from './AddContactToGroupModal';
|
|
36
36
|
import { NonOrgCaseNotifyeesSelector } from './NonOrgCaseNotifyeesSelector';
|
|
37
37
|
function CaseContactSelector(props) {
|
|
38
|
+
var _a;
|
|
38
39
|
const ability = useContext(AbilityContext);
|
|
39
40
|
const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
40
41
|
const [isAssociatesUpdating, setIsAssociatesUpdating] = useState(false);
|
|
41
42
|
const { t } = useTranslation();
|
|
42
43
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
43
|
-
const { accountNumber, caseNumber, contactSsoUsername, selectedNotificationContacts, selectedOwner, customEmailsList, product, selectedCaseGroupUsers, ownersCaseGroups, groupNumber, createdById, version, isCaseOwnerUpdating, } = useCaseSelector((state) => ({
|
|
44
|
+
const { accountNumber, caseNumber, contactSsoUsername, selectedNotificationContacts, selectedOwner, customEmailsList, product, selectedCaseGroupUsers, ownersCaseGroups, groupNumber, createdById, version, isCaseOwnerUpdating, selectedAccountDetails, } = useCaseSelector((state) => ({
|
|
44
45
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
45
46
|
caseNumber: state.caseDetails.caseNumber,
|
|
46
47
|
contactSsoUsername: state.caseDetails.contactSSOName,
|
|
@@ -54,6 +55,7 @@ function CaseContactSelector(props) {
|
|
|
54
55
|
createdById: state.caseDetails.createdById,
|
|
55
56
|
product: state.caseDetails.product,
|
|
56
57
|
version: state.caseDetails.version,
|
|
58
|
+
selectedAccountDetails: state.selectedAccountDetails,
|
|
57
59
|
}), isEqual);
|
|
58
60
|
const caseDispatch = useCaseDispatch();
|
|
59
61
|
const { addCustomEmail, canAddCustomEmail, hideCustomEmails, deleteCustomEmail, isUpdatingCustomEmails, isEmailValid, showAddEmailToAccountModal, } = useCustomEmails({
|
|
@@ -268,7 +270,7 @@ function CaseContactSelector(props) {
|
|
|
268
270
|
React.createElement(Trans, null, "Send notifications"),
|
|
269
271
|
loggedInUserRights.data.isOrgAdmin() ? (React.createElement(React.Fragment, null,
|
|
270
272
|
React.createElement("div", { "data-tracking-id": "send-notification-listbox" },
|
|
271
|
-
React.createElement(CaseContactsSelectorExternal, { isDisabled: isUpdatingCustomEmails || isAssociatesUpdating, groupContactsAndEmails: true, allowCustomEmailAdd: true, contactSsoUsername: contactSsoUsername !== null && contactSsoUsername !== void 0 ? contactSsoUsername : '', loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, selected: [
|
|
273
|
+
React.createElement(CaseContactsSelectorExternal, { isDisabled: isUpdatingCustomEmails || isAssociatesUpdating, groupContactsAndEmails: true, allowCustomEmailAdd: true, contactSsoUsername: contactSsoUsername !== null && contactSsoUsername !== void 0 ? contactSsoUsername : '', loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, salesforceAccountId: (_a = selectedAccountDetails.data) === null || _a === void 0 ? void 0 : _a.salesforceAccountId, selected: [
|
|
272
274
|
...customEmailsList.data,
|
|
273
275
|
...filter(selectedNotificationContacts, (c) => !c.isInternal),
|
|
274
276
|
], contactsToExclude: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onNotifiedUserChange, clearButton: true, multiple: true, placeholder: t('Search for an email address or username of the person you want to notify'), id: "open-case-notifications", name: "open-case-notifications", className: "react-select-custom", renderToken: renderToken, isUpdating: isAssociatesUpdating ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAB.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAB.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAB.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAB.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IACzD,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACvD,SAAS,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;CACjC;AAED,oBAAY,MAAM;IACd,CAAC,MAAM;IACP,CAAC,MAAM;CACV;AAED,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAarF;AAkBD,wBAAgB,KAAK,CAAC,OAAO,GAAE,aAAkB,GAAG,YAAY,CAe/D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,sBAAsB,GAAG,qBAAqB,CAMrF"}
|
package/lib/esm/hooks/useAB.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useContext, useEffect, useState } from 'react';
|
|
5
|
-
import { useCaseDispatch, useCaseSelector } from '../context/CaseContext';
|
|
1
|
+
import { Env } from '@cee-eng/hydrajs';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useCaseDispatch } from '../context/CaseContext';
|
|
6
4
|
import { setABTestVariation } from '../reducers/CaseReducer';
|
|
7
5
|
export var ABEnum;
|
|
8
6
|
(function (ABEnum) {
|
|
@@ -15,54 +13,34 @@ export function getVariationByAccountNumber(accountNumber) {
|
|
|
15
13
|
}
|
|
16
14
|
const lastChar = accountNumber.charAt(accountNumber.length - 1);
|
|
17
15
|
const lastDigit = parseInt(lastChar, 10);
|
|
18
|
-
// If lastDigit is not a valid number, default to B
|
|
19
16
|
if (isNaN(lastDigit)) {
|
|
20
17
|
return ABEnum.B;
|
|
21
18
|
}
|
|
22
|
-
// Even last digit → Experience A, Odd last digit → Experience B
|
|
23
19
|
return lastDigit % 2 === 0 ? ABEnum.A : ABEnum.B;
|
|
24
20
|
}
|
|
21
|
+
function getVariationFromUrl() {
|
|
22
|
+
const isNonProdEnv = Env.getEnvName() !== Env.EnvNames.PROD && Env.getEnvName() !== Env.EnvNames.PROD_BETA;
|
|
23
|
+
if (!isNonProdEnv)
|
|
24
|
+
return null;
|
|
25
|
+
const hashQueryString = window.location.hash.includes('?')
|
|
26
|
+
? window.location.hash.substring(window.location.hash.indexOf('?'))
|
|
27
|
+
: '';
|
|
28
|
+
const urlParams = new URLSearchParams(hashQueryString || window.location.search);
|
|
29
|
+
const useflow = urlParams.get('useflow');
|
|
30
|
+
if (useflow && (useflow.charAt(0).toLowerCase() === 'a' || useflow.charAt(0).toLowerCase() === 'b')) {
|
|
31
|
+
return useflow.charAt(0).toUpperCase() === 'A' ? ABEnum.A : ABEnum.B;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
25
35
|
export function useAB(options = {}) {
|
|
26
|
-
const
|
|
27
|
-
const [testVariation, setTestVariation] = useState((options === null || options === void 0 ? void 0 : options.defaultVariation) || ABEnum.A);
|
|
36
|
+
const [testVariation, setTestVariation] = useState((options === null || options === void 0 ? void 0 : options.defaultVariation) || ABEnum.B);
|
|
28
37
|
const caseDispatch = useCaseDispatch();
|
|
29
|
-
const { caseType } = useCaseSelector((state) => ({ caseType: state.caseDetails.caseType }), isEqual);
|
|
30
38
|
useEffect(() => {
|
|
31
|
-
var _a
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
: '';
|
|
37
|
-
const urlParams = new URLSearchParams(hashQueryString || window.location.search);
|
|
38
|
-
const useflowFromUrl = urlParams.get('useflow');
|
|
39
|
-
if (useflowFromUrl &&
|
|
40
|
-
(((_a = useflowFromUrl === null || useflowFromUrl === void 0 ? void 0 : useflowFromUrl.charAt(0)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'a' || ((_b = useflowFromUrl === null || useflowFromUrl === void 0 ? void 0 : useflowFromUrl.charAt(0)) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'b')) {
|
|
41
|
-
newVariation = (useflowFromUrl === null || useflowFromUrl === void 0 ? void 0 : useflowFromUrl.charAt(0).toUpperCase()) === 'A' ? ABEnum.A : ABEnum.B;
|
|
42
|
-
}
|
|
43
|
-
else if (loggedInUsersAccount.data.hasConfirmedStatesideSupport || loggedInUsersAccount.data.secureSupport) {
|
|
44
|
-
newVariation = ABEnum.B;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
const isABTestingEnabled = getConfigField(pcmConfig.data, 'askRedHatAccountsA', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
48
|
-
const userAccountNumber = loggedInUsersAccount.data.accountNumber;
|
|
49
|
-
if (isABTestingEnabled && userAccountNumber) {
|
|
50
|
-
newVariation = getVariationByAccountNumber(userAccountNumber);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
newVariation = ABEnum.B;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
// Update local state used to display only the UI conditionally
|
|
57
|
-
setTestVariation(newVariation);
|
|
58
|
-
// Update global Redux state for analytics (userAgent field) - used in session
|
|
59
|
-
setABTestVariation(caseDispatch, newVariation);
|
|
60
|
-
// Check if the case type is Idea and update the variation to B (only for UI display) global state is still A
|
|
61
|
-
if (caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT) {
|
|
62
|
-
setTestVariation(ABEnum.B);
|
|
63
|
-
}
|
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
-
}, [pcmConfig.data, loggedInUsersAccount.data.accountNumber, caseDispatch, caseType]);
|
|
39
|
+
var _a;
|
|
40
|
+
const variation = (_a = getVariationFromUrl()) !== null && _a !== void 0 ? _a : ABEnum.B;
|
|
41
|
+
setTestVariation(variation);
|
|
42
|
+
setABTestVariation(caseDispatch, variation);
|
|
43
|
+
}, [caseDispatch]);
|
|
66
44
|
return {
|
|
67
45
|
variation: testVariation,
|
|
68
46
|
isVariationA: testVariation === ABEnum.A,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"@progress/kendo-licensing": "1.3.5",
|
|
53
53
|
"@progress/kendo-react-pdf": "^5.16.0",
|
|
54
54
|
"@redux-devtools/extension": "^3.3.0",
|
|
55
|
-
"@rh-support/components": "2.6.
|
|
56
|
-
"@rh-support/react-context": "2.6.
|
|
55
|
+
"@rh-support/components": "2.6.21",
|
|
56
|
+
"@rh-support/react-context": "2.6.21",
|
|
57
57
|
"@rh-support/types": "2.0.30",
|
|
58
|
-
"@rh-support/user-permissions": "2.6.
|
|
59
|
-
"@rh-support/utils": "2.6.
|
|
58
|
+
"@rh-support/user-permissions": "2.6.19",
|
|
59
|
+
"@rh-support/utils": "2.6.18",
|
|
60
60
|
"@types/react-redux": "^7.1.33",
|
|
61
61
|
"@types/redux": "^3.6.0",
|
|
62
62
|
"date-fns": "3.6.0",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"defaults and supports es6-module",
|
|
130
130
|
"maintained node versions"
|
|
131
131
|
],
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "b47efd73e7afe275c94a32a3a3ff8c76f4c45ec1"
|
|
133
133
|
}
|