@rh-support/troubleshoot 0.2.128 → 0.2.131
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":"AA0BA,UAAU,MAAM;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AA0BA,UAAU,MAAM;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAmPxD"}
|
|
@@ -44,6 +44,7 @@ export default function UpdateSeverityModal(props) {
|
|
|
44
44
|
caseDetails: {
|
|
45
45
|
caseNumber: state.caseDetails.caseNumber,
|
|
46
46
|
caseSeverity: state.caseDetails.severity,
|
|
47
|
+
caseStatus: state.caseDetails.status,
|
|
47
48
|
},
|
|
48
49
|
isCaseUpdating: state.isCaseUpdating,
|
|
49
50
|
}), isEqual);
|
|
@@ -51,6 +52,8 @@ export default function UpdateSeverityModal(props) {
|
|
|
51
52
|
const [currentSeverity, setCurrentSeverity] = useState(caseDetails.caseSeverity);
|
|
52
53
|
// Modal cancel function which resets the field
|
|
53
54
|
const onCancel = () => {
|
|
55
|
+
if (isCaseUpdating || isPostingComment)
|
|
56
|
+
return;
|
|
54
57
|
onClose();
|
|
55
58
|
setSeverityUpdating(caseOverviewDispatch, false);
|
|
56
59
|
setNewSeverityValue([]);
|
|
@@ -76,10 +79,9 @@ export default function UpdateSeverityModal(props) {
|
|
|
76
79
|
description: descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim(),
|
|
77
80
|
});
|
|
78
81
|
// Severity update failed comment body
|
|
79
|
-
const severityUpdateFailedComment = t('#### Severity update \n Failed to change severity from {{oldSeverity}} to {{newSeverity}}
|
|
82
|
+
const severityUpdateFailedComment = t('#### Severity update \n Failed to change severity from {{oldSeverity}} to {{newSeverity}}. Please try again\n', {
|
|
80
83
|
oldSeverity: currentSeverity,
|
|
81
84
|
newSeverity: newSeverityValue,
|
|
82
|
-
description: descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim(),
|
|
83
85
|
});
|
|
84
86
|
try {
|
|
85
87
|
setSeverityUpdating(caseOverviewDispatch, true);
|
|
@@ -91,33 +93,37 @@ export default function UpdateSeverityModal(props) {
|
|
|
91
93
|
contentType: 'markdown',
|
|
92
94
|
});
|
|
93
95
|
try {
|
|
94
|
-
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), caseDetails.
|
|
96
|
+
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), caseDetails.caseStatus);
|
|
95
97
|
setCurrentSeverity(newSeverityValue);
|
|
96
|
-
ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
|
|
97
98
|
onSuccessfulSubmit();
|
|
99
|
+
ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
|
|
98
100
|
}
|
|
99
101
|
catch (e) {
|
|
100
|
-
yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
|
|
101
|
-
severity: currentSeverity,
|
|
102
|
-
});
|
|
103
102
|
yield postCommentRequest({
|
|
104
103
|
caseNumber: caseDetails.caseNumber,
|
|
105
104
|
commentBody: severityUpdateFailedComment === null || severityUpdateFailedComment === void 0 ? void 0 : severityUpdateFailedComment.trim(),
|
|
106
105
|
contentType: 'markdown',
|
|
107
106
|
});
|
|
108
|
-
|
|
107
|
+
yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
|
|
108
|
+
status: 'Waiting on Customer',
|
|
109
|
+
severity: currentSeverity,
|
|
110
|
+
});
|
|
111
|
+
setCaseDetails(caseDispatch, { status: 'Waiting on Customer' });
|
|
112
|
+
onSuccessfulSubmit();
|
|
113
|
+
ToastNotification.addDangerMessage(t(`Failed to update case status. Please try again`));
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
116
|
catch (e) {
|
|
112
117
|
yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, {
|
|
113
118
|
severity: currentSeverity,
|
|
114
119
|
});
|
|
115
|
-
|
|
120
|
+
onClose();
|
|
121
|
+
ToastNotification.addDangerMessage(t(`Couldn't post severity update comment. Please try again`));
|
|
116
122
|
}
|
|
117
123
|
}
|
|
118
124
|
catch (e) {
|
|
119
|
-
ToastNotification.addDangerMessage(t('Severity failed to update'));
|
|
120
125
|
onSuccessfulSubmit();
|
|
126
|
+
ToastNotification.addDangerMessage(t('Severity failed to update'));
|
|
121
127
|
}
|
|
122
128
|
finally {
|
|
123
129
|
yield updateDiscussionStateComments(dispatchDiscussion, caseDetails.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
@@ -148,8 +154,8 @@ export default function UpdateSeverityModal(props) {
|
|
|
148
154
|
const isSubmitButtonDisabled = checkSeverityValid() && isTextAreaValid() ? false : true;
|
|
149
155
|
// Update severity modal buttons
|
|
150
156
|
const modalActions = [
|
|
151
|
-
React.createElement(Button, { key: "submit", variant: "primary", onClick: onSubmit, isLoading: isCaseUpdating || isPostingComment, "data-tracking-id": "update-severity-submit", isDisabled: isSubmitButtonDisabled }, t('Submit')),
|
|
152
|
-
React.createElement(Button, { key: "back", variant: "link", onClick: onCancel, "data-tracking-id": "update-severity-cancel" }, t('Cancel')),
|
|
157
|
+
React.createElement(Button, { key: "submit", variant: "primary", onClick: onSubmit, isLoading: isCaseUpdating || isPostingComment, "data-tracking-id": "update-severity-submit", isDisabled: isSubmitButtonDisabled || isCaseUpdating || isPostingComment }, t('Submit')),
|
|
158
|
+
React.createElement(Button, { key: "back", variant: "link", onClick: onCancel, "data-tracking-id": "update-severity-cancel", isDisabled: isCaseUpdating || isPostingComment }, t('Cancel')),
|
|
153
159
|
];
|
|
154
160
|
// To handle severity change in the modal
|
|
155
161
|
const onSeverityChange = (payload) => __awaiter(this, void 0, void 0, function* () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.131",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"not ie <= 11",
|
|
144
144
|
"not op_mini all"
|
|
145
145
|
],
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "ce04fafe161ee2fd361864d583066a39148f07ad"
|
|
147
147
|
}
|