@rh-support/troubleshoot 2.0.3 → 2.0.5
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/CaseOverview/index.js +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +36 -21
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -2
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +4 -4
- package/lib/esm/components/Recommendations/AlertToastWrapper.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AlertToastWrapper.js +9 -1
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.js +7 -1
- package/lib/esm/components/Recommendations/InsightsResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +4 -3
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +21 -5
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +10 -7
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +2 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +4 -0
- package/lib/esm/reducers/CaseHelpers.d.ts +1 -1
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +5 -4
- package/lib/esm/scss/_main.scss +6 -0
- package/package.json +8 -8
|
@@ -173,7 +173,7 @@ export default function CaseOverview(props) {
|
|
|
173
173
|
yield confirm({
|
|
174
174
|
catchOnCancel: true,
|
|
175
175
|
title: t(`Status has been changed`),
|
|
176
|
-
description: t('Are you sure you want to change this case status to {{
|
|
176
|
+
description: t('Are you sure you want to change this case status to {{newStatus}}?', { newStatus }),
|
|
177
177
|
});
|
|
178
178
|
updateStatusState(newStatus);
|
|
179
179
|
}
|
|
@@ -152,7 +152,7 @@ export const CaseSolutions = forwardRef((props, ref) => {
|
|
|
152
152
|
if (error.status === 403) {
|
|
153
153
|
ToastNotification.addDangerMessage(t('You do not have the proper entitlements to pin a recommendation.'), React.createElement(React.Fragment, null,
|
|
154
154
|
t('Please'),
|
|
155
|
-
React.createElement("a", { href: "/support/contact/customerService
|
|
155
|
+
React.createElement("a", { href: "/support/contact/customerService" },
|
|
156
156
|
" ",
|
|
157
157
|
t('contact Customer Service'),
|
|
158
158
|
" "),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAmBA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eAsP/B;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -16,6 +16,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
16
16
|
import React, { useContext, useEffect, useState } from 'react';
|
|
17
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
18
18
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
19
|
+
import { RouteContext } from '../../context/RouteContext';
|
|
19
20
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
20
21
|
import { setCaseDetails, setSelectedCaseGroupUsers, updateCaseDetails } from '../../reducers/CaseReducer';
|
|
21
22
|
import { CaseValuesToWatch } from '../shared/Constants';
|
|
@@ -31,16 +32,19 @@ const emptyCaseGroup = {
|
|
|
31
32
|
function CaseGroup(props) {
|
|
32
33
|
const { t } = useTranslation();
|
|
33
34
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
34
|
-
const { groupNumber, caseNumber, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName } = useCaseSelector((state) => ({
|
|
35
|
+
const { groupNumber, caseNumber, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName, isCaseOwnerUpdating, } = useCaseSelector((state) => ({
|
|
35
36
|
caseNumber: state.caseDetails.caseNumber,
|
|
36
37
|
groupNumber: state.caseDetails.groupNumber,
|
|
37
38
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
38
39
|
ownersCaseGroups: state.ownersCaseGroups,
|
|
39
40
|
selectedAccountDetails: state.selectedAccountDetails,
|
|
40
41
|
groupName: state.caseDetails.groupName,
|
|
42
|
+
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
41
43
|
}), isEqual);
|
|
42
44
|
const caseDispatch = useCaseDispatch();
|
|
43
|
-
const
|
|
45
|
+
const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
|
|
46
|
+
const isGroupMandatory = selectedAccountDetails.data.requireCGroupOnCreate;
|
|
47
|
+
const [selectedCaseGroup, setSelectedCaseGroup] = useState(isGroupMandatory ? undefined : emptyCaseGroup);
|
|
44
48
|
const [isCaseGroupInvalid, setCaseGroupInvalid] = useState(false);
|
|
45
49
|
const [isSelectedUngroupedInvalid, setIsSelectedUngroupedInvalid] = useState(false);
|
|
46
50
|
const [isCaseGroupUpdating, setCaseGroupUpdating] = useState(false);
|
|
@@ -50,13 +54,6 @@ function CaseGroup(props) {
|
|
|
50
54
|
const [localGroupChange, setLocalGroupChange] = useState(false);
|
|
51
55
|
const afterGroupLocalChange = () => setLocalGroupChange(false);
|
|
52
56
|
const groupComparator = (value, pvalue) => value && pvalue && !isEmpty(value.groupNum) && !isEmpty(pvalue.groupNum) && value.groupNum !== pvalue.groupNum;
|
|
53
|
-
const isGroupMandatory = selectedAccountDetails.data.requireCGroupOnCreate;
|
|
54
|
-
const isInValidSelectedGroup = (selectedItem) => {
|
|
55
|
-
var _a;
|
|
56
|
-
const isInvalidSelectedGroup = isGroupMandatory && ((_a = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === null || _a === void 0 ? void 0 : _a.groupNum) === '-1';
|
|
57
|
-
setIsSelectedUngroupedInvalid(isInvalidSelectedGroup);
|
|
58
|
-
return isInvalidSelectedGroup;
|
|
59
|
-
};
|
|
60
57
|
const isInvalidateCaseGroup = (selectedItem) => {
|
|
61
58
|
const isInValidGroup = isEmpty(selectedItem) || !selectedItem.label;
|
|
62
59
|
setCaseGroupInvalid(isInValidGroup);
|
|
@@ -78,20 +75,28 @@ function CaseGroup(props) {
|
|
|
78
75
|
}
|
|
79
76
|
});
|
|
80
77
|
const onCaseGroupChange = (selection) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
var _a;
|
|
82
|
-
if (
|
|
83
|
-
selection.value.groupNum !== groupNumber) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
if (!isInvalidateCaseGroup(selection) && selection.value.groupNum !== groupNumber) {
|
|
84
80
|
const caseDetails = {
|
|
85
81
|
groupNumber: selection.value.groupNum,
|
|
86
82
|
groupName: ((_a = selection.value) === null || _a === void 0 ? void 0 : _a.name) || '',
|
|
87
83
|
};
|
|
88
84
|
if (!isEmpty(caseNumber)) {
|
|
89
85
|
yield onCaseGroupUpdate(caseDetails);
|
|
86
|
+
setIsSelectedUngroupedInvalid(isGroupMandatory && (!selection.value.groupNum || selection.value.groupNum === '-1'));
|
|
90
87
|
}
|
|
91
88
|
else {
|
|
92
89
|
setCaseDetails(caseDispatch, caseDetails);
|
|
93
90
|
setSelectedCaseGroupUsers(caseDispatch, accountNumber, caseDetails.groupNumber, loggedInUserRights.data);
|
|
94
91
|
}
|
|
92
|
+
setSelectedCaseGroup({
|
|
93
|
+
name: ((_b = selection.value) === null || _b === void 0 ? void 0 : _b.name) || '',
|
|
94
|
+
groupNum: selection.value.groupNum,
|
|
95
|
+
defaultMembers: [],
|
|
96
|
+
isDefault: false,
|
|
97
|
+
isPrivate: false,
|
|
98
|
+
members: [],
|
|
99
|
+
});
|
|
95
100
|
setLocalGroupChange(true);
|
|
96
101
|
}
|
|
97
102
|
});
|
|
@@ -102,7 +107,8 @@ function CaseGroup(props) {
|
|
|
102
107
|
if (isGroupMandatory) {
|
|
103
108
|
// having group selected for case is mandatory, make 'UnGrouped Case' option disabled
|
|
104
109
|
const listItems = list.map((item) => (Object.assign(Object.assign({}, item), { disabled: item.groupNum === '-1' })));
|
|
105
|
-
|
|
110
|
+
// As group is mandatory, 'UnGrouped Case' cannot be selected we filter it out
|
|
111
|
+
return toOptions(listItems.filter((g) => g.groupNum !== '-1'), {
|
|
106
112
|
labelKey: 'name',
|
|
107
113
|
disabledKey: 'disabled',
|
|
108
114
|
});
|
|
@@ -112,11 +118,12 @@ function CaseGroup(props) {
|
|
|
112
118
|
}
|
|
113
119
|
};
|
|
114
120
|
const onOuterClickGroupCheck = (selectedItem) => {
|
|
115
|
-
isInValidSelectedGroup(selectedItem);
|
|
116
121
|
isInvalidateCaseGroup(selectedItem);
|
|
117
122
|
};
|
|
118
123
|
useEffect(() => {
|
|
119
124
|
var _a, _b;
|
|
125
|
+
// case group may change outside of PCM. On group load check if we have a valid group
|
|
126
|
+
setIsSelectedUngroupedInvalid(isGroupMandatory && (!groupNumber || groupNumber === '-1'));
|
|
120
127
|
if (groupNumber === undefined)
|
|
121
128
|
return;
|
|
122
129
|
if (((_b = (_a = ownersCaseGroups === null || ownersCaseGroups === void 0 ? void 0 : ownersCaseGroups.data) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0) {
|
|
@@ -134,14 +141,18 @@ function CaseGroup(props) {
|
|
|
134
141
|
}
|
|
135
142
|
const selectedGroup = find(ownersCaseGroups.data, (g) => g.groupNum === groupNumber);
|
|
136
143
|
if (selectedGroup && selectedGroup.groupNum) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
if (isGroupMandatory && selectedGroup.groupNum === '-1') {
|
|
145
|
+
setCaseGroupInvalid(true);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
setSelectedCaseGroup(selectedGroup);
|
|
149
|
+
}
|
|
140
150
|
}
|
|
141
151
|
else {
|
|
142
152
|
setCaseGroupInvalid(true);
|
|
143
153
|
}
|
|
144
|
-
|
|
154
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
155
|
+
}, [ownersCaseGroups, caseNumber, isGroupMandatory]);
|
|
145
156
|
const onCaseGroupClear = () => __awaiter(this, void 0, void 0, function* () {
|
|
146
157
|
try {
|
|
147
158
|
yield onCaseGroupChange(toOption(emptyCaseGroup));
|
|
@@ -152,15 +163,19 @@ function CaseGroup(props) {
|
|
|
152
163
|
}
|
|
153
164
|
});
|
|
154
165
|
const showHelperText = !isSelectedUngroupedInvalid || (!isCaseGroupInvalid && !isGroupMandatory);
|
|
166
|
+
const showEmptyValidationError = !caseNumber && showValidationErrorAlert && isCaseGroupInvalid;
|
|
155
167
|
return (React.createElement("div", { className: "form-group" },
|
|
156
168
|
React.createElement("label", { htmlFor: "get-support-group" },
|
|
157
169
|
React.createElement(Trans, null, "Group"),
|
|
158
170
|
React.createElement(ValueChangedIcon, { afterLocalChange: afterGroupLocalChange, comparator: groupComparator, isLocalChange: localGroupChange, value: selectedCaseGroup, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.group, (v) => v.name) }),
|
|
159
171
|
isGroupMandatory && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
|
|
160
|
-
React.createElement(Dropdown, { id: "get-support-group", searchable: (ownersCaseGroups.data || []).length > 10, onClearSelection: onCaseGroupClear, name: "get-support-group", placeholder: t(`Select a group`), title: t(`Select a group`), list: computeDropdownList(), selectedItem: toOption(selectedCaseGroup, { labelKey: 'name' }), disabled: ownersCaseGroups.isError ||
|
|
161
|
-
|
|
172
|
+
React.createElement(Dropdown, { id: "get-support-group", searchable: (ownersCaseGroups.data || []).length > 10, onClearSelection: onCaseGroupClear, name: "get-support-group", placeholder: t(`Select a group`), title: t(`Select a group`), list: computeDropdownList(), selectedItem: toOption(selectedCaseGroup, { labelKey: 'name' }), disabled: ownersCaseGroups.isError ||
|
|
173
|
+
ownersCaseGroups.isFetching ||
|
|
174
|
+
isCaseGroupUpdating ||
|
|
175
|
+
isCaseOwnerUpdating, isLoadingList: !isCaseOwnerUpdating && (ownersCaseGroups.isFetching || isCaseGroupUpdating), onChange: onCaseGroupChange, isInValid: ownersCaseGroups.isError || showEmptyValidationError || (caseNumber && isSelectedUngroupedInvalid), required: isGroupMandatory, onOuterClick: onOuterClickGroupCheck, "data-tracking-id": "get-support-group" }),
|
|
176
|
+
caseNumber && isSelectedUngroupedInvalid && (React.createElement("p", { className: "form-instructions form-invalid" },
|
|
162
177
|
React.createElement(Trans, null, "'Ungrouped Case' cannot be selected. Please select a group."))),
|
|
163
|
-
|
|
178
|
+
showEmptyValidationError && isGroupMandatory && (React.createElement("p", { className: "form-instructions form-invalid" },
|
|
164
179
|
React.createElement(Trans, null, "Case group cannot be empty."))),
|
|
165
180
|
showHelperText && (React.createElement("p", { className: "form-instructions" },
|
|
166
181
|
React.createElement(Trans, null, "Organization administrators have the permission to manage groups.")))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AA2BA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,mBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBAUxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAIjC,CAAC;AAEF,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AA2BA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,mBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBAUxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAIjC,CAAC;AAEF,wBAAgB,kBAAkB,gBAyRjC"}
|
|
@@ -120,6 +120,8 @@ export function OpenShiftClusterId() {
|
|
|
120
120
|
// context api state will be reset on parent component each time user changes product and version
|
|
121
121
|
useEffect(() => {
|
|
122
122
|
clusterStateReset();
|
|
123
|
+
v3ClusterNameInputBoxChanged(v3ClusterName);
|
|
124
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
123
125
|
}, [product, version]);
|
|
124
126
|
/**
|
|
125
127
|
* Hook to set clusterId fields when comes from session or backward/forward
|
|
@@ -191,8 +193,10 @@ export function OpenShiftClusterId() {
|
|
|
191
193
|
}
|
|
192
194
|
};
|
|
193
195
|
const v3ClusterNameInputBoxChanged = (v3Cluster) => {
|
|
194
|
-
const v3ClusterName = isEmpty(v3Cluster.trim())
|
|
195
|
-
|
|
196
|
+
const v3ClusterName = product === 'OpenShift Container Platform' && version !== '3.11' && isEmpty(v3Cluster.trim())
|
|
197
|
+
? ''
|
|
198
|
+
: v3Cluster;
|
|
199
|
+
const description = getUpdatedDescription(issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName, product, version);
|
|
196
200
|
setCaseState(caseDispatch, { v3ClusterName });
|
|
197
201
|
setCaseDetails(caseDispatch, { description });
|
|
198
202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAMpE,UAAU,MAAM;IACZ,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,yBAAyB,UAAW,MAAM,gBA+EtD,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Select, SelectGroup, SelectOption, SelectVariant } from '@patternfly/react-core';
|
|
2
2
|
import isEmpty from 'lodash/isEmpty';
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
4
5
|
export const NewProductVersionSelector = (props) => {
|
|
6
|
+
const { t } = useTranslation();
|
|
5
7
|
const [isOpen, setIsOpen] = useState(false);
|
|
6
8
|
const [selected, setSelected] = useState('');
|
|
7
9
|
const [selectVersionOptions, setSelectVersionOptions] = React.useState([]);
|
|
@@ -31,9 +33,7 @@ export const NewProductVersionSelector = (props) => {
|
|
|
31
33
|
renderVersions();
|
|
32
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
35
|
}, [props.selectedProduct]);
|
|
34
|
-
let options = [
|
|
35
|
-
React.createElement(SelectGroup, { label: "Version", key: "productVersions" }, selectVersionOptions),
|
|
36
|
-
];
|
|
36
|
+
let options = [React.createElement(SelectGroup, { label: "Version", key: "productVersions" }), ...selectVersionOptions];
|
|
37
37
|
const onToggle = (isOpen) => {
|
|
38
38
|
setIsOpen(isOpen);
|
|
39
39
|
};
|
|
@@ -53,5 +53,5 @@ export const NewProductVersionSelector = (props) => {
|
|
|
53
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54
54
|
}, [props.versionState]);
|
|
55
55
|
const titleId = 'version-selector';
|
|
56
|
-
return (React.createElement(Select, { variant: SelectVariant.single, onToggle: onToggle, onSelect: onSelect, isOpen: isOpen, placeholderText:
|
|
56
|
+
return (React.createElement(Select, { variant: SelectVariant.single, onToggle: onToggle, onSelect: onSelect, isOpen: isOpen, placeholderText: t('Select a version'), "aria-labelledby": titleId, selections: selected, validated: isEmpty(selected) && showValidationLocal ? 'error' : 'default', isDisabled: isEmpty(props.selectedProduct.product), "data-tracking-id": "get-support-version-dropdown-selector" }, options));
|
|
57
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertToastWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AlertToastWrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"AlertToastWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AlertToastWrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAWnE,UAAU,MAAM;IACZ,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,MAAM,CAuCjC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
* We need to wrap Critical solution toast notification and Cluster recommendation toast notification so they don't get overlapped.
|
|
3
3
|
*/
|
|
4
4
|
import { AlertGroup } from '@patternfly/react-core';
|
|
5
|
+
import { PreviousCaseTypes } from '@rh-support/utils';
|
|
6
|
+
import isEqual from 'lodash/isEqual';
|
|
5
7
|
import React, { useContext, useEffect, useState } from 'react';
|
|
6
8
|
import { isUploadedAndAnalyzed } from '../../components/shared/fileUpload/reducer/AttachmentHelper';
|
|
9
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
7
10
|
import { RouteContext } from '../../context/RouteContext';
|
|
8
11
|
import { hideSideBarClusterIdRuleToast } from '../../reducers/RouteConstNTypes';
|
|
9
12
|
import { AttachmentStateContext } from '../shared/fileUpload';
|
|
@@ -13,10 +16,15 @@ import CriticalSolutionsToast from './CriticalSolutionsToast';
|
|
|
13
16
|
const AlertToastWrapper = ({ submitCaseAndNavigate }) => {
|
|
14
17
|
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
15
18
|
const [isCriticalSolutionsVisible, setIsCriticalSolutionsVisible] = useState(true);
|
|
19
|
+
const { caseType } = useCaseSelector((state) => ({
|
|
20
|
+
caseType: state.caseDetails.caseType,
|
|
21
|
+
}), isEqual);
|
|
16
22
|
const { attachmentState } = useContext(AttachmentStateContext);
|
|
17
23
|
useEffect(() => {
|
|
18
24
|
const isEveryFileFinished = attachmentState.caseFiles.selectedLocalFiles.every((file) => isUploadedAndAnalyzed(file));
|
|
19
|
-
isEveryFileFinished &&
|
|
25
|
+
isEveryFileFinished &&
|
|
26
|
+
caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT &&
|
|
27
|
+
setIsCriticalSolutionsVisible(true);
|
|
20
28
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
29
|
}, [attachmentState.caseFiles.selectedLocalFiles]);
|
|
22
30
|
const hideClusterIdReportModal = hideSideBarClusterIdRuleToast.includes(activeSection);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalSolutionsToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/CriticalSolutionsToast.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CriticalSolutionsToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/CriticalSolutionsToast.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAMnE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,sBAAsB,EAAE,EAAE,CAAC,MAAM,CAyDtC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Alert, AlertActionCloseButton, Button } from '@patternfly/react-core';
|
|
2
|
+
import { PreviousCaseTypes } from '@rh-support/utils';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
2
4
|
import React, { useContext, useEffect, useState } from 'react';
|
|
3
5
|
import { Trans, useTranslation } from 'react-i18next';
|
|
6
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
4
7
|
import { RulesDispatchContext, RulesStateContext } from '../../context/RulesContext';
|
|
5
8
|
import { RulesReducerConstants } from '../../reducers/RulesReducer';
|
|
6
9
|
const CriticalSolutionsToast = (props) => {
|
|
@@ -8,6 +11,9 @@ const CriticalSolutionsToast = (props) => {
|
|
|
8
11
|
const [showNotification, setShowNotification] = useState(false);
|
|
9
12
|
const { rulesState } = useContext(RulesStateContext);
|
|
10
13
|
const rulesDispatch = useContext(RulesDispatchContext);
|
|
14
|
+
const { caseType } = useCaseSelector((state) => ({
|
|
15
|
+
caseType: state.caseDetails.caseType,
|
|
16
|
+
}), isEqual);
|
|
11
17
|
useEffect(() => {
|
|
12
18
|
if (rulesState.triggerRuleNotification && !showNotification) {
|
|
13
19
|
setShowNotification(true);
|
|
@@ -36,6 +42,6 @@ const CriticalSolutionsToast = (props) => {
|
|
|
36
42
|
if (!showNotification && !rulesState.triggerRuleNotification)
|
|
37
43
|
return null;
|
|
38
44
|
return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: t('File recommendations are ready to view'), "data-tracking-id": "toast-view-crit-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: viewCriticalSolution },
|
|
39
|
-
React.createElement(Trans, null, "Troubleshooting specific for your uploaded files.")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: onClose }) }));
|
|
45
|
+
React.createElement(Trans, null, "Troubleshooting specific for your uploaded files.")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: onClose }), timeout: caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT }));
|
|
40
46
|
};
|
|
41
47
|
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;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;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;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eAyPrC;kBAzPQ,eAAe;;;AA4PxB,eAAe,eAAe,CAAC"}
|
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
import { search } from '@cee-eng/hydrajs';
|
|
22
22
|
import { Alert } from '@patternfly/react-core';
|
|
23
23
|
import { usePrevious } from '@rh-support/components';
|
|
24
|
-
import { getSolrParams } from '@rh-support/utils';
|
|
24
|
+
import { getSolrParams, PreviousCaseTypes } from '@rh-support/utils';
|
|
25
25
|
import difference from 'lodash/difference';
|
|
26
26
|
import filter from 'lodash/filter';
|
|
27
27
|
import flatMap from 'lodash/flatMap';
|
|
@@ -49,7 +49,7 @@ const defaultProps = {
|
|
|
49
49
|
function InsightsResults(props) {
|
|
50
50
|
const recommendationDispatch = useContext(RecommendationDispatchContext);
|
|
51
51
|
const { attachmentState: { includeAnalysisResults, caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
|
|
52
|
-
const { product, version, environment, summary, issue, periodicityOfIssue, timeFramesAndUrgency } = useCaseSelector((state) => ({
|
|
52
|
+
const { product, version, environment, summary, issue, periodicityOfIssue, timeFramesAndUrgency, caseType } = useCaseSelector((state) => ({
|
|
53
53
|
product: state.caseDetails.product,
|
|
54
54
|
version: state.caseDetails.version,
|
|
55
55
|
environment: state.caseDetails.environment,
|
|
@@ -57,6 +57,7 @@ function InsightsResults(props) {
|
|
|
57
57
|
issue: state.caseDetails.issue,
|
|
58
58
|
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
59
59
|
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
60
|
+
caseType: state.caseDetails.caseType,
|
|
60
61
|
}), isEqual);
|
|
61
62
|
const [recommendedResultsMap, setRecommendedResultsMap] = useState({});
|
|
62
63
|
const [insightResultsMap, setInsightResultsMap] = useState({});
|
|
@@ -238,7 +239,7 @@ function InsightsResults(props) {
|
|
|
238
239
|
return (React.createElement(InsightResultModal, { EARule: validEARules, onModalToggle: insightsModalToggle, isOpen: isRuleModalVisible, insightResults: allResults, isRenderedMain: true }));
|
|
239
240
|
}
|
|
240
241
|
return (React.createElement(React.Fragment, null,
|
|
241
|
-
!rulesState.triggerRuleNotification && (React.createElement(Alert, { isInline: true, title: t('File recommendations are ready to view'), "data-tracking-id": "inline-view-
|
|
242
|
+
!rulesState.triggerRuleNotification && caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT && (React.createElement(Alert, { isInline: true, title: t('File recommendations are ready to view'), "data-tracking-id": "inline-view-critical-solution", children: React.createElement("p", null,
|
|
242
243
|
React.createElement(Trans, null, "Troubleshooting specific for your uploaded files.")) })),
|
|
243
244
|
React.createElement(InsightResultModal, { EARule: validEARules, onModalToggle: insightsModalToggle, isOpen: isRuleModalVisible, insightResults: allResults })));
|
|
244
245
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAuFzC;kBAvFQ,mBAAmB;;;AA0F5B,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ErrorBoundary, LoadingDots } from '@rh-support/components';
|
|
2
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
+
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
4
|
+
import { PreviousCaseTypes } from '@rh-support/utils';
|
|
2
5
|
import isEmpty from 'lodash/isEmpty';
|
|
3
6
|
import isEqual from 'lodash/isEqual';
|
|
4
7
|
import React, { useContext } from 'react';
|
|
@@ -21,30 +24,43 @@ function TroubleshootSection(props) {
|
|
|
21
24
|
var _a;
|
|
22
25
|
const { t } = useTranslation();
|
|
23
26
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
24
|
-
const {
|
|
27
|
+
const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
28
|
+
const { product, version, isCreatingCase, caseType } = useCaseSelector((state) => ({
|
|
25
29
|
product: state.caseDetails.product,
|
|
26
30
|
version: state.caseDetails.version,
|
|
27
31
|
isCreatingCase: state.isCreatingCase,
|
|
32
|
+
caseType: state.caseDetails.caseType,
|
|
28
33
|
}), isEqual);
|
|
34
|
+
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
29
35
|
const canShowTopProducts = isEmpty(product);
|
|
30
36
|
const canShowTopContent = !canShowTopProducts && ((_a = topContent === null || topContent === void 0 ? void 0 : topContent.data) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
37
|
+
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
31
38
|
return (React.createElement(React.Fragment, null,
|
|
32
39
|
!isCreatingCase && (React.createElement("section", { className: "push-bottom" },
|
|
33
40
|
React.createElement(OpenShiftClusterId, null))),
|
|
34
41
|
React.createElement("section", null,
|
|
35
42
|
React.createElement("header", null,
|
|
36
|
-
|
|
43
|
+
React.createElement("h3", null,
|
|
37
44
|
React.createElement(Trans, null,
|
|
38
45
|
"Because you selected",
|
|
39
46
|
' ',
|
|
40
|
-
React.createElement("p", { className: "pf-u-font-weight-bold selected-product-suggestion" }, product)))
|
|
47
|
+
React.createElement("p", { className: "pf-u-font-weight-bold selected-product-suggestion" }, product))),
|
|
41
48
|
React.createElement(LoadingDots, { show: topContent.isFetching }),
|
|
49
|
+
topContent.data.length === 0 && (React.createElement("div", { className: "card card-white card-support" },
|
|
50
|
+
React.createElement("h3", { className: "card-heading popular-solutions" },
|
|
51
|
+
React.createElement(Trans, null, "Popular solutions and docs")),
|
|
52
|
+
React.createElement("div", { className: "card-body" },
|
|
53
|
+
React.createElement(Trans, null, "No recommendations for this product")))),
|
|
42
54
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading suggestions') } }, canShowTopContent && !isEmpty(version) && React.createElement(Suggestions, null)),
|
|
43
55
|
!isCreatingCase && React.createElement(ClusterRecommendations, { className: "push-top" }))),
|
|
44
56
|
React.createElement("section", { className: "pf-u-mt-lg" },
|
|
45
57
|
React.createElement(InsightsResults, { isDisplayOnMain: true }),
|
|
46
|
-
React.createElement("div", { className: "push-top" },
|
|
47
|
-
React.createElement(
|
|
58
|
+
React.createElement("div", { className: "push-top" }, canAddAttachments ? (React.createElement(FileDiag, null)) : (React.createElement("div", { className: "card card-white card-support file-diag" },
|
|
59
|
+
React.createElement("h3", { className: "card-heading" }, isIdea || loggedInUsersAccount.data.secureSupport ? (React.createElement(Trans, null, "File uploader")) : (React.createElement(Trans, null, "Upload file to analyze"))),
|
|
60
|
+
React.createElement("div", { className: "card-body" },
|
|
61
|
+
React.createElement("div", { className: "display-dashed pf-u-font-weight-bold pf-u-text-align-center" },
|
|
62
|
+
React.createElement(Trans, null, "You do not have access to upload files"),
|
|
63
|
+
"."))))))));
|
|
48
64
|
}
|
|
49
65
|
TroubleshootSection.defaultProps = defaultProps;
|
|
50
66
|
export default TroubleshootSection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/WidgetFileUploader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AA2B/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAInD,UAAU,MAAO,SAAQ,wBAAwB,EAAE,gBAAgB;IAC/D,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAYD,iBAAS,kBAAkB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"WidgetFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/WidgetFileUploader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AA2B/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAInD,UAAU,MAAO,SAAQ,wBAAwB,EAAE,gBAAgB;IAC/D,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAYD,iBAAS,kBAAkB,CAAC,KAAK,EAAE,MAAM,eAwLxC;kBAxLQ,kBAAkB;;;AA4L3B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -123,15 +123,17 @@ function WidgetFileUploader(props) {
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
return (React.createElement("div", { className: `card card-white card-support file-diag ${props.className || ''}`, onPaste: handlePaste },
|
|
126
|
-
React.createElement("h3", { className: "card-heading" }, props.isIdea || props.isSecureSupport ? (React.createElement(Trans, null, "File uploader")) : (React.createElement(Trans, null, "
|
|
126
|
+
React.createElement("h3", { className: "card-heading" }, props.isIdea || props.isSecureSupport ? (React.createElement(Trans, null, "File uploader")) : (React.createElement(Trans, null, "Upload file to analyze"))),
|
|
127
127
|
React.createElement("div", { className: "card-body" },
|
|
128
128
|
props.isIdea ? (React.createElement(WidgetFileSelectorImage, { isSessionId: props.isSessionId, isPrivate: props.isPrivate })) : (React.createElement(WidgetFileSelector, { isSessionId: props.isSessionId, isPrivate: props.isPrivate })),
|
|
129
|
-
!hasSomeSelectedFiles(selectedLocalFiles) ? (props.helperText || (React.createElement("p", { className: "pf-u-mt-sm" },
|
|
130
|
-
"
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
!hasSomeSelectedFiles(selectedLocalFiles) ? ((!props.isIdea && props.helperText) || (React.createElement("p", { className: "pf-u-mt-sm" },
|
|
130
|
+
!props.isIdea ? (React.createElement(Trans, { i18nKey: "i18nUploadSosReport" },
|
|
131
|
+
"Upload a",
|
|
132
|
+
' ',
|
|
133
|
+
React.createElement("a", { href: "/solutions/3592", target: "_blank" }, "sosreport"),
|
|
134
|
+
"to help us provide the best solutions for your system.")) : (React.createElement("span", { className: "pf-u-font-family-redhatVF-heading-sans-serif pf-u-color-300" },
|
|
135
|
+
React.createElement(Trans, null, "Allowed file types: png, gif, jpg, jpeg."))),
|
|
136
|
+
' '))) : (React.createElement(React.Fragment, null,
|
|
135
137
|
React.createElement(FileLister, { selectedLocalFiles: attachmentState.caseFiles.selectedLocalFiles, onFileEdit: editFile, onFileRemove: removeFile, onRetry: retryUpload, onRetryAnalysis: retryAnalysis, isSessionId: props.isSessionId, showSlowUploadMsg: attachmentState.showUploadingOnSlowConnectionMsg }),
|
|
136
138
|
hasUploadedSomeAttachments(selectedLocalFiles) && !props.isIdea && (React.createElement("p", null,
|
|
137
139
|
React.createElement(Trans, null, "If you can't find a solution, all files are moved to your case."))))),
|
|
@@ -139,6 +141,7 @@ function WidgetFileUploader(props) {
|
|
|
139
141
|
isAnalysingAnyAttachment(attachmentState.caseFiles.selectedLocalFiles) && (React.createElement(Button, { isDisabled: true },
|
|
140
142
|
React.createElement(Trans, null, "Analyzing..."))),
|
|
141
143
|
showViewRecBtn &&
|
|
144
|
+
!props.isIdea &&
|
|
142
145
|
!isAnalysingAnyAttachment(attachmentState.caseFiles.selectedLocalFiles) &&
|
|
143
146
|
hasAnalysedSomeAttachments(attachmentState.caseFiles.selectedLocalFiles) && (React.createElement(Button, { "data-tracking-id": "widget-file-uploader-view-recs", onClick: onViewRecBtnClick },
|
|
144
147
|
React.createElement(Trans, null, "View recommendations"))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,wBAAgB,iBAAiB,CAAC,WAAW,GAAE,gBAAuB;;;;;
|
|
1
|
+
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,wBAAgB,iBAAiB,CAAC,WAAW,GAAE,gBAAuB;;;;;EA4LrE"}
|
|
@@ -48,7 +48,8 @@ export function useIsSectionValid(sectionName = null) {
|
|
|
48
48
|
!allProducts.isError &&
|
|
49
49
|
!topContent.isFetching &&
|
|
50
50
|
!isEmpty(summary) &&
|
|
51
|
-
!recommendationState.isLoadingRecommendations
|
|
51
|
+
!recommendationState.isLoadingRecommendations &&
|
|
52
|
+
summary.length < SUMMARY_LENGTH_LIMIT);
|
|
52
53
|
};
|
|
53
54
|
const isCaseManagementSectionValid = () => {
|
|
54
55
|
const hasContactInfo24x7ValidLength = contactInfo24x7
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcrF,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":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eA0atD"}
|
|
@@ -331,6 +331,7 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
331
331
|
// Need to check `hasCluster` is empty as when product is changing from shift product to non-shift
|
|
332
332
|
// product new product will don't have any cluster
|
|
333
333
|
const isClusterInfoShouldBeReset = !hasCluster || (hasCluster && oldMajorVersion !== newMajorVersion);
|
|
334
|
+
const isOpenShiftV3 = product === 'OpenShift Container Platform' && newMajorVersion === '3';
|
|
334
335
|
if (isClusterInfoShouldBeReset) {
|
|
335
336
|
setCaseDetails(caseDispatch, {
|
|
336
337
|
openshiftClusterID: '',
|
|
@@ -340,6 +341,9 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
340
341
|
});
|
|
341
342
|
setCaseState(caseDispatch, { v3ClusterName: '' });
|
|
342
343
|
}
|
|
344
|
+
if (!isOpenShiftV3) {
|
|
345
|
+
setCaseState(caseDispatch, { v3ClusterName: '' });
|
|
346
|
+
}
|
|
343
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
344
348
|
}, [product, version, allProducts.data.productsResult, caseDispatch]);
|
|
345
349
|
return React.createElement(React.Fragment, null);
|
|
@@ -8,7 +8,7 @@ import { ICaseState } from './CaseConstNTypes';
|
|
|
8
8
|
export declare const getCaseRecommendations: (docs: ISolrRecommendation[], oldDocs: any) => any[];
|
|
9
9
|
export declare const getCepCommentFromCepDetails: (cepDetails: ICepDetails) => string;
|
|
10
10
|
export declare const getRecommendationObject: (doc: ISolrRecommendation, index: number) => ICaseResourceLink;
|
|
11
|
-
export declare const getUpdatedDescription: (issue: string, environment?: string, periodicityOfIssue?: string, timeFramesAndUrgency?: string, v3ClusterName?: string) => string;
|
|
11
|
+
export declare const getUpdatedDescription: (issue: string, environment?: string, periodicityOfIssue?: string, timeFramesAndUrgency?: string, v3ClusterName?: string, product?: string, version?: string) => string;
|
|
12
12
|
export declare const getDescriptionWOQues: (issue: string, environment?: string, periodicityOfIssue?: string, timeFramesAndUrgency?: string) => string;
|
|
13
13
|
export declare const getIrtForSLAAndSeverity: (slaProcessId: string, severity: string) => string;
|
|
14
14
|
export declare const getOrtForSLAAndSeverity: (slaProcessId: string, severity: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAkB3D,OAAO,EAUH,UAAU,EAgBb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,SAAU,mBAAmB,EAAE,wBAMjE,CAAC;AAEF,eAAO,MAAM,2BAA2B,eAAgB,WAAW,KAAG,MAOrE,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAS,mBAAmB,SAAS,MAAM,sBAyB9E,CAAC;AAIF,eAAO,MAAM,qBAAqB,UACvB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,kBACb,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAkB3D,OAAO,EAUH,UAAU,EAgBb,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,SAAU,mBAAmB,EAAE,wBAMjE,CAAC;AAEF,eAAO,MAAM,2BAA2B,eAAgB,WAAW,KAAG,MAOrE,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAS,mBAAmB,SAAS,MAAM,sBAyB9E,CAAC;AAIF,eAAO,MAAM,qBAAqB,UACvB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,kBACb,MAAM,YACZ,MAAM,YACN,MAAM,KACjB,MAyBF,CAAC;AAIF,eAAO,MAAM,oBAAoB,UACtB,MAAM,gBACC,MAAM,uBACC,MAAM,yBACJ,MAAM,KAC9B,MAQF,CAAC;AAEF,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,YAAY,MAAM,KAAG,MAQhF,CAAC;AAEF,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,YAAY,MAAM,KAAG,MAQhF,CAAC;AAEF,eAAO,MAAM,sBAAsB,aAAc,MAAM,KAAG,MAKzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAqC5B,CAAC;AAIF,eAAO,MAAM,gBAAgB,cAAe,UAAU,wBAAwB,QAAQ,eAAe,CAAC,KAAG,OA6BxG,CAAC;AAEF,eAAO,MAAM,oBAAoB,cAClB,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAyBF,CAAC;AAEF,eAAO,MAAM,0BAA0B,cACxB,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAiBF,CAAC;AAIF,eAAO,MAAM,6BAA6B,cAC3B,UAAU,wBACC,QAAQ,eAAe,CAAC,KAC/C,OAuBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,cACf,UAAU,gBACP,YAAY,iBACZ,OAAO,KACtB,QAAQ,YAAY,CAuEtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,qBAAsB,YAAY,EAAE,KAAG,YAAY,EAEvF,CAAC;AACF,eAAO,MAAM,yBAAyB,qBAAsB,YAAY,EAAE,KAAG,OAE5E,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBACrB,YAAY,6BACE,MAAM,mBAChB,MAAM,KACxB,QAAQ,YAAY,CA+BtB,CAAC;AACF,eAAO,MAAM,yBAAyB,gBACrB,QAAQ,YAAY,CAAC,gCACJ,QAAQ,EAAE,KACzC,eA2CF,CAAC"}
|
|
@@ -45,19 +45,20 @@ export const getRecommendationObject = (doc, index) => {
|
|
|
45
45
|
return rec;
|
|
46
46
|
};
|
|
47
47
|
// Responsible for the order of the questions in which they appear on case details
|
|
48
|
-
export const getUpdatedDescription = (issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName) => {
|
|
48
|
+
export const getUpdatedDescription = (issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName, product, version) => {
|
|
49
49
|
let description = issue;
|
|
50
|
+
const v3ClusterNameFinal = product === 'OpenShift Container Platform' && version !== '3.11' ? '' : v3ClusterName;
|
|
50
51
|
if (!isEmpty(environment) ||
|
|
51
52
|
!isEmpty(periodicityOfIssue) ||
|
|
52
53
|
!isEmpty(timeFramesAndUrgency) ||
|
|
53
|
-
!isEmpty(
|
|
54
|
+
!isEmpty(v3ClusterNameFinal)) {
|
|
54
55
|
description = `${KtQuestionConstant.issue}\n${issue}`;
|
|
55
56
|
description += !isEmpty(timeFramesAndUrgency)
|
|
56
57
|
? `\n\n${KtQuestionConstant.timeFramesAndUrgency}\n${timeFramesAndUrgency}`
|
|
57
58
|
: '';
|
|
58
59
|
description +=
|
|
59
|
-
!isEmpty(environment) || !isEmpty(
|
|
60
|
-
? `\n\n${KtQuestionConstant.environment}\n${
|
|
60
|
+
!isEmpty(environment) || !isEmpty(v3ClusterNameFinal)
|
|
61
|
+
? `\n\n${KtQuestionConstant.environment}\n${v3ClusterNameFinal ? `OpenShift Cluster Name: ${v3ClusterNameFinal} \n` : ''}${environment}`
|
|
61
62
|
: '';
|
|
62
63
|
description += !isEmpty(periodicityOfIssue)
|
|
63
64
|
? `\n\n${KtQuestionConstant.periodicityOfIssue}\n${periodicityOfIssue}`
|
package/lib/esm/scss/_main.scss
CHANGED
|
@@ -1789,3 +1789,9 @@ div.case-details-ref-number {
|
|
|
1789
1789
|
color: var(--pf-global--Color--100) !important;
|
|
1790
1790
|
}
|
|
1791
1791
|
}
|
|
1792
|
+
|
|
1793
|
+
.display-dashed {
|
|
1794
|
+
padding: 0.5rem;
|
|
1795
|
+
border: 2px dashed var(--pf-global--palette--black-600);
|
|
1796
|
+
background-color: var(--pf-global--palette--black-300);
|
|
1797
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lib/**/*"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@cee-eng/hydrajs": "4.15.
|
|
29
|
+
"@cee-eng/hydrajs": "4.15.72",
|
|
30
30
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
31
31
|
"@patternfly/patternfly": "4.196.7",
|
|
32
32
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-virtualized": "^9.21.2"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@cee-eng/hydrajs": "4.15.
|
|
66
|
+
"@cee-eng/hydrajs": "4.15.72",
|
|
67
67
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
68
68
|
"@patternfly/patternfly": "4.196.7",
|
|
69
69
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"@patternfly/react-core": "4.264.0",
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
|
-
"@rh-support/components": "2.0.
|
|
77
|
-
"@rh-support/react-context": "2.0.
|
|
76
|
+
"@rh-support/components": "2.0.4",
|
|
77
|
+
"@rh-support/react-context": "2.0.4",
|
|
78
78
|
"@rh-support/types": "2.0.1",
|
|
79
|
-
"@rh-support/user-permissions": "2.0.
|
|
80
|
-
"@rh-support/utils": "2.0.
|
|
79
|
+
"@rh-support/user-permissions": "2.0.4",
|
|
80
|
+
"@rh-support/utils": "2.0.4",
|
|
81
81
|
"@types/react-redux": "^7.1.12",
|
|
82
82
|
"@types/redux": "^3.6.0",
|
|
83
83
|
"@webcomponents/webcomponentsjs": "^2.2.10",
|
|
@@ -145,5 +145,5 @@
|
|
|
145
145
|
"not ie <= 11",
|
|
146
146
|
"not op_mini all"
|
|
147
147
|
],
|
|
148
|
-
"gitHead": "
|
|
148
|
+
"gitHead": "7ea1dd6e1863534b3a58c14342605a5221866fb2"
|
|
149
149
|
}
|