@rh-support/troubleshoot 2.2.116 → 2.2.118

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.
@@ -1 +1 @@
1
- {"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAyXnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAmYnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -120,12 +120,20 @@ function OwnerSelector(props) {
120
120
  yield updatePhone({
121
121
  phoneAreaCodePrefixLineNumber: loggedInUser.data.supportPhoneAreaCodePrefixLineNumber,
122
122
  phoneCountryCode: loggedInUser.data.supportPhoneCountryCode,
123
+ suppliedPhoneNumberVerified: isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') || //hasLoggedInUserConfirmedPhoneNumber: global verification phone state for contactSSOName === loggedInUser.data.ssoUsername
124
+ isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
125
+ ? hasLoggedInUserConfirmedPhoneNumber
126
+ : 'False',
123
127
  });
124
128
  }
125
129
  else {
126
130
  yield updatePhone({
127
131
  phoneAreaCodePrefixLineNumber: getPhoneObj(loggedInUser.data.phone).phoneLine || '',
128
132
  phoneCountryCode: getPhoneObj(loggedInUser.data.phone).countryCode || '',
133
+ suppliedPhoneNumberVerified: isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') || //hasLoggedInUserConfirmedPhoneNumber: global verification phone state for contactSSOName === loggedInUser.data.ssoUsername
134
+ isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
135
+ ? hasLoggedInUserConfirmedPhoneNumber
136
+ : 'False',
129
137
  });
130
138
  }
131
139
  }
@@ -296,7 +304,7 @@ function OwnerSelector(props) {
296
304
  }
297
305
  }
298
306
  // eslint-disable-next-line react-hooks/exhaustive-deps
299
- }, [loggedInUser.data, caseDetailes.contactSSOName]);
307
+ }, []);
300
308
  const showUsersWithSelectedGroupAccess = caseNumber &&
301
309
  (selectedCaseGroupUsers.isFetching ||
302
310
  (!selectedCaseGroupUsers.isFetching && (selectedCaseGroupUsers.data || []).length > 0));
@@ -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,sBAkRrC"}
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,sBAgTrC"}
@@ -22,7 +22,7 @@ import { PHONE_INSTRUCTION, PHONE_IS_NOT_VALID, PHONE_LINE_CANNOT_BE_EMPTY, PHON
22
22
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
23
23
  import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
24
24
  import { PHONE_LIMIT } from '../../../../reducers/CaseConstNTypes';
25
- import { updateCaseDetails } from '../../../../reducers/CaseReducer';
25
+ import { setCaseState, updateCaseDetails } from '../../../../reducers/CaseReducer';
26
26
  import { ContactPhoneNumberPopOver } from '../../../CaseInformation/ContactPhoneNumberPopOver';
27
27
  import { trimAndReplacePlus } from '../../../shared/utils';
28
28
  import { PDFContext } from '../../PDFContainer';
@@ -110,7 +110,8 @@ export function CaseContactPhoneNumber() {
110
110
  const isPhoneNeedsReview = !isEmpty(contactSSOName) &&
111
111
  contactSSOName === loggedInUser.data.ssoUsername &&
112
112
  suppliedPhoneNumberVerified === 'Deferred' &&
113
- !isCaseOwnerUpdating;
113
+ !isCaseOwnerUpdating &&
114
+ !isCasePhoneUpdating;
114
115
  const isPhoneNumberValid = (localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) > PHONE_LIMIT
115
116
  ? ValidatedOptions.error
116
117
  : isPhoneNeedsReview
@@ -134,8 +135,7 @@ export function CaseContactPhoneNumber() {
134
135
  }
135
136
  // eslint-disable-next-line react-hooks/exhaustive-deps
136
137
  }, [localFullPhoneState]);
