@rh-support/troubleshoot 0.2.43 → 0.2.47
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/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts +1 -0
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +7 -5
- package/lib/esm/components/Recommendations/AlertToastWrapper.d.ts +9 -0
- package/lib/esm/components/Recommendations/AlertToastWrapper.d.ts.map +1 -0
- package/lib/esm/components/Recommendations/AlertToastWrapper.js +13 -0
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts +0 -2
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +35 -6
- package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +9 -18
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts +0 -4
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +11 -4
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.d.ts +6 -0
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.d.ts.map +1 -0
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.js +39 -0
- package/lib/esm/components/Recommendations/InsightsResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +1 -21
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +3 -1
- package/lib/esm/context/ClusterRecommendationsContext.d.ts +2 -4
- package/lib/esm/context/ClusterRecommendationsContext.d.ts.map +1 -1
- package/lib/esm/context/ClusterRecommendationsContext.js +6 -6
- package/lib/esm/reducers/ClusterRecommendationsReducer.d.ts +10 -3
- package/lib/esm/reducers/ClusterRecommendationsReducer.d.ts.map +1 -1
- package/lib/esm/reducers/ClusterRecommendationsReducer.js +21 -5
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,eAkLzC"}
|
|
@@ -109,7 +109,7 @@ export default function Case(props) {
|
|
|
109
109
|
React.createElement("div", { className: "support-grid support-case" }, isFetchingCaseDetails && !isFetchingCaseDetailsError && isEmpty(product) ? (React.createElement(OverviewContentLoader, null)) : (React.createElement(React.Fragment, null,
|
|
110
110
|
React.createElement("article", { className: "grid-main" },
|
|
111
111
|
React.createElement("section", { className: "grid-main-section" },
|
|
112
|
-
(isFetchingCaseDetailsError || !canReadCase) && (React.createElement(CaseDetailsErrorMessage, { isError: isFetchingCaseDetailsError, errorDetails: caseDetailsError, canReadCase: canReadCase, caseNumber: caseNumber })),
|
|
112
|
+
(isFetchingCaseDetailsError || !canReadCase) && (React.createElement(CaseDetailsErrorMessage, { isError: isFetchingCaseDetailsError, errorDetails: caseDetailsError, canReadCase: canReadCase, caseNumber: caseNumber, isInlineError: true })),
|
|
113
113
|
React.createElement(CaseDetailsWarningMessage, { caseNumber: caseNumber, selectedAccountDetails: selectedAccountDetails.data || {} }),
|
|
114
114
|
canReadCase &&
|
|
115
115
|
(!isFetchingCaseDetails || !isEmpty(product)) &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsErrorMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsErrorMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAKrD,UAAU,MAAM;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseDetailsErrorMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsErrorMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAKrD,UAAU,MAAM;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,eAsDpD"}
|
|
@@ -6,19 +6,21 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
6
6
|
export function CaseDetailsErrorMessage(props) {
|
|
7
7
|
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
8
8
|
const { t } = useTranslation();
|
|
9
|
+
// Initialize Default Props Below
|
|
10
|
+
const { isInlineError = false, canReadCase, caseNumber, errorDetails } = props;
|
|
9
11
|
const getErrorMessage = () => {
|
|
10
|
-
const { status, message = '' } =
|
|
12
|
+
const { status, message = '' } = errorDetails || {};
|
|
11
13
|
const customDefaultErrorMessage403 = t('You are not authorized to see this case.');
|
|
12
14
|
const errorMessage404 = t("Case number doesn't exist");
|
|
13
15
|
let errorMessage403;
|
|
14
|
-
if (!
|
|
16
|
+
if (!canReadCase) {
|
|
15
17
|
errorMessage403 = customDefaultErrorMessage403;
|
|
16
18
|
}
|
|
17
19
|
else if (loggedInUserRights.data.isInternal() &&
|
|
18
20
|
loggedInUserRights.data.isSecureSupportTech() &&
|
|
19
21
|
status === 403 &&
|
|
20
22
|
message.includes('Account cannot be accessed via this endpoint')) {
|
|
21
|
-
const shCaseLink = getSFDCSecureSupportCaseLink(
|
|
23
|
+
const shCaseLink = getSFDCSecureSupportCaseLink(caseNumber);
|
|
22
24
|
errorMessage403 = (React.createElement(React.Fragment, null,
|
|
23
25
|
"Secured Support Technicians should use",
|
|
24
26
|
' ',
|
|
@@ -29,11 +31,11 @@ export function CaseDetailsErrorMessage(props) {
|
|
|
29
31
|
else {
|
|
30
32
|
errorMessage403 = customDefaultErrorMessage403;
|
|
31
33
|
}
|
|
32
|
-
return formattedApiErrorMessage(
|
|
34
|
+
return formattedApiErrorMessage(errorDetails, {
|
|
33
35
|
'403': { message: errorMessage403 },
|
|
34
36
|
'404': { message: errorMessage404 },
|
|
35
37
|
});
|
|
36
38
|
};
|
|
37
|
-
return (React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "
|
|
39
|
+
return (React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-u-mb-lg", show: true, title: errorMessageTitle(errorDetails), isInline: isInlineError },
|
|
38
40
|
React.createElement(Trans, null, getErrorMessage())));
|
|
39
41
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We need to wrap Critical solution toast notification and Cluster recommendation toast notification so they don't get overlapped.
|
|
3
|
+
*/
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
interface IProps {
|
|
6
|
+
}
|
|
7
|
+
declare const AlertToastWrapper: FC<IProps>;
|
|
8
|
+
export default AlertToastWrapper;
|
|
9
|
+
//# sourceMappingURL=AlertToastWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertToastWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AlertToastWrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKlC,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,MAAM,CAQjC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We need to wrap Critical solution toast notification and Cluster recommendation toast notification so they don't get overlapped.
|
|
3
|
+
*/
|
|
4
|
+
import { AlertGroup } from '@patternfly/react-core';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import ClusterRecommendationToast from './ClusterRecommendationToast';
|
|
7
|
+
import CriticalSolutionsToast from './CriticalSolutionsToast';
|
|
8
|
+
const AlertToastWrapper = () => {
|
|
9
|
+
return (React.createElement(AlertGroup, { isToast: true },
|
|
10
|
+
React.createElement(CriticalSolutionsToast, null),
|
|
11
|
+
React.createElement(ClusterRecommendationToast, null)));
|
|
12
|
+
};
|
|
13
|
+
export default AlertToastWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterRecommendationToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationToast.tsx"],"names":[],"mappings":"
|
|
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,CA+C1C,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,10 +1,39 @@
|
|
|
1
|
-
import { Alert, AlertActionCloseButton,
|
|
2
|
-
import
|
|
1
|
+
import { Alert, AlertActionCloseButton, Button } from '@patternfly/react-core';
|
|
2
|
+
import { usePrevious } from '@rh-support/components';
|
|
3
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
4
|
+
import { isEmpty, isEqual } from 'lodash';
|
|
5
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
3
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
-
|
|
7
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
8
|
+
import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
|
|
9
|
+
import { toggleClusterRecommendationModal } from '../../reducers/ClusterRecommendationsReducer';
|
|
10
|
+
import { isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
|
|
11
|
+
const ClusterRecommendationToast = () => {
|
|
12
|
+
var _a;
|
|
5
13
|
const { t } = useTranslation();
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
|
|
15
|
+
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
16
|
+
const [isToastVisible, setToastVisibility] = useState(false);
|
|
17
|
+
const { openshiftClusterID, product } = useCaseSelector((state) => ({
|
|
18
|
+
openshiftClusterID: state.caseDetails.openshiftClusterID,
|
|
19
|
+
product: state.caseDetails.product,
|
|
20
|
+
}), isEqual);
|
|
21
|
+
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
22
|
+
const previousOpenShiftClusterId = usePrevious(openshiftClusterID);
|
|
23
|
+
const onViewRecommendations = () => {
|
|
24
|
+
setToastVisibility(false);
|
|
25
|
+
toggleClusterRecommendationModal(clusterRecommendationsDispatch, !isClusterRecommendationsModalOpen);
|
|
26
|
+
};
|
|
27
|
+
// To prevent toast to reopen even after user close it we need to check cluster id
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!isEmpty(openshiftClusterID) && previousOpenShiftClusterId !== openshiftClusterID)
|
|
30
|
+
setToastVisibility(true);
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
+
}, [clusterRecommendations.data]);
|
|
33
|
+
const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
34
|
+
if (!isToastVisible || !hasCluster)
|
|
35
|
+
return null;
|
|
36
|
+
return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: t('Cluster recommendation has been triggered'), "data-tracking-id": "toast-view-cluster-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: onViewRecommendations },
|
|
37
|
+
React.createElement(Trans, null, "View recommendations")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: () => setToastVisibility(false) }) }));
|
|
9
38
|
};
|
|
10
39
|
export default ClusterRecommendationToast;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterRecommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendations.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClusterRecommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendations.tsx"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,UAAU,qBAAqB,gBAmC5C"}
|
|
@@ -1,35 +1,26 @@
|
|
|
1
1
|
import { Button } from '@patternfly/react-core';
|
|
2
|
-
import React, { useContext
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
3
|
import { Trans } from 'react-i18next';
|
|
4
|
-
import { ClusterRecommendationsContext } from '../../context/ClusterRecommendationsContext';
|
|
4
|
+
import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
|
|
5
|
+
import { toggleClusterRecommendationModal } from '../../reducers/ClusterRecommendationsReducer';
|
|
5
6
|
import { ClusterRecommendationItems } from './ClusterRecommendationItems';
|
|
6
7
|
import { ClusterRecommendationsModal } from './ClusterRecommendationsModal';
|
|
7
|
-
import ClusterRecommendationToast from './ClusterRecommendationToast';
|
|
8
8
|
export default function ClusteRecommendations() {
|
|
9
|
-
const { clusterRecommendations } = useContext(ClusterRecommendationsContext);
|
|
10
|
-
const
|
|
11
|
-
const [isToastVisible, setToastVisibility] = useState(false);
|
|
12
|
-
const onViewRecommendations = () => {
|
|
13
|
-
setToastVisibility(false);
|
|
14
|
-
setShowModal(true);
|
|
15
|
-
};
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
setToastVisibility(true);
|
|
18
|
-
}, [clusterRecommendations.data]);
|
|
9
|
+
const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
|
|
10
|
+
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
19
11
|
const NUMBER_OF_RULES_TO_DISPLAY = 3;
|
|
20
|
-
const
|
|
21
|
-
|
|
12
|
+
const onViewMoreRecommendation = () => {
|
|
13
|
+
toggleClusterRecommendationModal(clusterRecommendationsDispatch, !isClusterRecommendationsModalOpen);
|
|
22
14
|
};
|
|
23
15
|
if (clusterRecommendations.data.length === 0 || clusterRecommendations.isError || clusterRecommendations.isFetching)
|
|
24
16
|
return React.createElement(React.Fragment, null);
|
|
25
17
|
return (React.createElement(React.Fragment, null,
|
|
26
|
-
isToastVisible && (React.createElement(ClusterRecommendationToast, { onViewRecommendations: onViewRecommendations, onToastClose: () => setToastVisibility(false) })),
|
|
27
18
|
React.createElement("div", { className: "card card-white card-support top-recommendations" },
|
|
28
19
|
React.createElement("h3", { className: "card-heading" },
|
|
29
20
|
React.createElement(Trans, null, "Cluster recommendations")),
|
|
30
21
|
React.createElement("div", null,
|
|
31
22
|
React.createElement(ClusterRecommendationItems, { clusterRecommendations: clusterRecommendations.data.slice(0, NUMBER_OF_RULES_TO_DISPLAY) }),
|
|
32
|
-
clusterRecommendations.data.length > NUMBER_OF_RULES_TO_DISPLAY && (React.createElement(Button, { className: "pf-u-p-md", variant: "link", isBlock: true, onClick:
|
|
23
|
+
clusterRecommendations.data.length > NUMBER_OF_RULES_TO_DISPLAY && (React.createElement(Button, { className: "pf-u-p-md", variant: "link", isBlock: true, onClick: onViewMoreRecommendation },
|
|
33
24
|
React.createElement(Trans, null, "View more recommendations"))),
|
|
34
|
-
React.createElement(ClusterRecommendationsModal,
|
|
25
|
+
React.createElement(ClusterRecommendationsModal, null)))));
|
|
35
26
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { IClusterRecommendation } from '@cee-eng/hydrajs/@types/api/pcm/preCaseDiagnostics';
|
|
2
1
|
interface IProps {
|
|
3
|
-
clusterRecommendations: IClusterRecommendation[];
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
onModalClose: () => void;
|
|
6
2
|
}
|
|
7
3
|
export declare function ClusterRecommendationsModal(props: IProps): JSX.Element;
|
|
8
4
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterRecommendationsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationsModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClusterRecommendationsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationsModal.tsx"],"names":[],"mappings":"AAeA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eA2ExD"}
|
|
@@ -12,7 +12,9 @@ import { Button, Modal } from '@patternfly/react-core';
|
|
|
12
12
|
import { useFetch } from '@rh-support/components';
|
|
13
13
|
import React, { useContext, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
|
|
15
16
|
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
17
|
+
import { toggleClusterRecommendationModal } from '../../reducers/ClusterRecommendationsReducer';
|
|
16
18
|
import { ClusterRecommendationItems } from './ClusterRecommendationItems';
|
|
17
19
|
import { RecommendationFeedbackModal } from './RecommendationFeedbackModal';
|
|
18
20
|
export function ClusterRecommendationsModal(props) {
|
|
@@ -21,6 +23,8 @@ export function ClusterRecommendationsModal(props) {
|
|
|
21
23
|
const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
|
|
22
24
|
const { SessionResourceSource } = pcm.preCase.session;
|
|
23
25
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
26
|
+
const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
|
|
27
|
+
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
24
28
|
const handleSolvedIssue = () => __awaiter(this, void 0, void 0, function* () {
|
|
25
29
|
var _a, _b;
|
|
26
30
|
try {
|
|
@@ -31,18 +35,21 @@ export function ClusterRecommendationsModal(props) {
|
|
|
31
35
|
url: '',
|
|
32
36
|
});
|
|
33
37
|
setIsModalVisible(true);
|
|
34
|
-
|
|
38
|
+
onModalClose();
|
|
35
39
|
}
|
|
36
40
|
catch (e) { }
|
|
37
41
|
});
|
|
38
42
|
const onModalToggle = () => {
|
|
39
43
|
setIsModalVisible((visible) => !visible);
|
|
40
44
|
};
|
|
45
|
+
const onModalClose = () => {
|
|
46
|
+
toggleClusterRecommendationModal(clusterRecommendationsDispatch, !isClusterRecommendationsModalOpen);
|
|
47
|
+
};
|
|
41
48
|
return (React.createElement(React.Fragment, null,
|
|
42
49
|
React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
|
|
43
|
-
React.createElement(Modal, { className: "critical-solutions-modal", title: t('Cluster recommendations'), description: t('Recommendations have been triggered for your cluster.'), "data-tracking-id": "cluster-recommendations-modal-body", onClose:
|
|
50
|
+
React.createElement(Modal, { className: "critical-solutions-modal", title: t('Cluster recommendations'), description: t('Recommendations have been triggered for your cluster.'), "data-tracking-id": "cluster-recommendations-modal-body", onClose: onModalClose, isOpen: isClusterRecommendationsModalOpen, actions: [
|
|
44
51
|
React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, onClick: handleSolvedIssue, key: "solved-my-issue", variant: "primary", "data-tracking-id": "cluster-recommendations-solutions-modal" }, t('I solved my issue')),
|
|
45
|
-
React.createElement(Button, { onClick:
|
|
52
|
+
React.createElement(Button, { onClick: onModalClose, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-cluster-recommendations-modal" }, t('Cancel')),
|
|
46
53
|
] },
|
|
47
|
-
React.createElement(ClusterRecommendationItems, { clusterRecommendations:
|
|
54
|
+
React.createElement(ClusterRecommendationItems, { clusterRecommendations: clusterRecommendations.data }))));
|
|
48
55
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CriticalSolutionsToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/CriticalSolutionsToast.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAKnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,sBAAsB,EAAE,EAAE,CAAC,MAAM,CA+CtC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Alert, AlertActionCloseButton, Button } from '@patternfly/react-core';
|
|
2
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
3
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { RulesDispatchContext, RulesStateContext } from '../../context/RulesContext';
|
|
5
|
+
import { RulesReducerConstants } from '../../reducers/RulesReducer';
|
|
6
|
+
const CriticalSolutionsToast = () => {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const [showNotification, setShowNotification] = useState(false);
|
|
9
|
+
const { rulesState } = useContext(RulesStateContext);
|
|
10
|
+
const rulesDispatch = useContext(RulesDispatchContext);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (rulesState.triggerRuleNotification && !showNotification) {
|
|
13
|
+
setShowNotification(true);
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line
|
|
16
|
+
}, [rulesState.triggerRuleNotification]);
|
|
17
|
+
const onClose = () => {
|
|
18
|
+
rulesDispatch({
|
|
19
|
+
type: RulesReducerConstants.triggerRuleNotification,
|
|
20
|
+
payload: { triggerRuleNotification: false },
|
|
21
|
+
});
|
|
22
|
+
setShowNotification(false);
|
|
23
|
+
};
|
|
24
|
+
const setEAModalVisibility = (isVisible) => {
|
|
25
|
+
rulesDispatch({
|
|
26
|
+
type: RulesReducerConstants.triggerEARulesModalVisibiltyChange,
|
|
27
|
+
payload: { isRuleModalVisible: isVisible },
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const viewCriticalSolution = () => {
|
|
31
|
+
onClose();
|
|
32
|
+
setEAModalVisibility(true);
|
|
33
|
+
};
|
|
34
|
+
if (!showNotification && !rulesState.triggerRuleNotification)
|
|
35
|
+
return null;
|
|
36
|
+
return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: t('Critical solutions have been triggered'), "data-tracking-id": "toast-view-crit-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: viewCriticalSolution },
|
|
37
|
+
React.createElement(Trans, null, "View recommendations")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: onClose }) }));
|
|
38
|
+
};
|
|
39
|
+
export default CriticalSolutionsToast;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwB5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwB5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eA+OrC;kBA/OQ,eAAe;;;AAkPxB,eAAe,eAAe,CAAC"}
|
|
@@ -19,7 +19,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
21
|
import { search } from '@cee-eng/hydrajs';
|
|
22
|
-
import { Alert,
|
|
22
|
+
import { Alert, Button } from '@patternfly/react-core';
|
|
23
23
|
import { usePrevious } from '@rh-support/components';
|
|
24
24
|
import { getSolrParams } from '@rh-support/utils';
|
|
25
25
|
import difference from 'lodash/difference';
|
|
@@ -49,7 +49,6 @@ const defaultProps = {
|
|
|
49
49
|
function InsightsResults(props) {
|
|
50
50
|
const recommendationDispatch = useContext(RecommendationDispatchContext);
|
|
51
51
|
const { attachmentState: { includeAnalysisResults, caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
|
|
52
|
-
const [showNotification, setShowNotification] = useState(false);
|
|
53
52
|
const { product, version, environment, summary, issue, periodicityOfIssue, timeFramesAndUrgency } = useCaseSelector((state) => ({
|
|
54
53
|
product: state.caseDetails.product,
|
|
55
54
|
version: state.caseDetails.version,
|
|
@@ -71,19 +70,6 @@ function InsightsResults(props) {
|
|
|
71
70
|
const insightResults = flatMap(insightResultsMap);
|
|
72
71
|
const allResults = [...recommendedResults, ...insightResults];
|
|
73
72
|
const validEARules = filter(rulesState.EARules.rules, (r) => r.visible && r.rule_sub_type !== 'attachment');
|
|
74
|
-
function onClose() {
|
|
75
|
-
rulesDispatch({
|
|
76
|
-
type: RulesReducerConstants.triggerRuleNotification,
|
|
77
|
-
payload: { triggerRuleNotification: false },
|
|
78
|
-
});
|
|
79
|
-
setShowNotification(false);
|
|
80
|
-
}
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
if (rulesState.triggerRuleNotification && !showNotification) {
|
|
83
|
-
setShowNotification(true);
|
|
84
|
-
}
|
|
85
|
-
// eslint-disable-next-line
|
|
86
|
-
}, [rulesState.triggerRuleNotification]);
|
|
87
73
|
// to hide notification if modal is opened from somewhere else and notification toast is visible
|
|
88
74
|
useEffect(() => {
|
|
89
75
|
if (rulesState.isRuleModalVisible && rulesState.triggerRuleNotification) {
|
|
@@ -245,12 +231,6 @@ function InsightsResults(props) {
|
|
|
245
231
|
if (isEmpty(allResults))
|
|
246
232
|
return React.createElement(React.Fragment, null);
|
|
247
233
|
return (React.createElement(React.Fragment, null,
|
|
248
|
-
showNotification && rulesState.triggerRuleNotification && (React.createElement(AlertGroup, { isToast: true },
|
|
249
|
-
React.createElement(Alert, { isLiveRegion: true, variant: "success", title: t('Critical solutions have been triggered'), "data-tracking-id": "toast-view-crit-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: () => {
|
|
250
|
-
onClose();
|
|
251
|
-
setEAModalVisibility(true);
|
|
252
|
-
} },
|
|
253
|
-
React.createElement(Trans, null, "View recommendations")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: onClose }) }))),
|
|
254
234
|
!rulesState.triggerRuleNotification && (React.createElement(Alert, { isInline: true, title: t('Critical solutions have been triggered'), "data-tracking-id": "inline-view-crit-sol", actionLinks: React.createElement(Button, { isInline: true, className: "pf-c-alert__action", variant: "link", onClick: () => {
|
|
255
235
|
setEAModalVisibility(true);
|
|
256
236
|
} },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardAside.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardAside.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EAEH,eAAe,EAGlB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardAside.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardAside.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EAEH,eAAe,EAGlB,MAAM,iCAAiC,CAAC;AASzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,2BAA2B,EAAE,OAAO,CAAC;CACxC;AAGD,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,eA8CjC;kBA9CQ,WAAW;;;AAgDpB,eAAe,WAAW,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { RouteContext } from '../../context/RouteContext';
|
|
|
7
7
|
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
8
8
|
import { hideFileUploadSidebarWidgetSections, showSideBarClusterIdRuleWidgetSections, showSideBarEARuleWidgetSections, } from '../../reducers/RouteConstNTypes';
|
|
9
9
|
import { FileDiag } from '../CaseInformation/FileDiag';
|
|
10
|
+
import AlertToastWrapper from '../Recommendations/AlertToastWrapper';
|
|
10
11
|
import { AsideResults } from '../Recommendations/AsideResults';
|
|
11
12
|
import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
|
|
12
13
|
import { EARuleWidget } from '../Recommendations/EARules/EARuleWidget';
|
|
@@ -40,7 +41,8 @@ function WizardAside(props) {
|
|
|
40
41
|
canShowClusterIdWidgets && React.createElement(ClusterRecommendations, null),
|
|
41
42
|
canUseSessionManagement && React.createElement(SessionRestore, { routeProps: props.routeProps }),
|
|
42
43
|
React.createElement(AsideResults, null),
|
|
43
|
-
canShowFileUploadWidget() && React.createElement(FileDiag, null)
|
|
44
|
+
canShowFileUploadWidget() && React.createElement(FileDiag, null),
|
|
45
|
+
React.createElement(AlertToastWrapper, null))));
|
|
44
46
|
}
|
|
45
47
|
WizardAside.defaultProps = defaultProps;
|
|
46
48
|
export default WizardAside;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { IClusterRecommendation } from '@cee-eng/hydrajs/@types/api/pcm/preCaseDiagnostics';
|
|
2
|
-
import { IApiResponseDetails } from '@rh-support/types/shared';
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import { ClusterRecommendationsDispatchType } from '../reducers/ClusterRecommendationsReducer';
|
|
2
|
+
import { ClusterRecommendationsDispatchType, IInitialClusterRecommendationsStateType } from '../reducers/ClusterRecommendationsReducer';
|
|
5
3
|
export interface IRulesStateContext {
|
|
6
|
-
|
|
4
|
+
clusterRecommendationsState: IInitialClusterRecommendationsStateType;
|
|
7
5
|
}
|
|
8
6
|
export declare const ClusterRecommendationsContext: React.Context<IRulesStateContext>;
|
|
9
7
|
export declare const ClusterRecommendationsDispatchContext: React.Context<ClusterRecommendationsDispatchType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterRecommendationsContext.d.ts","sourceRoot":"","sources":["../../../src/context/ClusterRecommendationsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ClusterRecommendationsContext.d.ts","sourceRoot":"","sources":["../../../src/context/ClusterRecommendationsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EACH,kCAAkC,EAElC,uCAAuC,EAE1C,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IAC/B,2BAA2B,EAAE,uCAAuC,CAAC;CACxE;AAMD,eAAO,MAAM,6BAA6B,mCAAoD,CAAC;AAC/F,eAAO,MAAM,qCAAqC,mDAA8C,CAAC;AAEjG,wBAAgB,qCAAqC,CAAC,EAAE,QAAQ,EAAE;;CAAA,eAUjE"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useReducer } from 'react';
|
|
2
|
-
import { clusterRecommendationsReducer,
|
|
2
|
+
import { clusterRecommendationsReducer, initialState, } from '../reducers/ClusterRecommendationsReducer';
|
|
3
3
|
const initialClusterIdStateContext = {
|
|
4
|
-
|
|
4
|
+
clusterRecommendationsState: initialState,
|
|
5
5
|
};
|
|
6
|
-
const
|
|
6
|
+
const initialDispatchContext = null;
|
|
7
7
|
export const ClusterRecommendationsContext = React.createContext(initialClusterIdStateContext);
|
|
8
|
-
export const ClusterRecommendationsDispatchContext = React.createContext(
|
|
8
|
+
export const ClusterRecommendationsDispatchContext = React.createContext(initialDispatchContext);
|
|
9
9
|
export function ClusterRecommendationsContextProvider({ children }) {
|
|
10
|
-
const [
|
|
11
|
-
return (React.createElement(ClusterRecommendationsContext.Provider, { value: {
|
|
10
|
+
const [clusterRecommendationsState, dispatch] = useReducer(clusterRecommendationsReducer, initialState);
|
|
11
|
+
return (React.createElement(ClusterRecommendationsContext.Provider, { value: { clusterRecommendationsState } },
|
|
12
12
|
React.createElement(ClusterRecommendationsDispatchContext.Provider, { value: dispatch }, children)));
|
|
13
13
|
}
|
|
@@ -2,13 +2,20 @@ import { IClusterRecommendation } from '@cee-eng/hydrajs/@types/api/pcm/preCaseD
|
|
|
2
2
|
import { IAction, IApiResponseDetails } from '@rh-support/types/shared';
|
|
3
3
|
export declare enum RulesReducerConstants {
|
|
4
4
|
requestClusterRecommendations = "requestClusterRecommendations",
|
|
5
|
-
resetClusterRecommendations = "resetClusterRecommendations"
|
|
5
|
+
resetClusterRecommendations = "resetClusterRecommendations",
|
|
6
|
+
toggleClusterRecommendationModal = "toggleClusterRecommendationModal"
|
|
6
7
|
}
|
|
7
|
-
declare type IActionType = IAction<RulesReducerConstants,
|
|
8
|
+
declare type IActionType = IAction<RulesReducerConstants, IInitialClusterRecommendationsStateType>;
|
|
8
9
|
export declare type ClusterRecommendationsDispatchType = (value: IActionType) => void;
|
|
9
10
|
export declare const initialClusterRecommendations: IApiResponseDetails<IClusterRecommendation[]>;
|
|
10
|
-
export
|
|
11
|
+
export interface IInitialClusterRecommendationsStateType {
|
|
12
|
+
clusterRecommendations: IApiResponseDetails<IClusterRecommendation[]>;
|
|
13
|
+
isClusterRecommendationsModalOpen: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const initialState: IInitialClusterRecommendationsStateType;
|
|
16
|
+
export declare const clusterRecommendationsReducer: (state: IInitialClusterRecommendationsStateType, action: IActionType) => IInitialClusterRecommendationsStateType;
|
|
11
17
|
export declare const resetClusterRecommendations: (dispatch: ClusterRecommendationsDispatchType) => void;
|
|
12
18
|
export declare const fetchClusterRecommendations: (dispatch: ClusterRecommendationsDispatchType, clusterId: string) => Promise<void>;
|
|
19
|
+
export declare const toggleClusterRecommendationModal: (dispatch: ClusterRecommendationsDispatchType, newModalVisibilityValue: boolean) => void;
|
|
13
20
|
export {};
|
|
14
21
|
//# sourceMappingURL=ClusterRecommendationsReducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterRecommendationsReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/ClusterRecommendationsReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,sBAAsB,EAEzB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGxE,oBAAY,qBAAqB;IAC7B,6BAA6B,kCAAkC;IAC/D,2BAA2B,gCAAgC;
|
|
1
|
+
{"version":3,"file":"ClusterRecommendationsReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/ClusterRecommendationsReducer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,sBAAsB,EAEzB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGxE,oBAAY,qBAAqB;IAC7B,6BAA6B,kCAAkC;IAC/D,2BAA2B,gCAAgC;IAC3D,gCAAgC,qCAAqC;CACxE;AAED,aAAK,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE,uCAAuC,CAAC,CAAC;AAC3F,oBAAY,kCAAkC,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAE9E,eAAO,MAAM,6BAA6B,EAAE,mBAAmB,CAAC,sBAAsB,EAAE,CAA4B,CAAC;AAErH,MAAM,WAAW,uCAAuC;IACpD,sBAAsB,EAAE,mBAAmB,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACtE,iCAAiC,EAAE,OAAO,CAAC;CAC9C;AAED,eAAO,MAAM,YAAY,EAAE,uCAG1B,CAAC;AAEF,eAAO,MAAM,6BAA6B,UAC/B,uCAAuC,0BAE/C,uCAgBF,CAAC;AAGF,eAAO,MAAM,2BAA2B,aAAc,kCAAkC,SAEvF,CAAC;AACF,eAAO,MAAM,2BAA2B,aAAoB,kCAAkC,aAAa,MAAM,kBAyBhH,CAAC;AACF,eAAO,MAAM,gCAAgC,aAC/B,kCAAkC,2BACnB,OAAO,SAMnC,CAAC"}
|
|
@@ -13,16 +13,24 @@ export var RulesReducerConstants;
|
|
|
13
13
|
(function (RulesReducerConstants) {
|
|
14
14
|
RulesReducerConstants["requestClusterRecommendations"] = "requestClusterRecommendations";
|
|
15
15
|
RulesReducerConstants["resetClusterRecommendations"] = "resetClusterRecommendations";
|
|
16
|
+
RulesReducerConstants["toggleClusterRecommendationModal"] = "toggleClusterRecommendationModal";
|
|
16
17
|
})(RulesReducerConstants || (RulesReducerConstants = {}));
|
|
17
18
|
export const initialClusterRecommendations = getApiResourceObject([]);
|
|
19
|
+
export const initialState = {
|
|
20
|
+
clusterRecommendations: initialClusterRecommendations,
|
|
21
|
+
isClusterRecommendationsModalOpen: false,
|
|
22
|
+
};
|
|
18
23
|
export const clusterRecommendationsReducer = (state, action) => {
|
|
19
24
|
switch (action.type) {
|
|
20
25
|
case RulesReducerConstants.requestClusterRecommendations: {
|
|
21
|
-
return Object.assign(Object.assign({}, state), action.payload);
|
|
26
|
+
return Object.assign(Object.assign({}, state), { clusterRecommendations: action.payload.clusterRecommendations });
|
|
22
27
|
}
|
|
23
28
|
// used for reseting the rules when reseting on a new troubleshoot issue.
|
|
24
29
|
case RulesReducerConstants.resetClusterRecommendations: {
|
|
25
|
-
return Object.assign({}, initialClusterRecommendations);
|
|
30
|
+
return Object.assign(Object.assign({}, state), { clusterRecommendations: initialClusterRecommendations });
|
|
31
|
+
}
|
|
32
|
+
case RulesReducerConstants.toggleClusterRecommendationModal: {
|
|
33
|
+
return Object.assign(Object.assign({}, state), { isClusterRecommendationsModalOpen: action.payload.isClusterRecommendationsModalOpen });
|
|
26
34
|
}
|
|
27
35
|
default: {
|
|
28
36
|
return state;
|
|
@@ -37,21 +45,29 @@ export const fetchClusterRecommendations = (dispatch, clusterId) => __awaiter(vo
|
|
|
37
45
|
var _a;
|
|
38
46
|
dispatch({
|
|
39
47
|
type: RulesReducerConstants.requestClusterRecommendations,
|
|
40
|
-
payload:
|
|
48
|
+
payload: {
|
|
49
|
+
clusterRecommendations: getApiResourceObject([], true),
|
|
50
|
+
},
|
|
41
51
|
});
|
|
42
52
|
try {
|
|
43
53
|
const clusterInsight = yield pcm.preCase.diag.getClusterRecommendations(clusterId);
|
|
44
54
|
const rules = ((_a = clusterInsight === null || clusterInsight === void 0 ? void 0 : clusterInsight.report) === null || _a === void 0 ? void 0 : _a.data) || [];
|
|
45
55
|
dispatch({
|
|
46
56
|
type: RulesReducerConstants.requestClusterRecommendations,
|
|
47
|
-
payload: getApiResourceObject(rules),
|
|
57
|
+
payload: { clusterRecommendations: getApiResourceObject(rules) },
|
|
48
58
|
});
|
|
49
59
|
}
|
|
50
60
|
catch (e) {
|
|
51
61
|
console.log(e.message);
|
|
52
62
|
dispatch({
|
|
53
63
|
type: RulesReducerConstants.requestClusterRecommendations,
|
|
54
|
-
payload: getApiResourceObject([], false, true, e.message),
|
|
64
|
+
payload: { clusterRecommendations: getApiResourceObject([], false, true, e.message) },
|
|
55
65
|
});
|
|
56
66
|
}
|
|
57
67
|
});
|
|
68
|
+
export const toggleClusterRecommendationModal = (dispatch, newModalVisibilityValue) => {
|
|
69
|
+
dispatch({
|
|
70
|
+
type: RulesReducerConstants.toggleClusterRecommendationModal,
|
|
71
|
+
payload: { isClusterRecommendationsModalOpen: newModalVisibilityValue },
|
|
72
|
+
});
|
|
73
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.47",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@cee-eng/hydrajs": "4.7.3",
|
|
30
|
-
"@cee-eng/ui-toolkit": "1.1.
|
|
30
|
+
"@cee-eng/ui-toolkit": "1.1.6",
|
|
31
31
|
"@patternfly/patternfly": "4.102.2",
|
|
32
32
|
"@patternfly/pfe-accordion": "1.1.0",
|
|
33
33
|
"@patternfly/pfe-collapse": "1.1.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@cee-eng/hydrajs": "4.7.3",
|
|
67
|
-
"@cee-eng/ui-toolkit": "1.1.
|
|
67
|
+
"@cee-eng/ui-toolkit": "1.1.6",
|
|
68
68
|
"@patternfly/patternfly": "4.102.2",
|
|
69
69
|
"@patternfly/pfe-accordion": "1.1.0",
|
|
70
70
|
"@patternfly/pfe-collapse": "1.1.0",
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"@progress/kendo-drawing": "^1.6.0",
|
|
74
74
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
75
75
|
"@rh-support/api": "0.3.9",
|
|
76
|
-
"@rh-support/components": "1.1.
|
|
77
|
-
"@rh-support/react-context": "0.2.
|
|
76
|
+
"@rh-support/components": "1.1.23",
|
|
77
|
+
"@rh-support/react-context": "0.2.26",
|
|
78
78
|
"@rh-support/types": "0.2.0",
|
|
79
|
-
"@rh-support/user-permissions": "0.2.
|
|
80
|
-
"@rh-support/utils": "0.2.
|
|
79
|
+
"@rh-support/user-permissions": "0.2.17",
|
|
80
|
+
"@rh-support/utils": "0.2.15",
|
|
81
81
|
"@types/react-redux": "^7.1.12",
|
|
82
82
|
"@types/redux": "^3.6.0",
|
|
83
83
|
"@webcomponents/webcomponentsjs": "^2.2.10",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"not ie <= 11",
|
|
143
143
|
"not op_mini all"
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "83f945a320bb7f76cb312a66f064a301485dcee0"
|
|
146
146
|
}
|