@rh-support/troubleshoot 1.0.11 → 1.0.13

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":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AA0BA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAgS7C"}
1
+ {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AA0BA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAoS7C"}
@@ -70,12 +70,17 @@ export function CaseDetailsAside(props) {
70
70
  const userPreferredCaseView = () => __awaiter(this, void 0, void 0, function* () {
71
71
  try {
72
72
  const isRetrievedInternal = yield getOriginalCaseView(); // retrieving as string.
73
- const finalIsRetrievedInternal = !!+isRetrievedInternal; // converting backend string -> num -> bool
74
- if (finalIsRetrievedInternal != null) {
75
- setViewAsInternalPref(finalIsRetrievedInternal);
73
+ if (isRetrievedInternal !== null) {
74
+ const finalIsRetrievedInternal = !!+isRetrievedInternal; // converting backend string -> num -> bool
75
+ if (finalIsRetrievedInternal != null) {
76
+ setViewAsInternalPref(finalIsRetrievedInternal);
77
+ }
78
+ if (finalIsRetrievedInternal === false) {
79
+ !preferredOrDefaultCaseView() && toggleViewAsCustomerFlag(globalMetadataDispatchContext);
80
+ }
76
81
  }
77
- if (finalIsRetrievedInternal === false) {
78
- !preferredOrDefaultCaseView() && toggleViewAsCustomerFlag(globalMetadataDispatchContext);
82
+ if (isRetrievedInternal === null) {
83
+ setViewAsInternalPref(true);
79
84
  }
80
85
  }
81
86
  catch (_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAqB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,eAsfxC"}
1
+ {"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAqB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,eA4fxC"}
@@ -277,7 +277,7 @@ export function PostComment(props) {
277
277
  if (canEditCase.alert())
278
278
  return;
279
279
  };
280
- const fileUploadButton = (React.createElement(React.Fragment, null, canEditCase.isCaseNotEditable ? (React.createElement(Button, { variant: ButtonVariant.secondary, onClick: showCaseIsNotEditableAlert }, t(isPublic ? 'Attach files' : 'Attach private files'))) : (React.createElement(FileSelectorButton, { buttonLabel: t(isPublic ? 'Attach files' : 'Attach private files'), isSessionId: false, isPrivate: !isPublic, "data-tracking-id": "case-discussion-file-selector-button" }))));
280
+ const fileUploadButton = (React.createElement(React.Fragment, null, canEditCase.isCaseNotEditable ? (React.createElement(Button, { variant: ButtonVariant.secondary, onClick: showCaseIsNotEditableAlert }, t(isPublic || !canPostPrivateComments ? 'Attach files' : 'Attach private files'))) : (React.createElement(FileSelectorButton, { buttonLabel: t(isPublic || !canPostPrivateComments ? 'Attach files' : 'Attach private files'), isSessionId: false, isPrivate: !isPublic, "data-tracking-id": "case-discussion-file-selector-button" }))));
281
281
  const markdownToolbarFileSelectorBtn = (React.createElement(Button, { type: "button", onClick: open, "data-tracking-id": "inline-image-attach-file", isDisabled: isUploadingFile, variant: ButtonVariant.link, icon: React.createElement(PlusIcon, null) }, t(isPublic ? 'Attach files' : 'Attach private files')));
282
282
  // This is where we get all attachments to show in dropdown
283
283
  const getAllAttachments = () => {
@@ -312,7 +312,11 @@ export function PostComment(props) {
312
312
  };
313
313
  const isSubmitDisabled = isReplyDisabled() || isCommentEmpty || isPostCommentDisabled;
314
314
  return (React.createElement("div", { className: "pf-u-mb-md hide-in-pdf", ref: componentRef },
315
- React.createElement(MarkdownEditor, { className: `${!isPublic ? 'is-private' : ''}`, disabled: isProcessing || canEditCase.isCaseNotEditable, "aria-label": "comment text area", showMarkdownPlainTextToggle: true, editorMode: commentType, onFocus: () => setIsTextAreaFocused(true), onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, rows: isTextAreaFocused ? 12 : 4, bindTextArea: textAreaRef, onCommentExceedCharsLimit: onCommentExceedCharsLimit, mdPlaceholder: isPublic ? 'Add a comment using markdown' : 'Add a comment or attach a file privately', plainTextPlaceholder: isPublic ? 'Add a comment to this case' : 'Add a comment or attach a file privately', fileSelectorProps: {
315
+ React.createElement(MarkdownEditor, { className: `${!isPublic && canPostPrivateComments ? 'is-private' : ''}`, disabled: isProcessing || canEditCase.isCaseNotEditable, "aria-label": "comment text area", showMarkdownPlainTextToggle: true, editorMode: commentType, onFocus: () => setIsTextAreaFocused(true), onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, rows: isTextAreaFocused ? 12 : 4, bindTextArea: textAreaRef, onCommentExceedCharsLimit: onCommentExceedCharsLimit, mdPlaceholder: isPublic || !canPostPrivateComments
316
+ ? 'Add a comment using markdown'
317
+ : 'Add a comment or attach a file privately', plainTextPlaceholder: isPublic || !canPostPrivateComments
318
+ ? 'Add a comment to this case'
319
+ : 'Add a comment or attach a file privately', fileSelectorProps: {
316
320
  showFileSelectorInToolbar: !loggedInUsersAccount.data.secureSupport,
317
321
  filesList: getAllAttachments(),
318
322
  onFileSelect: onFileSelect,
@@ -331,7 +335,7 @@ export function PostComment(props) {
331
335
  React.createElement(Button, { "data-tracking-id": "postcomment-cancel-button", type: "button", variant: ButtonVariant.link, onClick: onCancelClick, isDisabled: isPostCommentDisabled },
332
336
  React.createElement(Trans, null, "Cancel")),
333
337
  canPostPrivateComments && (React.createElement("span", { className: "post-comment-checkbox" },
334
- React.createElement(Checkbox, { label: t('Private'), isChecked: !isPublic, onChange: handleCheckboxToggle, "aria-label": t('Private'), id: "private-comment", name: "private-comment", "data-tracking-id": "private-comment-checkbox" }))))),
338
+ React.createElement(Checkbox, { label: t('Private'), isChecked: !isPublic && canPostPrivateComments, onChange: handleCheckboxToggle, "aria-label": t('Private'), id: "private-comment", name: "private-comment", "data-tracking-id": "private-comment-checkbox" }))))),
335
339
  React.createElement(FileUpload, { className: `file-upload-section ${hasSomeSelectedFilesLocal ? 'card card-white pf-u-mt-lg pf-u-p-lg' : ''}`, idToUploadTo: caseNumber, onUploadClick: onFileUploadClick, isSessionId: false, isSecureSupport: loggedInUsersAccount.data.secureSupport, isPrivate: !isPublic, autoUploadOnSelect: true, showDescriptionInfoMsg: true }),
336
340
  React.createElement("span", Object.assign({}, getRootProps()),
337
341
  React.createElement("input", Object.assign({ style: { display: 'none !important' } }, getInputProps()))),
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAuCA,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,eA+YxD"}
1
+ {"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAsCA,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,eA8YxD"}
@@ -22,7 +22,6 @@ import { Trans, useTranslation } from 'react-i18next';
22
22
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
23
23
  import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
24
24
  import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../context/CaseDiscussionTabContext';
25
- import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
26
25
  import { updateDiscussionStateComments } from '../../reducers/CaseDiscussionTabReducer';
27
26
  import { getIrtForSLAAndSeverity, getOrtForSLAAndSeverity, getSeverityDescription } from '../../reducers/CaseHelpers';
28
27
  import { caseOverviewReducer, initialCaseViewState, setSeverityUpdating } from '../../reducers/CaseOverviewReducer';
@@ -30,7 +29,6 @@ import { checkForCaseStatusToggleOnAttachOrComment, setCaseDetails, updateCaseDe
30
29
  export default function UpdateSeverityModal(props) {
31
30
  const { show, onClose, isDisabled, isFetching } = props;
32
31
  const { t } = useTranslation();
33
- const caseUpdateError = useCaseUpdateErrorMessage();
34
32
  const [descriptionValue, setDescriptionValue] = useState('');
35
33
  const [caseOverviewState, caseOverviewDispatch] = useReducer(caseOverviewReducer, initialCaseViewState);
36
34
  const caseDispatch = useCaseDispatch();
@@ -176,30 +174,30 @@ export default function UpdateSeverityModal(props) {
176
174
  status: 'Waiting on Customer',
177
175
  severity: currentSeverity,
178
176
  });
177
+ onClose();
178
+ ToastNotification.addDangerMessage(t(`Failed to update case status. Please try again`));
179
179
  setCaseDetails(caseDispatch, { status: 'Waiting on Customer' });
180
- onSuccessfulSubmit();
181
- caseUpdateError.showError(e, t(`Failed to update case status. Please try again`));
182
180
  }
183
181
  }
184
182
  catch (e) {
185
183
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
186
184
  severity: caseDetails.caseSeverity,
187
185
  });
186
+ onClose();
187
+ ToastNotification.addDangerMessage(t(`Couldn't post severity update comment. Please try again`));
188
188
  setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
189
189
  reUpdateSeverity(caseDetails.caseSeverity);
190
- onClose();
191
190
  setSeverityUpdating(caseOverviewDispatch, false);
192
- caseUpdateError.showError(e, t(`Couldn't post severity update comment. Please try again`));
193
191
  }
194
192
  }
195
193
  catch (e) {
196
- onClose();
197
194
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
198
195
  severity: caseDetails.caseSeverity,
199
196
  });
200
- setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
197
+ onClose();
198
+ ToastNotification.addDangerMessage(t('Severity failed to update'));
201
199
  reUpdateSeverity(caseDetails.caseSeverity);
202
- caseUpdateError.showError(e, t('Severity failed to update'));
200
+ setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
203
201
  }
204
202
  finally {
205
203
  yield updateDiscussionStateComments(dispatchDiscussion, caseDetails.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -142,5 +142,5 @@
142
142
  "not ie <= 11",
143
143
  "not op_mini all"
144
144
  ],
145
- "gitHead": "9647d8b819bf1ccbf691c0e89909160752ea24a7"
145
+ "gitHead": "248d82aca4c59a1579f064ad8865561daaf52399"
146
146
  }