@rh-support/troubleshoot 1.0.12 → 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":"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.12",
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": "e10412261e6e63e28dd9784d430aace475f21376"
145
+ "gitHead": "248d82aca4c59a1579f064ad8865561daaf52399"
146
146
  }