@rh-support/troubleshoot 2.4.5-beta.1 → 2.4.5-beta.11
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/CaseDetailsTabs.js +2 -2
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +4 -18
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -2
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +1 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +4 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +2 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +21 -95
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +137 -269
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +20 -16
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +5 -6
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +2 -3
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +5 -11
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +5 -11
- package/lib/esm/components/Cve/CveItem.d.ts +8 -0
- package/lib/esm/components/Cve/CveItem.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveItem.js +96 -0
- package/lib/esm/components/Cve/CveModal.d.ts +3 -0
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveModal.js +41 -0
- package/lib/esm/components/Cve/CvePanel.d.ts +7 -0
- package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -0
- package/lib/esm/components/Cve/CvePanel.js +23 -0
- package/lib/esm/components/Cve/CveSidebar.d.ts +3 -0
- package/lib/esm/components/Cve/CveSidebar.d.ts.map +1 -0
- package/lib/esm/components/Cve/CveSidebar.js +23 -0
- package/lib/esm/components/OpenCase/OpenCase.d.ts +3 -0
- package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/OpenCase.js +8 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +3 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +33 -21
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -0
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +2 -2
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts +4 -2
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +8 -7
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +3 -5
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARule.js +2 -0
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +2 -2
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.js +5 -6
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +55 -27
- package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts +3 -0
- package/lib/esm/components/Recommendations/RecommendationsLoader.d.ts.map +1 -0
- package/lib/esm/components/Recommendations/RecommendationsLoader.js +11 -0
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +3 -3
- package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/TopContent.js +4 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts +2 -2
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +1 -10
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +14 -7
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +11 -9
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +1 -4
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +0 -5
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +3 -7
- package/lib/esm/css/results.css +6 -0
- package/lib/esm/hooks/useFetchCVEData.d.ts +5 -0
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -0
- package/lib/esm/hooks/useFetchCVEData.js +136 -0
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +10 -2
- package/lib/esm/models/caseCreationWorkflows.d.ts +25 -0
- package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -0
- package/lib/esm/models/caseCreationWorkflows.js +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +4 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +3 -0
- package/lib/esm/reducers/RouteConstNTypes.d.ts +0 -1
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/RouteConstNTypes.js +0 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +1 -1
- package/lib/esm/scss/_main.scss +20 -2
- package/lib/esm/scss/_pf-overrides.scss +0 -6
- package/lib/esm/utils/caseUtils.d.ts +18 -0
- package/lib/esm/utils/caseUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseUtils.js +42 -0
- package/package.json +11 -11
|
@@ -100,12 +100,10 @@ function Fts(props) {
|
|
|
100
100
|
setCaseState(caseDispatch, { ftsContactSameAsOwner: e.target.checked });
|
|
101
101
|
if (!e.target.checked) {
|
|
102
102
|
setFtsContact('');
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
setFtsContact(`${phoneCountryCode}-${phoneAreaCodePrefixLineNumber}`);
|
|
107
|
-
setContactInfoIntoGlobalState(`${phoneCountryCode}-${phoneAreaCodePrefixLineNumber}`);
|
|
103
|
+
return;
|
|
108
104
|
}
|
|
105
|
+
setFtsContact(`${phoneCountryCode}-${phoneAreaCodePrefixLineNumber}`);
|
|
106
|
+
setContactInfoIntoGlobalState(`${phoneCountryCode}-${phoneAreaCodePrefixLineNumber}`);
|
|
109
107
|
};
|
|
110
108
|
const onSave = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
111
109
|
setContactInfoIntoGlobalState(contactInfo24X7State);
|
|
@@ -150,7 +148,8 @@ function Fts(props) {
|
|
|
150
148
|
}
|
|
151
149
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
152
150
|
}, [phoneAreaCodePrefixLineNumber, phoneCountryCode]);
|
|
153
|
-
const disableFtsNContact = !isEmpty(caseNumber) &&
|
|
151
|
+
const disableFtsNContact = !isEmpty(caseNumber) &&
|
|
152
|
+
(!isFtsEditableOnEditPage(entitlementSla, severity) || isFtsContactUpdating || isFtsUpdating);
|
|
154
153
|
const maxLengthErrorMessage = t('Contact information cannot be more than {{limit}} characters.', {
|
|
155
154
|
limit: CONTACT_INFO_24X7_LIMIT,
|
|
156
155
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAoB/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAoB/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,qBAsThC"}
|
|
@@ -66,9 +66,8 @@ export function Cep(props) {
|
|
|
66
66
|
// edit mode - set cep to false
|
|
67
67
|
yield confirm({
|
|
68
68
|
catchOnCancel: true,
|
|
69
|
-
title: t(`
|
|
70
|
-
description: t(
|
|
71
|
-
confirmText: t('Yes, confirm'),
|
|
69
|
+
title: t(`Updating Consultant Engagement in Progress`),
|
|
70
|
+
description: t('Are you sure?'),
|
|
72
71
|
});
|
|
73
72
|
cepUpdate({ cep: false });
|
|
74
73
|
clearCepFormInputs();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RHAssociatesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/RHAssociatesSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RHAssociatesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/RHAssociatesSelector.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAqM1C;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -11,7 +11,6 @@ import { Button, Tooltip, TooltipPosition } from '@patternfly/react-core';
|
|
|
11
11
|
import { ToastNotification } from '@rh-support/components';
|
|
12
12
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
13
|
import { AbilityContext, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
|
-
import { dtmTrackEventCaseStepEncountered } from '@rh-support/utils';
|
|
15
14
|
import differenceBy from 'lodash/differenceBy';
|
|
16
15
|
import filter from 'lodash/filter';
|
|
17
16
|
import find from 'lodash/find';
|
|
@@ -32,13 +31,11 @@ function RHAssociatesSelector(props) {
|
|
|
32
31
|
const [isRHAssociatesUpdating, setIsRHAssociatesUpdating] = useState(false);
|
|
33
32
|
const ability = useContext(AbilityContext);
|
|
34
33
|
const { isExportingPDF } = useContext(PDFContext);
|
|
35
|
-
const { caseNumber, contactSsoUsername,
|
|
34
|
+
const { caseNumber, contactSsoUsername, selectedOwner, selectedNotificationContacts } = useCaseSelector((state) => ({
|
|
36
35
|
caseNumber: state.caseDetails.caseNumber,
|
|
37
36
|
contactSsoUsername: state.caseDetails.contactSSOName,
|
|
38
37
|
selectedOwner: state.selectedOwner,
|
|
39
38
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
40
|
-
product: state.caseDetails.product,
|
|
41
|
-
version: state.caseDetails.version,
|
|
42
39
|
}), isEqual);
|
|
43
40
|
const caseDispatch = useCaseDispatch();
|
|
44
41
|
const onRhAssociateAdded = (addedUsers) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -67,7 +64,7 @@ function RHAssociatesSelector(props) {
|
|
|
67
64
|
ToastNotification.addDangerMessage(t(`Red Hat associate failed to get removed`));
|
|
68
65
|
}
|
|
69
66
|
});
|
|
70
|
-
const onNotifiedUserChange = (
|
|
67
|
+
const onNotifiedUserChange = (selectedContacts) => __awaiter(this, void 0, void 0, function* () {
|
|
71
68
|
const toAdd = filter(differenceBy(selectedContacts, selectedNotificationContacts, 'ssoUsername'), (item) => item.ssoUsername !== contactSsoUsername);
|
|
72
69
|
const toRemove = filter(differenceBy(selectedNotificationContacts, selectedContacts, 'ssoUsername'), (item) => item.isInternal && item.ssoUsername !== contactSsoUsername);
|
|
73
70
|
let newContacts = [];
|
|
@@ -75,9 +72,6 @@ function RHAssociatesSelector(props) {
|
|
|
75
72
|
newContacts = [...selectedNotificationContacts, ...toAdd];
|
|
76
73
|
if (!isEmpty(caseNumber)) {
|
|
77
74
|
yield onRhAssociateAdded(toAdd);
|
|
78
|
-
if (throwTrackEventOnAdd) {
|
|
79
|
-
dtmTrackEventCaseStepEncountered('follow', caseNumber, product, version);
|
|
80
|
-
}
|
|
81
75
|
}
|
|
82
76
|
}
|
|
83
77
|
else if ((toRemove || []).length > 0) {
|
|
@@ -96,9 +90,9 @@ function RHAssociatesSelector(props) {
|
|
|
96
90
|
!isCurrentUserSelectedInternalNotifiedUser();
|
|
97
91
|
const showRemoveWatchButton = () => (loggedInUserRights.data.isInternal() && isCurrentUserSelectedInternalNotifiedUser()) ||
|
|
98
92
|
contactSsoUsername === loggedInUser.data.ssoUsername;
|
|
99
|
-
const addCurrentUser = () =>
|
|
100
|
-
onNotifiedUserChange([Object.assign(Object.assign({}, loggedInUser.data), { accountNumber: loggedInUserRights.data.getAccountNumber() })]
|
|
101
|
-
}
|
|
93
|
+
const addCurrentUser = () => {
|
|
94
|
+
onNotifiedUserChange([Object.assign(Object.assign({}, loggedInUser.data), { accountNumber: loggedInUserRights.data.getAccountNumber() })]);
|
|
95
|
+
};
|
|
102
96
|
const removeCurrentUser = () => {
|
|
103
97
|
if (isCurrentUserSelectedInternalNotifiedUser()) {
|
|
104
98
|
onNotifiedUserChange(filter(selectedNotificationContacts, (contact) => contact.ssoUsername !== loggedInUser.data.ssoUsername));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAmbzC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -11,7 +11,6 @@ import { Button, Tooltip, TooltipPosition } from '@patternfly/react-core';
|
|
|
11
11
|
import { CaseContactsSelectorExternal, getHydraContactLabel, PromisifyModal, ToastNotification, usePrevious, } from '@rh-support/components';
|
|
12
12
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
13
13
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
|
-
import { dtmTrackEventCaseStepEncountered } from '@rh-support/utils';
|
|
15
14
|
import differenceBy from 'lodash/differenceBy';
|
|
16
15
|
import filter from 'lodash/filter';
|
|
17
16
|
import find from 'lodash/find';
|
|
@@ -35,7 +34,7 @@ function CaseContactSelector(props) {
|
|
|
35
34
|
const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
36
35
|
const [isAssociatesUpdating, setIsAssociatesUpdating] = useState(false);
|
|
37
36
|
const { t } = useTranslation();
|
|
38
|
-
const { accountNumber, caseNumber, contactSsoUsername, selectedNotificationContacts, selectedOwner, customEmailsList,
|
|
37
|
+
const { accountNumber, caseNumber, contactSsoUsername, selectedNotificationContacts, selectedOwner, customEmailsList, selectedCaseGroupUsers, ownersCaseGroups, groupNumber, createdById, } = useCaseSelector((state) => ({
|
|
39
38
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
40
39
|
caseNumber: state.caseDetails.caseNumber,
|
|
41
40
|
contactSsoUsername: state.caseDetails.contactSSOName,
|
|
@@ -46,8 +45,6 @@ function CaseContactSelector(props) {
|
|
|
46
45
|
groupNumber: state.caseDetails.groupNumber,
|
|
47
46
|
ownersCaseGroups: state.ownersCaseGroups,
|
|
48
47
|
createdById: state.caseDetails.createdById,
|
|
49
|
-
product: state.caseDetails.product,
|
|
50
|
-
version: state.caseDetails.version,
|
|
51
48
|
}), isEqual);
|
|
52
49
|
const caseDispatch = useCaseDispatch();
|
|
53
50
|
const { addCustomEmail, canAddCustomEmail, hideCustomEmails, deleteCustomEmail, isUpdatingCustomEmails, isEmailValid, showAddEmailToAccountModal, } = useCustomEmails({
|
|
@@ -188,7 +185,7 @@ function CaseContactSelector(props) {
|
|
|
188
185
|
}
|
|
189
186
|
return hasGroupAccess;
|
|
190
187
|
});
|
|
191
|
-
const onNotifiedUserChange = (...args_1) => __awaiter(this, [...args_1], void 0, function* (selectedContacts = []
|
|
188
|
+
const onNotifiedUserChange = (...args_1) => __awaiter(this, [...args_1], void 0, function* (selectedContacts = []) {
|
|
192
189
|
// check if selection changed
|
|
193
190
|
const alreadySelected = [
|
|
194
191
|
...customEmailsList.data,
|
|
@@ -202,9 +199,6 @@ function CaseContactSelector(props) {
|
|
|
202
199
|
const selectedCustomEmails = remove(allSelectedContacts, (item) => item.customOption || item.emailAddress).map((item) => item.label || item.emailAddress || item.ssoUsername);
|
|
203
200
|
yield processCustomEmails(selectedCustomEmails);
|
|
204
201
|
yield processCaseContacts(allSelectedContacts);
|
|
205
|
-
if (throwTrackEvent) {
|
|
206
|
-
dtmTrackEventCaseStepEncountered('follow', caseNumber, product, version);
|
|
207
|
-
}
|
|
208
202
|
});
|
|
209
203
|
/** Reset all non-internal selectedNotificationContacts when selected account number changes */
|
|
210
204
|
useEffect(() => {
|
|
@@ -220,9 +214,9 @@ function CaseContactSelector(props) {
|
|
|
220
214
|
!isCurrentUserSelectedExternalNotifiedUser();
|
|
221
215
|
const showRemoveWatchButton = () => loggedInUserRights.data.isExternal() &&
|
|
222
216
|
(isCurrentUserSelectedExternalNotifiedUser() || isCurrentUserCaseContact);
|
|
223
|
-
const addCurrentUser = () =>
|
|
224
|
-
onNotifiedUserChange([...selectedNotificationContacts, ...customEmailsList.data, loggedInUser.data]
|
|
225
|
-
}
|
|
217
|
+
const addCurrentUser = () => {
|
|
218
|
+
onNotifiedUserChange([...selectedNotificationContacts, ...customEmailsList.data, loggedInUser.data]);
|
|
219
|
+
};
|
|
226
220
|
const removeCurrentUser = () => {
|
|
227
221
|
if (isCurrentUserSelectedExternalNotifiedUser()) {
|
|
228
222
|
onNotifiedUserChange([
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICVEWorkflowRecommendation } from '../../models/caseCreationWorkflows';
|
|
3
|
+
interface IProp {
|
|
4
|
+
cve: ICVEWorkflowRecommendation;
|
|
5
|
+
}
|
|
6
|
+
export declare const CveItem: (props: IProp) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=CveItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CveItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveItem.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,UAAU,KAAK;IACX,GAAG,EAAE,0BAA0B,CAAC;CACnC;AAaD,eAAO,MAAM,OAAO,UAAW,KAAK,sBAqJnC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Button, Flex, FlexItem, Label, LabelGroup, Text, TextVariants } from '@patternfly/react-core';
|
|
2
|
+
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
|
|
3
|
+
import StarIcon from '@patternfly/react-icons/dist/esm/icons/star-icon';
|
|
4
|
+
import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
|
|
5
|
+
import { format, isValid, parseISO } from 'date-fns';
|
|
6
|
+
import DOMPurify from 'dompurify';
|
|
7
|
+
import isEmpty from 'lodash/isEmpty';
|
|
8
|
+
import isEqual from 'lodash/isEqual';
|
|
9
|
+
import map from 'lodash/map';
|
|
10
|
+
import slice from 'lodash/slice';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { Trans } from 'react-i18next';
|
|
13
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
14
|
+
const sanitize = (html) => ({ __html: DOMPurify.sanitize(html) });
|
|
15
|
+
function formatDate(dateString) {
|
|
16
|
+
const date = parseISO(dateString);
|
|
17
|
+
if (isValid(date)) {
|
|
18
|
+
return format(date, 'MMM dd, yyyy');
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return dateString;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const CveItem = (props) => {
|
|
25
|
+
const { cve } = props;
|
|
26
|
+
const { isCveModalOpened } = useCaseSelector((state) => ({
|
|
27
|
+
isCveModalOpened: state.isCveModalOpened,
|
|
28
|
+
}), isEqual);
|
|
29
|
+
const renderDate = () => (cve === null || cve === void 0 ? void 0 : cve.publicDate) && (React.createElement("div", { className: "pf-v5-u-disabled-color-100" },
|
|
30
|
+
React.createElement(Trans, null, "Public on"),
|
|
31
|
+
" - ",
|
|
32
|
+
formatDate(cve.publicDate)));
|
|
33
|
+
const renderLabels = () => (React.createElement(LabelGroup, { defaultIsOpen: true, numLabels: 10 },
|
|
34
|
+
React.createElement(Label, { color: "green", isCompact: true, icon: React.createElement(StarIcon, null) },
|
|
35
|
+
React.createElement(Trans, null, "Exact match")),
|
|
36
|
+
!isEmpty(cve === null || cve === void 0 ? void 0 : cve.severity) && (React.createElement(Label, { color: cve.severity === 'Critical'
|
|
37
|
+
? 'red'
|
|
38
|
+
: cve.severity === 'Important'
|
|
39
|
+
? 'blue'
|
|
40
|
+
: cve.severity === 'Moderate'
|
|
41
|
+
? 'orange'
|
|
42
|
+
: undefined, isCompact: true }, cve.severity)),
|
|
43
|
+
!isEmpty(cve.errataData) && (React.createElement(Label, { color: "blue", isCompact: true },
|
|
44
|
+
React.createElement(Trans, null, "Fixed"))),
|
|
45
|
+
!isEmpty(cve.mitigation) && (React.createElement(Label, { isCompact: true },
|
|
46
|
+
React.createElement(Trans, { color: "blue" }, "Mitigation available")))));
|
|
47
|
+
const displayErrataTable = () => {
|
|
48
|
+
if (isEmpty(cve === null || cve === void 0 ? void 0 : cve.errataData)) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return (React.createElement(Table, { "aria-label": "Errata table", variant: 'compact', className: "pf-v5-u-mt-md", style: { borderTop: 'var(--pf-v5-global--BorderColor--light-100) solid 1px' } },
|
|
52
|
+
React.createElement(Thead, null,
|
|
53
|
+
React.createElement(Tr, null,
|
|
54
|
+
React.createElement(Th, null,
|
|
55
|
+
React.createElement(Trans, null, "Errata link")),
|
|
56
|
+
React.createElement(Th, { width: 30 },
|
|
57
|
+
React.createElement(Trans, null, "Component")),
|
|
58
|
+
React.createElement(Th, null,
|
|
59
|
+
React.createElement(Trans, null, "Status")))),
|
|
60
|
+
React.createElement(Tbody, null, map(slice(cve.errataData, 0, isCveModalOpened ? 3 : 2), (errata, index) => {
|
|
61
|
+
var _a, _b, _c;
|
|
62
|
+
return (React.createElement(Tr, Object.assign({ key: (_a = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _a === void 0 ? void 0 : _a.name }, (index % 2 === 0 && { isStriped: true })),
|
|
63
|
+
React.createElement(Td, null,
|
|
64
|
+
React.createElement(Text, { component: TextVariants.a, href: (_b = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _b === void 0 ? void 0 : _b.url, target: "_blank", ouiaSafe: true, "data-tracking-id": "errata-link" }, (_c = errata === null || errata === void 0 ? void 0 : errata.advisory) === null || _c === void 0 ? void 0 :
|
|
65
|
+
_c.name,
|
|
66
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" }))),
|
|
67
|
+
React.createElement(Td, { modifier: "truncate" }, errata === null || errata === void 0 ? void 0 : errata.package),
|
|
68
|
+
React.createElement(Td, null,
|
|
69
|
+
React.createElement(Trans, null, errata === null || errata === void 0 ? void 0 : errata.state))));
|
|
70
|
+
}))));
|
|
71
|
+
};
|
|
72
|
+
const displayDescription = () => {
|
|
73
|
+
var _a;
|
|
74
|
+
if (isEmpty(cve === null || cve === void 0 ? void 0 : cve.mitigation) && ((_a = cve === null || cve === void 0 ? void 0 : cve.errataData) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
75
|
+
return (React.createElement("p", { className: "pf-v5-u-mt-md" },
|
|
76
|
+
React.createElement(Trans, null, "for this CVE, mitigation and fix is not available, for more details, go to the CVE page.")));
|
|
77
|
+
}
|
|
78
|
+
const MAX_DESCRIPTION_LENGTH = isCveModalOpened ? 300 : 120;
|
|
79
|
+
const description = !isEmpty(cve === null || cve === void 0 ? void 0 : cve.mitigation) ? cve === null || cve === void 0 ? void 0 : cve.mitigation : cve === null || cve === void 0 ? void 0 : cve.details;
|
|
80
|
+
if (!description)
|
|
81
|
+
return '';
|
|
82
|
+
const trimmedDescription = description.length <= MAX_DESCRIPTION_LENGTH
|
|
83
|
+
? description
|
|
84
|
+
: description.slice(0, MAX_DESCRIPTION_LENGTH).trim() + '...';
|
|
85
|
+
return React.createElement("p", { className: "pf-v5-u-mt-md pf-v5-u-color-300", dangerouslySetInnerHTML: sanitize(trimmedDescription) });
|
|
86
|
+
};
|
|
87
|
+
return (React.createElement("p", null,
|
|
88
|
+
React.createElement(Flex, null,
|
|
89
|
+
React.createElement(FlexItem, { spacer: { default: 'spacerXs' } }, renderLabels()),
|
|
90
|
+
React.createElement(FlexItem, null, renderDate())),
|
|
91
|
+
displayErrataTable(),
|
|
92
|
+
displayDescription(),
|
|
93
|
+
(cve === null || cve === void 0 ? void 0 : cve.cveLink) && (React.createElement(Button, { variant: "primary", className: isCveModalOpened ? 'pf-v5-u-my-md' : '', "data-tracking-id": "go-to-CVE-button", component: "a", href: cve.cveLink, target: "_blank", rel: "noopener noreferrer" },
|
|
94
|
+
React.createElement(Trans, null, "Go to CVE"),
|
|
95
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" })))));
|
|
96
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CveModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAQ1C,eAAO,MAAM,QAAQ,yBA+DpB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Badge, Button, Flex, FlexItem, Modal, ModalVariant } from '@patternfly/react-core';
|
|
2
|
+
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
|
|
3
|
+
import { getAccessHostname } from '@rh-support/utils';
|
|
4
|
+
import isEqual from 'lodash/isEqual';
|
|
5
|
+
import join from 'lodash/join';
|
|
6
|
+
import map from 'lodash/map';
|
|
7
|
+
import size from 'lodash/size';
|
|
8
|
+
import React, { useContext } from 'react';
|
|
9
|
+
import { Trans } from 'react-i18next';
|
|
10
|
+
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
|
+
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
12
|
+
import { setCaseState } from '../../reducers/CaseReducer';
|
|
13
|
+
import { CvePanel } from './CvePanel';
|
|
14
|
+
export const CveModal = () => {
|
|
15
|
+
const caseDispatch = useCaseDispatch();
|
|
16
|
+
const { cveWorkflowRecommendation, isCveModalOpened } = useCaseSelector((state) => ({
|
|
17
|
+
cveWorkflowRecommendation: state.cveWorkflowRecommendation,
|
|
18
|
+
isCveModalOpened: state.isCveModalOpened,
|
|
19
|
+
}), isEqual);
|
|
20
|
+
const { sessionRestore: { activeSessionId }, } = useContext(SessionRestoreStateContext);
|
|
21
|
+
const handleModalToggle = () => {
|
|
22
|
+
setCaseState(caseDispatch, { isCveModalOpened: !isCveModalOpened });
|
|
23
|
+
};
|
|
24
|
+
const handleEscapePress = (event) => {
|
|
25
|
+
// prevent the default escape key behavior
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
};
|
|
28
|
+
const generateCveCheckerUrl = () => {
|
|
29
|
+
const cveTitles = join(map(cveWorkflowRecommendation, 'title'), ',');
|
|
30
|
+
return `https://${getAccessHostname()}/labs/cvechecker/?source=pcm&session=${activeSessionId}&id=${cveTitles}`;
|
|
31
|
+
};
|
|
32
|
+
return (React.createElement(Modal, { variant: ModalVariant.medium, title: React.createElement(Flex, { alignItems: { default: 'alignItemsCenter' } },
|
|
33
|
+
React.createElement(FlexItem, { spacer: { default: 'spacerSm' } }, cveWorkflowRecommendation.length > 1 ? (React.createElement(Trans, null, "Handpicked for these CVEs")) : (React.createElement(Trans, null, "Handpicked for this CVE"))),
|
|
34
|
+
React.createElement(Badge, { isRead: true }, size(cveWorkflowRecommendation))), isOpen: isCveModalOpened, onClose: handleModalToggle, titleIconVariant: "info", disableFocusTrap: true, onEscapePress: handleEscapePress, actions: [
|
|
35
|
+
React.createElement(Button, { key: "cve-checker-link", "data-tracking-id": "cve-checker-link", target: "_blank", variant: "secondary", isInline: true, component: "a", href: generateCveCheckerUrl() },
|
|
36
|
+
React.createElement(Trans, null, "Red Hat CVE Checker"),
|
|
37
|
+
" ",
|
|
38
|
+
React.createElement(ExternalLinkAltIcon, { className: "pf-v5-u-ml-sm" })),
|
|
39
|
+
] },
|
|
40
|
+
React.createElement(CvePanel, null)));
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CvePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CvePanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,UAAW,MAAM,sBAyCrC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionToggle } from '@patternfly/react-core';
|
|
2
|
+
import isEqual from 'lodash/isEqual';
|
|
3
|
+
import map from 'lodash/map';
|
|
4
|
+
import slice from 'lodash/slice';
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
7
|
+
import { CveItem } from './CveItem';
|
|
8
|
+
export const CvePanel = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const { cveWorkflowRecommendation } = useCaseSelector((state) => ({
|
|
11
|
+
cveWorkflowRecommendation: state.cveWorkflowRecommendation,
|
|
12
|
+
}), isEqual);
|
|
13
|
+
const [expanded, setExpanded] = useState(((_a = cveWorkflowRecommendation === null || cveWorkflowRecommendation === void 0 ? void 0 : cveWorkflowRecommendation[0]) === null || _a === void 0 ? void 0 : _a.title) || '');
|
|
14
|
+
const handleToggle = (id) => setExpanded(id === expanded ? '' : id);
|
|
15
|
+
const renderAccordionItem = (cve, index) => {
|
|
16
|
+
const isExpanded = expanded === (cve === null || cve === void 0 ? void 0 : cve.title);
|
|
17
|
+
return (React.createElement(AccordionItem, { key: `cve-item-${index}` },
|
|
18
|
+
React.createElement(AccordionToggle, { onClick: () => handleToggle(cve.title), isExpanded: isExpanded, id: `cve-toggle-${index}`, "data-tracking-id": "cve-accordion-toggle" }, cve.title),
|
|
19
|
+
React.createElement(AccordionContent, { id: `cve-content-${index}`, isHidden: !isExpanded },
|
|
20
|
+
React.createElement(CveItem, { cve: cve }))));
|
|
21
|
+
};
|
|
22
|
+
return (React.createElement(Accordion, { isBordered: true, displaySize: 'default', asDefinitionList: false, className: `${props.className ? props.className : ''}` }, map(slice(cveWorkflowRecommendation, 0, 4), renderAccordionItem)));
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CveSidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CveSidebar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,UAAU,yBA6BtB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Badge } from '@patternfly/react-core';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
4
|
+
import size from 'lodash/size';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Trans } from 'react-i18next';
|
|
7
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
8
|
+
import { CvePanel } from './CvePanel';
|
|
9
|
+
export const CveSidebar = () => {
|
|
10
|
+
const { cveWorkflowRecommendation } = useCaseSelector((state) => ({
|
|
11
|
+
cveWorkflowRecommendation: state.cveWorkflowRecommendation,
|
|
12
|
+
}), isEqual);
|
|
13
|
+
if (isEmpty(cveWorkflowRecommendation)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (React.createElement(React.Fragment, null,
|
|
17
|
+
React.createElement("div", { className: "card card-white card-support file-diag pf-v5-u-mb-md" },
|
|
18
|
+
React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" },
|
|
19
|
+
React.createElement("span", { className: "pf-v5-u-mr-sm" }, cveWorkflowRecommendation.length > 1 ? (React.createElement(Trans, null, "Handpicked for these CVEs")) : (React.createElement(Trans, null, "Handpicked for this CVE"))),
|
|
20
|
+
React.createElement(Badge, { isRead: true }, size(cveWorkflowRecommendation))),
|
|
21
|
+
React.createElement("div", { className: "card-body" },
|
|
22
|
+
React.createElement(CvePanel, null)))));
|
|
23
|
+
};
|
|
@@ -3,6 +3,9 @@ import { RouteComponentProps } from 'react-router-dom';
|
|
|
3
3
|
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
4
4
|
export interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
|
+
userSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
|
|
7
|
+
userClickedNextonRecommendations: boolean;
|
|
8
|
+
resultsRowRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
6
9
|
}
|
|
7
10
|
export default function OpenCase(props: IProps): React.JSX.Element;
|
|
8
11
|
//# sourceMappingURL=OpenCase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenCase.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/OpenCase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpenCase.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/OpenCase.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,MAAM,WAAW,MAAM;IACnB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACzE,gCAAgC,EAAE,OAAO,CAAC;IAC1C,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAChE;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,MAAM,qBAqC7C"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
2
|
+
import isEqual from 'lodash/isEqual';
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
3
5
|
import { AccountSelector } from '../AccountInfo/AccountSelector';
|
|
4
6
|
import { OwnerSelector } from '../AccountInfo/OwnerSelector';
|
|
7
|
+
import ProductSelector from '../ProductSelector/ProductSelector';
|
|
5
8
|
import SupportTypeSelectorPage from './SupportTypeSelectorPage';
|
|
6
9
|
export default function OpenCase(props) {
|
|
7
10
|
const canChangeAccountInfo = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ACCOUNT_AND_OWNER);
|
|
11
|
+
const { enableGetSupportProductVersion } = useCaseSelector((state) => ({
|
|
12
|
+
enableGetSupportProductVersion: state.enableGetSupportProductVersion,
|
|
13
|
+
}), isEqual);
|
|
8
14
|
return (React.createElement("form", null,
|
|
9
15
|
canChangeAccountInfo && (React.createElement(React.Fragment, null,
|
|
10
16
|
React.createElement(AccountSelector, { "data-tracking-id": "get-support-account-selector" }),
|
|
11
17
|
React.createElement(OwnerSelector, { "data-tracking-id": "get-support-owner-selector" }))),
|
|
18
|
+
enableGetSupportProductVersion && (React.createElement("div", { className: "form-group" },
|
|
19
|
+
React.createElement(ProductSelector, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendations: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef, isOnGetSupportPage: true }))),
|
|
12
20
|
React.createElement(SupportTypeSelectorPage, null)));
|
|
13
21
|
}
|
|
@@ -8,6 +8,9 @@ interface IProps {
|
|
|
8
8
|
showTCAfterButtonClicked?: boolean;
|
|
9
9
|
checkEntitledProduct?: boolean;
|
|
10
10
|
isOnSummaryPage?: boolean;
|
|
11
|
+
isOnGetSupportPage?: boolean;
|
|
12
|
+
isOnReviewPage?: boolean;
|
|
13
|
+
caseCreateExperience?: boolean;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* Renders a dropdown list to select all products.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOvG,UAAU,MAAM;IACZ,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAQD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EA4JvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -8,10 +8,14 @@ import isEqual from 'lodash/isEqual';
|
|
|
8
8
|
import React, { forwardRef, useContext, useEffect, useState } from 'react';
|
|
9
9
|
import { Trans, useTranslation } from 'react-i18next';
|
|
10
10
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
|
+
import { RouteContext } from '../../context/RouteContext';
|
|
11
12
|
import { TCStateContext } from '../../context/TopContentContext';
|
|
13
|
+
import { useFetchCVEData } from '../../hooks/useFetchCVEData';
|
|
12
14
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
15
|
+
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
13
16
|
import RouteUtils from '../../utils/routeUtils';
|
|
14
17
|
import OpenCaseIssue from '../CaseInformation/OpenCaseIssue';
|
|
18
|
+
import { CveModal } from '../Cve/CveModal';
|
|
15
19
|
import Suggestions from '../Suggestions/Suggestions';
|
|
16
20
|
import { ProductVersionDropdownSelector } from './ProductVersionDropdownSelector';
|
|
17
21
|
const defaultProps = {
|
|
@@ -36,6 +40,7 @@ const AllProductsSelector = forwardRef((props, ref) => {
|
|
|
36
40
|
version: state.caseDetails.version,
|
|
37
41
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
38
42
|
}), isEqual);
|
|
43
|
+
const { cveRecommendation } = useFetchCVEData();
|
|
39
44
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
40
45
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
41
46
|
const [showModal, setShowModal] = useState(false);
|
|
@@ -76,28 +81,35 @@ const AllProductsSelector = forwardRef((props, ref) => {
|
|
|
76
81
|
RouteUtils.updateQueryParams(props.routeProps, newParams);
|
|
77
82
|
}
|
|
78
83
|
const entitledProducts = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
85
|
+
if ((activeSection === AppRouteSections.SUMMARIZE && !props.caseCreateExperience) ||
|
|
86
|
+
activeSection === AppRouteSections.GET_SUPPORT) {
|
|
87
|
+
return (React.createElement("div", { className: "form-group product-selector-wrapper" },
|
|
81
88
|
React.createElement("div", { className: "all-product-selector-dropdown" },
|
|
82
|
-
React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching })))
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
89
|
+
React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching }))));
|
|
90
|
+
// } else if (activeSection === AppRouteSections.SUMMARIZE && props.caseCreateExperience)
|
|
91
|
+
}
|
|
92
|
+
else
|
|
93
|
+
return (React.createElement(React.Fragment, null,
|
|
94
|
+
React.createElement("div", { className: "case-details-summary" },
|
|
95
|
+
React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage })),
|
|
96
|
+
(cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && React.createElement(CveModal, null),
|
|
97
|
+
React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
|
|
98
|
+
? 'You are'
|
|
99
|
+
: 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
|
|
100
|
+
showModalButton &&
|
|
101
|
+
!isEmpty(product) &&
|
|
102
|
+
!isEmpty(version) &&
|
|
103
|
+
!topContent.isFetching &&
|
|
104
|
+
topContent.data.length !== 0 && (React.createElement("button", { className: "btn btn-bordered-blue btn-slim pull-top-narrow push-bottom-narrow", "data-tracking-id": "suggested-fixes-trigger", onClick: toggleTCModal, type: "button" },
|
|
105
|
+
React.createElement(Trans, null, "Suggested fixes"))),
|
|
106
|
+
props.loadTCOnChange && !topContent.isFetching && topContent.data.length !== 0 && (React.createElement(Modal, { className: "feedback-modal", title: t('Suggested fixes'), description: t('There are new updates to suggested fixes after changing your product.'), "aria-describedby": "Feedback Form", isOpen: isModalOpen, variant: ModalVariant.large, onClose: toggleTCModal, actions: [
|
|
107
|
+
React.createElement("button", { key: "cancel", onClick: toggleTCModal, className: "btn btn-app btn-primary", type: "button" },
|
|
108
|
+
React.createElement(Trans, null, "Cancel")),
|
|
109
|
+
] },
|
|
110
|
+
React.createElement("span", null,
|
|
111
|
+
React.createElement(Trans, null, "Here are some common suggestions:")),
|
|
112
|
+
React.createElement(Suggestions, { showTitleDescription: false, showMax: 6 })))));
|
|
101
113
|
});
|
|
102
114
|
AllProductsSelector.defaultProps = defaultProps;
|
|
103
115
|
export { AllProductsSelector };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewProductDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAMpE,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NewProductDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAMpE,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAOD,eAAO,MAAM,0BAA0B,UAAW,MAAM,sBAyHvD,CAAC"}
|
|
@@ -73,8 +73,8 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
73
73
|
setIsSelectedProductSupportedForCustomer(isProductSupportedForCustomer(product, allProducts.data.productsResult));
|
|
74
74
|
}, [allProducts.data.productsResult, product, props.isOnSummaryPage]);
|
|
75
75
|
return (React.createElement("div", null,
|
|
76
|
-
React.createElement(Select, { variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Search for or select a product'), onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, isOpen: isOpen, placeholderText: t('Search for or select a product'), "aria-labelledby": t('Product-selector'), onFilter: onFilter, selections: product, validated: isEmpty(product) && showValidationLocal ? 'error' : 'default', "data-tracking-id": "get-support-product-dropdown-selector" }, getOptions()),
|
|
77
|
-
!isSelectedProductSupportedForCustomer && (React.createElement("div", { className: "pf-v5-u-ml-xs pf-v5-u-mt-sm form-instructions" },
|
|
76
|
+
React.createElement(Select, { variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Search for or select a product'), onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, isOpen: isOpen, placeholderText: t('Search for or select a product'), "aria-labelledby": t('Product-selector'), onFilter: onFilter, selections: product, validated: isEmpty(product) && showValidationLocal ? 'error' : 'default', "data-tracking-id": "get-support-product-dropdown-selector", isDisabled: props.isLoading }, getOptions()),
|
|
77
|
+
!props.isLoading && !isSelectedProductSupportedForCustomer && (React.createElement("div", { className: "pf-v5-u-ml-xs pf-v5-u-mt-sm form-instructions" },
|
|
78
78
|
React.createElement(Trans, null, "Red Hat must confirm your subscription status before providing support."),
|
|
79
79
|
React.createElement("br", null),
|
|
80
80
|
React.createElement(Trans, null, "We'll contact you if we have any questions.")))));
|
|
@@ -91,5 +91,5 @@ export const NewProductVersionSelector = (props) => {
|
|
|
91
91
|
setIsOpen(false);
|
|
92
92
|
};
|
|
93
93
|
const titleId = 'version-selector';
|
|
94
|
-
return (React.createElement(Select, Object.assign({ variant: SelectVariant.single, onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, isOpen: isOpen, placeholderText: t('Select a version'), toggleAriaLabel: t('Select a version'), "aria-labelledby": titleId, selections: version, validated: isEmpty(version) && showValidationLocal ? 'error' : 'default', isDisabled: isEmpty(product), "data-tracking-id": "get-support-version-dropdown-selector" }, (isSEProductApiIsDown && versionsDetails.isFetching && { loadingVariant: 'spinner' })), selectVersionOptions.map((version, index) => (React.createElement(SelectOption, { key: index, value: version })))));
|
|
94
|
+
return (React.createElement(Select, Object.assign({ variant: SelectVariant.single, onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, isOpen: isOpen, placeholderText: t('Select a version'), toggleAriaLabel: t('Select a version'), "aria-labelledby": titleId, selections: version, validated: isEmpty(version) && showValidationLocal ? 'error' : 'default', isDisabled: isEmpty(product) || allProducts.isFetching, "data-tracking-id": "get-support-version-dropdown-selector" }, (isSEProductApiIsDown && versionsDetails.isFetching && { loadingVariant: 'spinner' })), selectVersionOptions.map((version, index) => (React.createElement(SelectOption, { key: index, value: version })))));
|
|
95
95
|
};
|
|
@@ -4,8 +4,10 @@ import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
|
4
4
|
interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
6
|
userSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
|
|
7
|
-
userClickedNextonRecommendations
|
|
8
|
-
resultsRowRef
|
|
7
|
+
userClickedNextonRecommendations?: boolean;
|
|
8
|
+
resultsRowRef?: React.MutableRefObject<HTMLDivElement | null>;
|
|
9
|
+
isOnGetSupportPage?: boolean;
|
|
10
|
+
caseCreateExperience?: boolean;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Responsible for:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACzE,gCAAgC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACzE,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,aAAa,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC9D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAmGpD"}
|