@rh-support/troubleshoot 2.4.5-beta.2 → 2.4.5-beta.20
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/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +24 -19
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +2 -2
- package/lib/esm/components/Cve/CveItem.d.ts +2 -0
- package/lib/esm/components/Cve/CveItem.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveItem.js +78 -20
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveModal.js +9 -5
- package/lib/esm/components/Cve/CvePanel.js +1 -1
- package/lib/esm/components/Cve/CveSidebar.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveSidebar.js +1 -2
- 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 +9 -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 +26 -5
- 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 +41 -23
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +6 -1
- package/lib/esm/components/Recommendations/AsideResults.js +1 -1
- 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 +66 -31
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +5 -3
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +5 -3
- package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
- package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/Suggestions.js +8 -3
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +13 -13
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +69 -13
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +10 -9
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +31 -4
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +50 -10
- package/lib/esm/css/results.css +6 -0
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -1
- package/lib/esm/hooks/useFetchCVEData.js +58 -21
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +9 -8
- package/lib/esm/models/caseCreationWorkflows.d.ts +2 -0
- package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +2 -0
- package/lib/esm/reducers/CaseReducer.d.ts +1 -0
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +9 -0
- package/lib/esm/reducers/RouteConstNTypes.d.ts +2 -2
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/RouteConstNTypes.js +9 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts +7 -4
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +26 -13
- package/lib/esm/scss/_main.scss +65 -0
- package/lib/esm/scss/_pf-overrides.scss +1 -1
- package/lib/esm/utils/caseUtils.d.ts +13 -1
- package/lib/esm/utils/caseUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseUtils.js +32 -5
- package/package.json +9 -8
|
@@ -14,7 +14,7 @@ import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
|
14
14
|
import { AttachmentStateContext } from './fileUpload/reducer/AttachmentReducerContext';
|
|
15
15
|
export function useIsSectionValid(sectionName) {
|
|
16
16
|
var _a, _b;
|
|
17
|
-
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue, } = useCaseSelector((state) => ({
|
|
17
|
+
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue, ABTestVariation, } = useCaseSelector((state) => ({
|
|
18
18
|
caseState: state,
|
|
19
19
|
caseType: state.caseDetails.caseType,
|
|
20
20
|
product: state.caseDetails.product,
|
|
@@ -30,7 +30,12 @@ export function useIsSectionValid(sectionName) {
|
|
|
30
30
|
environment: state.caseDetails.environment,
|
|
31
31
|
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
32
32
|
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
33
|
+
ABTestVariation: state.ABTestVariation,
|
|
33
34
|
}), isEqual);
|
|
35
|
+
//&seSessionId=8e8960ac-680b-443e-bf67-9e13f2acd64e
|
|
36
|
+
const isATestvariation = ABTestVariation === 'A';
|
|
37
|
+
const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
|
|
38
|
+
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
34
39
|
const { globalMetadataState: { allProducts, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
|
|
35
40
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
36
41
|
const { recommendationState } = useContext(RecommendationStateContext);
|
|
@@ -49,22 +54,57 @@ export function useIsSectionValid(sectionName) {
|
|
|
49
54
|
return !hasUnallowedFiles && !hasOversizeFiles; // we want it false to trigger the error if its true
|
|
50
55
|
};
|
|
51
56
|
const isGetSupportSectionValidLocal = () => {
|
|
52
|
-
|
|
57
|
+
let isValid = !isEmpty(caseType) &&
|
|
53
58
|
!isEmpty(accountNumber) &&
|
|
54
59
|
!isEmpty(contactSSOName) &&
|
|
55
|
-
!selectedAccountDetails.data.subscriptionAbuse
|
|
60
|
+
!selectedAccountDetails.data.subscriptionAbuse;
|
|
61
|
+
if (isATestvariation) {
|
|
62
|
+
isValid = isValid && !isEmpty(product) && !isEmpty(version);
|
|
63
|
+
}
|
|
64
|
+
return isValid;
|
|
56
65
|
};
|
|
57
66
|
const isSummarizeSectionValid = () => {
|
|
58
|
-
|
|
59
|
-
!
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
if (isBTestvariation) {
|
|
68
|
+
let isValid = !allProducts.isFetching &&
|
|
69
|
+
!allProducts.isError &&
|
|
70
|
+
!topContent.isFetching &&
|
|
71
|
+
!recommendationState.isLoadingRecommendations &&
|
|
72
|
+
(summary === null || summary === void 0 ? void 0 : summary.length) <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
73
|
+
(issue === null || issue === void 0 ? void 0 : issue.length) <= ISSUE_SUMMARY_LENGTH_LIMIT &&
|
|
74
|
+
!isEmpty(product) &&
|
|
75
|
+
!isEmpty(version) &&
|
|
76
|
+
!isEmpty(summary) &&
|
|
77
|
+
!isEmpty(issue);
|
|
78
|
+
return isValid;
|
|
79
|
+
}
|
|
80
|
+
if (isATestvariation) {
|
|
81
|
+
let isValid = !allProducts.isFetching &&
|
|
82
|
+
!allProducts.isError &&
|
|
83
|
+
!topContent.isFetching &&
|
|
84
|
+
!recommendationState.isLoadingRecommendations &&
|
|
85
|
+
(summary === null || summary === void 0 ? void 0 : summary.length) <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
86
|
+
(issue === null || issue === void 0 ? void 0 : issue.length) <= ISSUE_SUMMARY_LENGTH_LIMIT &&
|
|
87
|
+
!isEmpty(summary) &&
|
|
88
|
+
!isEmpty(issue);
|
|
89
|
+
return isValid;
|
|
90
|
+
}
|
|
91
|
+
if (isCaseCreate) {
|
|
92
|
+
//because on the summarize page for troubleshoot flow we have only product version and owner
|
|
93
|
+
let isValid = !allProducts.isFetching &&
|
|
94
|
+
!allProducts.isError &&
|
|
95
|
+
// !topContent.isFetching &&
|
|
96
|
+
// !recommendationState.isLoadingRecommendations &&
|
|
97
|
+
// summary!?.length <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
98
|
+
// issue!?.length <= ISSUE_SUMMARY_LENGTH_LIMIT &&
|
|
99
|
+
!isEmpty(product) &&
|
|
100
|
+
!isEmpty(accountNumber) &&
|
|
101
|
+
!isEmpty(contactSSOName) &&
|
|
102
|
+
!isEmpty(version);
|
|
103
|
+
return isValid;
|
|
104
|
+
}
|
|
105
|
+
else if (!isCaseCreate) {
|
|
106
|
+
return !isEmpty(product) && !isEmpty(version) && !isEmpty(accountNumber) && !isEmpty(contactSSOName);
|
|
107
|
+
}
|
|
68
108
|
};
|
|
69
109
|
const isCaseManagementSectionValid = () => {
|
|
70
110
|
const hasContactInfo24x7ValidLength = contactInfo24x7
|
|
@@ -76,6 +116,22 @@ export function useIsSectionValid(sectionName) {
|
|
|
76
116
|
hasAlternateCaseIdValidLength);
|
|
77
117
|
};
|
|
78
118
|
const isTroubleshootSectionValid = () => {
|
|
119
|
+
if (isBTestvariation) {
|
|
120
|
+
//if we are in the new experience and user is troubleshoot we give them those validity fields
|
|
121
|
+
if (!isCaseCreate) {
|
|
122
|
+
let isValid = !allProducts.isFetching &&
|
|
123
|
+
!allProducts.isError &&
|
|
124
|
+
!topContent.isFetching &&
|
|
125
|
+
!recommendationState.isLoadingRecommendations &&
|
|
126
|
+
(summary === null || summary === void 0 ? void 0 : summary.length) <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
127
|
+
(issue === null || issue === void 0 ? void 0 : issue.length) <= ISSUE_SUMMARY_LENGTH_LIMIT &&
|
|
128
|
+
!isEmpty(product) &&
|
|
129
|
+
!isEmpty(version) &&
|
|
130
|
+
!isEmpty(summary) &&
|
|
131
|
+
!isEmpty(issue);
|
|
132
|
+
return isValid;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
79
135
|
// don't check for entitled product if user is on search intent flow
|
|
80
136
|
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
81
137
|
return !recommendationState.isLoadingRecommendations && isEntitledProductLocal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardAside.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardAside.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAGH,eAAe,EAKlB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"WizardAside.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardAside.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAGH,eAAe,EAKlB,MAAM,iCAAiC,CAAC;AAQzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,2BAA2B,EAAE,OAAO,CAAC;CACxC;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,qBAsDjC;kBAtDQ,WAAW;;;AAwDpB,eAAe,WAAW,CAAC"}
|
|
@@ -5,46 +5,47 @@ import isUndefined from 'lodash/isUndefined';
|
|
|
5
5
|
import React, { useContext } from 'react';
|
|
6
6
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
7
7
|
import { RouteContext } from '../../context/RouteContext';
|
|
8
|
-
import { AppRouteSections, hideFileUploadSidebarWidgetSections,
|
|
8
|
+
import { AppRouteSections, hideFileUploadSidebarWidgetSections, showSideBarClusterIdRuleWidgetSections, showSideBarEARuleWidgetSections, showSideBarEARuleWidgetSectionsExperienceA, showSideBarFileRecommendationSections, } from '../../reducers/RouteConstNTypes';
|
|
9
9
|
import { FileDiag } from '../CaseInformation/FileDiag';
|
|
10
10
|
import { CveSidebar } from '../Cve/CveSidebar';
|
|
11
11
|
import { AsideResults } from '../Recommendations/AsideResults';
|
|
12
12
|
import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
|
|
13
13
|
import { EARuleWidget } from '../Recommendations/EARules/EARuleWidget';
|
|
14
14
|
import InsightsResults from '../Recommendations/InsightsResults';
|
|
15
|
-
import { RecommendationInfoBox } from '../Recommendations/RecommendationInfoBox';
|
|
16
15
|
import { SessionRestore } from '../SessionRestore';
|
|
17
16
|
const defaultProps = {};
|
|
18
17
|
function WizardAside(props) {
|
|
19
18
|
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
20
19
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
21
|
-
const { isCreatingCase, caseType, isCveModalOpened } = useCaseSelector((state) => ({
|
|
20
|
+
const { isCreatingCase, caseType, isCveModalOpened, ABTestVariation } = useCaseSelector((state) => ({
|
|
22
21
|
isCreatingCase: state.isCreatingCase,
|
|
23
22
|
caseType: state.caseDetails.caseType,
|
|
24
23
|
isCveModalOpened: state.isCveModalOpened,
|
|
24
|
+
ABTestVariation: state.ABTestVariation,
|
|
25
25
|
}), isEqual);
|
|
26
|
+
const isATestvariation = ABTestVariation === 'A';
|
|
26
27
|
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
27
28
|
const canUseSessionManagement = ability.can(resourceActions.CREATE, resources.SESSION_TRACKING);
|
|
28
29
|
const canShowFileUploadWidget = () => canAddAttachments &&
|
|
29
30
|
!props.isAttachmentUploadModalOpen &&
|
|
30
31
|
!isUndefined(activeSection) &&
|
|
31
32
|
!hideFileUploadSidebarWidgetSections.includes(activeSection);
|
|
32
|
-
const
|
|
33
|
+
const canShowEARuleWidget = isATestvariation
|
|
34
|
+
? showSideBarEARuleWidgetSectionsExperienceA.includes(activeSection)
|
|
35
|
+
: showSideBarEARuleWidgetSections.includes(activeSection);
|
|
33
36
|
const canShowClusterIdReportWidget = showSideBarClusterIdRuleWidgetSections.includes(activeSection);
|
|
34
37
|
const canShowFileRecommendationSectionsWidget = showSideBarFileRecommendationSections.includes(activeSection);
|
|
35
|
-
const canShowRecommendationTips = showRecommendationTipsSections.includes(activeSection) && !isIdea;
|
|
36
38
|
return (React.createElement("aside", null,
|
|
37
39
|
React.createElement("section", { className: "grid-aside-content" },
|
|
40
|
+
canUseSessionManagement && !isCreatingCase && activeSection !== AppRouteSections.SUBMIT_CASE && (React.createElement(SessionRestore, { routeProps: props.routeProps })),
|
|
38
41
|
canShowFileUploadWidget() && React.createElement(InsightsResults, null),
|
|
39
42
|
canShowFileUploadWidget() && React.createElement(FileDiag, { className: "pf-v5-u-mb-md" }),
|
|
40
43
|
activeSection === AppRouteSections.SUMMARIZE && !isCveModalOpened && React.createElement(CveSidebar, null),
|
|
41
44
|
activeSection === AppRouteSections.TROUBLESHOOT && React.createElement(CveSidebar, null),
|
|
42
|
-
|
|
45
|
+
canShowEARuleWidget && React.createElement(EARuleWidget, null),
|
|
43
46
|
!(isIdea && activeSection === 'submit-case') && (React.createElement(AsideResults, { routeProps: props.routeProps, className: "pf-v5-u-mb-md pf-v5-u-mt-0" })),
|
|
44
47
|
canShowFileRecommendationSectionsWidget && React.createElement(InsightsResults, { isDisplayOnMain: true }),
|
|
45
|
-
React.createElement(ClusterRecommendations, { showClusterRecommendationsList: canShowClusterIdReportWidget, className: "pf-v5-u-mb-md pf-v5-u-mt-0" })
|
|
46
|
-
canUseSessionManagement && !isCreatingCase && activeSection !== AppRouteSections.SUBMIT_CASE && (React.createElement(SessionRestore, { routeProps: props.routeProps })),
|
|
47
|
-
canShowRecommendationTips && React.createElement(RecommendationInfoBox, null))));
|
|
48
|
+
React.createElement(ClusterRecommendations, { showClusterRecommendationsList: canShowClusterIdReportWidget, className: "pf-v5-u-mb-md pf-v5-u-mt-0" }))));
|
|
48
49
|
}
|
|
49
50
|
WizardAside.defaultProps = defaultProps;
|
|
50
51
|
export default WizardAside;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBA2MzC"}
|
|
@@ -11,15 +11,16 @@ import { Grid, GridItem } from '@patternfly/react-core';
|
|
|
11
11
|
import { SupportFeedbackForm } from '@rh-support/components';
|
|
12
12
|
import { fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
13
|
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
|
-
import { getVersionIfOnlyVersion, pendoTrackEvent, PreviousCaseTypes } from '@rh-support/utils';
|
|
14
|
+
import { ABTestSplitBasedOnAccountNumber, getConfigField, getVersionIfOnlyVersion, PCM_CONFIG_FIELD_TYPE, pendoTrackEvent, PreviousCaseTypes, } from '@rh-support/utils';
|
|
15
15
|
import findIndex from 'lodash/findIndex';
|
|
16
|
+
import isEmpty from 'lodash/isEmpty';
|
|
16
17
|
import isEqual from 'lodash/isEqual';
|
|
17
18
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
18
19
|
import { Trans } from 'react-i18next';
|
|
19
20
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
20
21
|
import { RouteContext } from '../../context/RouteContext';
|
|
21
22
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
22
|
-
import { submitCase } from '../../reducers/CaseReducer';
|
|
23
|
+
import { setABTestVariation, submitCase } from '../../reducers/CaseReducer';
|
|
23
24
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
24
25
|
import RouteUtils from '../../utils/routeUtils';
|
|
25
26
|
import PreCaseConfirmationModals, { PreCaseConfirmationModalsEnum, } from '../ConfirmationModals/PreCaseConfirmationModals';
|
|
@@ -32,17 +33,18 @@ import WizardAside from './WizardAside';
|
|
|
32
33
|
import WizardMain from './WizardMain';
|
|
33
34
|
export function WizardLayout(props) {
|
|
34
35
|
const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
|
|
35
|
-
const { caseCreationError, contactSSOName, caseType, product, caseState } = useCaseSelector((state) => ({
|
|
36
|
+
const { caseCreationError, contactSSOName, caseType, product, caseState, ABTestVariation } = useCaseSelector((state) => ({
|
|
36
37
|
caseState: state,
|
|
37
38
|
caseCreationError: state.caseCreationError,
|
|
38
39
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
39
40
|
caseType: state.caseDetails.caseType,
|
|
40
41
|
product: state.caseDetails.product,
|
|
42
|
+
ABTestVariation: state.ABTestVariation,
|
|
41
43
|
}), isEqual);
|
|
42
44
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
43
45
|
const caseDispatch = useCaseDispatch();
|
|
44
46
|
const { sessionRestore: { activeSessionId, previousSessions }, } = useContext(SessionRestoreStateContext);
|
|
45
|
-
const { globalMetadataState: { allProducts, loggedInUser, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
47
|
+
const { globalMetadataState: { allProducts, loggedInUser, loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
46
48
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
47
49
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
48
50
|
const { attachmentState } = useContext(AttachmentStateContext);
|
|
@@ -110,6 +112,31 @@ export function WizardLayout(props) {
|
|
|
110
112
|
}
|
|
111
113
|
setConfirmationModalType(null);
|
|
112
114
|
};
|
|
115
|
+
// A/B test
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
var _a, _b;
|
|
118
|
+
if (isEmpty(loggedInUsersAccount.data.accountNumber))
|
|
119
|
+
return;
|
|
120
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
121
|
+
const useflowFromUrl = urlParams.get('useflow');
|
|
122
|
+
// if useflow was added in url, we force the selection
|
|
123
|
+
if (useflowFromUrl &&
|
|
124
|
+
(((_a = useflowFromUrl === null || useflowFromUrl === void 0 ? void 0 : useflowFromUrl.charAt(0)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'a' || ((_b = useflowFromUrl === null || useflowFromUrl === void 0 ? void 0 : useflowFromUrl.charAt(0)) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'b')) {
|
|
125
|
+
// set state for PCM to show A or B
|
|
126
|
+
setABTestVariation(caseDispatch, useflowFromUrl === null || useflowFromUrl === void 0 ? void 0 : useflowFromUrl.charAt(0).toUpperCase());
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const appABTestConfig = getConfigField(pcmConfig.data, 'testVariationWeightZeroToTen', PCM_CONFIG_FIELD_TYPE.STRING);
|
|
130
|
+
if (isEmpty(loggedInUsersAccount.data.accountNumber) || isEmpty(appABTestConfig))
|
|
131
|
+
return;
|
|
132
|
+
const appTestWeight = parseInt(appABTestConfig, 10);
|
|
133
|
+
const newABTestVariation = ABTestSplitBasedOnAccountNumber(appTestWeight, loggedInUsersAccount.data.accountNumber);
|
|
134
|
+
if (newABTestVariation !== ABTestVariation) {
|
|
135
|
+
// set state for PCM to show A or B
|
|
136
|
+
setABTestVariation(caseDispatch, newABTestVariation);
|
|
137
|
+
}
|
|
138
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
139
|
+
}, [loggedInUsersAccount.data.accountNumber, ABTestVariation]);
|
|
113
140
|
// Loading app metadata
|
|
114
141
|
useEffect(() => {
|
|
115
142
|
fetchProducts(dispatchToGlobalMetadataReducer, contactSSOName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAK3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxE;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAyStC;kBAzSQ,gBAAgB;;;AA2SzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -13,6 +13,7 @@ import { useFetch } from '@rh-support/components';
|
|
|
13
13
|
import { GlobalMetadataStateContext, useCanCreateCase } from '@rh-support/react-context';
|
|
14
14
|
import { dtmTrackEventCaseStartStopped, getResTypeFromUrl, scrollIntoView } from '@rh-support/utils';
|
|
15
15
|
import find from 'lodash/find';
|
|
16
|
+
import isEmpty from 'lodash/isEmpty';
|
|
16
17
|
import isEqual from 'lodash/isEqual';
|
|
17
18
|
import React, { useContext, useEffect, useState } from 'react';
|
|
18
19
|
import { useTranslation } from 'react-i18next';
|
|
@@ -31,11 +32,18 @@ function WizardNavigation(props) {
|
|
|
31
32
|
const { t } = useTranslation();
|
|
32
33
|
const canCreateCase = useCanCreateCase();
|
|
33
34
|
const { recommendationState } = useContext(RecommendationStateContext);
|
|
34
|
-
const { routeState: { activeSection, isNextBtnClickedToShowValidationError, noValidEntitlement, isSearchIntent }, } = useContext(RouteContext);
|
|
35
|
+
const { routeState: { activeSection, isNextBtnClickedToShowValidationError, noValidEntitlement, isSearchIntent, isCaseCreate, }, } = useContext(RouteContext);
|
|
35
36
|
const { globalMetadataState: { loggedInUsersAccount, allProducts, navBarRef }, } = useContext(GlobalMetadataStateContext);
|
|
36
|
-
const { caseState } = useCaseSelector((state) => ({
|
|
37
|
+
const { caseState, ABTestVariation, issue, summary, product, version } = useCaseSelector((state) => ({
|
|
37
38
|
caseState: state,
|
|
39
|
+
issue: state.caseDetails.issue,
|
|
40
|
+
summary: state.caseDetails.summary,
|
|
41
|
+
ABTestVariation: state.ABTestVariation,
|
|
42
|
+
product: state.caseDetails.product,
|
|
43
|
+
version: state.caseDetails.version,
|
|
38
44
|
}), isEqual);
|
|
45
|
+
const isATestvariation = ABTestVariation === 'A';
|
|
46
|
+
const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
|
|
39
47
|
// To check if the user is entitled or not
|
|
40
48
|
const isEntitledProduct = (_b = find((_a = allProducts === null || allProducts === void 0 ? void 0 : allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, (p) => p.product === caseState.caseDetails.product)) === null || _b === void 0 ? void 0 : _b.isEntitledProduct;
|
|
41
49
|
const dispatchToRouteReducer = useContext(RouteDispatchContext);
|
|
@@ -54,7 +62,7 @@ function WizardNavigation(props) {
|
|
|
54
62
|
props.userClickedNextonRecommendationsFn(false);
|
|
55
63
|
props.setUserScrolledLabel(false);
|
|
56
64
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
-
}, []);
|
|
65
|
+
}, [recommendationState.isLoadingRecommendations]);
|
|
58
66
|
useEffect(() => {
|
|
59
67
|
if (props.activeStep.id === AppRouteSections.TROUBLESHOOT) {
|
|
60
68
|
window.scrollTo({
|
|
@@ -76,7 +84,7 @@ function WizardNavigation(props) {
|
|
|
76
84
|
// console.log({ hasUserScrolled });
|
|
77
85
|
const boundingRect = entry.boundingClientRect;
|
|
78
86
|
const isScrollingUp = boundingRect.top > 0;
|
|
79
|
-
const isAboveThreshold = entry.intersectionRatio >= 0.
|
|
87
|
+
const isAboveThreshold = entry.intersectionRatio >= 0.6;
|
|
80
88
|
isAboveThreshold && props.setUserCanNavigateToTroubleshoot(true);
|
|
81
89
|
isAboveThreshold && props.setUserSeenRecommendations(true);
|
|
82
90
|
// If scrolling up, always use the threshold check
|
|
@@ -92,7 +100,7 @@ function WizardNavigation(props) {
|
|
|
92
100
|
}
|
|
93
101
|
}, {
|
|
94
102
|
root: null,
|
|
95
|
-
threshold: [0, 0.
|
|
103
|
+
threshold: [0, 0.6], // Changing threshold value to have its effect on pagination when page size is more than 10.
|
|
96
104
|
rootMargin: '0px',
|
|
97
105
|
});
|
|
98
106
|
const resultsRowElement = props.resultsRowRef.current;
|
|
@@ -175,14 +183,46 @@ function WizardNavigation(props) {
|
|
|
175
183
|
}
|
|
176
184
|
catch (e) { }
|
|
177
185
|
});
|
|
178
|
-
// To handle entitled products
|
|
179
186
|
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
187
|
+
const nextButtonDisabledLogic = () => {
|
|
188
|
+
if (isBTestvariation) {
|
|
189
|
+
let value = ((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
|
|
190
|
+
props.activeStep.id === AppRouteSections.SUMMARIZE) ||
|
|
191
|
+
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
192
|
+
props.activeStep.nextButtonLabel === 'Troubleshoot' ||
|
|
193
|
+
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
194
|
+
noValidEntitlement;
|
|
195
|
+
return value;
|
|
196
|
+
}
|
|
197
|
+
else if (isATestvariation) {
|
|
198
|
+
let value = ((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
|
|
199
|
+
props.activeStep.id === AppRouteSections.SUMMARIZE) ||
|
|
200
|
+
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
201
|
+
props.activeStep.nextButtonLabel === 'Troubleshoot' ||
|
|
202
|
+
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
203
|
+
noValidEntitlement;
|
|
204
|
+
return value;
|
|
205
|
+
}
|
|
206
|
+
else if (isATestvariation && !isCaseCreate) {
|
|
207
|
+
let value = isEmpty(summary) ||
|
|
208
|
+
isEmpty(issue) ||
|
|
183
209
|
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
184
210
|
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
185
|
-
noValidEntitlement
|
|
211
|
+
noValidEntitlement;
|
|
212
|
+
return value;
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const isDisabledGoBack = () => {
|
|
216
|
+
if (isBTestvariation || isEmpty(ABTestVariation))
|
|
217
|
+
return false;
|
|
218
|
+
if (isATestvariation && props.activeStep.id === 'get-support') {
|
|
219
|
+
return isEmpty(product) || isEmpty(version);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
// To handle entitled products
|
|
223
|
+
return (React.createElement(React.Fragment, null,
|
|
224
|
+
props.activeStep.order !== 0 && (React.createElement("button", { onClick: () => onBack(), className: "btn btn-app btn-open-white main-nav-button", "data-tracking-id": `prev-of-${activeSection}`, type: "button", disabled: isDisabledGoBack() }, t('Go back'))),
|
|
225
|
+
React.createElement("button", { disabled: nextButtonDisabledLogic(), onClick: onNext, className: "btn btn-app btn-primary main-nav-button", "data-tracking-id": `next-of-${activeSection}`, type: "button" }, t(props.activeStep.nextButtonLabel)),
|
|
186
226
|
activeSection === AppRouteSections.TROUBLESHOOT && isFileRecommendationsTriggered && (React.createElement(Button, { onClick: handleFileRecsSelfSolved, variant: ButtonVariant.secondary, className: "issue-solved-button solved-issue-button", "data-tracking-id": "troubleshoot-self-solved-issue" }, t('I solved my issue'))),
|
|
187
227
|
React.createElement(RecommendationFeedbackModal, { isModalOpen: isRecsModalVisible, handleModalToggle: onRecsFeedbackModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
|
|
188
228
|
activeSectionError ? (React.createElement("small", { className: "pf-v5-u-align-self-center pf-v5-u-ml-md text-red" }, activeSectionError)) : null));
|
package/lib/esm/css/results.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchCVEData.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchCVEData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFetchCVEData.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchCVEData.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,0BAA0B,EAAkB,MAAM,iCAAiC,CAAC;AAI7F,wBAAgB,eAAe;;EAwI9B"}
|
|
@@ -8,22 +8,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { search } from '@cee-eng/hydrajs';
|
|
11
|
-
import {
|
|
11
|
+
import { useDebounce, useLRUCache } from '@rh-support/components';
|
|
12
12
|
import filter from 'lodash/filter';
|
|
13
|
+
import includes from 'lodash/includes';
|
|
13
14
|
import isArray from 'lodash/isArray';
|
|
14
15
|
import isEmpty from 'lodash/isEmpty';
|
|
15
16
|
import isEqual from 'lodash/isEqual';
|
|
16
17
|
import map from 'lodash/map';
|
|
17
|
-
import
|
|
18
|
-
import
|
|
18
|
+
import slice from 'lodash/slice';
|
|
19
|
+
import sortBy from 'lodash/sortBy';
|
|
20
|
+
import uniqBy from 'lodash/uniqBy';
|
|
21
|
+
import { useState } from 'react';
|
|
19
22
|
import { useCaseDispatch, useCaseSelector } from '../context/CaseContext';
|
|
20
|
-
import { RecommendationStateContext } from '../context/RecommendationContext';
|
|
21
23
|
import { setCaseState } from '../reducers/CaseReducer';
|
|
22
24
|
import { findCVEsInString } from '../utils/caseUtils';
|
|
23
|
-
// custom hook for CVE workflow .
|
|
25
|
+
// custom hook for CVE workflow data .
|
|
24
26
|
export function useFetchCVEData() {
|
|
25
27
|
const caseDispatch = useCaseDispatch();
|
|
26
|
-
const { recommendationState } = useContext(RecommendationStateContext);
|
|
27
28
|
const [cveRecommendation, setCveRecommendation] = useState([]);
|
|
28
29
|
const { product, version, summary, description } = useCaseSelector((state) => ({
|
|
29
30
|
product: state.caseDetails.product,
|
|
@@ -31,6 +32,7 @@ export function useFetchCVEData() {
|
|
|
31
32
|
summary: state.caseDetails.summary,
|
|
32
33
|
description: state.caseDetails.description,
|
|
33
34
|
}), isEqual);
|
|
35
|
+
const { getFromCache, setInCache } = useLRUCache(50);
|
|
34
36
|
const getFixedErrataByProduct = (releaseInfo, selectedProduct, selectedVersion) => {
|
|
35
37
|
var _a;
|
|
36
38
|
if (isEmpty(releaseInfo) || !isArray(releaseInfo) || !selectedProduct) {
|
|
@@ -42,12 +44,11 @@ export function useFetchCVEData() {
|
|
|
42
44
|
const filteredArray = releaseInfo.filter((obj) => {
|
|
43
45
|
var _a, _b;
|
|
44
46
|
const product = (_b = (_a = obj === null || obj === void 0 ? void 0 : obj.product) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.trim();
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
(majorVersion && product === `${selectedProductLower} ${majorVersion}`);
|
|
48
|
-
return productVersionMatchConditions && (obj === null || obj === void 0 ? void 0 : obj.state) === 'Fixed';
|
|
47
|
+
const productWithVersion = `${selectedProductLower} ${majorVersion}`;
|
|
48
|
+
return includes(product, productWithVersion) && (obj === null || obj === void 0 ? void 0 : obj.state) === 'Fixed';
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
const uniqFilteredArray = uniqBy(filteredArray, (fa) => { var _a; return (_a = fa === null || fa === void 0 ? void 0 : fa.advisory) === null || _a === void 0 ? void 0 : _a.name; });
|
|
51
|
+
const errataData = map(uniqFilteredArray, (i) => {
|
|
51
52
|
var _a;
|
|
52
53
|
return ({
|
|
53
54
|
package: (i === null || i === void 0 ? void 0 : i.package) || '',
|
|
@@ -58,12 +59,42 @@ export function useFetchCVEData() {
|
|
|
58
59
|
product: (i === null || i === void 0 ? void 0 : i.product) || '',
|
|
59
60
|
});
|
|
60
61
|
});
|
|
62
|
+
return slice(errataData, 0, 3);
|
|
63
|
+
};
|
|
64
|
+
const sortCveResult = (cveData) => {
|
|
65
|
+
if (isEmpty(cveData)) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
const cveSeverity = {
|
|
69
|
+
Critical: 1,
|
|
70
|
+
Important: 2,
|
|
71
|
+
Moderate: 3,
|
|
72
|
+
Low: 4,
|
|
73
|
+
};
|
|
74
|
+
return sortBy(cveData, (item) => { var _a; return cveSeverity[(_a = item === null || item === void 0 ? void 0 : item.data) === null || _a === void 0 ? void 0 : _a.field_cve_threat_severity_text] || Infinity; });
|
|
61
75
|
};
|
|
62
76
|
const fetchCVEData = (cveIds) => __awaiter(this, void 0, void 0, function* () {
|
|
63
77
|
if (isEmpty(cveIds))
|
|
64
78
|
return [];
|
|
65
79
|
try {
|
|
66
|
-
const results = yield Promise.allSettled(map(cveIds, (id) =>
|
|
80
|
+
const results = yield Promise.allSettled(map(cveIds, (id) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
var _a;
|
|
82
|
+
const cachedData = getFromCache(id);
|
|
83
|
+
if (cachedData) {
|
|
84
|
+
return cachedData;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// sometime backend return html response so we need to handle this scenario so i have added this logic.
|
|
88
|
+
const data = yield search.getCVEDetailsById(id);
|
|
89
|
+
if (((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.title) === id) {
|
|
90
|
+
setInCache(id, data);
|
|
91
|
+
return data;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
throw new Error('unexpected response');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
})));
|
|
67
98
|
return map(filter(results, (result) => result.status === 'fulfilled'), (result) => result.value);
|
|
68
99
|
}
|
|
69
100
|
catch (error) {
|
|
@@ -71,14 +102,16 @@ export function useFetchCVEData() {
|
|
|
71
102
|
return [];
|
|
72
103
|
}
|
|
73
104
|
});
|
|
74
|
-
|
|
105
|
+
useDebounce(() => {
|
|
106
|
+
if (isEmpty(summary) || isEmpty(description)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
75
109
|
const CVETextValue = `${summary || ''} ${description || ''}`;
|
|
76
110
|
const cveIds = findCVEsInString(CVETextValue);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const processedData = map(results, ({ data }) => {
|
|
111
|
+
fetchCVEData(cveIds)
|
|
112
|
+
.then((results) => {
|
|
113
|
+
const sortedData = slice(sortCveResult(results), 0, 4);
|
|
114
|
+
const processedData = map(sortedData, ({ data }) => {
|
|
82
115
|
var _a, _b, _c, _d;
|
|
83
116
|
return ({
|
|
84
117
|
publicDate: (_a = data === null || data === void 0 ? void 0 : data.field_cve_public_date) === null || _a === void 0 ? void 0 : _a.value,
|
|
@@ -87,15 +120,19 @@ export function useFetchCVEData() {
|
|
|
87
120
|
mitigation: data === null || data === void 0 ? void 0 : data.field_cve_mitigation_text,
|
|
88
121
|
details: (_b = data === null || data === void 0 ? void 0 : data.field_cve_details_text) === null || _b === void 0 ? void 0 : _b.value,
|
|
89
122
|
cveLink: (_c = data === null || data === void 0 ? void 0 : data.path) === null || _c === void 0 ? void 0 : _c.replace(/\\/g, ''),
|
|
123
|
+
type: (data === null || data === void 0 ? void 0 : data.type) || 'cve',
|
|
124
|
+
nid: (data === null || data === void 0 ? void 0 : data.nid) || '',
|
|
90
125
|
errataData: getFixedErrataByProduct(((_d = data === null || data === void 0 ? void 0 : data.field_cve_releases_txt) === null || _d === void 0 ? void 0 : _d.object) || [], product, version),
|
|
91
126
|
});
|
|
92
|
-
});
|
|
127
|
+
}).filter((d) => d.severity !== 'Low');
|
|
93
128
|
setCveRecommendation(processedData);
|
|
94
129
|
setCaseState(caseDispatch, {
|
|
95
130
|
cveWorkflowRecommendation: processedData,
|
|
96
131
|
});
|
|
132
|
+
})
|
|
133
|
+
.catch((error) => {
|
|
134
|
+
console.error('Error processing CVE data:', error);
|
|
97
135
|
});
|
|
98
|
-
|
|
99
|
-
}, [summary, description, product, version, recommendationState === null || recommendationState === void 0 ? void 0 : recommendationState.visibleDocs]);
|
|
136
|
+
}, [summary, description, product, version], 1000);
|
|
100
137
|
return { cveRecommendation };
|
|
101
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWizard.tsx"],"names":[],"mappings":"AA+BA,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,GAAG,CAAC;IAChC,4BAA4B,EAAE,OAAO,CAAC;IACtC,6BAA6B,EAAE,OAAO,CAAC;IACvC,qCAAqC,EAAE,OAAO,CAAC;IAC/C,aAAa,EAAE,GAAG,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,UAAU,KAAA,EAAE,KAAK,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"useWizard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWizard.tsx"],"names":[],"mappings":"AA+BA,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,GAAG,CAAC;IAChC,4BAA4B,EAAE,OAAO,CAAC;IACtC,6BAA6B,EAAE,OAAO,CAAC;IACvC,qCAAqC,EAAE,OAAO,CAAC;IAC/C,aAAa,EAAE,GAAG,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,UAAU,KAAA,EAAE,KAAK,CAAC,EAAE,MAAM;iCAyQb,OAAO;EAwC7C"}
|
|
@@ -57,32 +57,33 @@ export function useWizard(routeProps, props) {
|
|
|
57
57
|
[AppRouteSections.GET_SUPPORT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.GET_SUPPORT, name: t('Get support'), component: (React.createElement(MainSection, { stepNumber: 1, totalSteps: 6, section: AppRouteSections.GET_SUPPORT, title: t('Why are you opening a case?'), description: t('Select the best category for your issue.') },
|
|
58
58
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
59
59
|
alertMessage(),
|
|
60
|
-
React.createElement(OpenCase, { routeProps: routeProps })))), canJumpTo: isSectionValidFn(AppRouteSections.GET_SUPPORT) || activeSection === AppRouteSections.GET_SUPPORT }),
|
|
61
|
-
[AppRouteSections.SUMMARIZE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.SUMMARIZE, name: t('Summarize'), component: (React.createElement(MainSection, { stepNumber: 2, totalSteps: 6, section: AppRouteSections.SUMMARIZE, title: t('What are you having an issue with?') },
|
|
60
|
+
React.createElement(OpenCase, { routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef })))), canJumpTo: isSectionValidFn(AppRouteSections.GET_SUPPORT) || activeSection === AppRouteSections.GET_SUPPORT }),
|
|
61
|
+
[AppRouteSections.SUMMARIZE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.SUMMARIZE, name: isCaseCreate ? t('Summarize') : t('Troubleshoot'), component: (React.createElement(MainSection, { stepNumber: 2, totalSteps: 6, section: AppRouteSections.SUMMARIZE, title: t('What are you having an issue with?') },
|
|
62
62
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
63
63
|
alertMessage(),
|
|
64
|
-
React.createElement(ProductSelector, { routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef })))), canJumpTo: isSectionValidFn(AppRouteSections.SUMMARIZE) || activeSection === AppRouteSections.SUMMARIZE, nextButtonLabel: (summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
|
|
65
|
-
!isEmpty(issue)
|
|
64
|
+
React.createElement(ProductSelector, { routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn, userClickedNextonRecommendations: props.userClickedNextonRecommendationsValue, resultsRowRef: props.resultsRowRef, isOnGetSupportPage: false, caseCreateExperience: isCaseCreate })))), canJumpTo: isSectionValidFn(AppRouteSections.SUMMARIZE) || activeSection === AppRouteSections.SUMMARIZE, nextButtonLabel: ((summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
|
|
65
|
+
!isEmpty(issue)) ||
|
|
66
|
+
numFound === 0 // do this so that when user refreshes tab and state persists we don't cause edge 'continue' render
|
|
66
67
|
? t('Continue')
|
|
67
68
|
: t('See more options') }),
|
|
68
|
-
[AppRouteSections.TROUBLESHOOT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.TROUBLESHOOT, name: t('
|
|
69
|
+
[AppRouteSections.TROUBLESHOOT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.TROUBLESHOOT, name: isCaseCreate ? t('Resources') : t('Resources'), component: (React.createElement(MainSection, { stepNumber: 3, totalSteps: 6, section: AppRouteSections.TROUBLESHOOT, title: t('Recommendations') },
|
|
69
70
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
70
71
|
alertMessage(),
|
|
71
72
|
React.createElement(TroubleshootSection, null)))), canJumpTo: isSectionValidFn(AppRouteSections.TROUBLESHOOT || activeSection === AppRouteSections.TROUBLESHOOT) &&
|
|
72
73
|
(props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) &&
|
|
73
74
|
(props === null || props === void 0 ? void 0 : props.userCanNavigateToTroubleshoot), nextButtonLabel: isCaseCreate ? t('Continue') : t('Convert to Case') }),
|
|
74
|
-
[AppRouteSections.DESCRIBE_MORE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_MORE, name: t('
|
|
75
|
+
[AppRouteSections.DESCRIBE_MORE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_MORE, name: t('Additional information'), component: (React.createElement(MainSection, { stepNumber: 4, totalSteps: 6, section: AppRouteSections.DESCRIBE_MORE, title: React.createElement(React.Fragment, null,
|
|
75
76
|
t('Case information'),
|
|
76
77
|
isEmpty(RouteUtils.seBasePath) && isSelectedAccounntSecureSupport && (React.createElement("span", { className: "secured-support" },
|
|
77
78
|
React.createElement(Trans, null, "Secured Support")))), description: t('Provide the details of your issue.') },
|
|
78
79
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
79
80
|
alertMessage(),
|
|
80
81
|
React.createElement(CaseInformation, { routeProps: routeProps })))), canJumpTo: isSectionValidFn(AppRouteSections.DESCRIBE_MORE) || activeSection === AppRouteSections.DESCRIBE_MORE }),
|
|
81
|
-
[AppRouteSections.DESCRIBE_IDEA]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_IDEA, name: t('
|
|
82
|
+
[AppRouteSections.DESCRIBE_IDEA]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_IDEA, name: t('Additional Information'), component: (React.createElement(MainSection, { stepNumber: 4, totalSteps: 6, section: AppRouteSections.DESCRIBE_IDEA, title: t('Idea information'), description: t("We'll be in contact with you shortly. Look for updates on this case.") },
|
|
82
83
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
83
84
|
alertMessage(),
|
|
84
85
|
React.createElement(IdeaInformation, null)))), canJumpTo: isSectionValidFn(AppRouteSections.DESCRIBE_IDEA) || activeSection === AppRouteSections.DESCRIBE_IDEA, nextButtonLabel: 'Submit', disableOtherSections: false }),
|
|
85
|
-
[AppRouteSections.MANAGEMENT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.MANAGEMENT, name: t('
|
|
86
|
+
[AppRouteSections.MANAGEMENT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.MANAGEMENT, name: t('Configuration'), component: (React.createElement(MainSection, { stepNumber: 5, totalSteps: 6, section: AppRouteSections.MANAGEMENT, title: t('Case management'), descriptionClassName: "text-medium-grey" },
|
|
86
87
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
87
88
|
alertMessage(),
|
|
88
89
|
React.createElement(CaseManagement, null)))), canJumpTo: isSectionValidFn(AppRouteSections.MANAGEMENT) || activeSection === AppRouteSections.MANAGEMENT }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caseCreationWorkflows.d.ts","sourceRoot":"","sources":["../../../src/models/caseCreationWorkflows.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;IACd,UAAU,EAAE,GAAG,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,cAAc,EAAE,CAAC;CAChC;AAED,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACzB"}
|
|
1
|
+
{"version":3,"file":"caseCreationWorkflows.d.ts","sourceRoot":"","sources":["../../../src/models/caseCreationWorkflows.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,GAAG,CAAC;IACd,UAAU,EAAE,GAAG,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,cAAc,EAAE,CAAC;CAChC;AAED,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACzB"}
|