@rh-support/troubleshoot 2.4.5-beta.10 → 2.4.5-beta.12
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 +2 -3
- 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 +70 -17
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveModal.js +5 -3
- 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.map +1 -1
- package/lib/esm/components/OpenCase/OpenCase.js +4 -3
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +41 -28
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +25 -21
- 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/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +26 -21
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +4 -2
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +4 -2
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +52 -14
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +9 -4
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +19 -3
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +23 -7
- package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -1
- package/lib/esm/hooks/useFetchCVEData.js +14 -7
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +23 -5
- 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/SessionRestoreReducer.d.ts +7 -4
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +25 -12
- package/lib/esm/scss/_main.scss +49 -0
- 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 +8 -8
|
@@ -27,14 +27,14 @@ import { WatsonxAiIcon } from './WatsonxAiIcon';
|
|
|
27
27
|
const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
|
|
28
28
|
export default function Recommendations(props) {
|
|
29
29
|
var _a, _b, _c;
|
|
30
|
-
const { product, version, environment, summary, caseResourceLinks, issue,
|
|
30
|
+
const { product, version, environment, summary, caseResourceLinks, issue, ABTestVarioation } = useCaseSelector((state) => ({
|
|
31
31
|
product: state.caseDetails.product,
|
|
32
32
|
version: state.caseDetails.version,
|
|
33
33
|
environment: state.caseDetails.environment,
|
|
34
34
|
summary: state.caseDetails.summary,
|
|
35
35
|
issue: state.caseDetails.issue,
|
|
36
36
|
caseResourceLinks: state.caseDetails.caseResourceLinks,
|
|
37
|
-
|
|
37
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
38
38
|
}), isEqual);
|
|
39
39
|
const caseDispatch = useCaseDispatch();
|
|
40
40
|
// Use Case Number
|
|
@@ -58,6 +58,8 @@ export default function Recommendations(props) {
|
|
|
58
58
|
summary: summary,
|
|
59
59
|
description: issue, // we don't need to truncate to 20k as Watsonx max recs is 4000 done for us already
|
|
60
60
|
};
|
|
61
|
+
const isATestvariation = ABTestVarioation === 'A';
|
|
62
|
+
const isBTestvariation = ABTestVarioation === 'B';
|
|
61
63
|
const isRecSearchPayloadSame = isEqual(payload, recommendationState.prevRecommendationsBody);
|
|
62
64
|
useEffect(() => {
|
|
63
65
|
// currently due to the debounce we use after the page load leads to some delay in the disbaling of next button
|
|
@@ -78,7 +80,7 @@ export default function Recommendations(props) {
|
|
|
78
80
|
* Also, log the newly presented resources on the session
|
|
79
81
|
*/
|
|
80
82
|
useDebounce(() => {
|
|
81
|
-
if (activeSection !== AppRouteSections.SUMMARIZE ||
|
|
83
|
+
if (activeSection !== AppRouteSections.SUMMARIZE || isRecSearchPayloadSame) {
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
86
|
setCurrentPage(recommendationDispatch, 1);
|
|
@@ -166,8 +168,8 @@ export default function Recommendations(props) {
|
|
|
166
168
|
function getRankPercentage(decimal) {
|
|
167
169
|
return Math.round(decimal * 100);
|
|
168
170
|
}
|
|
169
|
-
const computeLabel = (
|
|
170
|
-
const percentage = getRankPercentage(
|
|
171
|
+
const computeLabel = (rerankScore) => {
|
|
172
|
+
const percentage = getRankPercentage(rerankScore);
|
|
171
173
|
return (React.createElement(React.Fragment, null,
|
|
172
174
|
percentage > 80 && (React.createElement(Label, { color: "green", className: "match-label", icon: React.createElement(StarIcon, null) }, "Best Match")),
|
|
173
175
|
React.createElement(Label, { className: "match-label", color: "purple" },
|
|
@@ -175,32 +177,35 @@ export default function Recommendations(props) {
|
|
|
175
177
|
"% Match")));
|
|
176
178
|
};
|
|
177
179
|
return (React.createElement(React.Fragment, null,
|
|
178
|
-
|
|
179
|
-
React.createElement("div", { className: "recommendation-list", ref: props.resultsRowRef },
|
|
180
|
-
|
|
180
|
+
isATestvariation && (React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) && !isEmpty(issue) })),
|
|
181
|
+
React.createElement("div", { className: "recommendation-list pf-v5-u-pt-md", ref: props.resultsRowRef },
|
|
182
|
+
isBTestvariation
|
|
181
183
|
? (recommendationState.visibleDocs.length !== 0 ||
|
|
182
|
-
recommendationState.isLoadingRecommendations) && (React.createElement(
|
|
183
|
-
React.createElement(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
184
|
+
recommendationState.isLoadingRecommendations) && (React.createElement("div", { className: `${recommendationState.isLoadingRecommendations ? 'gradient' : ''} label-container-icon` },
|
|
185
|
+
React.createElement(Label, { id: "DeepPurpleColorAILabel", className: "pf-v5-u-mb-md" },
|
|
186
|
+
recommendationState.isLoadingRecommendations ? (React.createElement(React.Fragment, null,
|
|
187
|
+
React.createElement(Spinner, { size: "sm", className: "pf-v5-u-mr-xs" }),
|
|
188
|
+
' ',
|
|
189
|
+
React.createElement(Trans, null, "Recommending articles using OpenShift AI"),
|
|
190
|
+
' ',
|
|
191
|
+
React.createElement(InfoCircleIcon, { color: "white" }))) : (React.createElement(React.Fragment, null,
|
|
192
|
+
React.createElement(WatsonxAiIcon, { fillColor: "#FFFFFF", className: "pf-v5-u-mr-xs" }),
|
|
193
|
+
' ',
|
|
194
|
+
React.createElement(Trans, null, "Articles recommended by OpenShift AI"),
|
|
195
|
+
" ",
|
|
196
|
+
infoPopover)),
|
|
197
|
+
' ')))
|
|
193
198
|
: recommendationState.visibleDocs.length !== 0 && (React.createElement(Label, { color: "purple", className: "pf-v5-u-mb-md" },
|
|
194
199
|
React.createElement(WatsonxAiIcon, { fillColor: "#6753ac", className: "pf-v5-u-mr-xs" }),
|
|
195
200
|
React.createElement(Trans, null, "Live search results powered by OpenShift AI"))),
|
|
196
|
-
|
|
201
|
+
isBTestvariation && recommendationState.isLoadingRecommendations ? ( // as much as it pains me to add these <br /> the pf docs has it this way
|
|
197
202
|
React.createElement(RecommendationsLoader, null)) : (React.createElement("ul", { className: "list-flat" }, map(recommendationState.visibleDocs, (doc, i) => {
|
|
198
203
|
var _a, _b;
|
|
199
204
|
return (React.createElement("li", { className: "result", key: doc.id },
|
|
200
205
|
React.createElement("header", { className: "result-header" },
|
|
201
206
|
React.createElement("a", { href: `${doc.view_uri}?${RouteUtils.getSEResourceQueryParams(activeSessionId, (_b = (_a = sessionResourceTracking[SessionResourceSource.RECOMMENDATIONS]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', SessionResourceSource.RECOMMENDATIONS)}`, className: "se-recommended ts-result", "data-tracking-id": `se-recommended-main-recommendations-${i}`, rel: "noopener noreferrer", target: "_blank", onClick: onResourceClick(doc, i), dangerouslySetInnerHTML: computeRecommendationTitle(doc) }),
|
|
202
207
|
React.createElement("div", { className: "header-meta" },
|
|
203
|
-
|
|
208
|
+
isBTestvariation && doc.rerank_score && computeLabel(doc.rerank_score),
|
|
204
209
|
doc.kcsState === 'verified' && (React.createElement(React.Fragment, null,
|
|
205
210
|
React.createElement("span", { className: "status-verified pf-v5-u-font-weight-bold pf-v5-u-success-color-100" }, "verified"),
|
|
206
211
|
React.createElement("span", { className: "list-separator" }, "\u2013"))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Review.d.ts","sourceRoot":"","sources":["../../../../src/components/Review/Review.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAsBlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AACD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Review.d.ts","sourceRoot":"","sources":["../../../../src/components/Review/Review.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAsBlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AACD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,qBAiF3C"}
|
|
@@ -30,9 +30,10 @@ import { EARuleWidget } from '../Recommendations/EARules/EARuleWidget';
|
|
|
30
30
|
export default function Review(props) {
|
|
31
31
|
var _a;
|
|
32
32
|
const caseDispatch = useCaseDispatch();
|
|
33
|
-
const { contactInfo24x7, product } = useCaseSelector((state) => ({
|
|
33
|
+
const { contactInfo24x7, product, ABTestVarioation } = useCaseSelector((state) => ({
|
|
34
34
|
contactInfo24x7: state.caseDetails.contactInfo24x7,
|
|
35
35
|
product: state.caseDetails.product,
|
|
36
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
36
37
|
}), isEqual);
|
|
37
38
|
const ability = useContext(AbilityContext);
|
|
38
39
|
const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
@@ -41,10 +42,11 @@ export default function Review(props) {
|
|
|
41
42
|
const onSeverityChange = (payload) => {
|
|
42
43
|
setCaseDetails(caseDispatch, payload);
|
|
43
44
|
};
|
|
45
|
+
const isATestvariation = ABTestVarioation === 'A';
|
|
44
46
|
// To check if the user is ESS Customer and Product has ESS Support
|
|
45
47
|
const isESSCustomer = isSpecialSupportOfferingEnabled((_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, selectedProduct);
|
|
46
48
|
return (React.createElement(React.Fragment, null,
|
|
47
|
-
React.createElement(EARuleWidget, null),
|
|
49
|
+
isATestvariation && React.createElement(EARuleWidget, null),
|
|
48
50
|
React.createElement("form", { className: "review-form card card-light push-bottom" },
|
|
49
51
|
React.createElement(AccountSelector, null),
|
|
50
52
|
React.createElement(OwnerSelector, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAiBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAiBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBA2V3C"}
|
|
@@ -35,12 +35,13 @@ export function SessionRestore(props) {
|
|
|
35
35
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
36
36
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
37
37
|
const { sessionRestore } = useContext(SessionRestoreStateContext);
|
|
38
|
-
const { selectedNotificationContacts, cepDetails, caseDetails, caseCreation500ErrorStatus } = useCaseSelector((state) => ({
|
|
38
|
+
const { selectedNotificationContacts, cepDetails, caseDetails, caseCreation500ErrorStatus, ABTestVarioation } = useCaseSelector((state) => ({
|
|
39
39
|
openshiftClusterID: state.caseDetails.openshiftClusterID,
|
|
40
40
|
cepDetails: state.cepDetails,
|
|
41
41
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
42
42
|
caseDetails: state.caseDetails,
|
|
43
43
|
caseCreation500ErrorStatus: state.caseCreation500ErrorStatus,
|
|
44
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
44
45
|
}), isEqual);
|
|
45
46
|
const caseDispatch = useCaseDispatch();
|
|
46
47
|
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights, referrerUrl }, } = useContext(GlobalMetadataStateContext);
|
|
@@ -90,8 +91,9 @@ export function SessionRestore(props) {
|
|
|
90
91
|
const needsNewSessionId = hasProductVersionOrSummary && isEmpty(relevantSession);
|
|
91
92
|
if (needsNewSessionId) {
|
|
92
93
|
const userAgent = getUserAgentForCaseMode(isCaseCreate);
|
|
94
|
+
const userAgentAB = userAgent + (ABTestVarioation ? '-A-1' : '-B-1');
|
|
93
95
|
let session = {
|
|
94
|
-
userAgent,
|
|
96
|
+
userAgent: userAgentAB,
|
|
95
97
|
originatingSystem: userAgent,
|
|
96
98
|
referrerUrl: referrerUrl.substring(0, SESSION_REFERRER_URL_LIMIT),
|
|
97
99
|
isInternal: loggedInUserRights.data.isInternal(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAuB1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAuB1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKnE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EA6P9D"}
|
|
@@ -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,
|
|
17
|
+
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue, ABTestVarioation, } = useCaseSelector((state) => ({
|
|
18
18
|
caseState: state,
|
|
19
19
|
caseType: state.caseDetails.caseType,
|
|
20
20
|
product: state.caseDetails.product,
|
|
@@ -30,8 +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
|
-
|
|
33
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
34
34
|
}), isEqual);
|
|
35
|
+
//&seSessionId=8e8960ac-680b-443e-bf67-9e13f2acd64e
|
|
36
|
+
const isATestvariation = ABTestVarioation === 'A';
|
|
37
|
+
const isBTestvariation = ABTestVarioation === 'B';
|
|
38
|
+
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
35
39
|
const { globalMetadataState: { allProducts, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
|
|
36
40
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
37
41
|
const { recommendationState } = useContext(RecommendationStateContext);
|
|
@@ -54,24 +58,42 @@ export function useIsSectionValid(sectionName) {
|
|
|
54
58
|
!isEmpty(accountNumber) &&
|
|
55
59
|
!isEmpty(contactSSOName) &&
|
|
56
60
|
!selectedAccountDetails.data.subscriptionAbuse;
|
|
57
|
-
if (
|
|
61
|
+
if (isBTestvariation) {
|
|
58
62
|
isValid = isValid && !isEmpty(product) && !isEmpty(version);
|
|
59
63
|
}
|
|
60
64
|
return isValid;
|
|
61
65
|
};
|
|
62
66
|
const isSummarizeSectionValid = () => {
|
|
63
|
-
|
|
64
|
-
!allProducts.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
if (isATestvariation) {
|
|
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 (isCaseCreate) {
|
|
81
|
+
//because on the summarize page for troubleshoot flow we have only product version and owner
|
|
82
|
+
let isValid = !allProducts.isFetching &&
|
|
83
|
+
!allProducts.isError &&
|
|
84
|
+
// !topContent.isFetching &&
|
|
85
|
+
// !recommendationState.isLoadingRecommendations &&
|
|
86
|
+
// summary!?.length <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
87
|
+
// issue!?.length <= ISSUE_SUMMARY_LENGTH_LIMIT &&
|
|
88
|
+
!isEmpty(product) &&
|
|
89
|
+
!isEmpty(accountNumber) &&
|
|
90
|
+
!isEmpty(contactSSOName) &&
|
|
91
|
+
!isEmpty(version);
|
|
92
|
+
return isValid;
|
|
93
|
+
}
|
|
94
|
+
else if (!isCaseCreate) {
|
|
95
|
+
return !isEmpty(product) && !isEmpty(version) && !isEmpty(accountNumber) && !isEmpty(contactSSOName);
|
|
73
96
|
}
|
|
74
|
-
return isValid;
|
|
75
97
|
};
|
|
76
98
|
const isCaseManagementSectionValid = () => {
|
|
77
99
|
const hasContactInfo24x7ValidLength = contactInfo24x7
|
|
@@ -83,6 +105,22 @@ export function useIsSectionValid(sectionName) {
|
|
|
83
105
|
hasAlternateCaseIdValidLength);
|
|
84
106
|
};
|
|
85
107
|
const isTroubleshootSectionValid = () => {
|
|
108
|
+
if (isBTestvariation) {
|
|
109
|
+
//if we are in the new experience and user is troubleshoot we give them those validity fields
|
|
110
|
+
if (!isCaseCreate) {
|
|
111
|
+
let isValid = !allProducts.isFetching &&
|
|
112
|
+
!allProducts.isError &&
|
|
113
|
+
!topContent.isFetching &&
|
|
114
|
+
!recommendationState.isLoadingRecommendations &&
|
|
115
|
+
(summary === null || summary === void 0 ? void 0 : summary.length) <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
116
|
+
(issue === null || issue === void 0 ? void 0 : issue.length) <= ISSUE_SUMMARY_LENGTH_LIMIT &&
|
|
117
|
+
!isEmpty(product) &&
|
|
118
|
+
!isEmpty(version) &&
|
|
119
|
+
!isEmpty(summary) &&
|
|
120
|
+
!isEmpty(issue);
|
|
121
|
+
return isValid;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
86
124
|
// don't check for entitled product if user is on search intent flow
|
|
87
125
|
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
88
126
|
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,EAIlB,MAAM,iCAAiC,CAAC;AASzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,2BAA2B,EAAE,OAAO,CAAC;CACxC;AAGD,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,
|
|
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,EAIlB,MAAM,iCAAiC,CAAC;AASzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,2BAA2B,EAAE,OAAO,CAAC;CACxC;AAGD,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,qBA8DjC;kBA9DQ,WAAW;;;AAgEpB,eAAe,WAAW,CAAC"}
|
|
@@ -17,19 +17,24 @@ const defaultProps = {};
|
|
|
17
17
|
function WizardAside(props) {
|
|
18
18
|
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
19
19
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
20
|
-
const { isCreatingCase, caseType, isCveModalOpened,
|
|
20
|
+
const { isCreatingCase, caseType, isCveModalOpened, ABTestVarioation } = useCaseSelector((state) => ({
|
|
21
21
|
isCreatingCase: state.isCreatingCase,
|
|
22
22
|
caseType: state.caseDetails.caseType,
|
|
23
23
|
isCveModalOpened: state.isCveModalOpened,
|
|
24
|
-
|
|
24
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
25
25
|
}), isEqual);
|
|
26
|
+
const isATestvariation = ABTestVarioation === '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 canShowEARuleWidget =
|
|
33
|
+
const canShowEARuleWidget = isATestvariation
|
|
34
|
+
? showSideBarEARuleWidgetSections.includes(activeSection)
|
|
35
|
+
: showSideBarEARuleWidgetSections.includes(activeSection) ||
|
|
36
|
+
activeSection === AppRouteSections.SUMMARIZE ||
|
|
37
|
+
activeSection === AppRouteSections.REVIEW;
|
|
33
38
|
const canShowClusterIdReportWidget = showSideBarClusterIdRuleWidgetSections.includes(activeSection);
|
|
34
39
|
const canShowFileRecommendationSectionsWidget = showSideBarFileRecommendationSections.includes(activeSection);
|
|
35
40
|
return (React.createElement("aside", null,
|
|
@@ -39,7 +44,7 @@ function WizardAside(props) {
|
|
|
39
44
|
canShowFileUploadWidget() && React.createElement(FileDiag, { className: "pf-v5-u-mb-md" }),
|
|
40
45
|
activeSection === AppRouteSections.SUMMARIZE && !isCveModalOpened && React.createElement(CveSidebar, null),
|
|
41
46
|
activeSection === AppRouteSections.TROUBLESHOOT && React.createElement(CveSidebar, null),
|
|
42
|
-
|
|
47
|
+
canShowEARuleWidget && React.createElement(EARuleWidget, null),
|
|
43
48
|
!(isIdea && activeSection === 'submit-case') && (React.createElement(AsideResults, { routeProps: props.routeProps, className: "pf-v5-u-mb-md pf-v5-u-mt-0" })),
|
|
44
49
|
canShowFileRecommendationSectionsWidget && React.createElement(InsightsResults, { isDisplayOnMain: true }),
|
|
45
50
|
React.createElement(ClusterRecommendations, { showClusterRecommendationsList: canShowClusterIdReportWidget, className: "pf-v5-u-mb-md pf-v5-u-mt-0" }))));
|
|
@@ -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":"AAaA,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,qBAyLzC"}
|
|
@@ -11,7 +11,7 @@ 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 { getConfigField, getVersionIfOnlyVersion, PCM_CONFIG_FIELD_TYPE, pendoTrackEvent, PreviousCaseTypes, } from '@rh-support/utils';
|
|
15
15
|
import findIndex from 'lodash/findIndex';
|
|
16
16
|
import isEqual from 'lodash/isEqual';
|
|
17
17
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
@@ -19,7 +19,7 @@ import { Trans } from 'react-i18next';
|
|
|
19
19
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
20
20
|
import { RouteContext } from '../../context/RouteContext';
|
|
21
21
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
22
|
-
import { submitCase } from '../../reducers/CaseReducer';
|
|
22
|
+
import { setABTestVarioation, submitCase } from '../../reducers/CaseReducer';
|
|
23
23
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
24
24
|
import RouteUtils from '../../utils/routeUtils';
|
|
25
25
|
import PreCaseConfirmationModals, { PreCaseConfirmationModalsEnum, } from '../ConfirmationModals/PreCaseConfirmationModals';
|
|
@@ -32,6 +32,7 @@ import WizardAside from './WizardAside';
|
|
|
32
32
|
import WizardMain from './WizardMain';
|
|
33
33
|
export function WizardLayout(props) {
|
|
34
34
|
const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
|
|
35
|
+
// const urlParams = getUrlParsedParams(props.routeProps.location.search);
|
|
35
36
|
const { caseCreationError, contactSSOName, caseType, product, caseState } = useCaseSelector((state) => ({
|
|
36
37
|
caseState: state,
|
|
37
38
|
caseCreationError: state.caseCreationError,
|
|
@@ -42,13 +43,14 @@ export function WizardLayout(props) {
|
|
|
42
43
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
43
44
|
const caseDispatch = useCaseDispatch();
|
|
44
45
|
const { sessionRestore: { activeSessionId, previousSessions }, } = useContext(SessionRestoreStateContext);
|
|
45
|
-
const { globalMetadataState: { allProducts, loggedInUser, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
46
|
+
const { globalMetadataState: { allProducts, loggedInUser, loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
46
47
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
47
48
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
48
49
|
const { attachmentState } = useContext(AttachmentStateContext);
|
|
49
50
|
const isAnyFileAttachedLocal = isAnyFileAttached(attachmentState.caseFiles.selectedLocalFiles);
|
|
50
51
|
const [confirmationModalType, setConfirmationModalType] = useState(null);
|
|
51
52
|
const viewedConfirmationModalsList = useRef([]);
|
|
53
|
+
const testVariationWeight = getConfigField(pcmConfig.data, 'testVariationWeightZeroToTen', PCM_CONFIG_FIELD_TYPE.STRING);
|
|
52
54
|
const closeROCMProductModal = () => {
|
|
53
55
|
const productName = 'OpenShift Container Platform';
|
|
54
56
|
// if user click on Cancel then change product selection.
|
|
@@ -110,6 +112,20 @@ export function WizardLayout(props) {
|
|
|
110
112
|
}
|
|
111
113
|
setConfirmationModalType(null);
|
|
112
114
|
};
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
// todo: check why we are getting activeSessionId = undefined
|
|
117
|
+
setABTestVarioation(caseDispatch, 'B');
|
|
118
|
+
// if (urlParams.userFlow) {
|
|
119
|
+
// setABTestVarioation(caseDispatch, urlParams.userFlow as string);
|
|
120
|
+
// } else {
|
|
121
|
+
// console.log({ activeSessionId, testVariationWeight });
|
|
122
|
+
// if (isEmpty(activeSessionId) || isEmpty(testVariationWeight)) return;
|
|
123
|
+
// const sessionItem = previousSessions.data[activeSessionId];
|
|
124
|
+
// const weight = parseInt(testVariationWeight, 10);
|
|
125
|
+
// setABTestVarioation(caseDispatch, trafficSplit(weight, sessionItem.session.createdDate!));
|
|
126
|
+
// }
|
|
127
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
128
|
+
}, [activeSessionId, previousSessions, testVariationWeight]);
|
|
113
129
|
// Loading app metadata
|
|
114
130
|
useEffect(() => {
|
|
115
131
|
fetchProducts(dispatchToGlobalMetadataReducer, contactSSOName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAOA,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,
|
|
1
|
+
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAOA,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,qBAmRtC;kBAnRQ,gBAAgB;;;AAqRzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -31,11 +31,14 @@ function WizardNavigation(props) {
|
|
|
31
31
|
const { t } = useTranslation();
|
|
32
32
|
const canCreateCase = useCanCreateCase();
|
|
33
33
|
const { recommendationState } = useContext(RecommendationStateContext);
|
|
34
|
-
const { routeState: { activeSection, isNextBtnClickedToShowValidationError, noValidEntitlement, isSearchIntent }, } = useContext(RouteContext);
|
|
34
|
+
const { routeState: { activeSection, isNextBtnClickedToShowValidationError, noValidEntitlement, isSearchIntent, isCaseCreate, }, } = useContext(RouteContext);
|
|
35
35
|
const { globalMetadataState: { loggedInUsersAccount, allProducts, navBarRef }, } = useContext(GlobalMetadataStateContext);
|
|
36
|
-
const { caseState } = useCaseSelector((state) => ({
|
|
36
|
+
const { caseState, ABTestVarioation } = useCaseSelector((state) => ({
|
|
37
37
|
caseState: state,
|
|
38
|
+
ABTestVarioation: state.ABTestVarioation,
|
|
38
39
|
}), isEqual);
|
|
40
|
+
const isATestvariation = ABTestVarioation === 'A';
|
|
41
|
+
const isBTestvariation = ABTestVarioation === 'B';
|
|
39
42
|
// To check if the user is entitled or not
|
|
40
43
|
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
44
|
const dispatchToRouteReducer = useContext(RouteDispatchContext);
|
|
@@ -54,7 +57,7 @@ function WizardNavigation(props) {
|
|
|
54
57
|
props.userClickedNextonRecommendationsFn(false);
|
|
55
58
|
props.setUserScrolledLabel(false);
|
|
56
59
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
-
}, []);
|
|
60
|
+
}, [recommendationState.isLoadingRecommendations]);
|
|
58
61
|
useEffect(() => {
|
|
59
62
|
if (props.activeStep.id === AppRouteSections.TROUBLESHOOT) {
|
|
60
63
|
window.scrollTo({
|
|
@@ -175,14 +178,27 @@ function WizardNavigation(props) {
|
|
|
175
178
|
}
|
|
176
179
|
catch (e) { }
|
|
177
180
|
});
|
|
181
|
+
const nextButtonDisabledLogic = () => {
|
|
182
|
+
if (isATestvariation) {
|
|
183
|
+
let value = (!props.userSeenRecommendations && props.activeStep.id === AppRouteSections.SUMMARIZE) ||
|
|
184
|
+
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
185
|
+
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
186
|
+
noValidEntitlement;
|
|
187
|
+
return value;
|
|
188
|
+
}
|
|
189
|
+
else if (isBTestvariation && !isCaseCreate) {
|
|
190
|
+
let value = (!props.userSeenRecommendations && props.activeStep.id === AppRouteSections.TROUBLESHOOT) ||
|
|
191
|
+
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
192
|
+
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
193
|
+
noValidEntitlement;
|
|
194
|
+
return value;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
178
197
|
// To handle entitled products
|
|
179
198
|
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
180
199
|
return (React.createElement(React.Fragment, null,
|
|
181
200
|
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" }, t('Go back'))),
|
|
182
|
-
React.createElement("button", { disabled: (
|
|
183
|
-
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
184
|
-
(!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
|
|
185
|
-
noValidEntitlement, onClick: onNext, className: "btn btn-app btn-primary main-nav-button", "data-tracking-id": `next-of-${activeSection}`, type: "button" }, t(props.activeStep.nextButtonLabel)),
|
|
201
|
+
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
202
|
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
203
|
React.createElement(RecommendationFeedbackModal, { isModalOpen: isRecsModalVisible, handleModalToggle: onRecsFeedbackModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
|
|
188
204
|
activeSectionError ? (React.createElement("small", { className: "pf-v5-u-align-self-center pf-v5-u-ml-md text-red" }, activeSectionError)) : null));
|
|
@@ -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":"AAcA,OAAO,EAAE,0BAA0B,EAAkB,MAAM,iCAAiC,CAAC;AAI7F,wBAAgB,eAAe;;EAmI9B"}
|
|
@@ -14,16 +14,16 @@ import isArray from 'lodash/isArray';
|
|
|
14
14
|
import isEmpty from 'lodash/isEmpty';
|
|
15
15
|
import isEqual from 'lodash/isEqual';
|
|
16
16
|
import map from 'lodash/map';
|
|
17
|
+
import slice from 'lodash/slice';
|
|
17
18
|
import sortBy from 'lodash/sortBy';
|
|
18
|
-
import
|
|
19
|
+
import uniqBy from 'lodash/uniqBy';
|
|
20
|
+
import { useEffect, useState } from 'react';
|
|
19
21
|
import { useCaseDispatch, useCaseSelector } from '../context/CaseContext';
|
|
20
|
-
import { RecommendationStateContext } from '../context/RecommendationContext';
|
|
21
22
|
import { setCaseState } from '../reducers/CaseReducer';
|
|
22
23
|
import { findCVEsInString } from '../utils/caseUtils';
|
|
23
24
|
// custom hook for CVE workflow data .
|
|
24
25
|
export function useFetchCVEData() {
|
|
25
26
|
const caseDispatch = useCaseDispatch();
|
|
26
|
-
const { recommendationState } = useContext(RecommendationStateContext);
|
|
27
27
|
const [cveRecommendation, setCveRecommendation] = useState([]);
|
|
28
28
|
const { product, version, summary, description } = useCaseSelector((state) => ({
|
|
29
29
|
product: state.caseDetails.product,
|
|
@@ -44,11 +44,15 @@ export function useFetchCVEData() {
|
|
|
44
44
|
var _a, _b;
|
|
45
45
|
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();
|
|
46
46
|
const productVersionMatchConditions = product === selectedProductLower ||
|
|
47
|
+
product === `red hat ${selectedProductLower}` ||
|
|
47
48
|
product === `${selectedProductLower} ${selectedVersionLower}` ||
|
|
48
|
-
|
|
49
|
+
product === `red hat ${selectedProductLower} ${selectedVersionLower}` ||
|
|
50
|
+
(majorVersion && product === `${selectedProductLower} ${majorVersion}`) ||
|
|
51
|
+
(majorVersion && product === `red hat ${selectedProductLower} ${majorVersion}`);
|
|
49
52
|
return productVersionMatchConditions && (obj === null || obj === void 0 ? void 0 : obj.state) === 'Fixed';
|
|
50
53
|
});
|
|
51
|
-
|
|
54
|
+
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; });
|
|
55
|
+
const errataData = map(uniqFilteredArray, (i) => {
|
|
52
56
|
var _a;
|
|
53
57
|
return ({
|
|
54
58
|
package: (i === null || i === void 0 ? void 0 : i.package) || '',
|
|
@@ -59,6 +63,7 @@ export function useFetchCVEData() {
|
|
|
59
63
|
product: (i === null || i === void 0 ? void 0 : i.product) || '',
|
|
60
64
|
});
|
|
61
65
|
});
|
|
66
|
+
return slice(errataData, 0, 3);
|
|
62
67
|
};
|
|
63
68
|
const sortCveResult = (cveData) => {
|
|
64
69
|
if (isEmpty(cveData)) {
|
|
@@ -106,7 +111,7 @@ export function useFetchCVEData() {
|
|
|
106
111
|
const cveIds = findCVEsInString(CVETextValue);
|
|
107
112
|
fetchCVEData(cveIds)
|
|
108
113
|
.then((results) => {
|
|
109
|
-
const sortedData = sortCveResult(results);
|
|
114
|
+
const sortedData = slice(sortCveResult(results), 0, 4);
|
|
110
115
|
const processedData = map(sortedData, ({ data }) => {
|
|
111
116
|
var _a, _b, _c, _d;
|
|
112
117
|
return ({
|
|
@@ -116,6 +121,8 @@ export function useFetchCVEData() {
|
|
|
116
121
|
mitigation: data === null || data === void 0 ? void 0 : data.field_cve_mitigation_text,
|
|
117
122
|
details: (_b = data === null || data === void 0 ? void 0 : data.field_cve_details_text) === null || _b === void 0 ? void 0 : _b.value,
|
|
118
123
|
cveLink: (_c = data === null || data === void 0 ? void 0 : data.path) === null || _c === void 0 ? void 0 : _c.replace(/\\/g, ''),
|
|
124
|
+
type: (data === null || data === void 0 ? void 0 : data.type) || 'cve',
|
|
125
|
+
nid: (data === null || data === void 0 ? void 0 : data.nid) || '',
|
|
119
126
|
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),
|
|
120
127
|
});
|
|
121
128
|
}).filter((d) => d.severity !== 'Low');
|
|
@@ -128,6 +135,6 @@ export function useFetchCVEData() {
|
|
|
128
135
|
console.error('Error processing CVE data:', error);
|
|
129
136
|
});
|
|
130
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
|
-
}, [summary, description, product, version
|
|
138
|
+
}, [summary, description, product, version]);
|
|
132
139
|
return { cveRecommendation };
|
|
133
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWizard.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWizard.tsx"],"names":[],"mappings":"AAmCA,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":"AAmCA,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;iCAsSb,OAAO;EAwC7C"}
|
|
@@ -57,6 +57,27 @@ export function useWizard(routeProps, props) {
|
|
|
57
57
|
return props.userScrolledLabel;
|
|
58
58
|
};
|
|
59
59
|
const canChangeAccountInfo = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ACCOUNT_AND_OWNER);
|
|
60
|
+
const summarizeButtonLabel = () => {
|
|
61
|
+
if (isCaseCreate) {
|
|
62
|
+
const shouldContinue = (summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
|
|
63
|
+
!isEmpty(issue);
|
|
64
|
+
return shouldContinue ? t('Continue') : t('See more options');
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return t('Continue');
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const informationButtonLabel = () => {
|
|
71
|
+
if (!isCaseCreate) {
|
|
72
|
+
(summarizeNextButtonLabelLogic() || ((props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) && numFound < 3)) &&
|
|
73
|
+
!isEmpty(issue) // do this so that when user refreshes tab and state persists we don't cause edge 'continue' render
|
|
74
|
+
? t('Continue')
|
|
75
|
+
: t('See more options');
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return t('Continue');
|
|
79
|
+
}
|
|
80
|
+
};
|
|
60
81
|
// components that are used in wizard steps
|
|
61
82
|
const appRouteConfugurations = {
|
|
62
83
|
[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.') },
|
|
@@ -69,16 +90,13 @@ export function useWizard(routeProps, props) {
|
|
|
69
90
|
canChangeAccountInfo && !isCaseCreate && (React.createElement(React.Fragment, null,
|
|
70
91
|
React.createElement(AccountSelector, { "data-tracking-id": "get-support-account-selector" }),
|
|
71
92
|
React.createElement(OwnerSelector, { "data-tracking-id": "get-support-owner-selector" }))),
|
|
72
|
-
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: (
|
|
73
|
-
!isEmpty(issue) // do this so that when user refreshes tab and state persists we don't cause edge 'continue' render
|
|
74
|
-
? t('Continue')
|
|
75
|
-
: t('See more options') }),
|
|
93
|
+
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: summarizeButtonLabel() }),
|
|
76
94
|
[AppRouteSections.TROUBLESHOOT]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.TROUBLESHOOT, name: t('Troubleshoot'), component: (React.createElement(MainSection, { stepNumber: 3, totalSteps: 6, section: AppRouteSections.TROUBLESHOOT, title: t('Recommendations') },
|
|
77
95
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
78
96
|
alertMessage(),
|
|
79
97
|
React.createElement(TroubleshootSection, null)))), canJumpTo: isSectionValidFn(AppRouteSections.TROUBLESHOOT || activeSection === AppRouteSections.TROUBLESHOOT) &&
|
|
80
98
|
(props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) &&
|
|
81
|
-
(props === null || props === void 0 ? void 0 : props.userCanNavigateToTroubleshoot), nextButtonLabel:
|
|
99
|
+
(props === null || props === void 0 ? void 0 : props.userCanNavigateToTroubleshoot), nextButtonLabel: informationButtonLabel() }),
|
|
82
100
|
[AppRouteSections.DESCRIBE_MORE]: Object.assign(Object.assign({}, defaultRouteConfiguration), { id: AppRouteSections.DESCRIBE_MORE, name: t('Describe more'), component: (React.createElement(MainSection, { stepNumber: 4, totalSteps: 6, section: AppRouteSections.DESCRIBE_MORE, title: React.createElement(React.Fragment, null,
|
|
83
101
|
t('Case information'),
|
|
84
102
|
isEmpty(RouteUtils.seBasePath) && isSelectedAccounntSecureSupport && (React.createElement("span", { className: "secured-support" },
|
|
@@ -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"}
|