@rh-support/troubleshoot 2.6.333 → 2.6.335

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.
Files changed (77) hide show
  1. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/OwnerSelector.js +1 -0
  3. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +1 -1
  4. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +2 -2
  5. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/CaseOverview/index.js +13 -8
  7. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +1 -1
  9. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +26 -4
  11. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +26 -4
  13. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +1 -0
  14. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +1 -0
  16. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  17. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +7 -4
  18. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +106 -71
  20. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  21. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +4 -2
  22. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +1 -0
  23. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +3 -1
  25. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +11 -4
  27. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +4 -2
  28. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +11 -4
  30. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +3 -0
  31. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +42 -13
  33. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  34. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +1 -1
  35. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  36. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +70 -6
  37. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +2 -1
  38. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  39. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +19 -3
  40. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  41. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +13 -14
  42. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  43. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +7 -3
  44. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  45. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +12 -2
  46. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  47. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +13 -0
  48. package/lib/esm/constants/caseDetailsConstants.d.ts +5 -0
  49. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  50. package/lib/esm/constants/caseDetailsConstants.js +5 -0
  51. package/lib/esm/hooks/useCaseComments/index.d.ts +1 -1
  52. package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -1
  53. package/lib/esm/hooks/useCaseComments/index.js +1 -1
  54. package/lib/esm/hooks/useCaseComments/types.d.ts +11 -5
  55. package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -1
  56. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +2 -1
  57. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -1
  58. package/lib/esm/hooks/useCaseComments/useCaseComments.js +15 -2
  59. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -1
  60. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +1 -2
  61. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -1
  62. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  63. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +21 -11
  64. package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -0
  65. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  66. package/lib/esm/reducers/CaseConstNTypes.js +1 -0
  67. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +5 -0
  68. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  69. package/lib/esm/reducers/CaseDiscussionTabReducer.js +15 -0
  70. package/lib/esm/reducers/CaseHelpers.js +1 -1
  71. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  72. package/lib/esm/reducers/CaseReducer.js +9 -6
  73. package/lib/esm/scss/_main.scss +9 -0
  74. package/package.json +6 -6
  75. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +0 -4
  76. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +0 -1
  77. package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +0 -12
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { useApolloClient } from '@apollo/client/react';
11
11
  import { Button, ButtonVariant, Checkbox } from '@patternfly/react-core';
12
12
  import PlusIcon from '@patternfly/react-icons/dist/js/icons/plus-icon';
13
+ import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
13
14
  import { LoadingIndicator, RichTextEditor, ToastNotification, usePrevious } from '@rh-support/components';
14
15
  import { GlobalMetadataStateContext, useCanEditCase, useUserPreferences } from '@rh-support/react-context';
15
16
  import { ability, CaseDiscussionFields, resourceActions, resources } from '@rh-support/user-permissions';
16
- import { getHydraAttachmentImageUrl } from '@rh-support/utils';
17
+ import { formatDateTime, getHydraAttachmentImageUrl } from '@rh-support/utils';
17
18
  import isEmpty from 'lodash/isEmpty';
18
19
  import isEqual from 'lodash/isEqual';
19
20
  import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
@@ -32,7 +33,7 @@ import { useCommentDrafts } from './PostComment/useCommentDrafts';
32
33
  import { useMarkdownFileUploader } from './PostComment/useMarkdownFileUploader';
33
34
  import { VerifyCaseStatusModal } from './VerifyCaseStatusModal/VerifyCaseStatusModal';
