@rh-support/troubleshoot 2.2.140 → 2.2.142
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 +3 -79
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +113 -55
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +6 -1
- package/package.json +4 -4
|
@@ -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":"AAiBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAuOnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -7,8 +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 {
|
|
11
|
-
import { CaseContactsSelectorExternal, getHydraContactLabel, getPhoneObj, renderMenuItemChildren, ToastNotification, usePrevious, ValueChangedIcon, } from '@rh-support/components';
|
|
10
|
+
import { CaseContactsSelectorExternal, getHydraContactLabel, renderMenuItemChildren, ToastNotification, usePrevious, ValueChangedIcon, } from '@rh-support/components';
|
|
12
11
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
13
12
|
import { sortHydraContacts } from '@rh-support/utils';
|
|
14
13
|
import filter from 'lodash/filter';
|
|
@@ -28,18 +27,17 @@ import { getChangedValueTooltip } from '../shared/utils';
|
|
|
28
27
|
function OwnerSelector(props) {
|
|
29
28
|
const { t } = useTranslation();
|
|
30
29
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
31
|
-
const { accountNumber, caseNumber, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, isCaseOwnerUpdating,
|
|
30
|
+
const { accountNumber, caseNumber, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, isCaseOwnerUpdating, } = useCaseSelector((state) => ({
|
|
32
31
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
33
32
|
caseNumber: state.caseDetails.caseNumber,
|
|
34
33
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
35
34
|
selectedOwner: state.selectedOwner,
|
|
36
35
|
selectedCaseGroupUsers: state.selectedCaseGroupUsers,
|
|
37
36
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
38
|
-
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
39
37
|
}), isEqual);
|
|
40
38
|
const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
|
|
41
39
|
const caseDispatch = useCaseDispatch();
|
|
42
|
-
const { globalMetadataState: { loggedInUserRights
|
|
40
|
+
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
43
41
|
const previousAccountNumber = usePrevious(accountNumber);
|
|
44
42
|
const { isExportingPDF } = useContext(PDFContext);
|
|
45
43
|
const [usersWithGroupAccess, setUsersWithGroupAccess] = useState([]);
|
|
@@ -51,79 +49,6 @@ function OwnerSelector(props) {
|
|
|
51
49
|
!isEmpty(pvalue.ssoUsername) &&
|
|
52
50
|
value.ssoUsername !== pvalue.ssoUsername;
|
|
53
51
|
const canEditCase = useCanEditCase();
|
|
54
|
-
const updatePhone = (phoneSetting) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
yield updateCaseDetails(caseDispatch, caseNumber, phoneSetting);
|
|
56
|
-
setCaseDetails(caseDispatch, Object.assign({}, phoneSetting));
|
|
57
|
-
});
|
|
58
|
-
// set owner on updating a case
|
|
59
|
-
const updateContactPhoneNumber = (sso) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
try {
|
|
61
|
-
// logged in user and case owner are the same
|
|
62
|
-
if (sso === loggedInUser.data.ssoUsername) {
|
|
63
|
-
try {
|
|
64
|
-
const loggedInUserContact = yield (contacts === null || contacts === void 0 ? void 0 : contacts.getSFDCContactBySso(sso)); // to get updated loggedIn user contact details
|
|
65
|
-
if (loggedInUserContact.supportPhoneAreaCodePrefixLineNumber) {
|
|
66
|
-
yield updatePhone({
|
|
67
|
-
phoneAreaCodePrefixLineNumber: loggedInUserContact.supportPhoneAreaCodePrefixLineNumber || '',
|
|
68
|
-
phoneCountryCode: loggedInUserContact.supportPhoneCountryCode || '',
|
|
69
|
-
suppliedPhoneNumberVerified: isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') || //hasLoggedInUserConfirmedPhoneNumber: global verification phone state for contactSSOName === loggedInUser.data.ssoUsername
|
|
70
|
-
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
71
|
-
? hasLoggedInUserConfirmedPhoneNumber
|
|
72
|
-
: 'False',
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
yield updatePhone({
|
|
77
|
-
phoneAreaCodePrefixLineNumber: getPhoneObj(loggedInUserContact.phone).phoneLine || '',
|
|
78
|
-
phoneCountryCode: getPhoneObj(loggedInUserContact.phone).countryCode || '',
|
|
79
|
-
suppliedPhoneNumberVerified: isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') || //hasLoggedInUserConfirmedPhoneNumber: global verification phone state for contactSSOName === loggedInUser.data.ssoUsername
|
|
80
|
-
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
81
|
-
? hasLoggedInUserConfirmedPhoneNumber
|
|
82
|
-
: 'False',
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
catch (e) {
|
|
87
|
-
yield updatePhone({
|
|
88
|
-
phoneAreaCodePrefixLineNumber: '',
|
|
89
|
-
phoneCountryCode: '',
|
|
90
|
-
suppliedPhoneNumberVerified: 'False',
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
// logged in user and case owner are different
|
|
96
|
-
try {
|
|
97
|
-
const selectedContact = yield contacts.getSFDCContactBySso(sso);
|
|
98
|
-
if (selectedContact.supportPhoneAreaCodePrefixLineNumber) {
|
|
99
|
-
yield updatePhone({
|
|
100
|
-
phoneAreaCodePrefixLineNumber: selectedContact.supportPhoneAreaCodePrefixLineNumber,
|
|
101
|
-
phoneCountryCode: selectedContact.supportPhoneCountryCode,
|
|
102
|
-
suppliedPhoneNumberVerified: 'Deferred',
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
yield updatePhone({
|
|
107
|
-
phoneAreaCodePrefixLineNumber: getPhoneObj(selectedContact.phone).phoneLine || '',
|
|
108
|
-
phoneCountryCode: getPhoneObj(selectedContact.phone).countryCode || '',
|
|
109
|
-
suppliedPhoneNumberVerified: 'Deferred',
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
yield updatePhone({
|
|
115
|
-
phoneAreaCodePrefixLineNumber: '',
|
|
116
|
-
phoneCountryCode: '',
|
|
117
|
-
suppliedPhoneNumberVerified: 'False',
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
ToastNotification.addSuccessMessage(t(`Phone number has been successfully updated`));
|
|
122
|
-
}
|
|
123
|
-
catch (e) {
|
|
124
|
-
caseUpdateError.showError(e, t(`Phone number failed to update`));
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
52
|
/**
|
|
128
53
|
* Changing selected owner related
|
|
129
54
|
*/
|
|
@@ -183,7 +108,6 @@ function OwnerSelector(props) {
|
|
|
183
108
|
setLocalOwnerChange(true);
|
|
184
109
|
updateNotifyUsersList(newOwner);
|
|
185
110
|
ToastNotification.addSuccessMessage(t(`Owner has been successfully updated`));
|
|
186
|
-
yield updateContactPhoneNumber(newOwner.ssoUsername);
|
|
187
111
|
setCaseState(caseDispatch, { isCaseOwnerUpdating: false });
|
|
188
112
|
}
|
|
189
113
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AASA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAgB/D,wBAAgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AASA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAgB/D,wBAAgB,sBAAsB,sBA0XrC"}
|
|
@@ -24,17 +24,16 @@ import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorM
|
|
|
24
24
|
import { PHONE_LIMIT } from '../../../../reducers/CaseConstNTypes';
|
|
25
25
|
import { setCaseState, updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
26
26
|
import { ContactPhoneNumberPopOver } from '../../../CaseInformation/ContactPhoneNumberPopOver';
|
|
27
|
-
import { trimAndReplacePlus } from '../../../shared/utils';
|
|
27
|
+
import { removeAllChars, trimAndReplacePlus } from '../../../shared/utils';
|
|
28
28
|
import { PDFContext } from '../../PDFContainer';
|
|
29
29
|
export function CaseContactPhoneNumber() {
|
|
30
|
-
const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, suppliedPhoneNumberVerified, isCaseOwnerUpdating,
|
|
30
|
+
const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, suppliedPhoneNumberVerified, isCaseOwnerUpdating, hasLoggedInUserConfirmedPhoneNumber, } = useCaseSelector((state) => ({
|
|
31
31
|
phoneCountryCode: state.caseDetails.phoneCountryCode || '',
|
|
32
32
|
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber || '',
|
|
33
33
|
caseNumber: state.caseDetails.caseNumber,
|
|
34
34
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
35
35
|
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
36
36
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
37
|
-
phone: state.caseDetails.phone,
|
|
38
37
|
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
39
38
|
}), isEqual);
|
|
40
39
|
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
@@ -45,7 +44,7 @@ export function CaseContactPhoneNumber() {
|
|
|
45
44
|
const [localCountryCodeState, setLocalCountryCodeState] = useState(phoneCountryCode);
|
|
46
45
|
const [invalid, setInvalid] = useState(false);
|
|
47
46
|
const [isSaveClicked, setIsSavedClicked] = useState(false);
|
|
48
|
-
const [
|
|
47
|
+
const [isFetchingSSO, setIsFetchingSSO] = useState(false);
|
|
49
48
|
const caseDispatch = useCaseDispatch();
|
|
50
49
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
51
50
|
const { t } = useTranslation();
|
|
@@ -61,21 +60,22 @@ export function CaseContactPhoneNumber() {
|
|
|
61
60
|
return;
|
|
62
61
|
setLocalCountryCodeState(countryCode);
|
|
63
62
|
};
|
|
64
|
-
const regex = /[()\s-]/g; // to have only digits in phone
|
|
65
63
|
// To check if country code is given but phone number empty
|
|
66
64
|
const isPhoneNumberInvalid = !isEmpty(localFullPhoneState) &&
|
|
67
|
-
isEmpty(localFullPhoneState
|
|
65
|
+
isEmpty(removeAllChars(localFullPhoneState).replace(localCountryCodeState, ''));
|
|
68
66
|
const isPhoneLineEmpty = isEmpty(trimAndReplacePlus(localCountryCodeState)) &&
|
|
69
67
|
isEmpty(localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.replace(localCountryCodeState, ''));
|
|
68
|
+
const showInvalidPhoneError = !isCasePhoneUpdating &&
|
|
69
|
+
!isEmpty(localFullPhoneState) &&
|
|
70
|
+
!isEmpty(phoneAreaCodePrefixLineNumber) &&
|
|
71
|
+
isEmpty(phoneCountryCode); // country code empty
|
|
70
72
|
const onSave = () => __awaiter(this, void 0, void 0, function* () {
|
|
71
73
|
setIsSavedClicked(true);
|
|
72
74
|
if (isPhoneValueCannotBeSaved)
|
|
73
75
|
return;
|
|
74
76
|
setCasePhoneUpdating(true);
|
|
75
|
-
const phoneLine = localFullPhoneState
|
|
76
|
-
|
|
77
|
-
.trim();
|
|
78
|
-
const countryCode = trimAndReplacePlus(localCountryCodeState);
|
|
77
|
+
const phoneLine = getPhoneObj(localFullPhoneState).phoneLine;
|
|
78
|
+
const countryCode = getPhoneObj(localFullPhoneState).countryCode;
|
|
79
79
|
try {
|
|
80
80
|
// update case contact info
|
|
81
81
|
yield updateCaseDetails(caseDispatch, caseNumber, Object.assign(Object.assign({ phoneCountryCode: countryCode, phoneAreaCodePrefixLineNumber: phoneLine }, (contactSSOName === loggedInUser.data.ssoUsername && { suppliedPhoneNumberVerified: 'True' })), (!countryCode && !phoneLine && { clearPhoneNumber: true, suppliedPhoneNumberVerified: 'False' })));
|
|
@@ -128,54 +128,21 @@ export function CaseContactPhoneNumber() {
|
|
|
128
128
|
isPhoneNumberInvalid ||
|
|
129
129
|
isEmpty(trimAndReplacePlus(localCountryCodeState)) ||
|
|
130
130
|
trimAndReplacePlus(localFullPhoneState) === trimAndReplacePlus(localCountryCodeState);
|
|
131
|
-
|
|
132
|
-
if (isEqual(
|
|
133
|
-
|
|
131
|
+
const checkingPlusInLocalFullPhone = (_localFullPhone) => {
|
|
132
|
+
if (isEqual(_localFullPhone.trim(), '+')) {
|
|
133
|
+
return '';
|
|
134
134
|
}
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
139
|
-
}, [localFullPhoneState]);
|
|
140
|
-
const updatePhone = () => __awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
var _a, _b;
|
|
142
|
-
if (isEmpty(phoneCountryCode) && isEmpty(phoneAreaCodePrefixLineNumber) && !isEmpty(phone)) {
|
|
143
|
-
const oldPhoneline = ((_a = getPhoneObj(phone)) === null || _a === void 0 ? void 0 : _a.phoneLine) || '';
|
|
144
|
-
const oldCountryCode = ((_b = getPhoneObj(phone)) === null || _b === void 0 ? void 0 : _b.countryCode) || '';
|
|
145
|
-
if (!isEmpty(oldPhoneline.trim()) && !isEmpty(trimAndReplacePlus(oldCountryCode))) {
|
|
146
|
-
setLocalFullPhoneState(oldCountryCode + ' ' + oldPhoneline);
|
|
147
|
-
setLocalCountryCodeState(oldCountryCode);
|
|
148
|
-
setCasePhoneUpdating(true);
|
|
149
|
-
try {
|
|
150
|
-
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
151
|
-
phoneCountryCode: oldCountryCode,
|
|
152
|
-
phoneAreaCodePrefixLineNumber: oldPhoneline,
|
|
153
|
-
});
|
|
154
|
-
setCasePhoneUpdating(false);
|
|
155
|
-
}
|
|
156
|
-
catch (e) {
|
|
157
|
-
setCasePhoneUpdating(false);
|
|
158
|
-
caseUpdateError.showError(e, t(`Phone number failed to update`));
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
setIsShowOldPhone(true);
|
|
163
|
-
}
|
|
135
|
+
else if (!isEmpty(_localFullPhone.trim()) && !_localFullPhone.trim().startsWith('+')) {
|
|
136
|
+
return '+' + _localFullPhone.replace(' ', '');
|
|
164
137
|
}
|
|
165
138
|
else {
|
|
166
|
-
|
|
167
|
-
setIsShowOldPhone(false);
|
|
139
|
+
return _localFullPhone;
|
|
168
140
|
}
|
|
169
|
-
}
|
|
170
|
-
// should be removed when old phone field is removed by CCM team
|
|
171
|
-
useEffect(() => {
|
|
172
|
-
updatePhone();
|
|
173
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
174
|
-
}, [phone, phoneAreaCodePrefixLineNumber, phoneCountryCode]);
|
|
141
|
+
};
|
|
175
142
|
useEffect(() => {
|
|
176
143
|
if (contactSSOName === loggedInUser.data.ssoUsername) {
|
|
177
144
|
// edge case: when loggedInUser === contactSSOName while opening a case confirms or deffers the phone
|
|
178
|
-
// we need to save the verification state
|
|
145
|
+
// we need to save the verification state globally so that we don't show the phone review banner again
|
|
179
146
|
// to the user where he changes it to another owner and then again assigns himself as the case owner
|
|
180
147
|
setCaseState(caseDispatch, {
|
|
181
148
|
hasLoggedInUserConfirmedPhoneNumber: suppliedPhoneNumberVerified,
|
|
@@ -193,13 +160,104 @@ export function CaseContactPhoneNumber() {
|
|
|
193
160
|
}
|
|
194
161
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
195
162
|
}, [suppliedPhoneNumberVerified]);
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
if (isEmpty(contactSSOName)) {
|
|
165
|
+
setLocalFullPhoneState('');
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const initContactPhoneNumber = () => __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
let _phoneAreaCodePrefixLineNumber;
|
|
170
|
+
let _phoneCountryCode;
|
|
171
|
+
let _suppliedPhoneNumberVerified;
|
|
172
|
+
// logged in user and case owner are the same
|
|
173
|
+
if (contactSSOName === loggedInUser.data.ssoUsername) {
|
|
174
|
+
try {
|
|
175
|
+
setIsFetchingSSO(true);
|
|
176
|
+
const loggedInUserContact = yield (contacts === null || contacts === void 0 ? void 0 : contacts.getSFDCContactBySso(contactSSOName));
|
|
177
|
+
setIsFetchingSSO(false);
|
|
178
|
+
if (loggedInUserContact.supportPhoneAreaCodePrefixLineNumber) {
|
|
179
|
+
// User has opened a case before and has phone and area code in her/his contact on SF
|
|
180
|
+
_phoneAreaCodePrefixLineNumber = loggedInUserContact.supportPhoneAreaCodePrefixLineNumber;
|
|
181
|
+
_phoneCountryCode = loggedInUserContact.supportPhoneCountryCode;
|
|
182
|
+
_suppliedPhoneNumberVerified =
|
|
183
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
|
|
184
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
185
|
+
? hasLoggedInUserConfirmedPhoneNumber
|
|
186
|
+
: 'False';
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
const phoneLine = getPhoneObj(loggedInUserContact.phone).phoneLine || '';
|
|
190
|
+
const countryCode = getPhoneObj(loggedInUserContact.phone).countryCode;
|
|
191
|
+
_phoneAreaCodePrefixLineNumber = phoneLine;
|
|
192
|
+
_phoneCountryCode = countryCode;
|
|
193
|
+
_suppliedPhoneNumberVerified =
|
|
194
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
|
|
195
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
196
|
+
? hasLoggedInUserConfirmedPhoneNumber
|
|
197
|
+
: 'False';
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch (_a) {
|
|
201
|
+
_phoneAreaCodePrefixLineNumber = '';
|
|
202
|
+
_phoneCountryCode = '';
|
|
203
|
+
_suppliedPhoneNumberVerified = 'False';
|
|
204
|
+
setIsFetchingSSO(false);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
// user is openning case for others (use is partner or red hatter)
|
|
209
|
+
try {
|
|
210
|
+
setIsFetchingSSO(true);
|
|
211
|
+
const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
|
|
212
|
+
setIsFetchingSSO(false);
|
|
213
|
+
if (selectedContact.supportPhoneAreaCodePrefixLineNumber) {
|
|
214
|
+
_phoneAreaCodePrefixLineNumber = selectedContact.supportPhoneAreaCodePrefixLineNumber;
|
|
215
|
+
_phoneCountryCode = selectedContact.supportPhoneCountryCode;
|
|
216
|
+
_suppliedPhoneNumberVerified = 'Deferred';
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
_phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
|
|
220
|
+
_phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
|
|
221
|
+
_suppliedPhoneNumberVerified = 'Deferred';
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (e) {
|
|
225
|
+
_phoneAreaCodePrefixLineNumber = '';
|
|
226
|
+
_phoneCountryCode = '';
|
|
227
|
+
_suppliedPhoneNumberVerified = 'False';
|
|
228
|
+
setIsFetchingSSO(false);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
setCasePhoneUpdating(true);
|
|
232
|
+
try {
|
|
233
|
+
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
234
|
+
phoneAreaCodePrefixLineNumber: _phoneAreaCodePrefixLineNumber,
|
|
235
|
+
phoneCountryCode: _phoneCountryCode,
|
|
236
|
+
suppliedPhoneNumberVerified: _suppliedPhoneNumberVerified,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
console.log(error);
|
|
241
|
+
}
|
|
242
|
+
let _localFullPhone = _phoneCountryCode + ' ' + _phoneAreaCodePrefixLineNumber;
|
|
243
|
+
setLocalFullPhoneState(checkingPlusInLocalFullPhone(_localFullPhone));
|
|
244
|
+
setCasePhoneUpdating(false);
|
|
245
|
+
});
|
|
246
|
+
if (isEmpty(phoneCountryCode) && isEmpty(phoneAreaCodePrefixLineNumber)) {
|
|
247
|
+
initContactPhoneNumber();
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
setLocalFullPhoneState(phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber);
|
|
251
|
+
}
|
|
252
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
253
|
+
}, [contactSSOName]);
|
|
196
254
|
return (React.createElement("div", { className: "form-group pf-v5-u-pb-md", style: { minWidth: '200px' } },
|
|
197
255
|
React.createElement("h3", { className: `subheading subheading-sm ${isExportingPDF ? 'expand-input' : ''}` },
|
|
198
256
|
React.createElement(Trans, null, "Case owner's phone number"),
|
|
199
257
|
React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*"),
|
|
200
258
|
!isExportingPDF ? ContactPhoneNumberPopOver() : ''),
|
|
201
259
|
React.createElement(InputGroupText, null,
|
|
202
|
-
React.createElement(PhoneInput, { phoneValue: localFullPhoneState, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating || !isEditting, isLoading: isCasePhoneUpdating || isCaseOwnerUpdating, "data-tracking-id": "case-details-page-supplied-phone", invalid: invalid, setInvalid: setInvalid }),
|
|
260
|
+
React.createElement(PhoneInput, { phoneValue: localFullPhoneState, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating || !isEditting, isLoading: isCasePhoneUpdating || isCaseOwnerUpdating || isFetchingSSO, "data-tracking-id": "case-details-page-supplied-phone", invalid: invalid, setInvalid: setInvalid }),
|
|
203
261
|
isEditting ? (React.createElement(React.Fragment, null,
|
|
204
262
|
React.createElement("button", { className: "btn btn-app btn-link pf-v5-u-ml-sm", type: "button", "data-tracking-id": "case-details-page-supplied-phone-save", onClick: () => onSave(), "aria-label": "Save", disabled: (isSaveClicked && isPhoneValueCannotBeSaved) ||
|
|
205
263
|
(localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) > PHONE_LIMIT ||
|
|
@@ -213,7 +271,7 @@ export function CaseContactPhoneNumber() {
|
|
|
213
271
|
!invalid &&
|
|
214
272
|
(localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) < PHONE_LIMIT &&
|
|
215
273
|
!(isSaveClicked && isPhoneValueCannotBeSaved) &&
|
|
216
|
-
!
|
|
274
|
+
!showInvalidPhoneError && (React.createElement("p", { className: "form-instructions" },
|
|
217
275
|
React.createElement(Trans, null, PHONE_INSTRUCTION))),
|
|
218
276
|
invalid && (React.createElement("p", { className: "form-instructions form-invalid" },
|
|
219
277
|
React.createElement(Trans, null, PHONE_NO_CHAR_ERROR))),
|
|
@@ -224,9 +282,9 @@ export function CaseContactPhoneNumber() {
|
|
|
224
282
|
React.createElement(Trans, null, PHONE_LINE_CANNOT_BE_EMPTY))),
|
|
225
283
|
isSaveClicked && isEmpty(trimAndReplacePlus(localCountryCodeState)) && !isPhoneLineEmpty && (React.createElement("p", { className: "form-instructions form-invalid" },
|
|
226
284
|
React.createElement(Trans, null, PHONE_IS_NOT_VALID))),
|
|
227
|
-
|
|
285
|
+
showInvalidPhoneError && (React.createElement("p", { className: "form-instructions form-invalid" },
|
|
228
286
|
React.createElement(Trans, null,
|
|
229
287
|
"The phone number on case is ",
|
|
230
|
-
|
|
288
|
+
localFullPhoneState,
|
|
231
289
|
". The format of the phone field is changed and this phone does not fit.")))));
|
|
232
290
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,wBAAgB,kBAAkB,sBA+UjC"}
|
|
@@ -234,7 +234,12 @@ export function ContactPhoneNumber() {
|
|
|
234
234
|
}
|
|
235
235
|
else {
|
|
236
236
|
// user is openning case for others (use is partner or red hatter)
|
|
237
|
-
|
|
237
|
+
try {
|
|
238
|
+
yield getSelectedContactPhoneInfo();
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
console.log(error);
|
|
242
|
+
}
|
|
238
243
|
}
|
|
239
244
|
if ((isUndefined(supportPhone) || isEmpty(supportPhone)) &&
|
|
240
245
|
isEqual(removeAllChars(portalPhone), removeAllChars(phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber)) &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.142",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@progress/kendo-licensing": "1.3.5",
|
|
61
61
|
"@progress/kendo-react-pdf": "^5.16.0",
|
|
62
62
|
"@redux-devtools/extension": "^3.3.0",
|
|
63
|
-
"@rh-support/components": "2.1.
|
|
64
|
-
"@rh-support/react-context": "2.1.
|
|
63
|
+
"@rh-support/components": "2.1.70",
|
|
64
|
+
"@rh-support/react-context": "2.1.78",
|
|
65
65
|
"@rh-support/types": "2.0.4",
|
|
66
66
|
"@rh-support/user-permissions": "2.1.48",
|
|
67
67
|
"@rh-support/utils": "2.1.37",
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
"defaults and supports es6-module",
|
|
132
132
|
"maintained node versions"
|
|
133
133
|
],
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "e840019f9485b934d8d2b5163b4a94c3fc4ae2d2"
|
|
135
135
|
}
|