@rh-support/troubleshoot 0.2.118 → 0.2.121
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/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +15 -21
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +1 -1
- package/lib/esm/components/shared/Constants.d.ts +4 -0
- package/lib/esm/components/shared/Constants.d.ts.map +1 -1
- package/lib/esm/components/shared/Constants.js +9 -4
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +15 -7
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAuBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA6WzC;kBA7WQ,mBAAmB;;;AAgX5B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -15,7 +15,7 @@ import groupBy from 'lodash/groupBy';
|
|
|
15
15
|
import isEmpty from 'lodash/isEmpty';
|
|
16
16
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
17
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
18
|
-
import { getDisplayNameForCluster
|
|
18
|
+
import { getDisplayNameForCluster } from '../../utils/caseOpenshiftClusterIdUtils';
|
|
19
19
|
import CaseOpenShiftPopover from '../CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover';
|
|
20
20
|
const defaultProps = {
|
|
21
21
|
className: '',
|
|
@@ -48,7 +48,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
48
48
|
const [showArchivedClusters, setShowArchivedClusters] = useState(false);
|
|
49
49
|
const [isFetchingClusters, setIsFetchingClusters] = useState(false);
|
|
50
50
|
const [totalResultsNo, setTotalResultsNo] = useState(0);
|
|
51
|
-
const { getFromCache, setInCache } = useLRUCache(
|
|
51
|
+
const { getFromCache, setInCache } = useLRUCache(50);
|
|
52
52
|
// gets a cluster id and returns display name
|
|
53
53
|
const getDisplayName = (id, noClusterIdReasonExplanation, display_name) => {
|
|
54
54
|
if (isEmpty(id))
|
|
@@ -136,10 +136,12 @@ function OpenshiftDropdownV4(props) {
|
|
|
136
136
|
};
|
|
137
137
|
const fetchAClusterIdDetails = (clusterId) => __awaiter(this, void 0, void 0, function* () {
|
|
138
138
|
var _a;
|
|
139
|
+
if (isEmpty(clusterId))
|
|
140
|
+
return {};
|
|
139
141
|
setIsFetchingClusters(true);
|
|
140
142
|
try {
|
|
141
143
|
const clustersResponse = yield cloud.getAccountClustersSubscription({
|
|
142
|
-
search: `external_cluster_id='${clusterId}'`,
|
|
144
|
+
search: `external_cluster_id='${clusterId.trim()}'`,
|
|
143
145
|
fields: 'external_cluster_id,display_name,status,metrics.openshift_version',
|
|
144
146
|
});
|
|
145
147
|
setIsFetchingClusters(false);
|
|
@@ -157,6 +159,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
157
159
|
}
|
|
158
160
|
});
|
|
159
161
|
const fetchAccountClusters = (search = '', page = 0) => __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
search = search.trim();
|
|
160
163
|
setIsFetchingClusters(true);
|
|
161
164
|
try {
|
|
162
165
|
let clustersResponse;
|
|
@@ -176,7 +179,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
176
179
|
order: 'display_name asc',
|
|
177
180
|
page,
|
|
178
181
|
size: PER_PAGE,
|
|
179
|
-
search:
|
|
182
|
+
search: `external_cluster_id!='' AND ${showArchivedClusters ? '' : "status!='Archived'"} ${search && !showArchivedClusters ? 'AND' : ''} ${search
|
|
180
183
|
? `(external_cluster_id ILIKE '%${search}%' OR display_name ILIKE '%${search}%' OR console_url ILIKE '%${search}%')`
|
|
181
184
|
: ''}`,
|
|
182
185
|
fields: 'external_cluster_id,display_name,status,metrics.openshift_version,console_url',
|
|
@@ -184,9 +187,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
184
187
|
setInCache(`showArchived=${showArchivedClusters}input=${search}p=${page}`, clustersResponse);
|
|
185
188
|
}
|
|
186
189
|
setIsFetchingClusters(false);
|
|
187
|
-
const items = clustersResponse.items
|
|
188
|
-
.filter((c) => !isEmpty(c.external_cluster_id))
|
|
189
|
-
.map((item) => {
|
|
190
|
+
const items = clustersResponse.items.map((item) => {
|
|
190
191
|
var _a, _b;
|
|
191
192
|
return ({
|
|
192
193
|
display_name: item.display_name,
|
|
@@ -214,7 +215,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
214
215
|
// we have clusterId but need to get display name
|
|
215
216
|
useEffect(() => {
|
|
216
217
|
const getClusterDetails = () => __awaiter(this, void 0, void 0, function* () {
|
|
217
|
-
if (props.openshiftClusterIDState &&
|
|
218
|
+
if (!isEmpty(props.openshiftClusterIDState) &&
|
|
218
219
|
props.openshiftClusterIDState !== 'dont-have-id' &&
|
|
219
220
|
props.openshiftClusterIDState !== 'v3-cluster' &&
|
|
220
221
|
isEmpty(props.openshiftDisplayName)) {
|
|
@@ -260,20 +261,13 @@ function OpenshiftDropdownV4(props) {
|
|
|
260
261
|
// when user type or paste a clusterId we land here
|
|
261
262
|
const onTypeaheadInputChanged = (input) => __awaiter(this, void 0, void 0, function* () {
|
|
262
263
|
setInputVal(input);
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
props.onClusterIdStateUpdate({ external_cluster_id: input });
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
// user paste a valid cluster id
|
|
272
|
-
const fetchedCluster = yield fetchAClusterIdDetails(input);
|
|
273
|
-
props.onClusterIdStateUpdate(fetchedCluster);
|
|
274
|
-
}
|
|
264
|
+
const fetchedClusters = yield fetchAccountClusters(input);
|
|
265
|
+
setClustersRawResponse(fetchedClusters.items);
|
|
266
|
+
setTotalResultsNo(fetchedClusters.total);
|
|
267
|
+
setClustersSelectOptions(getClusterOptions(fetchedClusters.items));
|
|
268
|
+
props.onClusterIdStateUpdate({ external_cluster_id: input });
|
|
275
269
|
});
|
|
276
|
-
const debounceFn = debounce(onTypeaheadInputChanged,
|
|
270
|
+
const debounceFn = debounce(onTypeaheadInputChanged, 500);
|
|
277
271
|
const getSelectedItem = () => {
|
|
278
272
|
if (!isEmpty(inputVal)) {
|
|
279
273
|
return createState(props.openshiftClusterIDState, inputVal);
|
|
@@ -33,7 +33,7 @@ export function ClusterRecommendationItems(props) {
|
|
|
33
33
|
React.createElement("h3", null, rule.description)),
|
|
34
34
|
React.createElement("pfe-accordion-panel", null,
|
|
35
35
|
React.createElement("p", null,
|
|
36
|
-
React.createElement(Label, { color: riskLabels[rule.total_risk].color },
|
|
36
|
+
React.createElement(Label, { icon: riskLabels[rule.total_risk].icon, color: riskLabels[rule.total_risk].color },
|
|
37
37
|
React.createElement(Trans, null, riskLabels[rule.total_risk].label))),
|
|
38
38
|
React.createElement("p", null, rule.details || ''),
|
|
39
39
|
rule.reason && (React.createElement(React.Fragment, null,
|
|
@@ -52,18 +52,22 @@ export declare const markdownInlineFileSelectEvent = "PCM-Next > Markdown-toolba
|
|
|
52
52
|
export declare const markdownFilePasteEvent = "PCM-Next > Markdown-toolbar-file-paste";
|
|
53
53
|
export declare const riskLabels: {
|
|
54
54
|
1: {
|
|
55
|
+
icon: JSX.Element;
|
|
55
56
|
label: string;
|
|
56
57
|
color: string;
|
|
57
58
|
};
|
|
58
59
|
2: {
|
|
60
|
+
icon: JSX.Element;
|
|
59
61
|
label: string;
|
|
60
62
|
color: string;
|
|
61
63
|
};
|
|
62
64
|
3: {
|
|
65
|
+
icon: JSX.Element;
|
|
63
66
|
label: string;
|
|
64
67
|
color: string;
|
|
65
68
|
};
|
|
66
69
|
4: {
|
|
70
|
+
icon: JSX.Element;
|
|
67
71
|
label: string;
|
|
68
72
|
color: string;
|
|
69
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Constants.
|
|
1
|
+
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Constants.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBA+BE;AAEF;;GAEG;AACH,oBAAY,iBAAiB;IACzB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,cAAc;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,sBAAsB;IAC3B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,kBAAkB,yBAAyB;CAC9C;AAED,eAAO,MAAM,8BAA8B,oDAAoD,CAAC;AAEhG,eAAO,MAAM,oCAAoC,wDAAwD,CAAC;AAC1G,eAAO,MAAM,6BAA6B,4CAA4C,CAAC;AACvF,eAAO,MAAM,sBAAsB,2CAA2C,CAAC;AAE/E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;CAKtB,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import AngleDoubleDownIcon from '@patternfly/react-icons/dist/js/icons/angle-double-down-icon';
|
|
2
|
+
import AngleDoubleUpIcon from '@patternfly/react-icons/dist/js/icons/angle-double-up-icon';
|
|
3
|
+
import CriticalRiskIcon from '@patternfly/react-icons/dist/js/icons/critical-risk-icon';
|
|
4
|
+
import EqualsIcon from '@patternfly/react-icons/dist/js/icons/equals-icon';
|
|
5
|
+
import React from 'react';
|
|
1
6
|
export default {
|
|
2
7
|
languagesMap: {
|
|
3
8
|
en: 'English',
|
|
@@ -51,8 +56,8 @@ export const recsViewedFromNoAttachmentModalEvent = 'PCM-Next > No-Attachment-mo
|
|
|
51
56
|
export const markdownInlineFileSelectEvent = 'PCM-Next > Markdown-toolbar-file-select';
|
|
52
57
|
export const markdownFilePasteEvent = 'PCM-Next > Markdown-toolbar-file-paste';
|
|
53
58
|
export const riskLabels = {
|
|
54
|
-
1: { label: 'Low', color: 'blue' },
|
|
55
|
-
2: { label: 'Moderate', color: '
|
|
56
|
-
3: { label: 'Important', color: '
|
|
57
|
-
4: { label: 'Critical', color: 'red' },
|
|
59
|
+
1: { icon: React.createElement(AngleDoubleDownIcon, null), label: 'Low', color: 'blue' },
|
|
60
|
+
2: { icon: React.createElement(EqualsIcon, null), label: 'Moderate', color: 'gold' },
|
|
61
|
+
3: { icon: React.createElement(AngleDoubleUpIcon, null), label: 'Important', color: 'orange' },
|
|
62
|
+
4: { icon: React.createElement(CriticalRiskIcon, null), label: 'Critical', color: 'red' },
|
|
58
63
|
};
|
|
@@ -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;
|
|
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;AAQrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eA6YtD"}
|
|
@@ -30,6 +30,7 @@ import { fetchEdmundAbbottRules } from '../../reducers/RulesReducer';
|
|
|
30
30
|
import { fetchTopContent } from '../../reducers/TopContentReducer';
|
|
31
31
|
import { isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
|
|
32
32
|
import RouteUtils from '../../utils/routeUtils';
|
|
33
|
+
import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
33
34
|
export function GlobalTroubleshootEffects(props) {
|
|
34
35
|
const [initDefaultSection, setInitDefaultSection] = useState(false);
|
|
35
36
|
const dispatchToRouteReducer = useContext(RouteDispatchContext);
|
|
@@ -64,6 +65,7 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
64
65
|
// top content state
|
|
65
66
|
const { topContentState: { topContentPayload }, } = useContext(TCStateContext);
|
|
66
67
|
const tcDispatch = useContext(TCDispatchContext);
|
|
68
|
+
const { attachmentState: { caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
|
|
67
69
|
const { resetCaseCreateState } = useResetCaseCreate();
|
|
68
70
|
const prevSectionsToHide = usePrevious(sectionsToHide);
|
|
69
71
|
const hasSummaryInUrl = !isEmpty(urlQueryParams.summary);
|
|
@@ -238,8 +240,7 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
238
240
|
return;
|
|
239
241
|
}
|
|
240
242
|
const getEARules = () => __awaiter(this, void 0, void 0, function* () {
|
|
241
|
-
const rulesBody = {
|
|
242
|
-
caseType: {
|
|
243
|
+
const rulesBody = Object.assign({ caseType: {
|
|
243
244
|
product,
|
|
244
245
|
version,
|
|
245
246
|
summary,
|
|
@@ -247,11 +248,15 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
247
248
|
type: caseType,
|
|
248
249
|
language,
|
|
249
250
|
accountNumber,
|
|
250
|
-
|
|
251
|
-
accountType: { isSecure: selectedAccountDetails.data.securedEnvironment || false },
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
session_id: activeSessionId,
|
|
252
|
+
}, accountType: { isSecure: selectedAccountDetails.data.securedEnvironment || false }, userType: { canAddAttachments }, fields: ['title', 'cta', 'description', 'rule_type', 'rule_sub_type', 'rule_id'] }, ((selectedLocalFiles === null || selectedLocalFiles === void 0 ? void 0 : selectedLocalFiles.length) && {
|
|
253
|
+
attachment: selectedLocalFiles.map((file) => ({
|
|
254
|
+
uuid: file.attachmentId,
|
|
255
|
+
fileName: file.name,
|
|
256
|
+
size: file.size,
|
|
257
|
+
fileType: file.type,
|
|
258
|
+
})),
|
|
259
|
+
}));
|
|
255
260
|
yield fetchEdmundAbbottRules(rulesDispatch, rulesBody);
|
|
256
261
|
});
|
|
257
262
|
getEARules();
|
|
@@ -269,6 +274,9 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
269
274
|
loggedInUserRights.data,
|
|
270
275
|
rulesDispatch,
|
|
271
276
|
selectedAccountDetails.data.securedEnvironment,
|
|
277
|
+
selectedLocalFiles,
|
|
278
|
+
selectedLocalFiles === null || selectedLocalFiles === void 0 ? void 0 : selectedLocalFiles.length,
|
|
279
|
+
activeSessionId,
|
|
272
280
|
], 2000);
|
|
273
281
|
/**
|
|
274
282
|
* If a component refetches the global account details , we want to make sure that the same changes are reflected in the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.121",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"lib/**/*"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@cee-eng/hydrajs": "4.12.
|
|
29
|
+
"@cee-eng/hydrajs": "4.12.6",
|
|
30
30
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
31
|
-
"@patternfly/patternfly": "4.
|
|
31
|
+
"@patternfly/patternfly": "4.202.1",
|
|
32
32
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
33
33
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
34
34
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
35
|
-
"@patternfly/react-core": "4.
|
|
35
|
+
"@patternfly/react-core": "4.224.1",
|
|
36
36
|
"@rh-support/api": "0.3.9",
|
|
37
37
|
"@rh-support/components": "^0.1.3",
|
|
38
38
|
"@rh-support/react-context": "^0.1.3",
|
|
@@ -63,22 +63,22 @@
|
|
|
63
63
|
"react-virtualized": "^9.21.2"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@cee-eng/hydrajs": "4.12.
|
|
66
|
+
"@cee-eng/hydrajs": "4.12.6",
|
|
67
67
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
68
68
|
"@patternfly/patternfly": "4.185.1",
|
|
69
69
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
70
70
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
71
71
|
"@patternfly/pfe-icon": "^1.12.3",
|
|
72
72
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
73
|
-
"@patternfly/react-core": "4.
|
|
73
|
+
"@patternfly/react-core": "4.224.1",
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
|
-
"@rh-support/api": "0.3.
|
|
77
|
-
"@rh-support/components": "1.1.
|
|
78
|
-
"@rh-support/react-context": "0.2.
|
|
76
|
+
"@rh-support/api": "0.3.24",
|
|
77
|
+
"@rh-support/components": "1.1.73",
|
|
78
|
+
"@rh-support/react-context": "0.2.78",
|
|
79
79
|
"@rh-support/types": "0.2.0",
|
|
80
|
-
"@rh-support/user-permissions": "0.2.
|
|
81
|
-
"@rh-support/utils": "0.2.
|
|
80
|
+
"@rh-support/user-permissions": "0.2.61",
|
|
81
|
+
"@rh-support/utils": "0.2.46",
|
|
82
82
|
"@types/react-redux": "^7.1.12",
|
|
83
83
|
"@types/redux": "^3.6.0",
|
|
84
84
|
"@webcomponents/webcomponentsjs": "^2.2.10",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"not ie <= 11",
|
|
144
144
|
"not op_mini all"
|
|
145
145
|
],
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "1462a3928f01dcc4bd501c6423c1ff1f2e1b48b3"
|
|
147
147
|
}
|