@rh-support/troubleshoot 0.2.64 → 0.2.72
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/README.md +2 -0
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +4 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +7 -8
- package/lib/esm/scss/_pf4-overrides.scss +6 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;AAqBF,wBAAgB,kBAAkB,gBAsRjC"}
|
|
@@ -16,7 +16,7 @@ import React, { useContext, useEffect, useState } from 'react';
|
|
|
16
16
|
import { Trans } from 'react-i18next';
|
|
17
17
|
import { useLocation } from 'react-router';
|
|
18
18
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
19
|
-
import { ClusterRecommendationsDispatchContext } from '../../context/ClusterRecommendationsContext';
|
|
19
|
+
import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
|
|
20
20
|
import { RouteContext } from '../../context/RouteContext';
|
|
21
21
|
import { getUpdatedDescription } from '../../reducers/CaseHelpers';
|
|
22
22
|
import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
|
|
@@ -58,6 +58,7 @@ export function OpenShiftClusterId() {
|
|
|
58
58
|
const { globalMetadataState: { pcmConfig, allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
59
59
|
const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
|
|
60
60
|
const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
|
|
61
|
+
const { clusterRecommendationsState: { clusterRecommendations }, } = useContext(ClusterRecommendationsContext);
|
|
61
62
|
const majorVersion = (version && getVersion(version).major) || '';
|
|
62
63
|
const isOpenShiftV3 = majorVersion === '3';
|
|
63
64
|
const isCustomer = loggedInUserRights.data.isAccountSameAsLoggedInAccount(selectedAccountDetails.data.accountNumber);
|
|
@@ -154,7 +155,9 @@ export function OpenShiftClusterId() {
|
|
|
154
155
|
setSelectedReason('dont-have-id');
|
|
155
156
|
}
|
|
156
157
|
const canFetchClusterRecommendation = isClusterRecommendationEnabled && !isClusterIdInvalid && !isEmpty(openshiftClusterID);
|
|
158
|
+
// To prevent refetching clusterRecommendations checking for clusterRecommendations data length
|
|
157
159
|
canFetchClusterRecommendation &&
|
|
160
|
+
!clusterRecommendations.data.length &&
|
|
158
161
|
fetchClusterRecommendations(clusterRecommendationsDispatch, openshiftClusterID);
|
|
159
162
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
160
163
|
}, [v3ClusterName, noClusterIdReason]);
|
|
@@ -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":"AAGA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAUnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC,MAAM,CAqD1C,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Alert, AlertActionCloseButton, Button } from '@patternfly/react-core';
|
|
2
|
-
import { usePrevious } from '@rh-support/components';
|
|
3
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
4
3
|
import { isEmpty, isEqual } from 'lodash';
|
|
5
4
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -7,7 +6,7 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
7
6
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
8
7
|
import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
|
|
9
8
|
import { toggleClusterRecommendationModal } from '../../reducers/ClusterRecommendationsReducer';
|
|
10
|
-
import { isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
|
|
9
|
+
import { getIsClusterIdInvalid, isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
|
|
11
10
|
const ClusterRecommendationToast = () => {
|
|
12
11
|
var _a;
|
|
13
12
|
const { t } = useTranslation();
|
|
@@ -19,21 +18,21 @@ const ClusterRecommendationToast = () => {
|
|
|
19
18
|
product: state.caseDetails.product,
|
|
20
19
|
}), isEqual);
|
|
21
20
|
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
22
|
-
const previousOpenShiftClusterId = usePrevious(openshiftClusterID);
|
|
23
21
|
const onViewRecommendations = () => {
|
|
24
22
|
setToastVisibility(false);
|
|
25
23
|
toggleClusterRecommendationModal(clusterRecommendationsDispatch, !isClusterRecommendationsModalOpen);
|
|
26
24
|
};
|
|
27
|
-
// To
|
|
25
|
+
// To open popover we check for cluster id and clusterRecommendations array length
|
|
28
26
|
useEffect(() => {
|
|
29
|
-
if (!isEmpty(openshiftClusterID) &&
|
|
30
|
-
previousOpenShiftClusterId !== openshiftClusterID &&
|
|
31
|
-
clusterRecommendations.data.length)
|
|
27
|
+
if (!isEmpty(openshiftClusterID) && clusterRecommendations.data.length)
|
|
32
28
|
setToastVisibility(true);
|
|
33
29
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
30
|
}, [clusterRecommendations.data]);
|
|
31
|
+
/**
|
|
32
|
+
* Hide Popover on cluster id change
|
|
33
|
+
*/
|
|
35
34
|
useEffect(() => {
|
|
36
|
-
if (!openshiftClusterID)
|
|
35
|
+
if (!openshiftClusterID || getIsClusterIdInvalid(openshiftClusterID))
|
|
37
36
|
setToastVisibility(false);
|
|
38
37
|
}, [openshiftClusterID]);
|
|
39
38
|
const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
@@ -295,3 +295,9 @@ div.common-suggestions pfe-accordion {
|
|
|
295
295
|
--pfe-accordion--FontSize--header: 16px;
|
|
296
296
|
--pfe-accordion--FontWeight--header: 600;
|
|
297
297
|
}
|
|
298
|
+
|
|
299
|
+
// Override PFE Collapse discloser = false
|
|
300
|
+
section.grid-aside-content pfe-accordion {
|
|
301
|
+
--pfe-accordion--FontSize--header: 16px;
|
|
302
|
+
--pfe-accordion--FontWeight--header: 600;
|
|
303
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.72",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
76
|
"@rh-support/api": "0.3.10",
|
|
77
|
-
"@rh-support/components": "1.1.
|
|
78
|
-
"@rh-support/react-context": "0.2.
|
|
77
|
+
"@rh-support/components": "1.1.39",
|
|
78
|
+
"@rh-support/react-context": "0.2.40",
|
|
79
79
|
"@rh-support/types": "0.2.0",
|
|
80
|
-
"@rh-support/user-permissions": "0.2.
|
|
80
|
+
"@rh-support/user-permissions": "0.2.30",
|
|
81
81
|
"@rh-support/utils": "0.2.21",
|
|
82
82
|
"@types/react-redux": "^7.1.12",
|
|
83
83
|
"@types/redux": "^3.6.0",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"not ie <= 11",
|
|
144
144
|
"not op_mini all"
|
|
145
145
|
],
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "4c011d810dfd20f1da1b9aa172636543263db426"
|
|
147
147
|
}
|