@rh-support/troubleshoot 0.2.58 → 0.2.59
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/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +17 -12
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +3 -1
- package/package.json +2 -2
|
@@ -276,7 +276,7 @@ export function PostComment(props) {
|
|
|
276
276
|
onClipboardPaste,
|
|
277
277
|
} }),
|
|
278
278
|
isProcessing ? (React.createElement(LoadingIndicator, { isInline: true, size: "sm" })) : (React.createElement("div", { className: "pf-l-flex post-comment-btn-group push-top-narrow" },
|
|
279
|
-
isModalOpen &&
|
|
279
|
+
isModalOpen && loggedInUserRights.data.isInternal() && isPublic && (React.createElement(VerifyCaseStatusModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: isPostingComment, caseNumber: props.caseNumber })),
|
|
280
280
|
React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isPostCommentDisabled, className: "postcomment-submit" },
|
|
281
281
|
React.createElement(Trans, null, "Submit")),
|
|
282
282
|
canAddAttachments &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAiBA,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,
|
|
1
|
+
{"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAiBA,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,eAqIlD"}
|
|
@@ -53,24 +53,29 @@ export function VerifyCaseStatusModal(props) {
|
|
|
53
53
|
const { isCaseUpdating } = caseState;
|
|
54
54
|
const canEditCase = useCanEditCase();
|
|
55
55
|
const caseDispatch = useCaseDispatch();
|
|
56
|
-
const [statusChange, setStatusChange] = useState();
|
|
56
|
+
const [statusChange, setStatusChange] = useState(status);
|
|
57
57
|
const [isVerifyCaseStatusLoading, setIsVerifyCaseStatusLoading] = useState(false);
|
|
58
58
|
const onSubmit = () => __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
yield props.onConfirm();
|
|
59
60
|
yield updateStatusState(statusChange);
|
|
60
61
|
setIsVerifyCaseStatusLoading(true);
|
|
61
|
-
props.onConfirm();
|
|
62
62
|
});
|
|
63
63
|
const updateStatusState = (statusVal, onStatusUpdate = null) => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
if (status !== statusVal) {
|
|
65
|
+
setStatusUpdating(caseOverviewDispatch, true);
|
|
66
|
+
try {
|
|
67
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, { status: statusVal });
|
|
68
|
+
setStatusUpdating(caseOverviewDispatch, false);
|
|
69
|
+
onStatusUpdate && (yield onStatusUpdate());
|
|
70
|
+
ToastNotification.addSuccessMessage(t('Status has been successfully updated'));
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
setStatusUpdating(caseOverviewDispatch, false);
|
|
74
|
+
ToastNotification.addDangerMessage(t('Status failed to update'));
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
ToastNotification.addDangerMessage(t('Status failed to update'));
|
|
77
|
+
else {
|
|
78
|
+
return;
|
|
74
79
|
}
|
|
75
80
|
});
|
|
76
81
|
const onStatusChange = (event, newStatus) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -90,6 +95,6 @@ export function VerifyCaseStatusModal(props) {
|
|
|
90
95
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
91
96
|
React.createElement(Select, { "aria-label": t(status), id: "verify-case-status", selections: statusChange, onSelect: onStatusChange, isOpen: showDropdown, isDisabled: !canManageCase ||
|
|
92
97
|
caseOverviewState.allCaseStatuses.isFetching ||
|
|
93
|
-
(caseOverviewState.caseStatusUpdating && isCaseUpdating), menuAppendTo: document.body, validated: !status ? 'error' : 'default', placeholderText: t(status), onToggle: onDropdownToggle }, caseOverviewState.allCaseStatuses.data.map((option, index) => (React.createElement(SelectOption, { key: index, value: option },
|
|
98
|
+
(caseOverviewState.caseStatusUpdating && isCaseUpdating), menuAppendTo: document.body, validated: !status ? 'error' : 'default', placeholderText: t(status), onToggle: onDropdownToggle }, caseOverviewState.allCaseStatuses.data.map((option, index) => (React.createElement(SelectOption, { key: index, value: option, isDisabled: option === status },
|
|
94
99
|
React.createElement(Trans, null, option)))))));
|
|
95
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterRecommendationToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationToast.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAUnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"ClusterRecommendationToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationToast.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAUnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC,MAAM,CAwD1C,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -26,7 +26,9 @@ const ClusterRecommendationToast = () => {
|
|
|
26
26
|
};
|
|
27
27
|
// To prevent toast to reopen even after user close it we need to check cluster id
|
|
28
28
|
useEffect(() => {
|
|
29
|
-
if (!isEmpty(openshiftClusterID) &&
|
|
29
|
+
if (!isEmpty(openshiftClusterID) &&
|
|
30
|
+
previousOpenShiftClusterId !== openshiftClusterID &&
|
|
31
|
+
clusterRecommendations.data.length)
|
|
30
32
|
setToastVisibility(true);
|
|
31
33
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
34
|
}, [clusterRecommendations.data]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.59",
|
|
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": "053a5aa02f56e75747823ec36596180ed6427ab7"
|
|
147
147
|
}
|