@rh-support/troubleshoot 1.0.13 → 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":"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"}
1
+ {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AA2BA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAoS7C"}
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { Button, Checkbox, Popover, PopoverPosition, Switch, Tooltip } from '@patternfly/react-core';
11
11
  import AngleDoubleLeftIcon from '@patternfly/react-icons/dist/js/icons/angle-double-left-icon';
12
12
  import AngleDoubleRightIcon from '@patternfly/react-icons/dist/js/icons/angle-double-right-icon';
13
+ import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
13
14
  import ListIcon from '@patternfly/react-icons/dist/js/icons/list-icon';
14
15
  import LockIcon from '@patternfly/react-icons/dist/js/icons/lock-icon';
15
16
  import TrendUpIcon from '@patternfly/react-icons/dist/js/icons/trend-up-icon';
@@ -179,7 +180,7 @@ export function CaseDetailsAside(props) {
179
180
  preferredOrDefaultCaseView() ? t('Customer view') : t('Internal view'),
180
181
  React.createElement(Popover, { "aria-label": "Preferred-default-case-view-popover", position: PopoverPosition.top, bodyContent: React.createElement("p", { className: 'pref-case-popover-text' },
181
182
  React.createElement(Trans, null, renderCasePrefPopoverText())), showClose: false },
182
- React.createElement("i", { "aria-label": "Preferred-default-case-view-info-icon", className: "fa fa-question-circle" }))),
183
+ React.createElement(InfoCircleIcon, { "aria-label": "Preferred-case-view-info-icon", className: "pf-u-ml-sm" }))),
183
184
  React.createElement(Switch, { title: preferredOrDefaultCaseView() ? t('Customer view') : t('Internal view'), "data-tracking-id": preferredOrDefaultCaseView()
184
185
  ? 'disable-view-as-customer'
185
186
  : 'enable-view-as-customer', "aria-label": preferredOrDefaultCaseView()
@@ -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();
@@ -170,32 +172,32 @@ export default function UpdateSeverityModal(props) {
170
172
  commentBody: severityUpdateFailedComment === null || severityUpdateFailedComment === void 0 ? void 0 : severityUpdateFailedComment.trim(),
171
173
  contentType: 'markdown',
172
174
  });
175
+ onClose();
176
+ caseUpdateError.showError(e, t(`Failed to update case status. Please try again`));
173
177
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
174
178
  status: 'Waiting on Customer',
175
179
  severity: currentSeverity,
176
180
  });
177
- onClose();
178
- ToastNotification.addDangerMessage(t(`Failed to update case status. Please try again`));
179
181
  setCaseDetails(caseDispatch, { status: 'Waiting on Customer' });
180
182
  }
181
183
  }
182
184
  catch (e) {
185
+ onClose();
186
+ caseUpdateError.showError(e, t(`Couldn't post severity update comment. Please try again`));
183
187
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
184
188
  severity: caseDetails.caseSeverity,
185
189
  });
186
- onClose();
187
- ToastNotification.addDangerMessage(t(`Couldn't post severity update comment. Please try again`));
188
190
  setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
189
191
  reUpdateSeverity(caseDetails.caseSeverity);
190
192
  setSeverityUpdating(caseOverviewDispatch, false);
191
193
  }
192
194
  }
193
195
  catch (e) {
196
+ onClose();
197
+ caseUpdateError.showError(e, t('Severity failed to update'));
194
198
  yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
195
199
  severity: caseDetails.caseSeverity,
196
200
  });
197
- onClose();
198
- ToastNotification.addDangerMessage(t('Severity failed to update'));
199
201
  reUpdateSeverity(caseDetails.caseSeverity);
200
202
  setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
201
203
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.0.13",
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": "248d82aca4c59a1579f064ad8865561daaf52399"
145
+ "gitHead": "5f9e76a3f75e15eb2229af3657a22772fe888135"
146
146
  }