@rh-support/troubleshoot 1.0.47-beta.33 → 1.0.47-beta.35
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 +63 -8
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +4 -3
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts +2 -0
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +2 -2
- package/lib/esm/components/CaseEditView/CaseDetailsWarningMessage.js +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts +2 -0
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -0
- package/lib/esm/components/CaseEditView/CaseSecureSupportAlert.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSecureSupportAlert.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts +2 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +95 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts +2 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.d.ts +9 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +62 -0
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +0 -2
- package/lib/esm/components/CaseInformation/CaseType.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseType.js +11 -5
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts +2 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +45 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumberAlert.d.ts +2 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumberAlert.d.ts.map +1 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumberAlert.js +33 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.d.ts +2 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.d.ts.map +1 -0
- package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +12 -0
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +13 -13
- package/lib/esm/components/CaseInformation/SupportLevel.js +1 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +6 -3
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +15 -1
- package/lib/esm/components/CaseManagement/OpenAlternateID.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenAlternateID.js +6 -7
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +4 -10
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +5 -3
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -2
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +20 -26
- package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.js +13 -10
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +14 -16
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +9 -1
- package/lib/esm/components/Suggestions/Suggestions.d.ts +1 -0
- package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/Suggestions.js +5 -4
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +0 -4
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +11 -5
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +8 -0
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +5 -16
- package/lib/esm/constants/caseDetailsConstants.d.ts +1 -0
- package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
- package/lib/esm/constants/caseDetailsConstants.js +1 -0
- package/lib/esm/css/app.css +5 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +5 -0
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +14 -3
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +2 -0
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/RouteConstNTypes.js +1 -5
- package/lib/esm/reducers/RouteReducer.d.ts +1 -3
- package/lib/esm/reducers/RouteReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RouteReducer.js +5 -7
- package/lib/esm/scss/_main.scss +29 -0
- package/lib/esm/utils/routeUtils.d.ts.map +1 -1
- package/lib/esm/utils/routeUtils.js +1 -3
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAoCA,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,eAuRnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -7,6 +7,7 @@ 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 { contacts } from '@cee-eng/hydrajs';
|
|
10
11
|
import { CaseContactsSelectorExternal, getHydraContactLabel, renderMenuItemChildren, ToastNotification, usePrevious, ValueChangedIcon, } from '@rh-support/components';
|
|
11
12
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
12
13
|
import { sortHydraContacts } from '@rh-support/utils';
|
|
@@ -20,24 +21,24 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
20
21
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
21
22
|
import { RouteContext } from '../../context/RouteContext';
|
|
22
23
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
23
|
-
import { setCaseOwner, setNotifiedUser, updateCaseDetails } from '../../reducers/CaseReducer';
|
|
24
|
+
import { setCaseDetails, setCaseOwner, setCaseState, setNotifiedUser, updateCaseDetails, } from '../../reducers/CaseReducer';
|
|
24
25
|
import { CaseValuesToWatch } from '../shared/Constants';
|
|
25
26
|
import { getChangedValueTooltip } from '../shared/utils';
|
|
26
27
|
function OwnerSelector(props) {
|
|
27
28
|
const { t } = useTranslation();
|
|
28
29
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
29
|
-
const { accountNumber, caseNumber, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers } = useCaseSelector((state) => ({
|
|
30
|
+
const { accountNumber, caseNumber, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, isCaseOwnerUpdating, } = useCaseSelector((state) => ({
|
|
30
31
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
31
32
|
caseNumber: state.caseDetails.caseNumber,
|
|
32
33
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
33
34
|
selectedOwner: state.selectedOwner,
|
|
34
35
|
selectedCaseGroupUsers: state.selectedCaseGroupUsers,
|
|
36
|
+
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
35
37
|
}), isEqual);
|
|
36
38
|
const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
|
|
37
39
|
const caseDispatch = useCaseDispatch();
|
|
38
|
-
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
40
|
+
const { globalMetadataState: { loggedInUserRights, loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
39
41
|
const previousAccountNumber = usePrevious(accountNumber);
|
|
40
|
-
const [isCaseOwnerUpdating, setCaseOwnerUpdating] = useState(false);
|
|
41
42
|
const [usersWithGroupAccess, setUsersWithGroupAccess] = useState([]);
|
|
42
43
|
const [localOwnerChange, setLocalOwnerChange] = useState(false);
|
|
43
44
|
const afterLocalChange = () => setLocalOwnerChange(false);
|
|
@@ -47,17 +48,70 @@ function OwnerSelector(props) {
|
|
|
47
48
|
!isEmpty(pvalue.ssoUsername) &&
|
|
48
49
|
value.ssoUsername !== pvalue.ssoUsername;
|
|
49
50
|
const canEditCase = useCanEditCase();
|
|
51
|
+
const setContactPhoneNumber = (sso) => __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
if (sso === loggedInUser.data.ssoUsername) {
|
|
53
|
+
setCaseDetails(caseDispatch, {
|
|
54
|
+
phone: loggedInUser.data.phone,
|
|
55
|
+
suppliedPhoneNumberVerified: 'True',
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
try {
|
|
60
|
+
const selectedContact = yield contacts.getSFDCContactBySso(sso);
|
|
61
|
+
setCaseDetails(caseDispatch, {
|
|
62
|
+
phone: selectedContact.phone,
|
|
63
|
+
suppliedPhoneNumberVerified: 'Deferred',
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
setCaseDetails(caseDispatch, {
|
|
68
|
+
phone: '',
|
|
69
|
+
suppliedPhoneNumberVerified: 'Deferred',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const updateContactPhoneNumber = (sso) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
try {
|
|
76
|
+
if (sso === loggedInUser.data.ssoUsername) {
|
|
77
|
+
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
78
|
+
phone: loggedInUser.data.phone,
|
|
79
|
+
suppliedPhoneNumberVerified: 'Deferred',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
try {
|
|
84
|
+
const selectedContact = yield contacts.getSFDCContactBySso(sso);
|
|
85
|
+
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
86
|
+
phone: selectedContact.phone,
|
|
87
|
+
suppliedPhoneNumberVerified: 'Deferred',
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
92
|
+
phone: '',
|
|
93
|
+
suppliedPhoneNumberVerified: 'Deferred',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
ToastNotification.addSuccessMessage(t(`Phone number has been successfully updated`));
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
caseUpdateError.showError(e, t(`Phone number failed to update`));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
50
103
|
/**
|
|
51
104
|
* Changing selected owner related
|
|
52
105
|
*/
|
|
53
106
|
const previousCaseOwner = usePrevious(selectedOwner.data.ssoUsername);
|
|
54
107
|
const onOwnerChange = (selectedContact, prevCaseOwner, notificationContacts, dispatch, abortSignalCaseGroup, abortSignalEntitlements) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
if (prevCaseOwner === selectedContact.ssoUsername)
|
|
108
|
+
if (prevCaseOwner === selectedContact.ssoUsername || isEmpty(selectedContact.ssoUsername))
|
|
56
109
|
return;
|
|
57
110
|
yield setCaseOwner(dispatch, selectedContact, '', abortSignalCaseGroup, abortSignalEntitlements, true);
|
|
58
111
|
setLocalOwnerChange(true);
|
|
59
112
|
!isEmpty(selectedContact) &&
|
|
60
113
|
setNotifiedUser(dispatch, filter(notificationContacts, (c) => c.ssoUsername !== selectedContact.ssoUsername));
|
|
114
|
+
setContactPhoneNumber(selectedContact.ssoUsername);
|
|
61
115
|
});
|
|
62
116
|
/** Reset owner when selected account number changes */
|
|
63
117
|
useEffect(() => {
|
|
@@ -90,7 +144,7 @@ function OwnerSelector(props) {
|
|
|
90
144
|
};
|
|
91
145
|
const onCaseOwnerUpdate = (newOwner) => __awaiter(this, void 0, void 0, function* () {
|
|
92
146
|
const caseDetails = { contactSSOName: newOwner.ssoUsername };
|
|
93
|
-
|
|
147
|
+
setCaseState(caseDispatch, { isCaseOwnerUpdating: true });
|
|
94
148
|
try {
|
|
95
149
|
yield updateCaseDetails(caseDispatch, caseNumber, caseDetails);
|
|
96
150
|
const abortSignal = new AbortController().signal;
|
|
@@ -102,11 +156,12 @@ function OwnerSelector(props) {
|
|
|
102
156
|
}, '', abortSignal);
|
|
103
157
|
setLocalOwnerChange(true);
|
|
104
158
|
updateNotifyUsersList(newOwner);
|
|
105
|
-
|
|
159
|
+
yield updateContactPhoneNumber(newOwner.ssoUsername);
|
|
160
|
+
setCaseState(caseDispatch, { isCaseOwnerUpdating: false });
|
|
106
161
|
ToastNotification.addSuccessMessage(t(`Owner has been successfully updated`));
|
|
107
162
|
}
|
|
108
163
|
catch (e) {
|
|
109
|
-
|
|
164
|
+
setCaseState(caseDispatch, { isCaseOwnerUpdating: false });
|
|
110
165
|
caseUpdateError.showError(e, t(`Owner failed to update`));
|
|
111
166
|
}
|
|
112
167
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,eA6LzC"}
|
|
@@ -4,7 +4,7 @@ import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@
|
|
|
4
4
|
import { getUrlParsedParams, isValidCaseNumber } from '@rh-support/utils';
|
|
5
5
|
import isEmpty from 'lodash/isEmpty';
|
|
6
6
|
import isEqual from 'lodash/isEqual';
|
|
7
|
-
import React, { useContext, useEffect } from 'react';
|
|
7
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
import { Route, Switch, useLocation, useParams, useRouteMatch } from 'react-router-dom';
|
|
10
10
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
@@ -29,6 +29,7 @@ export default function Case(props) {
|
|
|
29
29
|
const { caseNumber } = useParams();
|
|
30
30
|
const queryParams = getUrlParsedParams(useLocation().search);
|
|
31
31
|
const ability = useContext(AbilityContext);
|
|
32
|
+
const caseDetailsTabsRef = useRef(null);
|
|
32
33
|
const canSeeFeedbackButtons = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_FEEDBACK_BUTTONS);
|
|
33
34
|
const canReadCase = ability.can(resourceActions.READ, resources.CASE_DETAILS);
|
|
34
35
|
const canSeeExternalTracker = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_EXTERNAL_TRACKER);
|
|
@@ -115,10 +116,10 @@ export default function Case(props) {
|
|
|
115
116
|
(!isFetchingCaseDetails || !isEmpty(product)) &&
|
|
116
117
|
!isFetchingCaseDetailsError && (React.createElement(React.Fragment, null,
|
|
117
118
|
React.createElement(ErrorBoundary, { errorMsgInfo: t('There was an error loading cases. Please try refreshing the page.') },
|
|
118
|
-
React.createElement(CaseOverview, { caseNumber: caseNumber })),
|
|
119
|
+
React.createElement(CaseOverview, { caseNumber: caseNumber, tabsRef: caseDetailsTabsRef })),
|
|
119
120
|
React.createElement(Switch, null,
|
|
120
121
|
React.createElement(Route, { path: `${path}/:activeTab?` },
|
|
121
|
-
React.createElement(CaseDetailsTabs, { basePath: url, caseNumber: caseNumber, routeProps: props.routeProps }))))),
|
|
122
|
+
React.createElement(CaseDetailsTabs, { basePath: url, caseNumber: caseNumber, routeProps: props.routeProps, tabdRef: caseDetailsTabsRef }))))),
|
|
122
123
|
React.createElement(HostnameAwarenessModal, null))),
|
|
123
124
|
React.createElement(CaseDetailsAside, { caseNumber: caseNumber }),
|
|
124
125
|
React.createElement(CaseDetailsModals, { caseNumber: caseNumber, isSecureSupport: loggedInUsersAccount.data.secureSupport })))))));
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { RouteComponentProps } from 'react-router-dom';
|
|
2
3
|
interface IProps {
|
|
3
4
|
caseNumber: string;
|
|
4
5
|
routeProps: RouteComponentProps;
|
|
5
6
|
basePath: string;
|
|
7
|
+
tabdRef: React.MutableRefObject<HTMLDivElement>;
|
|
6
8
|
}
|
|
7
9
|
export declare function CaseDetailsTabs(props: IProps): JSX.Element;
|
|
8
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAwBlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,eAmL5C"}
|
|
@@ -59,7 +59,7 @@ export function CaseDetailsTabs(props) {
|
|
|
59
59
|
key: 'case details',
|
|
60
60
|
routePath: 'management',
|
|
61
61
|
ref: managementTabRef,
|
|
62
|
-
component: React.createElement(CaseDetailsManagement, { caseNumber: caseNumber, routeProps: props.routeProps }),
|
|
62
|
+
component: (React.createElement(CaseDetailsManagement, { caseNumber: caseNumber, routeProps: props.routeProps, tabRef: managementTabRef })),
|
|
63
63
|
});
|
|
64
64
|
canSeeBugZillas &&
|
|
65
65
|
tabsToRender.push({
|
|
@@ -104,7 +104,7 @@ export function CaseDetailsTabs(props) {
|
|
|
104
104
|
return tabIndex > -1 ? tabIndex : activeTabKey;
|
|
105
105
|
};
|
|
106
106
|
const isTabVisibleInPdfExport = (tab) => tab.title === CaseDetailsTabsEnum.DISCUSSION && pdfOption === 'Reduced' ? false : true;
|
|
107
|
-
return (React.createElement("div", { className: "case-details-tabs" },
|
|
107
|
+
return (React.createElement("div", { className: "case-details-tabs", ref: props.tabdRef },
|
|
108
108
|
React.createElement(Tabs, { className: "hide-in-pdf", activeKey: getActiveTabKey(), component: TabsComponent.nav, onSelect: handleTabClick }, tabsToRender.map((tab, index) => (React.createElement(Tab, { eventKey: index, tabContentRef: tab.ref, tabContentId: tab.key, key: tab.title, href: `#${props.basePath}/${tab.routePath}`, "data-tracking-id": tab['data-tracking-id'], title: React.createElement(TabTitleText, null,
|
|
109
109
|
React.createElement(Trans, null, tab.title)) })))),
|
|
110
110
|
React.createElement("div", { className: "case-details-tabs-content pf-u-pt-xl" }, tabsToRender.map((tab, index) => (React.createElement(TabContent, { eventKey: index, key: tab.key, id: tab.key, ref: tab.ref, "aria-label": tab.title, hidden: isExportingPDF ? !isTabVisibleInPdfExport(tab) : index !== getActiveTabKey() },
|
|
@@ -4,7 +4,7 @@ import { CaseSecureSupportAlert } from './CaseSecureSupportAlert';
|
|
|
4
4
|
import { CaseSubscriptionAbuseAlert } from './CaseSubscriptionAbuseAlert';
|
|
5
5
|
export function CaseDetailsWarningMessage(props) {
|
|
6
6
|
const subscriptionAbused = useSubscriptionAbused();
|
|
7
|
-
return (React.createElement(
|
|
7
|
+
return (React.createElement(React.Fragment, null,
|
|
8
8
|
React.createElement(CaseSecureSupportAlert, { caseNumber: props.caseNumber, selectedAccountDetails: props.selectedAccountDetails }),
|
|
9
9
|
subscriptionAbused.isAccountFreezed && React.createElement(CaseSubscriptionAbuseAlert, null)));
|
|
10
10
|
}
|
|
@@ -41,7 +41,7 @@ function CaseType(props) {
|
|
|
41
41
|
React.createElement(Trans, null, "Support type"),
|
|
42
42
|
React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localTypeChange, value: props.selectedType, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.type) }),
|
|
43
43
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
44
|
-
React.createElement(Dropdown, { name: "
|
|
44
|
+
React.createElement(Dropdown, { name: "get-support-type", placeholder: t(`Select`), title: t(`Select a category`), list: toOptions(props.allTypes || []), selectedItem: toOption(props.selectedType), disabled: props.hasError || props.isDisabled, isLoadingList: props.isFetching, isInValid: isCaseTypeInValid, required: true, onChange: onCaseTypeChange, onOuterClick: validateCaseType, "data-tracking-id": "case-details-type-selector" })));
|
|
45
45
|
}
|
|
46
46
|
CaseType.defaultProps = defaultProps;
|
|
47
47
|
export default CaseType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA8D,MAAM,OAAO,CAAC;AA4BnF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,eAsejD"}
|
|
@@ -26,6 +26,7 @@ import { usePostComment } from '../../shared/usePostComment';
|
|
|
26
26
|
import { ReopenCaseModal } from '../ConfirmationModals/ReopenCaseModal';
|
|
27
27
|
import { PDFContext } from '../PDFContainer';
|
|
28
28
|
import { CaseInformation } from '../Tabs/CaseDetails/CaseInformation';
|
|
29
|
+
import { CaseContactPhoneNumberAlert } from '../Tabs/CaseDetails/CasePhoneNumberConfirmAlert';
|
|
29
30
|
import CaseOwnerInfo from './CaseOwnerInfo';
|
|
30
31
|
import CaseStatus from './CaseStatus';
|
|
31
32
|
import CaseType from './CaseType';
|
|
@@ -226,6 +227,7 @@ export default function CaseOverview(props) {
|
|
|
226
227
|
React.createElement(Trans, null, "Case inactivity warning")),
|
|
227
228
|
React.createElement("p", { className: "pf-u-mb-sm" },
|
|
228
229
|
React.createElement(Trans, null, "The customer has received two warnings regarding inactivity. This case will be closed soon if we don't receive any input."))) })))),
|
|
230
|
+
React.createElement(CaseContactPhoneNumberAlert, { isReview: true, tabRef: props.tabsRef }),
|
|
229
231
|
React.createElement("header", null,
|
|
230
232
|
React.createElement("h2", { className: "case-ID" },
|
|
231
233
|
React.createElement(Trans, null, "Case"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSecureSupportAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseSecureSupportAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAOlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,QAAQ,CAAC;CACpC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseSecureSupportAlert.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseSecureSupportAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAOlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,QAAQ,CAAC;CACpC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,eA+BnD"}
|
|
@@ -17,6 +17,6 @@ export function CaseSecureSupportAlert(props) {
|
|
|
17
17
|
"to access secure support cases."));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
return (React.createElement(AlertMessage, { variant: AlertType.WARNING, show: isSecureSupportTechViewingSecureCase, isInline: true },
|
|
20
|
+
return (React.createElement(AlertMessage, { className: "pf-u-mb-md", variant: AlertType.WARNING, show: isSecureSupportTechViewingSecureCase, isInline: true },
|
|
21
21
|
React.createElement(Trans, null, getWarningMsg())));
|
|
22
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,sBAAsB,gBA2IrC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { InputGroupText, InputGroupTextVariant, Spinner, TextInput, TextInputGroup, ValidatedOptions, } from '@patternfly/react-core';
|
|
11
|
+
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
|
|
12
|
+
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
13
|
+
import { NewInlineEdit, ToastNotification } from '@rh-support/components';
|
|
14
|
+
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
15
|
+
import isEqual from 'lodash/isEqual';
|
|
16
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
17
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
18
|
+
import { PHONE_INSTRUCTION } from '../../../../constants/caseDetailsConstants';
|
|
19
|
+
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
20
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
21
|
+
import { PHONE_LIMIT } from '../../../../reducers/CaseConstNTypes';
|
|
22
|
+
import { updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
23
|
+
import { ContactPhoneNumberPopOver } from '../../../CaseInformation/ContactPhoneNumberPopOver';
|
|
24
|
+
export function CaseContactPhoneNumber() {
|
|
25
|
+
const { phone, caseNumber, contactSSOName, suppliedPhoneNumberVerified, isCaseOwnerUpdating } = useCaseSelector((state) => ({
|
|
26
|
+
phone: state.caseDetails.phone || '',
|
|
27
|
+
caseNumber: state.caseDetails.caseNumber,
|
|
28
|
+
contactSSOName: state.caseDetails.contactSSOName,
|
|
29
|
+
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
30
|
+
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
31
|
+
}), isEqual);
|
|
32
|
+
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
33
|
+
const canEditCase = useCanEditCase();
|
|
34
|
+
const [isCasePhoneUpdating, setCasePhoneUpdating] = useState(false);
|
|
35
|
+
const [localPhoneState, setLocalPhoneState] = useState(phone);
|
|
36
|
+
const caseDispatch = useCaseDispatch();
|
|
37
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
38
|
+
const { t } = useTranslation();
|
|
39
|
+
const onPhoneChange = (phone) => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (canEditCase.alert())
|
|
41
|
+
return;
|
|
42
|
+
setLocalPhoneState(phone);
|
|
43
|
+
});
|
|
44
|
+
const onSave = () => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
setCasePhoneUpdating(true);
|
|
46
|
+
try {
|
|
47
|
+
yield updateCaseDetails(caseDispatch, caseNumber, { phone: localPhoneState.trim() });
|
|
48
|
+
setCasePhoneUpdating(false);
|
|
49
|
+
ToastNotification.addSuccessMessage(t(`Phone number has been successfully updated`));
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
setCasePhoneUpdating(false);
|
|
53
|
+
caseUpdateError.showError(e, t(`Phone number failed to update`));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const onCancel = () => {
|
|
57
|
+
setLocalPhoneState(phone);
|
|
58
|
+
};
|
|
59
|
+
// Function to handle keyDown events
|
|
60
|
+
const handleKeyDown = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
// Cancel on pressing esc
|
|
62
|
+
if (e.keyCode === 27) {
|
|
63
|
+
yield onCancel();
|
|
64
|
+
}
|
|
65
|
+
// Save on pressing enter
|
|
66
|
+
else if (!isCasePhoneUpdating && e.keyCode === 13) {
|
|
67
|
+
yield onSave();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
setLocalPhoneState(phone);
|
|
72
|
+
}, [phone]);
|
|
73
|
+
const maxLengthErrorMessage = t('Phone number cannot be more than {{limit}} characters.', {
|
|
74
|
+
limit: PHONE_LIMIT,
|
|
75
|
+
});
|
|
76
|
+
const isPhoneNeedsReview = contactSSOName === loggedInUser.data.ssoUsername && suppliedPhoneNumberVerified === 'Deferred';
|
|
77
|
+
return (React.createElement("div", { className: "form-group", style: { minWidth: '200px' } },
|
|
78
|
+
React.createElement(NewInlineEdit, { labelProps: { htmlFor: 'case-details-supplied-phone' }, labelContent: React.createElement(React.Fragment, null,
|
|
79
|
+
React.createElement(Trans, null, "Case owner's phone number"),
|
|
80
|
+
ContactPhoneNumberPopOver()), allowInlineEdit: false, hideSaveCancel: false, saveDisabled: isCasePhoneUpdating },
|
|
81
|
+
React.createElement(TextInputGroup, null,
|
|
82
|
+
React.createElement(TextInput, { value: localPhoneState || '', type: "text", className: "form-control", id: "case-details-supplied-phone", placeholder: "+1 555-555-5555", onChange: onPhoneChange, "data-tracking-id": "case-details-page-supplied-phone", isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating, onKeyDown: handleKeyDown, validated: (localPhoneState === null || localPhoneState === void 0 ? void 0 : localPhoneState.length) > PHONE_LIMIT
|
|
83
|
+
? ValidatedOptions.error
|
|
84
|
+
: isPhoneNeedsReview
|
|
85
|
+
? ValidatedOptions.warning
|
|
86
|
+
: ValidatedOptions.default }),
|
|
87
|
+
!isCasePhoneUpdating ? (React.createElement(InputGroupText, { variant: InputGroupTextVariant.plain },
|
|
88
|
+
React.createElement("button", { className: "btn btn-app btn-link pf-u-ml-sm", type: "button", "data-tracking-id": "case-details-page-supplied-phone-save", onClick: () => onSave(), disabled: (localPhoneState === null || localPhoneState === void 0 ? void 0 : localPhoneState.length) > PHONE_LIMIT || localPhoneState === phone },
|
|
89
|
+
React.createElement(CheckIcon, null)),
|
|
90
|
+
React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: onCancel, "data-tracking-id": "case-details-page-supplied-phone-cancel" },
|
|
91
|
+
React.createElement(TimesIcon, { color: "#6A6E73" })))) : (React.createElement(InputGroupText, { variant: InputGroupTextVariant.plain },
|
|
92
|
+
React.createElement(Spinner, { isSVG: true, size: "lg", className: "pf-u-ml-2xl pf-u-mr-xl" })))),
|
|
93
|
+
(localPhoneState === null || localPhoneState === void 0 ? void 0 : localPhoneState.length) > PHONE_LIMIT ? (React.createElement("p", { className: "form-instructions form-invalid" }, maxLengthErrorMessage)) : (React.createElement("p", { className: "form-instructions" },
|
|
94
|
+
React.createElement(Trans, null, PHONE_INSTRUCTION))))));
|
|
95
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IDClassNameProps } from '@rh-support/types/shared';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { RouteComponentProps } from 'react-router';
|
|
3
4
|
interface IProps extends IDClassNameProps {
|
|
4
5
|
caseNumber: string;
|
|
5
6
|
routeProps: RouteComponentProps;
|
|
7
|
+
tabRef: React.MutableRefObject<HTMLDivElement>;
|
|
6
8
|
}
|
|
7
9
|
export default function CaseDetailsManagement(props: IProps): JSX.Element;
|
|
8
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAiBnD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,eAiE1D"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
1
2
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
2
3
|
import isEqual from 'lodash/isEqual';
|
|
3
4
|
import React, { useContext, useState } from 'react';
|
|
@@ -11,7 +12,9 @@ import CaseContactSelector from '../../../CaseManagement/SendNotifications/CaseC
|
|
|
11
12
|
import { PartnerCaseHelper } from '../../ShareCase/PartnerCaseHelper';
|
|
12
13
|
import { ShareWithPartner } from '../../ShareCase/PartnerShare';
|
|
13
14
|
import CaseAlternateId from './CaseAlternateId';
|
|
15
|
+
import { CaseContactPhoneNumber } from './CaseContactPhoneNumber';
|
|
14
16
|
import CaseInternalStatus from './CaseInternalStatus';
|
|
17
|
+
import { CaseContactPhoneNumberAlert } from './CasePhoneNumberConfirmAlert';
|
|
15
18
|
import CaseSbrGroups from './CaseSbrGroups';
|
|
16
19
|
export default function CaseDetailsManagement(props) {
|
|
17
20
|
const [isUpdatingPartner, setIsUpdatingPartner] = useState(false);
|
|
@@ -30,7 +33,12 @@ export default function CaseDetailsManagement(props) {
|
|
|
30
33
|
React.createElement(PartnerCaseHelper, { setIsUpdatingPartners: setIsUpdatingPartner, caseNumber: props.caseNumber, routeProps: props.routeProps }),
|
|
31
34
|
React.createElement("section", { className: "card card-white" },
|
|
32
35
|
React.createElement("form", { onSubmit: handleFormSubmit },
|
|
33
|
-
React.createElement(
|
|
36
|
+
React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
|
|
37
|
+
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
38
|
+
React.createElement(OwnerSelector, null)),
|
|
39
|
+
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
40
|
+
React.createElement(CaseContactPhoneNumber, null))),
|
|
41
|
+
React.createElement(CaseContactPhoneNumberAlert, { isConfirm: true }),
|
|
34
42
|
canSeeInternalStatus && React.createElement(CaseInternalStatus, null),
|
|
35
43
|
canSeeSBRGroups && React.createElement(CaseSbrGroups, null),
|
|
36
44
|
React.createElement(CaseGroup, null),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
isReview?: boolean;
|
|
4
|
+
isConfirm?: boolean;
|
|
5
|
+
tabRef?: React.MutableRefObject<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare function CaseContactPhoneNumberAlert(props: IProps): JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=CasePhoneNumberConfirmAlert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CasePhoneNumberConfirmAlert.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAQpD,UAAU,MAAM;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eA4FxD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Alert, AlertVariant, Button, ButtonVariant } from '@patternfly/react-core';
|
|
11
|
+
import { ToastNotification } from '@rh-support/components';
|
|
12
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
|
+
import { scrollIntoView } from '@rh-support/utils';
|
|
14
|
+
import isEqual from 'lodash/isEqual';
|
|
15
|
+
import React, { useContext, useState } from 'react';
|
|
16
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
17
|
+
import { Link } from 'react-router-dom';
|
|
18
|
+
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
19
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
20
|
+
import { updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
21
|
+
export function CaseContactPhoneNumberAlert(props) {
|
|
22
|
+
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
23
|
+
const [isCaseUpdating, setCasUpdating] = useState(false);
|
|
24
|
+
const { caseNumber, suppliedPhoneNumberVerified, contactSSOName } = useCaseSelector((state) => ({
|
|
25
|
+
caseNumber: state.caseDetails.caseNumber,
|
|
26
|
+
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
27
|
+
contactSSOName: state.caseDetails.contactSSOName,
|
|
28
|
+
}), isEqual);
|
|
29
|
+
const { t } = useTranslation();
|
|
30
|
+
const caseDispatch = useCaseDispatch();
|
|
31
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
32
|
+
const onCaseDetailsChange = (caseDetails) => __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
setCasUpdating(true);
|
|
34
|
+
try {
|
|
35
|
+
yield updateCaseDetails(caseDispatch, caseNumber, caseDetails);
|
|
36
|
+
setCasUpdating(false);
|
|
37
|
+
ToastNotification.addSuccessMessage(t(`Phone number has been successfully confirmed`));
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
setCasUpdating(false);
|
|
41
|
+
caseUpdateError.showError(e, t(`Phone number failed to be confirmed`));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const goToPhoneField = () => {
|
|
45
|
+
scrollIntoView(props.tabRef);
|
|
46
|
+
};
|
|
47
|
+
const isPhoneNeedsReview = contactSSOName === loggedInUser.data.ssoUsername && suppliedPhoneNumberVerified === 'Deferred';
|
|
48
|
+
if (!isPhoneNeedsReview)
|
|
49
|
+
return React.createElement(React.Fragment, null);
|
|
50
|
+
return (React.createElement(React.Fragment, null, props.isReview ? (React.createElement(Alert, { className: "pf-u-mb-md", isInline: true, variant: AlertVariant.warning, title: t('Review phone number'), actionLinks: [
|
|
51
|
+
React.createElement(Link, { replace: true, to: {
|
|
52
|
+
pathname: `/case/${caseNumber}/management`,
|
|
53
|
+
search: 'hello',
|
|
54
|
+
}, onClick: () => goToPhoneField(), "data-tracking-id": "case-contact-phone-number-review" },
|
|
55
|
+
React.createElement(Trans, null, "Review phone number")),
|
|
56
|
+
] },
|
|
57
|
+
React.createElement(Trans, null, "You are the new owner for this case. Is the new phone number correct?"))) : props.isConfirm ? (React.createElement(Alert, { isInline: true, className: "pf-u-mb-md", variant: AlertVariant.warning, title: t('Review phone number'), actionLinks: [
|
|
58
|
+
React.createElement(Button, { variant: ButtonVariant.link, isInline: true, onClick: () => onCaseDetailsChange({ suppliedPhoneNumberVerified: 'True' }), "data-tracking-id": "case-contact-phone-number-confirm", isLoading: isCaseUpdating, isDisabled: isCaseUpdating },
|
|
59
|
+
React.createElement(Trans, null, "Confirm phone number")),
|
|
60
|
+
] },
|
|
61
|
+
React.createElement(Trans, null, "You are the new owner for this case. Is the new phone number correct?"))) : (React.createElement(React.Fragment, null))));
|
|
62
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eA2HpD"}
|
|
@@ -13,7 +13,6 @@ import { Hostname } from '../ImproveCase/Hostname';
|
|
|
13
13
|
import KtQuestions from '../ImproveCase/KtQuestions';
|
|
14
14
|
import { AllProductsSelector } from '../ProductSelector/AllProductsSelector';
|
|
15
15
|
import Description from './Description';
|
|
16
|
-
import OpenCaseIssue from './OpenCaseIssue';
|
|
17
16
|
export default function CaseInformation(props) {
|
|
18
17
|
const { t } = useTranslation();
|
|
19
18
|
const { appMetadataState: { nextButtonRef }, } = useContext(AppMetadataStateContext);
|
|
@@ -91,7 +90,6 @@ export default function CaseInformation(props) {
|
|
|
91
90
|
skippedTroubleshooting && (React.createElement(AllProductsSelector, { isDropdownSelected: true, routeProps: props.routeProps, loadTCOnChange: true, checkEntitledProduct: true })),
|
|
92
91
|
React.createElement(Hostname, null),
|
|
93
92
|
React.createElement(OpenShiftClusterId, null),
|
|
94
|
-
skippedTroubleshooting && React.createElement(OpenCaseIssue, { inlineEditable: false, required: true }),
|
|
95
93
|
React.createElement(Description, { inlineEditable: false }),
|
|
96
94
|
React.createElement(KtQuestions, null))))));
|
|
97
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseType.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseType.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseType.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseType.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;CAAG;AAEnB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,MAAM,eA+D7C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dropdown } from '@rh-support/components';
|
|
2
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import { toOption, toOptions } from '@rh-support/utils';
|
|
3
|
+
import { toNewCaseTypeMapper, toNewCaseTypeSwitcher, toOldCaseTypeSwitcher, toOption, toOptions, } from '@rh-support/utils';
|
|
4
4
|
import isEmpty from 'lodash/isEmpty';
|
|
5
5
|
import React, { useContext, useMemo, useState } from 'react';
|
|
6
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -20,22 +20,28 @@ export default function CaseType(props) {
|
|
|
20
20
|
setCaseDetails(caseDispatch, caseDetails);
|
|
21
21
|
};
|
|
22
22
|
const onCaseTypeChange = (option) => {
|
|
23
|
-
|
|
23
|
+
const selectedOldCaseTypeValue = toOldCaseTypeSwitcher(option.value);
|
|
24
|
+
onCaseDetailsChange({ caseType: selectedOldCaseTypeValue });
|
|
24
25
|
validateCaseType(option);
|
|
25
26
|
};
|
|
27
|
+
// To convert selected case type to new case type
|
|
28
|
+
const selectedNewCaseType = toNewCaseTypeSwitcher(caseType);
|
|
29
|
+
// To convert all case types to new case types
|
|
30
|
+
const mappedSupportTypes = toNewCaseTypeMapper(allCaseTypes.data);
|
|
31
|
+
const newCaseTypes = toOptions(mappedSupportTypes);
|
|
26
32
|
return (React.createElement("div", { className: "form-group" },
|
|
27
|
-
React.createElement("label", { htmlFor: "
|
|
33
|
+
React.createElement("label", { htmlFor: "get-support-type" },
|
|
28
34
|
React.createElement(Trans, null, "Support type"),
|
|
29
35
|
' ',
|
|
30
36
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
31
|
-
React.createElement(Dropdown, { id: "
|
|
37
|
+
React.createElement(Dropdown, { id: "get-support-type", name: "get-support-type", placeholder: t(`Select a category`), title: t(`Select a category`), list: allCaseTypes.data ? newCaseTypes : [], selectedItem: toOption(selectedNewCaseType), disabled: allCaseTypes.isError, isLoadingList: allCaseTypes.isFetching, isInValid: isCaseTypeInValid, required: true, onChange: onCaseTypeChange, onOuterClick: validateCaseType, "data-tracking-id": "get-support-type" })));
|
|
32
38
|
}, [
|
|
33
39
|
allCaseTypes.data,
|
|
34
40
|
allCaseTypes.isError,
|
|
35
41
|
allCaseTypes.isFetching,
|
|
36
|
-
caseType,
|
|
37
42
|
isCaseTypeInValid,
|
|
38
43
|
caseDispatch,
|
|
44
|
+
caseType,
|
|
39
45
|
t,
|
|
40
46
|
]);
|
|
41
47
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAYA,wBAAgB,kBAAkB,gBAiDjC"}
|