137
- // should be removed when old phone field is removed by CCM team
138
- useEffect(() => {
138
+ const updatePhone = () => __awaiter(this, void 0, void 0, function* () {
139
139
  var _a, _b;
140
140
  if (isEmpty(phoneCountryCode) && isEmpty(phoneAreaCodePrefixLineNumber) && !isEmpty(phone)) {
141
141
  const oldPhoneline = ((_a = getPhoneObj(phone)) === null || _a === void 0 ? void 0 : _a.phoneLine) || '';
@@ -143,6 +143,18 @@ export function CaseContactPhoneNumber() {
143
143
  if (!isEmpty(oldPhoneline.trim()) && !isEmpty(trimAndReplacePlus(oldCountryCode))) {
144
144
  setLocalFullPhoneState(oldCountryCode + ' ' + oldPhoneline);
145
145
  setLocalCountryCodeState(oldCountryCode);
146
+ setCasePhoneUpdating(true);
147
+ try {
148
+ yield updateCaseDetails(caseDispatch, caseNumber, {
149
+ phoneCountryCode: oldCountryCode,
150
+ phoneAreaCodePrefixLineNumber: oldPhoneline,
151
+ });
152
+ setCasePhoneUpdating(false);
153
+ }
154
+ catch (e) {
155
+ setCasePhoneUpdating(false);
156
+ caseUpdateError.showError(e, t(`Phone number failed to update`));
157
+ }
146
158
  }
147
159
  else {
148
160
  setIsShowOldPhone(true);
@@ -152,21 +164,38 @@ export function CaseContactPhoneNumber() {
152
164
  setLocalFullPhoneState((phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber).trim());
153
165
  setIsShowOldPhone(false);
154
166
  }
167
+ });
168
+ // should be removed when old phone field is removed by CCM team
169
+ useEffect(() => {
170
+ updatePhone();
155
171
  // eslint-disable-next-line react-hooks/exhaustive-deps
156
172
  }, [phone, phoneAreaCodePrefixLineNumber, phoneCountryCode]);
173
+ useEffect(() => {
174
+ if (contactSSOName === loggedInUser.data.ssoUsername) {
175
+ // edge case: when loggedInUser === contactSSOName while opening a case confirms or deffers the phone
176
+ // we need to save the verification state globallly so that we don't show the phone review banner again
177
+ // to the user where he changes it to another owner and then again assigns himself as the case owner
178
+ setCaseState(caseDispatch, {
179
+ hasLoggedInUserConfirmedPhoneNumber: suppliedPhoneNumberVerified,
180
+ });
181
+ }
182
+ // eslint-disable-next-line react-hooks/exhaustive-deps
183
+ }, [suppliedPhoneNumberVerified]);
157
184
  return (React.createElement("div", { className: "form-group pf-v5-u-pb-md", style: { minWidth: '200px' } },
158
185
  React.createElement("h3", { className: `subheading subheading-sm ${isExportingPDF ? 'expand-input' : ''}` },
159
186
  React.createElement(Trans, null, "Case owner's phone number"),
160
187
  React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*"),
161
188
  !isExportingPDF ? ContactPhoneNumberPopOver() : ''),
162
189
  React.createElement(InputGroupText, null,
163
- React.createElement(PhoneInput, { phoneValue: localFullPhoneState, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating || !isEditting, isLoading: isCasePhoneUpdating, "data-tracking-id": "case-details-page-supplied-phone", invalid: invalid, setInvalid: setInvalid }),
190
+ 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 }),
164
191
  isEditting ? (React.createElement(React.Fragment, null,
165
192
  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) ||
166
193
  (localFullPhoneState === null || localFullPhoneState === void 0 ? void 0 : localFullPhoneState.length) > PHONE_LIMIT ||
167
- localFullPhoneState === phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber, style: { display: isExportingPDF ? 'none' : '' } },
194
+ localFullPhoneState === phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber ||
195
+ isCaseOwnerUpdating ||
196
+ isCasePhoneUpdating, style: { display: isExportingPDF ? 'none' : '' } },
168
197
  React.createElement(CheckIcon, null)),
169
- React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: onClear, "data-tracking-id": "case-details-page-supplied-phone-cancel", style: { display: isExportingPDF ? 'none' : '' }, disabled: isEmpty(localFullPhoneState), "aria-label": "Clear" },
198
+ React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: onClear, "data-tracking-id": "case-details-page-supplied-phone-cancel", style: { display: isExportingPDF ? 'none' : '' }, disabled: isEmpty(localFullPhoneState) || isCaseOwnerUpdating || isCasePhoneUpdating, "aria-label": "Clear" },
170
199
  React.createElement(TimesIcon, { color: "#6A6E73" })))) : (React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: () => setIsEditting(true), "data-tracking-id": "case-details-page-supplied-phone-edit", style: { display: isExportingPDF ? 'none' : '' }, "aria-label": "Edit" },
171
200
  React.createElement(PencilAltIcon, null)))),
172
201
  !invalid &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.116",
3
+ "version": "2.2.118",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -131,5 +131,5 @@
131
131
  "defaults and supports es6-module",
132
132
  "maintained node versions"
133
133
  ],
134
- "gitHead": "aa56a22b784978f97c2a073e1cc5868648790890"
134
+ "gitHead": "deab4dee0be1771b098bd0260da67743c8f2a804"
135
135
  }