@rh-support/troubleshoot 1.0.6 → 1.0.8
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.
- package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +3 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +31 -16
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +6 -4
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +4 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +5 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +10 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +3 -1
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +3 -1
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +4 -2
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +3 -1
- package/lib/esm/components/EditDescription/EditDescription.d.ts.map +1 -1
- package/lib/esm/components/EditDescription/EditDescription.js +9 -6
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +5 -3
- package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +4 -0
- package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseUpdateErrorMessage.js +16 -0
- package/lib/esm/scss/_main.scss +8 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OwnerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/OwnerSelector.tsx"],"names":[],"mappings":"AA4BA,UAAU,MAAM;CAAG;AAEnB,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,eA2NnC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -19,11 +19,13 @@ import { Typeahead } from 'react-bootstrap-typeahead';
|
|
|
19
19
|
import { Trans, useTranslation } from 'react-i18next';
|
|
20
20
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
21
21
|
import { RouteContext } from '../../context/RouteContext';
|
|
22
|
+
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
22
23
|
import { setCaseOwner, setNotifiedUser, updateCaseDetails } from '../../reducers/CaseReducer';
|
|
23
24
|
import { CaseValuesToWatch } from '../shared/Constants';
|
|
24
25
|
import { getChangedValueTooltip } from '../shared/utils';
|
|
25
26
|
function OwnerSelector(props) {
|
|
26
27
|
const { t } = useTranslation();
|
|
28
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
27
29
|
const { accountNumber, caseNumber, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers } = useCaseSelector((state) => ({
|
|
28
30
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
29
31
|
caseNumber: state.caseDetails.caseNumber,
|
|
@@ -105,7 +107,7 @@ function OwnerSelector(props) {
|
|
|
105
107
|
}
|
|
106
108
|
catch (e) {
|
|
107
109
|
setCaseOwnerUpdating(false);
|
|
108
|
-
|
|
110
|
+
caseUpdateError.showError(e, t(`Owner failed to update`));
|
|
109
111
|
}
|
|
110
112
|
});
|
|
111
113
|
/**
|
|
@@ -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,
|
|
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"}
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Button, Checkbox, Switch, Tooltip } from '@patternfly/react-core';
|
|
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
13
|
import ListIcon from '@patternfly/react-icons/dist/js/icons/list-icon';
|
|
@@ -65,7 +65,7 @@ export function CaseDetailsAside(props) {
|
|
|
65
65
|
};
|
|
66
66
|
const { getOriginalCaseView, updateOriginalCaseView } = useUserPreferences();
|
|
67
67
|
const [viewAsInternalPref, setViewAsInternalPref] = useState();
|
|
68
|
-
const [isDefaultBoxChecked, setIsDefaultBoxChecked] = useState(
|
|
68
|
+
const [isDefaultBoxChecked, setIsDefaultBoxChecked] = useState(true);
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
const userPreferredCaseView = () => __awaiter(this, void 0, void 0, function* () {
|
|
71
71
|
try {
|
|
@@ -73,7 +73,6 @@ export function CaseDetailsAside(props) {
|
|
|
73
73
|
const finalIsRetrievedInternal = !!+isRetrievedInternal; // converting backend string -> num -> bool
|
|
74
74
|
if (finalIsRetrievedInternal != null) {
|
|
75
75
|
setViewAsInternalPref(finalIsRetrievedInternal);
|
|
76
|
-
!finalIsRetrievedInternal && setIsDefaultBoxChecked(true);
|
|
77
76
|
}
|
|
78
77
|
if (finalIsRetrievedInternal === false) {
|
|
79
78
|
!preferredOrDefaultCaseView() && toggleViewAsCustomerFlag(globalMetadataDispatchContext);
|
|
@@ -115,28 +114,40 @@ export function CaseDetailsAside(props) {
|
|
|
115
114
|
!isXLScreen && toggleAside(false);
|
|
116
115
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
116
|
}, [breakPoint]);
|
|
118
|
-
const onDefaultCheckboxChange = (e) => {
|
|
117
|
+
const onDefaultCheckboxChange = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
119
118
|
try {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
updateOriginalCaseView(+viewAsCustomer);
|
|
119
|
+
if (viewAsInternalPref !== undefined) {
|
|
120
|
+
yield updateOriginalCaseView(+!viewAsInternalPref);
|
|
123
121
|
setIsDefaultBoxChecked(!isDefaultBoxChecked);
|
|
124
122
|
}
|
|
125
|
-
else if (
|
|
126
|
-
updateOriginalCaseView(
|
|
127
|
-
|
|
123
|
+
else if (viewAsInternalPref === undefined) {
|
|
124
|
+
yield updateOriginalCaseView(viewAsCustomer);
|
|
125
|
+
// the else is to initialize a value for the pref. If user does not have one (undefined) we initialize with the default permission (viewascustomer).
|
|
128
126
|
}
|
|
127
|
+
ToastNotification.addSuccessMessage(t('Successfully set the default case view'), React.createElement("p", null,
|
|
128
|
+
React.createElement(Trans, null,
|
|
129
|
+
"You can view these settings in ",
|
|
130
|
+
React.createElement("a", { href: "/support/cases/#/manage/preferences" }, "Preferences"))));
|
|
129
131
|
}
|
|
130
132
|
catch (error) {
|
|
131
|
-
|
|
133
|
+
console.log(error);
|
|
132
134
|
}
|
|
133
|
-
};
|
|
135
|
+
});
|
|
134
136
|
const onCaseSwitchChange = (e) => {
|
|
137
|
+
setIsDefaultBoxChecked(!isDefaultBoxChecked);
|
|
135
138
|
toggleViewAsCustomerFlag(globalMetadataDispatchContext);
|
|
136
139
|
};
|
|
137
140
|
const isSideBarExpanded = (_a = caseDetailsAsidePanelRef.current) === null || _a === void 0 ? void 0 : _a.expanded;
|
|
138
141
|
if (isFetchingCaseDetails || isFetchingCaseDetailsError)
|
|
139
142
|
return null;
|
|
143
|
+
const renderCasePrefPopoverText = () => {
|
|
144
|
+
if (viewAsCustomer) {
|
|
145
|
+
return t('Hide internal information that is unavailable to customers.');
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
return t('View internal information available to Red Hat associates only.');
|
|
149
|
+
}
|
|
150
|
+
};
|
|
140
151
|
return (React.createElement("aside", { className: `grid-aside ${isSideBarExpanded ? '' : 'sidebar-collapsed'}` },
|
|
141
152
|
React.createElement("pfe-collapse-toggle", { "aria-controls": "case-details-aside-content", onClick: onToggleAside }, isSideBarExpanded ? (React.createElement("div", { className: "sidebar-header" },
|
|
142
153
|
React.createElement(Button, { variant: "link", isInline: true, title: t('Collapse sidebar') },
|
|
@@ -146,9 +157,9 @@ export function CaseDetailsAside(props) {
|
|
|
146
157
|
React.createElement(Tooltip, { content: t('Expand sidebar'), position: "left" },
|
|
147
158
|
React.createElement(Button, { variant: "link" },
|
|
148
159
|
React.createElement(AngleDoubleLeftIcon, { size: "md" }))),
|
|
149
|
-
canSeeToggleCustomerView && (React.createElement(Tooltip, { content: t('Internal view'), position: "left" },
|
|
160
|
+
canSeeToggleCustomerView && (React.createElement(Tooltip, { content: viewAsCustomer ? t('External view') : t('Internal view'), position: "left" },
|
|
150
161
|
React.createElement(Button, { variant: "link", onClick: () => setSectionToScollRef(toggleCustomerViewRef), className: "sidebar-section-toggle-btn" },
|
|
151
|
-
React.createElement(LockIcon, { size: "md" })))),
|
|
162
|
+
React.createElement(LockIcon, { size: "md", className: viewAsCustomer ? 'blueLock' : 'greyLock' })))),
|
|
152
163
|
!isLoadingRecommendations && allDocs.length > 0 && (React.createElement(Tooltip, { content: t('Top recommendations'), position: "left" },
|
|
153
164
|
React.createElement(Button, { variant: "link", onClick: () => setSectionToScollRef(topSolutionsRef), className: "sidebar-section-toggle-btn" },
|
|
154
165
|
React.createElement(ListIcon, { size: "md" })))),
|
|
@@ -159,14 +170,18 @@ export function CaseDetailsAside(props) {
|
|
|
159
170
|
React.createElement("div", { className: "grid-aside-content" },
|
|
160
171
|
React.createElement("div", null,
|
|
161
172
|
canSeeToggleCustomerView && (React.createElement("div", { className: "pf-u-display-flex customer-view-toggle", ref: toggleCustomerViewRef },
|
|
162
|
-
React.createElement("span", { className: "customer-view-switch-label" },
|
|
173
|
+
React.createElement("span", { className: "customer-view-switch-label" },
|
|
174
|
+
preferredOrDefaultCaseView() ? t('Customer view') : t('Internal view'),
|
|
175
|
+
React.createElement(Popover, { "aria-label": "Preferred-default-case-view-popover", position: PopoverPosition.top, bodyContent: React.createElement("p", { className: 'pref-case-popover-text' },
|
|
176
|
+
React.createElement(Trans, null, renderCasePrefPopoverText())), showClose: false },
|
|
177
|
+
React.createElement("i", { "aria-label": "Preferred-default-case-view-info-icon", className: "fa fa-question-circle" }))),
|
|
163
178
|
React.createElement(Switch, { title: preferredOrDefaultCaseView() ? t('Customer view') : t('Internal view'), "data-tracking-id": preferredOrDefaultCaseView()
|
|
164
179
|
? 'disable-view-as-customer'
|
|
165
180
|
: 'enable-view-as-customer', "aria-label": preferredOrDefaultCaseView()
|
|
166
181
|
? 'disable view as customer'
|
|
167
182
|
: 'enable view as customer', id: "customer-view-switch", className: "pf-u-ml-auto", isChecked: preferredOrDefaultCaseView(), onChange: onCaseSwitchChange }))),
|
|
168
183
|
canSeeToggleCustomerView && (React.createElement("div", null,
|
|
169
|
-
React.createElement(Checkbox, { label: t('Set to default'), isChecked: isDefaultBoxChecked, onChange: onDefaultCheckboxChange, id: "set-default-view-checkbox", name: "default-view-checkbox", isDisabled:
|
|
184
|
+
React.createElement(Checkbox, { label: t('Set to default'), isChecked: isDefaultBoxChecked, onChange: onDefaultCheckboxChange, id: "set-default-view-checkbox", name: "default-view-checkbox", isDisabled: isDefaultBoxChecked, className: 'defaultViewCheckbox' })))),
|
|
170
185
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading top solutions') } },
|
|
171
186
|
React.createElement(CaseSolutions, { caseNumber: caseNumber, ref: topSolutionsRef, isSecureSupportAccount: isSecureSupportAccount })),
|
|
172
187
|
!caseEscalations.isFetching && canViewACESection && (React.createElement(ErrorBoundary, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAyCA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,eAoejD"}
|
|
@@ -17,6 +17,7 @@ import React, { useContext, useEffect, useReducer, useRef, useState } from 'reac
|
|
|
17
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
18
18
|
import { CaseStatusEnum } from '../../../constants/caseDetailsConstants';
|
|
19
19
|
import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
20
|
+
import { useCaseUpdateErrorMessage } from '../../../hooks/useCaseUpdateErrorMessage';
|
|
20
21
|
import { SupportLevelDisplay } from '../../../reducers/CaseConstNTypes';
|
|
21
22
|
import { caseOverviewReducer, fetchAllStatuses, fetchCaseHydra, initialCaseViewState, setSeverityUpdating, setStatusUpdating, setTypeUpdating, } from '../../../reducers/CaseOverviewReducer';
|
|
22
23
|
import { updateCaseDetails } from '../../../reducers/CaseReducer';
|
|
@@ -33,6 +34,7 @@ import DateTime from './DateTime';
|
|
|
33
34
|
export default function CaseOverview(props) {
|
|
34
35
|
const ability = useContext(AbilityContext);
|
|
35
36
|
const { t } = useTranslation();
|
|
37
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
36
38
|
const canManageCase = ability.can(resourceActions.UPDATE, resources.CASE_DETAILS);
|
|
37
39
|
const canSeeCaseOwnerInfo = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_OWNER);
|
|
38
40
|
const canSeeInactivityWarning = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_ACTIVITY_WARNING);
|
|
@@ -112,7 +114,7 @@ export default function CaseOverview(props) {
|
|
|
112
114
|
}
|
|
113
115
|
catch (e) {
|
|
114
116
|
setTypeUpdating(caseOverviewDispatch, false);
|
|
115
|
-
|
|
117
|
+
caseUpdateError.showError(e, t('Case type failed to update'));
|
|
116
118
|
}
|
|
117
119
|
});
|
|
118
120
|
const onSeverityChange = (payLoad) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -133,7 +135,7 @@ export default function CaseOverview(props) {
|
|
|
133
135
|
}
|
|
134
136
|
catch (e) {
|
|
135
137
|
setSeverityUpdating(caseOverviewDispatch, false);
|
|
136
|
-
|
|
138
|
+
caseUpdateError.showError(e, t('Severity failed to update'));
|
|
137
139
|
}
|
|
138
140
|
});
|
|
139
141
|
const updateStatusState = (statusVal, reopenedAt, reopenedBySSOName, reopenedReason, reopenedReasonOther, onStatusUpdate = null) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -153,7 +155,7 @@ export default function CaseOverview(props) {
|
|
|
153
155
|
}
|
|
154
156
|
catch (e) {
|
|
155
157
|
setStatusUpdating(caseOverviewDispatch, false);
|
|
156
|
-
|
|
158
|
+
caseUpdateError.showError(e, t('Status failed to update'));
|
|
157
159
|
}
|
|
158
160
|
});
|
|
159
161
|
const onStatusChange = (newStatus) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -191,7 +193,7 @@ export default function CaseOverview(props) {
|
|
|
191
193
|
});
|
|
192
194
|
}
|
|
193
195
|
catch (e) {
|
|
194
|
-
|
|
196
|
+
caseUpdateError.showError(e, t('Could not post comment after status update'));
|
|
195
197
|
}
|
|
196
198
|
});
|
|
197
199
|
const onToggleDetails = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsD,MAAM,OAAO,CAAC;AA+D3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAoYxB,CAAC"}
|
|
@@ -30,6 +30,7 @@ import React, { forwardRef, useContext, useEffect, useState } from 'react';
|
|
|
30
30
|
import { Trans, useTranslation } from 'react-i18next';
|
|
31
31
|
import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
32
32
|
import { useRecommendationDispatchContext, useRecommendationStateContext, } from '../../../context/RecommendationContext';
|
|
33
|
+
import { useCaseUpdateErrorMessage } from '../../../hooks/useCaseUpdateErrorMessage';
|
|
33
34
|
import { updateCaseDetails } from '../../../reducers/CaseReducer';
|
|
34
35
|
import { fetchRecommendations } from '../../../reducers/RecommendationsReducer';
|
|
35
36
|
import { CaseSolutionsItem } from './CaseSolutionsItem';
|
|
@@ -79,6 +80,7 @@ const titleFix = (recommendations, allDocs) => __awaiter(void 0, void 0, void 0,
|
|
|
79
80
|
// pins and links both have thier 'linked' field set as true.
|
|
80
81
|
// A recommendation can be both link and pin. We use pinnedBy and linkedBy fileds to identify them
|
|
81
82
|
export const CaseSolutions = forwardRef((props, ref) => {
|
|
83
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
82
84
|
const { product, version, summary, description, recomendationsObj, isFetchingCaseDetails } = useCaseSelector((state) => ({
|
|
83
85
|
product: state.caseDetails.product,
|
|
84
86
|
version: state.caseDetails.version,
|
|
@@ -158,8 +160,8 @@ export const CaseSolutions = forwardRef((props, ref) => {
|
|
|
158
160
|
}
|
|
159
161
|
else {
|
|
160
162
|
isPinned !== undefined || isLinked !== undefined
|
|
161
|
-
?
|
|
162
|
-
:
|
|
163
|
+
? caseUpdateError.showError(error, t('Could not unpin the solution'))
|
|
164
|
+
: caseUpdateError.showError(error, t('Could not pin the solution'));
|
|
163
165
|
}
|
|
164
166
|
setIsPinLoading((prevPiningMap) => delete prevPiningMap[recommendationToUpdate.resourceId]);
|
|
165
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseActionPlan.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseActionPlan.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,eAiHpC;kBAjHQ,cAAc;;;AAoHvB,eAAe,cAAc,CAAC"}
|
|
@@ -14,12 +14,14 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
14
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
15
15
|
import { Trans, useTranslation } from 'react-i18next';
|
|
16
16
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
17
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
17
18
|
import { updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
18
19
|
const defaultProps = {
|
|
19
20
|
caseNumber: undefined,
|
|
20
21
|
};
|
|
21
22
|
function CaseActionPlan(props) {
|
|
22
23
|
const { t } = useTranslation();
|
|
24
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
23
25
|
const ability = useContext(AbilityContext);
|
|
24
26
|
const canUpdateActionPlan = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_ACTION_PLAN_EDIT);
|
|
25
27
|
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
@@ -45,7 +47,7 @@ function CaseActionPlan(props) {
|
|
|
45
47
|
setIsUpdating(false);
|
|
46
48
|
}
|
|
47
49
|
catch (e) {
|
|
48
|
-
|
|
50
|
+
caseUpdateError.showError(e, t('Action plan failed to update'));
|
|
49
51
|
setIsUpdating(false);
|
|
50
52
|
}
|
|
51
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseAlternateId.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseAlternateId.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAOD,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eA6HrC;kBA7HQ,eAAe;;;AAgIxB,eAAe,eAAe,CAAC"}
|
|
@@ -16,6 +16,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
16
16
|
import React, { useEffect, useState } from 'react';
|
|
17
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
18
18
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
19
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
19
20
|
import { ALTERNATE_CASE_ID_LIMIT } from '../../../../reducers/CaseConstNTypes';
|
|
20
21
|
import { setCaseDetails, updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
21
22
|
import { CaseValuesToWatch } from '../../../shared/Constants';
|
|
@@ -26,6 +27,7 @@ const defaultProps = {
|
|
|
26
27
|
};
|
|
27
28
|
function CaseAlternateId(props) {
|
|
28
29
|
const { t } = useTranslation();
|
|
30
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
29
31
|
const { alternateId, caseNumber } = useCaseSelector((state) => ({
|
|
30
32
|
alternateId: state.caseDetails.alternateId,
|
|
31
33
|
caseNumber: state.caseDetails.caseNumber,
|
|
@@ -59,8 +61,8 @@ function CaseAlternateId(props) {
|
|
|
59
61
|
setIsUpdating(false);
|
|
60
62
|
}
|
|
61
63
|
catch (e) {
|
|
64
|
+
caseUpdateError.showError(e, t('Alternate case ID failed to update'));
|
|
62
65
|
setIsUpdating(false);
|
|
63
|
-
ToastNotification.addDangerMessage(t(`Alternate case ID failed to update`));
|
|
64
66
|
throw e;
|
|
65
67
|
}
|
|
66
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHostname.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseHostname.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseHostname.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseHostname.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAa5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,OAAO,CAAC;CAC3B;AAMD,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,eAwKlC;kBAxKQ,YAAY;;;AA2KrB,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -17,6 +17,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
17
17
|
import React, { useContext, useEffect, useState } from 'react';
|
|
18
18
|
import { Trans, useTranslation } from 'react-i18next';
|
|
19
19
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
20
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
20
21
|
import { HOSTNAME_LENGTH_LIMIT } from '../../../../reducers/CaseConstNTypes';
|
|
21
22
|
import { updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
22
23
|
import { CaseValuesToWatch } from '../../../shared/Constants';
|
|
@@ -31,6 +32,7 @@ function CaseHostname(props) {
|
|
|
31
32
|
}), isEqual);
|
|
32
33
|
const caseDispatch = useCaseDispatch();
|
|
33
34
|
const { t } = useTranslation();
|
|
35
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
34
36
|
const [hostnameState, setHostnameState] = useState(hostname);
|
|
35
37
|
const [isHostnameUpdating, setIsHostnameUpdating] = useState(false);
|
|
36
38
|
const canUseHostName = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.HOSTNAME);
|
|
@@ -61,7 +63,7 @@ function CaseHostname(props) {
|
|
|
61
63
|
}
|
|
62
64
|
catch (e) {
|
|
63
65
|
setIsHostnameUpdating(false);
|
|
64
|
-
|
|
66
|
+
caseUpdateError.showError(e, t('Hostname failed to updated'));
|
|
65
67
|
throw e;
|
|
66
68
|
}
|
|
67
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseInternalStatus.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseInternalStatus.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.tsx"],"names":[],"mappings":"AAiBA,MAAM,CAAC,OAAO,UAAU,kBAAkB,gBAwDzC"}
|
|
@@ -14,9 +14,11 @@ import React, { useContext, useEffect, useState } from 'react';
|
|
|
14
14
|
import { Trans, useTranslation } from 'react-i18next';
|
|
15
15
|
import { shallowEqual } from 'react-redux';
|
|
16
16
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
17
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
17
18
|
import { updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
18
19
|
export default function CaseInternalStatus() {
|
|
19
20
|
const { t } = useTranslation();
|
|
21
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
20
22
|
const { internalStatus, caseNumber } = useCaseSelector((state) => ({
|
|
21
23
|
internalStatus: state.caseDetails.internalStatus,
|
|
22
24
|
caseNumber: state.caseDetails.caseNumber,
|
|
@@ -41,7 +43,7 @@ export default function CaseInternalStatus() {
|
|
|
41
43
|
}
|
|
42
44
|
catch (e) {
|
|
43
45
|
setIsIStatusUpdating(false);
|
|
44
|
-
|
|
46
|
+
caseUpdateError.showError(e, t('Case Internal Status failed to update'));
|
|
45
47
|
}
|
|
46
48
|
});
|
|
47
49
|
return (React.createElement("div", { className: "form-group" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AA2BA,wBAAgB,sBAAsB,gBAoRrC"}
|
|
@@ -16,12 +16,14 @@ import isEqual from 'lodash/isEqual';
|
|
|
16
16
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
17
17
|
import { useTranslation } from 'react-i18next';
|
|
18
18
|
import { useCaseDispatch, useCaseSelector } from '../../../../../context/CaseContext';
|
|
19
|
+
import { useCaseUpdateErrorMessage } from '../../../../../hooks/useCaseUpdateErrorMessage';
|
|
19
20
|
import { setCaseDetails, updateCaseDetails } from '../../../../../reducers/CaseReducer';
|
|
20
21
|
import { getIsClusterIdInvalid, isClusterIdEnabledForProduct, } from '../../../../../utils/caseOpenshiftClusterIdUtils';
|
|
21
22
|
import { NoClusterIDReasonSelector } from '../../../../CaseManagement/NoClusterIDReasonSelector';
|
|
22
23
|
import { discoverV4ClusterIdLink, discoverV4ClusterIdLinkError, isInvalidErrorMessage, v3Tov4TransitionLink, } from '../../../../CaseManagement/OpenShiftClusterId';
|
|
23
24
|
import { OpenshiftDropdownV4 } from '../../../../CaseManagement/OpenshiftDropdownV4';
|
|
24
25
|
export function CaseOpenshiftClusterId() {
|
|
26
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
25
27
|
const { openshiftClusterID, product, version, caseNumber, openshiftClusterVersion, noClusterIdReason, noClusterIdReasonExplanation, selectedAccountDetails, description, } = useCaseSelector((state) => ({
|
|
26
28
|
openshiftClusterID: state.caseDetails.openshiftClusterID,
|
|
27
29
|
product: state.caseDetails.product,
|
|
@@ -117,7 +119,7 @@ export function CaseOpenshiftClusterId() {
|
|
|
117
119
|
catch (e) {
|
|
118
120
|
if (showToast) {
|
|
119
121
|
setIsClusterIdUpdating(false);
|
|
120
|
-
|
|
122
|
+
caseUpdateError.showError(e, t(`OpenShift Cluster ID failed to updated`));
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"AAuBA,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAYD,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eAoQrC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -19,6 +19,7 @@ import uniq from 'lodash/uniq';
|
|
|
19
19
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
20
20
|
import { Trans, useTranslation } from 'react-i18next';
|
|
21
21
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
22
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
22
23
|
import { getVersionsDetails, setCaseDetails, updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
23
24
|
const getVersions = (products, product) => {
|
|
24
25
|
const allProductsIndex = findIndex(products, (p) => p.product === product);
|
|
@@ -30,6 +31,7 @@ const checkIsTopProduct = (products, product) => {
|
|
|
30
31
|
};
|
|
31
32
|
function ProductNVersion(props) {
|
|
32
33
|
const { t } = useTranslation();
|
|
34
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
33
35
|
const [versions, setVersions] = useState([]);
|
|
34
36
|
const [isProductUpdating, setIsProductUpdating] = useState(false);
|
|
35
37
|
const [isVersionUpdating, setIsVersionUpdating] = useState(false);
|
|
@@ -109,7 +111,7 @@ function ProductNVersion(props) {
|
|
|
109
111
|
setIsProductUpdating(false);
|
|
110
112
|
setIsVersionUpdating(false);
|
|
111
113
|
setIsProductInvalid(false);
|
|
112
|
-
|
|
114
|
+
caseUpdateError.showError(e, t('Product and Version failed to update'));
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
else {
|
|
@@ -154,10 +156,10 @@ function ProductNVersion(props) {
|
|
|
154
156
|
setIsVersionUpdating(false);
|
|
155
157
|
setIsProductInvalid(false);
|
|
156
158
|
if (onlyVersionChanged) {
|
|
157
|
-
|
|
159
|
+
caseUpdateError.showError(e, t('Version failed to update'));
|
|
158
160
|
}
|
|
159
161
|
else {
|
|
160
|
-
|
|
162
|
+
caseUpdateError.showError(e, t('Your product failed to update'));
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
165
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/Summary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/Summary.tsx"],"names":[],"mappings":"AAaA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAOD,iBAAS,OAAO,CAAC,KAAK,EAAE,MAAM,eAiI7B;kBAjIQ,OAAO;;;AAoIhB,eAAe,OAAO,CAAC"}
|
|
@@ -14,6 +14,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
14
14
|
import React, { useEffect, useState } from 'react';
|
|
15
15
|
import { Trans, useTranslation } from 'react-i18next';
|
|
16
16
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
17
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
17
18
|
import { SUMMARY_LENGTH_LIMIT, summaryMaxLengthErrorMessage } from '../../../../reducers/CaseConstNTypes';
|
|
18
19
|
import { setCaseDetails, updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
19
20
|
const defaultProps = {
|
|
@@ -22,6 +23,7 @@ const defaultProps = {
|
|
|
22
23
|
};
|
|
23
24
|
function Summary(props) {
|
|
24
25
|
const { t } = useTranslation();
|
|
26
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
25
27
|
const maxLengthErrorMessage = t(summaryMaxLengthErrorMessage, {
|
|
26
28
|
limit: SUMMARY_LENGTH_LIMIT,
|
|
27
29
|
});
|
|
@@ -61,7 +63,7 @@ function Summary(props) {
|
|
|
61
63
|
}
|
|
62
64
|
catch (e) {
|
|
63
65
|
setIsSummaryUpdating(false);
|
|
64
|
-
|
|
66
|
+
caseUpdateError.showError(e, t(`Summary failed to updated`));
|
|
65
67
|
throw e;
|
|
66
68
|
}
|
|
67
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -22,6 +22,7 @@ import { useDropzone } from 'react-dropzone';
|
|
|
22
22
|
import { Trans, useTranslation } from 'react-i18next';
|
|
23
23
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
24
24
|
import { CaseDetailsCacheNamespaces } from '../../../../enums/cache';
|
|
25
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
25
26
|
import { DiscussionType } from '../../../../reducers/CaseDiscussionTabReducer';
|
|
26
27
|
import { addingNotifiedUsers, checkForCaseStatusToggleOnAttachOrComment, setNotifiedUser, } from '../../../../reducers/CaseReducer';
|
|
27
28
|
import { CaseDetailsCacheUtils } from '../../../../utils/caseDetailsCacheUtils';
|
|
@@ -33,6 +34,7 @@ import { useMarkdownFileUploader } from './PostComment/useMarkdownFileUploader';
|
|
|
33
34
|
import { VerifyCaseStatusModal } from './VerifyCaseStatusModal/VerifyCaseStatusModal';
|
|
34
35
|
export function PostComment(props) {
|
|
35
36
|
const { t } = useTranslation();
|
|
37
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
36
38
|
let { caseNumber } = props;
|
|
37
39
|
const [isTextAreaFocused, setIsTextAreaFocused] = useState(false);
|
|
38
40
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
@@ -188,7 +190,7 @@ export function PostComment(props) {
|
|
|
188
190
|
ToastNotification.addSuccessMessage(t('Comment submitted'));
|
|
189
191
|
}
|
|
190
192
|
catch (e) {
|
|
191
|
-
|
|
193
|
+
caseUpdateError.showError(e, t('Could not submit comment'));
|
|
192
194
|
}
|
|
193
195
|
finally {
|
|
194
196
|
setIsProcessing(false);
|
|
@@ -293,20 +295,22 @@ export function PostComment(props) {
|
|
|
293
295
|
const isNotInternalConfirm = () => {
|
|
294
296
|
onPostComment();
|
|
295
297
|
};
|
|
296
|
-
const onConfirm = (commentText) =>
|
|
297
|
-
|
|
298
|
+
const onConfirm = (commentText) => {
|
|
299
|
+
setIsModalOpen(false);
|
|
298
300
|
isNotInternalConfirm();
|
|
299
|
-
}
|
|
301
|
+
};
|
|
300
302
|
const onBtnClick = () => {
|
|
301
303
|
setIsModalOpen(true);
|
|
302
304
|
};
|
|
303
305
|
// To check is commment is empty
|
|
304
|
-
const
|
|
306
|
+
const checkCommentSignature = commentText.replace(commentSignature, '');
|
|
307
|
+
const isCommentEmpty = isEmpty(checkCommentSignature === null || checkCommentSignature === void 0 ? void 0 : checkCommentSignature.trim());
|
|
305
308
|
// To check is comment reply is empty and disable if it is
|
|
306
309
|
const isReplyDisabled = () => {
|
|
307
310
|
let parsedPassedReply = getReplyText(passedReply, props.commentCreator);
|
|
308
311
|
return (parsedPassedReply === null || parsedPassedReply === void 0 ? void 0 : parsedPassedReply.trim()) === (commentText === null || commentText === void 0 ? void 0 : commentText.trim());
|
|
309
312
|
};
|
|
313
|
+
const isSubmitDisabled = isReplyDisabled() || isCommentEmpty || isPostCommentDisabled;
|
|
310
314
|
return (React.createElement("div", { className: "pf-u-mb-md hide-in-pdf", ref: componentRef },
|
|
311
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: {
|
|
312
316
|
showFileSelectorInToolbar: !loggedInUsersAccount.data.secureSupport,
|
|
@@ -320,7 +324,7 @@ export function PostComment(props) {
|
|
|
320
324
|
} }),
|
|
321
325
|
isProcessing ? (React.createElement(LoadingIndicator, { isInline: true, size: "sm" })) : (React.createElement("div", { className: "pf-l-flex post-comment-btn-group push-top-narrow" },
|
|
322
326
|
isModalOpen && loggedInUserRights.data.isInternal() && isPublic && (React.createElement(VerifyCaseStatusModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: isPostingComment, caseNumber: props.caseNumber })),
|
|
323
|
-
React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled:
|
|
327
|
+
React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isSubmitDisabled, className: "postcomment-submit" },
|
|
324
328
|
React.createElement(Trans, null, "Submit")),
|
|
325
329
|
canAddAttachments &&
|
|
326
330
|
(isPublic && canPostPrivateComments ? (React.createElement(Tooltip, { content: t('You can attach files privately') }, fileUploadButton)) : (fileUploadButton)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAkBA,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,eAsIlD"}
|
|
@@ -15,10 +15,12 @@ import isEqual from 'lodash/isEqual';
|
|
|
15
15
|
import React, { useContext, useEffect, useReducer, useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
17
|
import { useCaseDispatch, useCaseSelector } from '../../../../../context/CaseContext';
|
|
18
|
+
import { useCaseUpdateErrorMessage } from '../../../../../hooks/useCaseUpdateErrorMessage';
|
|
18
19
|
import { caseOverviewReducer, fetchAllStatuses, initialCaseViewState, setStatusUpdating, } from '../../../../../reducers/CaseOverviewReducer';
|
|
19
20
|
import { updateCaseDetails } from '../../../../../reducers/CaseReducer';
|
|
20
21
|
export function VerifyCaseStatusModal(props) {
|
|
21
22
|
const { t } = useTranslation();
|
|
23
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
22
24
|
const [caseOverviewState, caseOverviewDispatch] = useReducer(caseOverviewReducer, initialCaseViewState);
|
|
23
25
|
const canManageCase = ability.can(resourceActions.UPDATE, resources.CASE_DETAILS);
|
|
24
26
|
const [showDropdown, setShowDropdown] = useState(false);
|
|
@@ -71,7 +73,7 @@ export function VerifyCaseStatusModal(props) {
|
|
|
71
73
|
}
|
|
72
74
|
catch (e) {
|
|
73
75
|
setStatusUpdating(caseOverviewDispatch, false);
|
|
74
|
-
|
|
76
|
+
caseUpdateError.showError(e, t('Status failed to update'));
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CasePrivateNotes.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CasePrivateNotes.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,YAAY;;CAEjB,CAAC;AAEF,aAAK,YAAY,GAAG,OAAO,YAAY,CAAC;AAExC,UAAU,MAAO,SAAQ,YAAY;CAAG;AAExC,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAqGtC;kBArGQ,gBAAgB;;;;;AAwGzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -15,12 +15,14 @@ import isEqual from 'lodash/isEqual';
|
|
|
15
15
|
import React, { useContext, useEffect, useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
17
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
18
|
+
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
18
19
|
import { updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
19
20
|
const defaultProps = {
|
|
20
21
|
caseNumber: undefined,
|
|
21
22
|
};
|
|
22
23
|
function CasePrivateNotes(props) {
|
|
23
24
|
const { t } = useTranslation();
|
|
25
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
24
26
|
const ability = useContext(AbilityContext);
|
|
25
27
|
const canUpdatePrivateNotes = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_PRIVATE_NOTES_EDIT);
|
|
26
28
|
const notes = useCaseSelector((state) => state.caseDetails.notes, isEqual);
|
|
@@ -46,7 +48,7 @@ function CasePrivateNotes(props) {
|
|
|
46
48
|
setIsUpdating(false);
|
|
47
49
|
}
|
|
48
50
|
catch (e) {
|
|
49
|
-
|
|
51
|
+
caseUpdateError.showError(e, t(`Failed to update notes`));
|
|
50
52
|
setIsUpdating(false);
|
|
51
53
|
}
|
|
52
54
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAID,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eA4N/B;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -16,12 +16,14 @@ import isEqual from 'lodash/isEqual';
|
|
|
16
16
|
import React, { useContext, useEffect, useState } from 'react';
|
|
17
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
18
18
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
19
|
+
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
19
20
|
import { setCaseDetails, setSelectedCaseGroupUsers, updateCaseDetails } from '../../reducers/CaseReducer';
|
|
20
21
|
import { CaseValuesToWatch } from '../shared/Constants';
|
|
21
22
|
import { getChangedValueTooltip } from '../shared/utils';
|
|
22
23
|
const emptyCaseGroup = { groupNum: '', name: '', isPrivate: false, isDefault: false, defaultMembers: [], members: [] };
|
|
23
24
|
function CaseGroup(props) {
|
|
24
25
|
const { t } = useTranslation();
|
|
26
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
25
27
|
const { groupNumber, caseNumber, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName } = useCaseSelector((state) => ({
|
|
26
28
|
caseNumber: state.caseDetails.caseNumber,
|
|
27
29
|
groupNumber: state.caseDetails.groupNumber,
|
|
@@ -93,7 +95,7 @@ function CaseGroup(props) {
|
|
|
93
95
|
}
|
|
94
96
|
catch (e) {
|
|
95
97
|
setCaseGroupUpdating(false);
|
|
96
|
-
|
|
98
|
+
caseUpdateError.showError(e, t(`Group failed to update`));
|
|
97
99
|
}
|
|
98
100
|
});
|
|
99
101
|
const onCaseGroupChange = (selection) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fts.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Fts.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Fts.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Fts.tsx"],"names":[],"mappings":"AAaA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,iBAAS,GAAG,CAAC,KAAK,EAAE,MAAM,eA+KzB;kBA/KQ,GAAG;;;AAkLZ,eAAe,GAAG,CAAC"}
|
|
@@ -15,6 +15,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
15
15
|
import React, { useEffect, useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
17
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
18
|
+
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
18
19
|
import { CONTACT_INFO_24X7_LIMIT } from '../../reducers/CaseConstNTypes';
|
|
19
20
|
import { setCaseDetails, updateCaseDetails } from '../../reducers/CaseReducer';
|
|
20
21
|
const defaultProps = {
|
|
@@ -24,6 +25,7 @@ const defaultProps = {
|
|
|
24
25
|
};
|
|
25
26
|
function Fts(props) {
|
|
26
27
|
const { t } = useTranslation();
|
|
28
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
27
29
|
const { fts, contactInfo24x7, caseNumber, severity, entitlementSla } = useCaseSelector((state) => ({
|
|
28
30
|
fts: state.caseDetails.fts,
|
|
29
31
|
caseNumber: state.caseDetails.caseNumber,
|
|
@@ -49,7 +51,7 @@ function Fts(props) {
|
|
|
49
51
|
}
|
|
50
52
|
catch (e) {
|
|
51
53
|
setFtsContactUpdating(false);
|
|
52
|
-
|
|
54
|
+
caseUpdateError.showError(e, t(`Failed to update the case`));
|
|
53
55
|
}
|
|
54
56
|
});
|
|
55
57
|
const onCaseFtsUpdate = (caseDetails) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -61,7 +63,7 @@ function Fts(props) {
|
|
|
61
63
|
}
|
|
62
64
|
catch (e) {
|
|
63
65
|
setFtsUpdating(false);
|
|
64
|
-
|
|
66
|
+
caseUpdateError.showError(e, t(`Failed to update the case`));
|
|
65
67
|
}
|
|
66
68
|
});
|
|
67
69
|
const onFtsChange = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AAqCA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,eAkShC"}
|
|
@@ -18,11 +18,13 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
18
18
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
19
19
|
import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
|
|
20
20
|
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../context/CaseDiscussionTabContext';
|
|
21
|
+
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
21
22
|
import { updateDiscussionStateComments } from '../../reducers/CaseDiscussionTabReducer';
|
|
22
23
|
import { checkForCaseStatusToggleOnAttachOrComment, postCepDetails, setCaseDetails, setCaseState, updateCaseDetails, } from '../../reducers/CaseReducer';
|
|
23
24
|
export function Cep(props) {
|
|
24
25
|
var _a, _b, _c, _d, _e, _f;
|
|
25
26
|
const { t } = useTranslation();
|
|
27
|
+
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
26
28
|
const { cep, caseNumber, status, cepDetails, isPostingCep, isCaseUpdating } = useCaseSelector((state) => ({
|
|
27
29
|
cep: state.caseDetails.cep,
|
|
28
30
|
caseNumber: state.caseDetails.caseNumber,
|
|
@@ -91,7 +93,7 @@ export function Cep(props) {
|
|
|
91
93
|
ToastNotification.addSuccessMessage(t(`Consultant Engagement in Progress has been updated successfully`));
|
|
92
94
|
}
|
|
93
95
|
catch (e) {
|
|
94
|
-
|
|
96
|
+
caseUpdateError.showError(e, t(`Consultant Engagement in Progress failed to update`));
|
|
95
97
|
}
|
|
96
98
|
});
|
|
97
99
|
const onCancel = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditDescription.d.ts","sourceRoot":"","sources":["../../../../src/components/EditDescription/EditDescription.tsx"],"names":[],"mappings":"AAaA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;CAC3B;AAUD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EditDescription.d.ts","sourceRoot":"","sources":["../../../../src/components/EditDescription/EditDescription.tsx"],"names":[],"mappings":"AAaA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;CAC3B;AAUD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eAoEpD"}
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { kase } from '@cee-eng/hydrajs';
|
|
11
11
|
import { encodeAngularBrackets, linkifyBZIDs, linkifyWithCaseIDs } from '@cee-eng/ui-toolkit';
|
|
12
|
-
import { InlineEdit, LoadingIndicator, TextAreaAutosize, ToastNotification
|
|
12
|
+
import { InlineEdit, LoadingIndicator, TextAreaAutosize, ToastNotification } from '@rh-support/components';
|
|
13
13
|
import isEqual from 'lodash/isEqual';
|
|
14
14
|
import React, { useState } from 'react';
|
|
15
15
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -32,22 +32,25 @@ export default function EditDescription(props) {
|
|
|
32
32
|
}), isEqual);
|
|
33
33
|
const caseDispatch = useCaseDispatch();
|
|
34
34
|
const [localDescription, setLocalDescription] = useState(description);
|
|
35
|
-
const
|
|
35
|
+
const [isUpdating, setIsUpdating] = useState(false);
|
|
36
36
|
const [isDescriptionTextAreaFocused, setDescriptionTextAreaFocused] = useState(false);
|
|
37
37
|
const onDescriptionSave = () => __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
setDescriptionTextAreaFocused(false);
|
|
39
39
|
if (localDescription === description)
|
|
40
40
|
return;
|
|
41
41
|
try {
|
|
42
|
+
setIsUpdating(true);
|
|
42
43
|
const caseDetails = { description: localDescription };
|
|
43
44
|
// Only GS4 internal can edit description
|
|
44
|
-
yield
|
|
45
|
+
yield kase.updateCase(caseNumber, caseDetails, true);
|
|
46
|
+
setIsUpdating(false);
|
|
45
47
|
setCaseDetails(caseDispatch, caseDetails);
|
|
46
48
|
ToastNotification.addSuccessMessage(t('Case description has been successfully updated'));
|
|
47
49
|
}
|
|
48
50
|
catch (e) {
|
|
51
|
+
setLocalDescription(description);
|
|
52
|
+
setIsUpdating(false);
|
|
49
53
|
ToastNotification.addDangerMessage(t('Case description failed to update'));
|
|
50
|
-
throw e;
|
|
51
54
|
}
|
|
52
55
|
});
|
|
53
56
|
const onDescriptionChange = (event) => {
|
|
@@ -55,7 +58,7 @@ export default function EditDescription(props) {
|
|
|
55
58
|
};
|
|
56
59
|
const descriptionErrorMessage = t(LargeDescriptionErrorMessage, { limit: DESCRIPTION_LENGTH_LIMIT });
|
|
57
60
|
return (React.createElement(InlineEdit, { labelContent: React.createElement(React.Fragment, null,
|
|
58
|
-
React.createElement(Trans, null, "Description")), loadingIndicator:
|
|
59
|
-
React.createElement(TextAreaAutosize, { id: "edit-description", name: "edit-description", className: `form-control${hasLargeCaseDescription ? ' form-invalid' : ''}`, value: localDescription, disabled:
|
|
61
|
+
React.createElement(Trans, null, "Description")), loadingIndicator: isUpdating ? React.createElement(LoadingIndicator, { size: "xs" }) : null, labelProps: { htmlFor: 'edit-description' }, content: React.createElement("div", { dangerouslySetInnerHTML: { __html: linkifiedDescription(localDescription) } }), allowInlineEdit: !!props.inlineEditable, saveDisabled: localDescription === description || isUpdating, usePreformattedTag: true, onSave: onDescriptionSave },
|
|
62
|
+
React.createElement(TextAreaAutosize, { id: "edit-description", name: "edit-description", className: `form-control${hasLargeCaseDescription ? ' form-invalid' : ''}`, value: localDescription, disabled: isUpdating, onChange: onDescriptionChange, "data-tracking-id": "edit-description" }),
|
|
60
63
|
React.createElement("p", { className: "form-instructions" }, `${hasLargeCaseDescription && isDescriptionTextAreaFocused ? descriptionErrorMessage : ''}`)));
|
|
61
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"
|
|
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,eA6YxD"}
|
|
@@ -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();
|
|
@@ -176,7 +178,7 @@ export default function UpdateSeverityModal(props) {
|
|
|
176
178
|
});
|
|
177
179
|
setCaseDetails(caseDispatch, { status: 'Waiting on Customer' });
|
|
178
180
|
onSuccessfulSubmit();
|
|
179
|
-
|
|
181
|
+
caseUpdateError.showError(e, t(`Failed to update case status. Please try again`));
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
184
|
catch (e) {
|
|
@@ -187,7 +189,7 @@ export default function UpdateSeverityModal(props) {
|
|
|
187
189
|
reUpdateSeverity(caseDetails.caseSeverity);
|
|
188
190
|
onClose();
|
|
189
191
|
setSeverityUpdating(caseOverviewDispatch, false);
|
|
190
|
-
|
|
192
|
+
caseUpdateError.showError(e, t(`Couldn't post severity update comment. Please try again`));
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
195
|
catch (e) {
|
|
@@ -195,7 +197,7 @@ export default function UpdateSeverityModal(props) {
|
|
|
195
197
|
severity: currentSeverity,
|
|
196
198
|
});
|
|
197
199
|
onSuccessfulSubmit();
|
|
198
|
-
|
|
200
|
+
caseUpdateError.showError(e, t('Severity failed to update'));
|
|
199
201
|
}
|
|
200
202
|
finally {
|
|
201
203
|
yield updateDiscussionStateComments(dispatchDiscussion, caseDetails.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCaseUpdateErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseUpdateErrorMessage.ts"],"names":[],"mappings":"AAGA,wBAAgB,yBAAyB;;EAaxC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { formattedApiErrorMessage, ToastNotification } from '@rh-support/components';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
export function useCaseUpdateErrorMessage() {
|
|
4
|
+
const { t } = useTranslation();
|
|
5
|
+
const showError = (e, message500) => {
|
|
6
|
+
const errorMessage = formattedApiErrorMessage(e, {
|
|
7
|
+
'500': { title: t('There was a problem with your request'), message: message500 },
|
|
8
|
+
'403': {
|
|
9
|
+
title: t('There was a problem with your request'),
|
|
10
|
+
message: t('You are not authorized to update this case.'),
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
ToastNotification.addDangerMessage(errorMessage);
|
|
14
|
+
};
|
|
15
|
+
return { showError };
|
|
16
|
+
}
|
package/lib/esm/scss/_main.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"@patternfly/react-core": "4.202.16",
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
|
-
"@rh-support/components": "1.2.
|
|
77
|
-
"@rh-support/react-context": "1.0.
|
|
76
|
+
"@rh-support/components": "1.2.5",
|
|
77
|
+
"@rh-support/react-context": "1.0.6",
|
|
78
78
|
"@rh-support/types": "0.2.0",
|
|
79
|
-
"@rh-support/user-permissions": "1.0.
|
|
79
|
+
"@rh-support/user-permissions": "1.0.5",
|
|
80
80
|
"@rh-support/utils": "1.0.3",
|
|
81
81
|
"@types/react-redux": "^7.1.12",
|
|
82
82
|
"@types/redux": "^3.6.0",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"not ie <= 11",
|
|
143
143
|
"not op_mini all"
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "99871945be699eeae0ed20023dd6708b2a0d422d"
|
|
146
146
|
}
|