@rh-support/troubleshoot 0.2.47 → 0.2.48
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/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +4 -0
- package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +16 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +4 -2
- package/package.json +2 -2
|
@@ -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,CAmD1C,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -30,6 +30,10 @@ const ClusterRecommendationToast = () => {
|
|
|
30
30
|
setToastVisibility(true);
|
|
31
31
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
32
|
}, [clusterRecommendations.data]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!openshiftClusterID)
|
|
35
|
+
setToastVisibility(false);
|
|
36
|
+
}, [openshiftClusterID]);
|
|
33
37
|
const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
34
38
|
if (!isToastVisible || !hasCluster)
|
|
35
39
|
return null;
|
|
@@ -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":"AAgBA,MAAM,CAAC,OAAO,UAAU,qBAAqB,gBAmD5C"}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import { Button } from '@patternfly/react-core';
|
|
2
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
+
import { isEqual } from 'lodash';
|
|
2
4
|
import React, { useContext } from 'react';
|
|
3
5
|
import { Trans } from 'react-i18next';
|
|
6
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
4
7
|
import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
|
|
5
8
|
import { toggleClusterRecommendationModal } from '../../reducers/ClusterRecommendationsReducer';
|
|
9
|
+
import { isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
|
|
6
10
|
import { ClusterRecommendationItems } from './ClusterRecommendationItems';
|
|
7
11
|
import { ClusterRecommendationsModal } from './ClusterRecommendationsModal';
|
|
8
12
|
export default function ClusteRecommendations() {
|
|
13
|
+
var _a;
|
|
9
14
|
const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
|
|
10
15
|
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
16
|
+
const { openshiftClusterID, product } = useCaseSelector((state) => ({
|
|
17
|
+
openshiftClusterID: state.caseDetails.openshiftClusterID,
|
|
18
|
+
product: state.caseDetails.product,
|
|
19
|
+
}), isEqual);
|
|
20
|
+
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
11
21
|
const NUMBER_OF_RULES_TO_DISPLAY = 3;
|
|
12
22
|
const onViewMoreRecommendation = () => {
|
|
13
23
|
toggleClusterRecommendationModal(clusterRecommendationsDispatch, !isClusterRecommendationsModalOpen);
|
|
14
24
|
};
|
|
15
|
-
|
|
25
|
+
const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
26
|
+
if (clusterRecommendations.data.length === 0 ||
|
|
27
|
+
clusterRecommendations.isError ||
|
|
28
|
+
clusterRecommendations.isFetching ||
|
|
29
|
+
!hasCluster ||
|
|
30
|
+
!openshiftClusterID)
|
|
16
31
|
return React.createElement(React.Fragment, null);
|
|
17
32
|
return (React.createElement(React.Fragment, null,
|
|
18
33
|
React.createElement("div", { className: "card card-white card-support top-recommendations" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eAkXtD"}
|
|
@@ -293,8 +293,10 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
293
293
|
const oldMajorVersion = previousVersion && getVersion(previousVersion).major;
|
|
294
294
|
const newMajorVersion = getVersion(version).major;
|
|
295
295
|
const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
// Need to check `hasCluster` is empty as when product is changing from shift product to non-shift
|
|
297
|
+
// product new product will don't have any cluster
|
|
298
|
+
const isClusterInfoShouldBeReset = !hasCluster || (hasCluster && oldMajorVersion !== newMajorVersion);
|
|
299
|
+
if (isClusterInfoShouldBeReset) {
|
|
298
300
|
setCaseDetails(caseDispatch, {
|
|
299
301
|
openshiftClusterID: '',
|
|
300
302
|
openshiftClusterVersion: '',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.48",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"not ie <= 11",
|
|
143
143
|
"not op_mini all"
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "2631f851bb93e3c623df318a2062b2426c864a7e"
|
|
146
146
|
}
|