@rh-support/troubleshoot 1.0.14 → 1.0.15

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":"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"}
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"}
@@ -22,6 +22,7 @@ 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';
25
26
  import { updateDiscussionStateComments } from '../../reducers/CaseDiscussionTabReducer';
26
27
  import { getIrtForSLAAndSeverity, getOrtForSLAAndSeverity, getSeverityDescription } from '../../reducers/CaseHelpers';
27
28
  import { caseOverviewReducer, initialCaseViewState, setSeverityUpdating } from '../../reducers/CaseOverviewReducer';
@@ -29,6 +30,7 @@ import { checkForCaseStatusToggleOnAttachOrComment, setCaseDetails, updateCaseDe
29
30
  export default function UpdateSeverityModal(props) {
30
31
  const { show, onClose, isDisabled, isFetching } = props;
31
32
  const { t } = useTranslation();
33
+ const caseUpdateError = useCaseUpdateErrorMessage();
32
34
  const [descriptionValue, setDescriptionValue] = useState('');
33
35
  const [caseOverviewState, caseOverviewDispatch] = useReducer(caseOverviewReducer, initialCaseViewState);
34
36
  const caseDispatch = useCaseDispatch();
@@ -171,7 +173,7 @@ export default function UpdateSeverityModal(props) {
171
173
  contentType: 'markdown',
172
174
  });
173
175
  onClose();
174
- ToastNotification.addDangerMessage(t(`Failed to update case status. Please try again`));
176
+ caseUpdateError.showError(e, t(`Failed to update case status. Please try again`));
175
177
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
176
178
  status: 'Waiting on Customer',
177
179
  severity: currentSeverity,
@@ -181,7 +183,7 @@ export default function UpdateSeverityModal(props) {
181
183
  }
182
184
  catch (e) {
183
185
  onClose();
184
- ToastNotification.addDangerMessage(t(`Couldn't post severity update comment. Please try again`));
186
+ caseUpdateError.showError(e, t(`Couldn't post severity update comment. Please try again`));
185
187
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
186
188
  severity: caseDetails.caseSeverity,
187
189
  });
@@ -192,7 +194,7 @@ export default function UpdateSeverityModal(props) {
192
194
  }
193
195
  catch (e) {
194
196
  onClose();
195
- ToastNotification.addDangerMessage(t('Severity failed to update'));
197
+ caseUpdateError.showError(e, t('Severity failed to update'));
196
198
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
197
199
  severity: caseDetails.caseSeverity,
198
200
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
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": "385be1a5087e7a199a974b22442a06f8ef61a06b"
145
+ "gitHead": "5f9e76a3f75e15eb2229af3657a22772fe888135"
146
146
  }