34
35
  export function PostComment(props) {
35
- var _a, _b, _c, _d, _e, _f;
36
+ var _a, _b, _c, _d, _e, _f, _g;
36
37
  const { t } = useTranslation();
37
38
  let { caseNumber } = props;
38
39
  const [isTextAreaFocused, setIsTextAreaFocused] = useState(false);
@@ -45,7 +46,7 @@ export function PostComment(props) {
45
46
  const hasQueuedUploads = hasQueuedAttachmentUploads(attachmentState.caseFiles.selectedLocalFiles);
46
47
  const hasAbortedOrFailed = hasAbortedOrFailedAttachments(attachmentState.caseFiles.selectedLocalFiles);
47
48
  const hasSomeSelectedFilesLocal = hasSomeSelectedFiles(attachmentState.caseFiles.selectedLocalFiles);
48
- const [isPublic, setIsPublic] = useState(props.defaultIsPublic === null ? true : props.defaultIsPublic);
49
+ const [isPublic, setIsPublic] = useState((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true);
49
50
  const [commentSignature, setCommentSignature] = useState('');
50
51
  const [commentText, setCommentText] = useState('');
51
52
  const { isExportingPDF } = useContext(PDFContext);
@@ -65,7 +66,7 @@ export function PostComment(props) {
65
66
  const sig = (yield getCommentSignature()) || '';
66
67
  setCommentSignature(sig);
67
68
  if (isEmpty(commentText) && !isEmpty(sig)) {
68
- setCommentText(`<p>${sig}</p>`);
69
+ setCommentText(`<p><br></p><p>${sig}</p>`);
69
70
  }
70
71
  }
71
72
  catch (error) {
@@ -82,7 +83,7 @@ export function PostComment(props) {
82
83
  const { globalMetadataState: { loggedInUser, loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
83
84
  const { onFileAttach, cancelFileUpload } = useMarkdownFileUploader({
84
85
  caseNumber,
85
- onAttachmentAdded: (_a = props.onAttachmentAdded) !== null && _a !== void 0 ? _a : (() => undefined),
86
+ onAttachmentAdded: (_b = props.onAttachmentAdded) !== null && _b !== void 0 ? _b : (() => undefined),
86
87
  });
87
88
  const { getRootProps, getInputProps } = useDropzone({
88
89
  onDrop: (files) => onFileAttach(files, isPublic),
@@ -103,24 +104,27 @@ export function PostComment(props) {
103
104
  }
104
105
  return getHydraAttachmentImageUrl(caseNumber, attachmentId);
105
106
  }), [caseNumber, uploadImageFile]);
106
- const isConfirmedStateSideSupport = (_b = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _b === void 0 ? void 0 : _b.hasConfirmedStatesideSupport;
107
+ const isConfirmedStateSideSupport = (_c = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _c === void 0 ? void 0 : _c.hasConfirmedStatesideSupport;
107
108
  const caseDispatch = useCaseDispatch();
108
109
  const [isCommentTooLong, setIsCommentTooLong] = useState(false);
109
110
  const canEditCase = useCanEditCase();
110
111
  const componentRef = useRef(null);
111
- const resetIsPublic = useCallback(() => setIsPublic(props.defaultIsPublic === null ? true : props.defaultIsPublic), [props.defaultIsPublic]);
112
+ const resetIsPublic = useCallback(() => { var _a; return setIsPublic((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true); }, [props.defaultIsPublic]);
112
113
  const previousDefaultIsPublic = usePrevious(props.defaultIsPublic);
113
114
  useEffect(() => {
115
+ var _a;
114
116
  if (previousDefaultIsPublic === props.defaultIsPublic)
115
117
  return;
116
- props.defaultIsPublic === null ? resetIsPublic() : setIsPublic(props.defaultIsPublic);
118
+ setIsPublic((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true);
117
119
  }, [props.defaultIsPublic, resetIsPublic, previousDefaultIsPublic]);
118
120
  const quillEditorRef = useRef(null);
119
121
  const loggedInUserSSO = loggedInUserRights.data.getSSOUsername();
120
122
  const { saveDraft, clearDraft } = useCommentDrafts({
121
123
  caseNumber,
122
124
  loggedInUserSSO,
125
+ isInternal: loggedInUserRights.data.isInternal(),
123
126
  commentSignature,
127
+ canPostPrivateComments,
124
128
  setCommentText,
125
129
  setIsPublic,
126
130
  applySignature,
@@ -130,7 +134,7 @@ export function PostComment(props) {
130
134
  setIsTextAreaFocused(false);
131
135
  resetIsPublic();
132
136
  yield clearDraft();
133
- setCommentText(commentSignature ? `<p>${commentSignature}</p>` : '');
137
+ setCommentText(commentSignature ? `<p><br></p><p>${commentSignature}</p>` : '');
134
138
  });
135
139
  const resetAttachmentSection = () => {
136
140
  resetAttachment(dispatchToAttachmentReducer);
@@ -181,22 +185,35 @@ export function PostComment(props) {
181
185
  // await addingNotifiedUsers(caseDispatch, caseNumber, [{ ssoUsername: sso }]);
182
186
  // setNotifiedUser(caseDispatch, uniqBy([...selectedNotificationContacts, loggedInUser.data], 'ssoUsername'));
183
187
  // };
184
- const plainTextContent = (_f = (_e = (_d = (_c = quillEditorRef.current) === null || _c === void 0 ? void 0 : _c.getText) === null || _d === void 0 ? void 0 : _d.call(_c)) === null || _e === void 0 ? void 0 : _e.trim()) !== null && _f !== void 0 ? _f : '';
188
+ const plainTextContent = (_g = (_f = (_e = (_d = quillEditorRef.current) === null || _d === void 0 ? void 0 : _d.getText) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.trim()) !== null && _g !== void 0 ? _g : '';
185
189
  const checkCommentSignature = plainTextContent.replace(commentSignature, '');
186
190
  const isCommentEmpty = isEmpty(checkCommentSignature === null || checkCommentSignature === void 0 ? void 0 : checkCommentSignature.trim());
187
191
  const onPostComment = () => __awaiter(this, void 0, void 0, function* () {
188
- var _a;
192
+ var _a, _b;
189
193
  if (canEditCase.alert())
190
194
  return;
191
195
  if (!commentText)
192
196
  return;
193
197
  if (!caseSalesforceId)
194
198
  return;
199
+ let body = commentText;
200
+ if (props.replyingToAuthor) {
201
+ const formattedTimestamp = props.replyingToTimestamp ? formatDateTime(props.replyingToTimestamp) : '';
202
+ const replyPrefix = formattedTimestamp
203
+ ? t('(replying to {{commentCreator}}, {{timestamp}}) \n', {
204
+ commentCreator: props.replyingToAuthor,
205
+ timestamp: formattedTimestamp,
206
+ })
207
+ : t('(replying to {{commentCreator}}) \n', {
208
+ commentCreator: props.replyingToAuthor,
209
+ });
210
+ body = `<p>${replyPrefix}</p>${body}`;
211
+ }
195
212
  try {
196
213
  setIsProcessing(true);
197
214
  yield createComment({
198
215
  caseId: caseSalesforceId,
199
- body: commentText,
216
+ body,
200
217
  isPublic,
201
218
  isAssociate: loggedInUserRights.data.isInternal(),
202
219
  });
@@ -207,10 +224,11 @@ export function PostComment(props) {
207
224
  // addUserToNotifyList();
208
225
  yield ((_a = props.onCommentAdded) === null || _a === void 0 ? void 0 : _a.call(props));
209
226
  resetCommentSection();
227
+ (_b = props.onClearReply) === null || _b === void 0 ? void 0 : _b.call(props);
210
228
  ToastNotification.addSuccessMessage(t('Comment submitted'));
211
229
  setCssCommentAgreed(false);
212
230
  }
213
- catch (_b) {
231
+ catch (_c) {
214
232
  ToastNotification.addDangerMessage(t('Could not submit comment. Please refresh the page and try again.'));
215
233
  }
216
234
  finally {
@@ -241,6 +259,17 @@ export function PostComment(props) {
241
259
  // Submit stays independent of attachment upload so comments can be posted mid-upload (PCM-15915).
242
260
  const isSubmitDisabled = isCommentEmpty || isPostCommentDisabled || (isConfirmedStateSideSupport && !cssCommentAgreed);
243
261
  return (React.createElement("div", { className: `pf-v6-u-mb-md ${isExportingPDF ? 'hide-in-pdf' : ''}`, ref: componentRef },
262
+ props.replyingToAuthor && (React.createElement("div", { className: "post-comment-reply-banner pf-v6-u-mb-sm", "data-tracking-id": "reply-banner" },
263
+ React.createElement("span", null,
264
+ React.createElement(Trans, null, "Replying to"),
265
+ " ",
266
+ React.createElement("strong", null, props.replyingToAuthor),
267
+ props.replyingToTimestamp && (React.createElement("span", { className: "pf-v6-u-ml-xs pf-v6-u-color-200" },
268
+ "(",
269
+ formatDateTime(props.replyingToTimestamp),
270
+ ")"))),
271
+ React.createElement(Button, { variant: ButtonVariant.plain, "aria-label": t('Cancel reply'), onClick: props.onClearReply, "data-tracking-id": "cancel-reply-button" },
272
+ React.createElement(TimesIcon, null)))),
244
273
  React.createElement(RichTextEditor, { className: `${!isPublic && canPostPrivateComments ? 'is-private' : ''}`, disabled: isProcessing || canEditCase.isCaseNotEditable, "aria-label": "comment text area", onFocus: () => setIsTextAreaFocused(true), onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, height: isTextAreaFocused ? 313 : 120, onCharLimitExceeded: onCommentExceedCharsLimit, placeholder: !isPublic && canPostPrivateComments
245
274
  ? 'Add a comment or attach a file privately'
246
275
  : 'Add a comment to this case', charLimit: 32000, onImageUpload: onImageUpload, bindEditor: (editor) => {
@@ -1 +1 @@
1
- {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA8IlD"}
1
+ {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBAiJlD"}
@@ -71,7 +71,7 @@ export function VerifyCaseStatusModal(props) {
71
71
  }
72
72
  catch (e) {
73
73
  setStatusUpdating(caseOverviewDispatch, false);
74
- caseUpdateError.showError(e, t('Status failed to update'));
74
+ caseUpdateError.showError(e, t('Status failed to update, try refreshing the page. Please contact us if the problem persists.'));
75
75
  }
76
76
  }
77
77
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAsC/D,wBAAgB,kBAAkB,sBAwVjC"}
1
+ {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAsC/D,wBAAgB,kBAAkB,sBAwZjC"}
@@ -78,6 +78,7 @@ export function ContactPhoneNumber() {
78
78
  };
79
79
  const onPhoneChange = (fullPhone) => {
80
80
  setLocalFullPhone(checkingPlusInLocalFullPhone(fullPhone));
81
+ setCaseState(caseDispatch, { hasUserUpdatedSuppliedPhone: true });
81
82
  if (!shouldNotSetPhoneCountryCode) {
82
83
  setCaseDetails(caseDispatch, {
83
84
  phoneAreaCodePrefixLineNumber: getPhoneObj(fullPhone).phoneLine,
@@ -89,12 +90,17 @@ export function ContactPhoneNumber() {
89
90
  setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: false });
90
91
  }
91
92
  setCaseDetails(caseDispatch, {
93
+ // TODO: Temporary — do not prepend + for portal phone without country code.
94
+ phoneAreaCodePrefixLineNumber: fullPhone.trim().replace(/^\+/, ''),
95
+ /* TODO: Revert to previous logic after phone format handling is finalized.
92
96
  phoneAreaCodePrefixLineNumber: checkingPlusInLocalFullPhone(fullPhone),
97
+ */
93
98
  phoneCountryCode: '',
94
99
  });
95
100
  }
96
101
  };
97
102
  const onCountryCodeChange = (phoneCountryCode) => {
103
+ setCaseState(caseDispatch, { hasUserUpdatedSuppliedPhone: true });
98
104
  setCaseDetails(caseDispatch, { phoneCountryCode });
99
105
  };
100
106
  const maxLengthErrorMessage = t('Phone number cannot be more than {{limit}} digits.', {
@@ -135,6 +141,7 @@ export function ContactPhoneNumber() {
135
141
  setLocalFullPhone('');
136
142
  setCaseState(caseDispatch, { isCasePhoneUpdating: true });
137
143
  const initContactPhoneNumber = () => __awaiter(this, void 0, void 0, function* () {
144
+ var _a, _b;
138
145
  let _phoneAreaCodePrefixLineNumber;
139
146
  let _phoneCountryCode;
140
147
  let _suppliedPhoneNumberVerified;
@@ -152,20 +159,41 @@ export function ContactPhoneNumber() {
152
159
  }
153
160
  else {
154
161
  // User is openning a case for the first time
155
- const phoneLength = trimAndReplacePlus(removeAllChars(loggedInUser.data.phone)).length;
162
+ /* TODO: Revert to previous logic after phone format handling is finalized.
163
+ const phoneLength = trimAndReplacePlus(removeAllChars(loggedInUser.data.phone!)).length;
164
+
156
165
  // For first time user whose phone is fetched from portal without country code
157
166
  // For phone length less or equal to 10 country code shouldn't be fetched to avoid faulty phone population
158
167
  if (phoneLength > 10) {
159
- const phoneLine = getPhoneObj(loggedInUser.data.phone).phoneLine || '';
160
- const countryCode = getPhoneObj(loggedInUser.data.phone).countryCode;
168
+ const phoneLine = getPhoneObj(loggedInUser.data.phone!).phoneLine || '';
169
+ const countryCode = getPhoneObj(loggedInUser.data.phone!).countryCode;
170
+
161
171
  _phoneAreaCodePrefixLineNumber = phoneLine;
162
172
  _phoneCountryCode = countryCode;
173
+ } else {
174
+ setCaseState(caseDispatch, {
175
+ shouldNotSetPhoneCountryCode: true,
176
+ });
177
+ _phoneAreaCodePrefixLineNumber = loggedInUser.data.phone!;
178
+ _phoneCountryCode = '';
179
+ setPortalPhone(loggedInUser.data.phone!);
180
+ }
181
+ */
182
+ // TODO: Temporary — only parse country code from +{countryCode}-{phoneLine} format
183
+ const explicitPhoneMatch = (_a = loggedInUser.data.phone) === null || _a === void 0 ? void 0 : _a.trim().match(/^\+(\d+)-(.+)$/);
184
+ if (explicitPhoneMatch) {
185
+ _phoneCountryCode = `+${explicitPhoneMatch[1]}`;
186
+ _phoneAreaCodePrefixLineNumber = explicitPhoneMatch[2];
163
187
  }
164
188
  else {
165
189
  setCaseState(caseDispatch, {
166
190
  shouldNotSetPhoneCountryCode: true,
167
191
  });
168
- _phoneAreaCodePrefixLineNumber = loggedInUser.data.phone;
192
+ // TODO: Temporary — strip leading + when phone is not in +{countryCode}-{phoneLine} format.
193
+ _phoneAreaCodePrefixLineNumber = loggedInUser.data.phone.replace(/^\+/, '');
194
+ /* TODO: Revert to previous logic after phone format handling is finalized.
195
+ _phoneAreaCodePrefixLineNumber = loggedInUser.data.phone!;
196
+ */
169
197
  _phoneCountryCode = '';
170
198
  setPortalPhone(loggedInUser.data.phone);
171
199
  }
@@ -184,13 +212,31 @@ export function ContactPhoneNumber() {
184
212
  setIsFetchingSso(true);
185
213
  const selectedContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
186
214
  setIsFetchingSso(false);
215
+ /* TODO: Revert to previous logic after phone format handling is finalized.
187
216
  const phoneLength = trimAndReplacePlus(removeAllChars(selectedContact.phone)).length;
217
+
188
218
  if (phoneLength > 10) {
189
219
  _phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
190
220
  _phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
221
+ } else {
222
+ _phoneAreaCodePrefixLineNumber = selectedContact.phone;
223
+ _phoneCountryCode = '';
224
+ setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: true });
225
+ setPortalPhone(selectedContact.phone);
226
+ }
227
+ */
228
+ // TODO: Temporary — only parse country code from +{countryCode}-{phoneLine} format (e.g. +93-895674341).
229
+ const explicitPhoneMatch = (_b = selectedContact.phone) === null || _b === void 0 ? void 0 : _b.trim().match(/^\+(\d+)-(.+)$/);
230
+ if (explicitPhoneMatch) {
231
+ _phoneCountryCode = `+${explicitPhoneMatch[1]}`;
232
+ _phoneAreaCodePrefixLineNumber = explicitPhoneMatch[2];
191
233
  }
192
234
  else {
235
+ // TODO: Temporary — strip leading + when phone is not in +{countryCode}-{phoneLine} format.
236
+ _phoneAreaCodePrefixLineNumber = selectedContact.phone.replace(/^\+/, '');
237
+ /* TODO: Revert to previous logic after phone format handling is finalized.
193
238
  _phoneAreaCodePrefixLineNumber = selectedContact.phone;
239
+ */
194
240
  _phoneCountryCode = '';
195
241
  setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: true });
196
242
  setPortalPhone(selectedContact.phone);
@@ -210,9 +256,19 @@ export function ContactPhoneNumber() {
210
256
  phoneCountryCode: _phoneCountryCode,
211
257
  suppliedPhoneNumberVerified: _suppliedPhoneNumberVerified,
212
258
  });
259
+ // TODO: Temporary — do not prepend + when country code is not set.
260
+ const _localFullPhone = isEmpty(_phoneCountryCode)
261
+ ? (_phoneAreaCodePrefixLineNumber === null || _phoneAreaCodePrefixLineNumber === void 0 ? void 0 : _phoneAreaCodePrefixLineNumber.trim()) || ''
262
+ : checkingPlusInLocalFullPhone(`${_phoneCountryCode} ${_phoneAreaCodePrefixLineNumber}`);
263
+ /* TODO: Revert to previous logic after phone format handling is finalized.
213
264
  let _localFullPhone = _phoneCountryCode + ' ' + _phoneAreaCodePrefixLineNumber;
214
265
  setLocalFullPhone(checkingPlusInLocalFullPhone(_localFullPhone));
215
- setCaseState(caseDispatch, { isCasePhoneUpdating: false });
266
+ */
267
+ setLocalFullPhone(_localFullPhone);
268
+ setCaseState(caseDispatch, {
269
+ isCasePhoneUpdating: false,
270
+ hasUserUpdatedSuppliedPhone: false,
271
+ });
216
272
  });
217
273
  // if phone not initialized with portal and user contact value, initialize it else populate phone inputbox
218
274
  if (isEmpty(phoneAreaCodePrefixLineNumber) && isEmpty(phoneCountryCode)) {
@@ -265,7 +321,15 @@ export function ContactPhoneNumber() {
265
321
  phoneLength <= 10) {
266
322
  setPortalPhone(portalPhone);
267
323
  }
268
- setLocalFullPhone(checkingPlusInLocalFullPhone((phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber).trim()));
324
+ // TODO: Temporary do not prepend + when country code is not set.
325
+ setLocalFullPhone(isEmpty(phoneCountryCode)
326
+ ? (phoneAreaCodePrefixLineNumber === null || phoneAreaCodePrefixLineNumber === void 0 ? void 0 : phoneAreaCodePrefixLineNumber.trim()) || ''
327
+ : checkingPlusInLocalFullPhone((phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber).trim()));
328
+ /* TODO: Revert to previous logic after phone format handling is finalized.
329
+ setLocalFullPhone(
330
+ checkingPlusInLocalFullPhone((phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber).trim())
331
+ );
332
+ */
269
333
  setCaseState(caseDispatch, { isCasePhoneUpdating: false });
270
334
  }
271
335
  });
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  interface IProps {
3
- onReasonInputBoxChanged: (Reason: string) => void;
3
+ onReasonInputBoxChanged?: (Reason: string) => void;
4
+ onReasonInputBoxBlur?: (reason: string) => void;
4
5
  onReasonChange: (Reason: string) => void;
5
6
  noClusterIdReasonExplanation: string;
6
7
  noClusterIdReason: string;
@@ -1 +1 @@
1
- {"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,yBAAyB,GAAI,OAAO,MAAM,sBAsK/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
1
+ {"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,yBAAyB,GAAI,OAAO,MAAM,sBAwL/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -26,9 +26,11 @@ const NoClusterIDReasonSelector = (props) => {
26
26
  'I am opening a case on behalf of the customer and cannot provide their Cluster ID at this time')
27
27
  : caseNoClusterIdReasons.data;
28
28
  const clearSelection = () => {
29
+ var _a, _b;
29
30
  setNotRegistered(false);
30
31
  setInputValue('');
31
- props.onReasonInputBoxChanged('');
32
+ (_a = props.onReasonInputBoxBlur) === null || _a === void 0 ? void 0 : _a.call(props, '');
33
+ (_b = props.onReasonInputBoxChanged) === null || _b === void 0 ? void 0 : _b.call(props, '');
32
34
  props.onReasonChange('');
33
35
  };
34
36
  const handleReasonChange = (option) => {
@@ -40,10 +42,24 @@ const NoClusterIDReasonSelector = (props) => {
40
42
  }
41
43
  };
42
44
  const handleInputChange = (_event, value) => {
45
+ var _a;
43
46
  const cleaned = value.trim().length === 0 ? '' : value;
44
47
  setInputValue(cleaned);
45
48
  setHasLargeReasonExplanation(cleaned.length > SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT);
46
- props.onReasonInputBoxChanged(cleaned);
49
+ if (!props.onReasonInputBoxBlur) {
50
+ (_a = props.onReasonInputBoxChanged) === null || _a === void 0 ? void 0 : _a.call(props, cleaned);
51
+ }
52
+ };
53
+ const handleInputBlur = () => {
54
+ var _a;
55
+ const cleaned = (inputValue || '').trim();
56
+ setInputValue(cleaned);
57
+ setHasLargeReasonExplanation(cleaned.length > SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT);
58
+ if (props.onReasonInputBoxBlur) {
59
+ props.onReasonInputBoxBlur(cleaned);
60
+ return;
61
+ }
62
+ (_a = props.onReasonInputBoxChanged) === null || _a === void 0 ? void 0 : _a.call(props, cleaned);
47
63
  };
48
64
  const getDropdownOptions = () => {
49
65
  return map(caseNoClusterIdReasonsList || [], (option) => ({
@@ -88,7 +104,7 @@ const NoClusterIDReasonSelector = (props) => {
88
104
  React.createElement(SingleSelectDropdown, { placeholder: t('Select an option or briefly describe your reason'), dataTrackingId: "no-openshift-cluster-id-reason", options: getDropdownOptions(), selected: getSelectedOption(), isDisabled: caseNoClusterIdReasons.isFetching || props.isDisabled, isLoading: caseNoClusterIdReasons.isFetching, isInvalid: props.isInValid, onSelect: handleReasonChange, "aria-labelledby": titleId, "aria-invalid": props.isInValid, "aria-describedby": "validate-reason-helper" })),
89
105
  props.noClusterIdReason === 'Other' && (React.createElement("div", { className: "text-input-wrapper" },
90
106
  React.createElement(TextInputGroup, null,
91
- React.createElement(TextInput, { value: inputValue, onChange: handleInputChange, placeholder: t('Briefly describe your reason'), "aria-label": t('Other reason description'), validated: hasLargeReasonExplanation ? ValidatedOptions.error : ValidatedOptions.default }))))),
107
+ React.createElement(TextInput, { value: inputValue, onChange: handleInputChange, onBlur: handleInputBlur, placeholder: t('Briefly describe your reason'), "aria-label": t('Other reason description'), validated: hasLargeReasonExplanation ? ValidatedOptions.error : ValidatedOptions.default }))))),
92
108
  React.createElement(LoadingIndicator, { show: caseNoClusterIdReasons.isFetching, size: "xs" }),
93
109
  React.createElement("p", { id: "validate-reason-helper", className: `form-instructions ${props.isInValid ? 'form-invalid' : ''}` }, notRegistered ? (registerMyClusterID()) : hasLargeReasonExplanation ? (React.createElement("span", { className: "form-instructions form-invalid pf-v6-u-danger-color-100 no-cluster-ID" }, t(`This reason exceeds ${SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT} characters. Try shortening it.`))) : (React.createElement(React.Fragment, null,
94
110
  props.isInValid && React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v6-u-mr-sm" }),
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CAC3C;AAsBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAkfzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CAC3C;AAsBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAufzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -37,6 +37,18 @@ function OpenshiftDropdownV4(props) {
37
37
  const { t } = useTranslation();
38
38
  const PER_PAGE = 200;
39
39
  const LOAD_MORE_VALUE = 'loader';
40
+ const getDisplayName = (id, noClusterIdReasonExplanation, display_name) => {
41
+ if (isEmpty(id))
42
+ return '';
43
+ if (id === 'dont-have-id') {
44
+ return noClusterIdReasonExplanation === 'v3-cluster'
45
+ ? t('The case is for a v3 cluster')
46
+ : t("I don't have my Cluster ID");
47
+ }
48
+ if (id === 'v3-cluster')
49
+ return t('The case is for a v3 cluster');
50
+ return display_name || id;
51
+ };
40
52
  const [clustersRawResponse, setClustersRawResponse] = useState([]);
41
53
  const clustersRawResponseRef = useRef(clustersRawResponse);
42
54
  clustersRawResponseRef.current = clustersRawResponse;
@@ -44,7 +56,7 @@ function OpenshiftDropdownV4(props) {
44
56
  const loadMoreInProgressRef = useRef(false);
45
57
  const [clustersSelectOptions, setClustersSelectOptions] = useState([]);
46
58
  const [isOpen, setIsOpen] = useState(false);
47
- const [inputVal, setInputVal] = useState(props.openshiftDisplayName);
59
+ const [inputVal, setInputVal] = useState(() => getDisplayName(props.openshiftClusterIDState, props.noClusterIdReasonExplanation || '', props.openshiftDisplayName || props.openshiftClusterIDState));
48
60
  const inputValRef = useRef(inputVal);
49
61
  inputValRef.current = inputVal;
50
62
  const [showArchivedClusters, setShowArchivedClusters] = useState(false);
@@ -53,19 +65,6 @@ function OpenshiftDropdownV4(props) {
53
65
  const { getFromCache, setInCache } = useLRUCache(50);
54
66
  const textInputRef = useRef();
55
67
  const { isExportingPDF } = useContext(PDFContext);
56
- // gets a cluster id and returns display name
57
- const getDisplayName = (id, noClusterIdReasonExplanation, display_name) => {
58
- if (isEmpty(id))
59
- return '';
60
- if (id === 'dont-have-id') {
61
- return noClusterIdReasonExplanation === 'v3-cluster'
62
- ? t('The case is for a v3 cluster')
63
- : t("I don't have my Cluster ID");
64
- }
65
- if (id === 'v3-cluster')
66
- return t('The case is for a v3 cluster');
67
- return display_name || id;
68
- };
69
68
  const onDropdownClear = () => __awaiter(this, void 0, void 0, function* () {
70
69
  setIsOpen(false);
71
70
  setInputVal('');
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAexF,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA0pBxD"}
1
+ {"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAexF,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA+pBxD"}
@@ -178,7 +178,13 @@ export default function UpdateSeverityModal(props) {
178
178
  const getFtsUpdateComment = () => {
179
179
  if (isIdea)
180
180
  return '';
181
- if (isEqual(caseDetails.fts, localFts) && isEqual(caseDetails.contactInfo24x7, localFtsContact))
181
+ // 24x7 fields are only shown for severity 1; do not report contact changes the user could not make.
182
+ if (!shouldShowFts)
183
+ return '';
184
+ const normalize24x7Contact = (value) => (value !== null && value !== void 0 ? value : '').trim();
185
+ const savedContact = normalize24x7Contact(caseDetails.contactInfo24x7);
186
+ const localContact = normalize24x7Contact(localFtsContact);
187
+ if (isEqual(caseDetails.fts, localFts) && isEqual(savedContact, localContact))
182
188
  return '';
183
189
  if (caseDetails.fts && !localFts)
184
190
  return '#### Contact Support Update \n User disabled 24x7 contact support';
@@ -373,8 +379,6 @@ export default function UpdateSeverityModal(props) {
373
379
  });
374
380
  }
375
381
  else {
376
- setLocalFts(false);
377
- setLocalFtsContact('');
378
382
  setUpdatedCaseDetails({ severity: option.name, fts: false });
379
383
  }
380
384
  setCurrentSeverity(option.name);
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/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ACR,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,UAAU,EAAE,EACxB,WAAW,EAAE,OAAO,iBAMvB;AAED,wBAAsB,0BAA0B,CAC5C,QAAQ,KAAA,EACR,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,qBAAqB,iBA6D3C;AAED,wBAAsB,sBAAsB,CACxC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,GAClD,OAAO,CAAC,gBAAgB,CAAC,CAwB3B;AAID,wBAAsB,2BAA2B,CAC7C,QAAQ,KAAA,EACR,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,iBAAiB,EAChC,gBAAgB,CAAC,EAAE,MAAM,iBA4E5B;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,KAAA,EAAE,SAAS,EAAE,MAAM,iBA+CxE;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,UAAU,EAAE,WAEvE;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,WAKzD;AAED,eAAO,MAAM,uBAAuB,GAAI,YAAY,UAAU,KAAG,OAShE,CAAC;AAKF,eAAO,MAAM,2BAA2B,UAOvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,oBAAoB,UAAU,EAAE,YAE9E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,aAAQ,SAUvC,CAAC"}
1
+ {"version":3,"file":"AttachmentHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentHelper.ts"],"names":[],"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UAAU,EAAE,UAAU,EAAE,EACxB,WAAW,EAAE,OAAO,iBAMvB;AAED,wBAAsB,0BAA0B,CAC5C,QAAQ,KAAA,EACR,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,qBAAqB,iBA6D3C;AAED,wBAAsB,sBAAsB,CACxC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,GAClD,OAAO,CAAC,gBAAgB,CAAC,CAwB3B;AAID,wBAAsB,2BAA2B,CAC7C,QAAQ,KAAA,EACR,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,iBAAiB,EAChC,gBAAgB,CAAC,EAAE,MAAM,iBA4E5B;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,KAAA,EAAE,SAAS,EAAE,MAAM,iBA+CxE;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,UAAU,EAAE,WAEvE;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,WAKzD;AAED,eAAO,MAAM,uBAAuB,GAAI,YAAY,UAAU,KAAG,OAShE,CAAC;AAKF,eAAO,MAAM,2BAA2B,UAOvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,oBAAoB,UAAU,EAAE,YAE9E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,aAAQ,SAUvC,CAAC"}
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { Config, pcm, sessionAttachments } from '@cee-eng/hydrajs';
11
11
  import { ToastNotification } from '@rh-support/components';
12
- import { CaseAttachmentUploadError, fetchCaseDetailsByCaseNumber, GET_CONTENT_DOCUMENT_IDS, getText, MultipartUploadError, pendoTrackEvent, pollAttachmentUploadStatus, pollContentVersionStatus, uploadCaseAttachment, } from '@rh-support/utils';
12
+ import { CaseAttachmentUploadError, deleteCaseAttachment, fetchCaseDetailsByCaseNumber, GET_CONTENT_DOCUMENT_IDS, getText, MultipartUploadError, pendoTrackEvent, pollAttachmentUploadStatus, pollContentVersionStatus, uploadCaseAttachment, } from '@rh-support/utils';
13
13
  import find from 'lodash/find';
14
14
  import forEach from 'lodash/forEach';
15
15
  import includes from 'lodash/includes';
@@ -275,7 +275,9 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
275
275
  parts: localFile.uploadProgress.multipartResumeState.parts,
276
276
  completedParts: localFile.uploadProgress.multipartResumeState.completedParts,
277
277
  }
278
- : undefined);
278
+ : undefined, (initAttachmentId) => {
279
+ updateAttachmentIdForFile(dispatch, initAttachmentId, index);
280
+ });
279
281
  if (userAborted) {
280
282
  return;
281
283
  }
@@ -321,6 +323,14 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
321
323
  updateAttachmentIdForFile(dispatch, attachmentIdFromError, index);
322
324
  }
323
325
  if (isUserAbort) {
326
+ if (!isSessionId && attachmentIdFromError) {
327
+ try {
328
+ yield deleteCaseAttachment(idToUploadTo, attachmentIdFromError);
329
+ }
330
+ catch (_c) {
331
+ // Best-effort: file stays in queue as ABORTED for retry
332
+ }
333
+ }
324
334
  const resumeState = error instanceof MultipartUploadError ? error.resumeData : undefined;
325
335
  updateUploadMetadata(dispatch, index, Object.assign({ uploadStatus: UploadStatusConstants.aborted, uploadErrorMessage: '', onAbort: undefined, percentUploaded: 0 }, (resumeState && resumeState.completedParts.length > 0 ? { multipartResumeState: resumeState } : {})));
326
336
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentReducer.d.ts","sourceRoot":"","sources":["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M,SAM1B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACjC,UAAU,6BAA6B,EACvC,gBAAgB,OAAO,CAAC,eAAe,CAAC,EACxC,iBAAiB,MAAM,SAM1B,CAAC"}
1
+ {"version":3,"file":"AttachmentReducer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AACrH,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAMzD,oBAAY,0BAA0B;IAClC,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,sBAAsB,2BAA2B;IACjD,wBAAwB,6BAA6B;IACrD,mCAAmC,wCAAwC;IAC3E,yBAAyB,8BAA8B;CAC1D;AAED,oBAAY,qBAAqB;IAC7B,cAAc,qBAAqB;IACnC,iBAAiB,wBAAwB;IACzC,eAAe,sBAAsB;IACrC,kBAAkB,yBAAyB;IAC3C,mBAAmB,0BAA0B;IAC7C,sBAAsB,6BAA6B;IACnD,cAAc,qBAAqB;IACnC,iBAAiB,wBAAwB;IACzC,kBAAkB,0BAA0B;IAC5C,qBAAqB,6BAA6B;IAClD,YAAY,mBAAmB;IAC/B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,mBAAmB,wBAAwB;CAC9C;AAED,oBAAY,uBAAuB;IAC/B,kBAAkB,yBAAyB;IAC3C,iBAAiB,yBAAyB;IAC1C,gBAAgB,sBAAsB;IACtC,cAAc,oBAAoB;IAClC,eAAe,qBAAqB;CACvC;AAED,MAAM,WAAW,aAAa;IAC1B,YAAY,EA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AAyB,GAClC,UAAU,6BAA6B,EACvC,cAAc,MAAM,EACpB,iBAAiB,MAAM,SAM1B,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAC/B,UAAU,6BAA6B,EACvC,kBAAkB,OAAO,CAAC,iBAAiB,CAAC,EAC5C,iBAAiB,MAAM,SAM1B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACjC,UAAU,6BAA6B,EACvC,gBAAgB,OAAO,CAAC,eAAe,CAAC,EACxC,iBAAiB,MAAM,SAM1B,CAAC"}
@@ -60,6 +60,7 @@ export const initialAttachmentState = {
60
60
  includeAnalysisResults: true,
61
61
  showUploadingOnSlowConnectionMsg: false,
62
62
  };
63
+ const getLocalFileAtIndex = (selectedLocalFiles, index) => index >= 0 && index < selectedLocalFiles.length ? selectedLocalFiles[index] : undefined;
63
64
  export const attachmentReducer = (pState, action) => {
64
65
  switch (action.type) {
65
66
  case AttachmentReducerConstants.caseFileSelected: {
@@ -79,6 +80,9 @@ export const attachmentReducer = (pState, action) => {
79
80
  case AttachmentReducerConstants.caseLocalFileEdited: {
80
81
  const editedLocalFile = action.payload.editedLocalFile;
81
82
  const indexToEdit = action.payload.fileIndexToEdit;
83
+ if (!getLocalFileAtIndex(pState.caseFiles.selectedLocalFiles, indexToEdit)) {
84
+ return pState;
85
+ }
82
86
  const newState = Object.assign({}, pState);
83
87
  const newCaseFiles = Object.assign({}, newState.caseFiles);
84
88
  const selectedLocalFiles = [...newState.caseFiles.selectedLocalFiles];
@@ -130,6 +134,9 @@ export const attachmentReducer = (pState, action) => {
130
134
  }
131
135
  case AttachmentReducerConstants.updateAttachmentIdForFile: {
132
136
  const indexToEdit = action.payload.fileIndexToEdit;
137
+ if (!getLocalFileAtIndex(pState.caseFiles.selectedLocalFiles, indexToEdit)) {
138
+ return pState;
139
+ }
133
140
  const newState = Object.assign({}, pState);
134
141
  const newCaseFiles = Object.assign({}, newState.caseFiles);
135
142
  const selectedLocalFiles = [...newState.caseFiles.selectedLocalFiles];
@@ -140,6 +147,9 @@ export const attachmentReducer = (pState, action) => {
140
147
  }
141
148
  case AttachmentReducerConstants.updateAnalysisMetadata: {
142
149
  const indexToEdit = action.payload.fileIndexToEdit;
150
+ if (!getLocalFileAtIndex(pState.caseFiles.selectedLocalFiles, indexToEdit)) {
151
+ return pState;
152
+ }
143
153
  const newState = Object.assign({}, pState);
144
154
  const newCaseFiles = Object.assign({}, newState.caseFiles);
145
155
  const selectedLocalFiles = [...newState.caseFiles.selectedLocalFiles];
@@ -150,6 +160,9 @@ export const attachmentReducer = (pState, action) => {
150
160
  }
151
161
  case AttachmentReducerConstants.udpateFileUploadMetadata: {
152
162
  const indexToEdit = action.payload.fileIndexToEdit;
163
+ if (!getLocalFileAtIndex(pState.caseFiles.selectedLocalFiles, indexToEdit)) {
164
+ return pState;
165
+ }
153
166
  const newState = Object.assign({}, pState);
154
167
  const newCaseFiles = Object.assign({}, newState.caseFiles);
155
168
  const selectedLocalFiles = [...newState.caseFiles.selectedLocalFiles];
@@ -11,7 +11,12 @@ export declare const CaseDetailsTabsEnum: {
11
11
  };
12
12
  export declare enum CaseStatusEnum {
13
13
  CLOSED = "Closed",
14
+ WAITING_ON_CUSTOMER_ACTION_REQUIRED = "Waiting on Customer Action Required",
15
+ WAITING_ON_CUSTOMER_SOLUTION_DELIVERED = "Waiting on Customer Solution Delivered",
16
+ IN_PROGRESS = "In Progress",
17
+ /** @deprecated Legacy alias -- do not use for new writes */
14
18
  WAITING_ON_CUSTOMER = "Waiting on Customer",
19
+ /** @deprecated Legacy alias -- do not use for new writes */
15
20
  WAITING_ON_REDHAT = "Waiting on Red Hat"
16
21
  }
17
22
  export declare enum CaseRecommendationEvalEnum {