@rh-support/troubleshoot 2.2.170 → 2.2.172
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/ProductSelector/ProductSelector.d.ts +2 -0
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +1 -1
- package/lib/esm/components/Recommendations/Recommendations.d.ts +2 -0
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +4 -6
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +9 -2
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +5 -0
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +63 -3
- package/lib/esm/hooks/useWizard.d.ts +3 -0
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +10 -3
- package/lib/esm/i18n/template-jp.js +1 -1
- package/package.json +2 -2
|
@@ -4,6 +4,8 @@ import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
|
4
4
|
interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
6
|
userSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
|
|
7
|
+
userClickedNextonRecommendations: boolean;
|
|
8
|
+
resultsRowRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* Responsible for:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACzE,gCAAgC,EAAE,OAAO,CAAC;IAC1C,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAChE;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAsFpD"}
|
|
@@ -52,5 +52,5 @@ export default function ProductSelector(props) {
|
|
|
52
52
|
React.createElement(EARuleWidget, null)),
|
|
53
53
|
React.createElement("div", { className: "suggestions-result-section" },
|
|
54
54
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
|
|
55
|
-
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations })))))))));
|
|
55
|
+
React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef })))))))));
|
|
56
56
|
}
|
|
@@ -4,6 +4,8 @@ import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
|
4
4
|
interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
6
|
userSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
|
|
7
|
+
userClickedNextonRecommendationsValue?: boolean;
|
|
8
|
+
resultsRowRef: any;
|
|
7
9
|
}
|
|
8
10
|
export default function Recommendations(props: IProps): React.JSX.Element;
|
|
9
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAelE,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAWpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACzE,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAyRpD"}
|
|
@@ -2,7 +2,7 @@ import { pcm } from '@cee-eng/hydrajs';
|
|
|
2
2
|
import { Label, Pagination, PaginationVariant } from '@patternfly/react-core';
|
|
3
3
|
import { LoadingDots, useDebounce, usePrevious } from '@rh-support/components';
|
|
4
4
|
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
5
|
-
import { computeRecommendationAbstract, computeRecommendationTitle, dtmTrackEventCaseStartStopped, formatDate,
|
|
5
|
+
import { computeRecommendationAbstract, computeRecommendationTitle, dtmTrackEventCaseStartStopped, formatDate, } from '@rh-support/utils';
|
|
6
6
|
import differenceBy from 'lodash/differenceBy';
|
|
7
7
|
import isEmpty from 'lodash/isEmpty';
|
|
8
8
|
import isEqual from 'lodash/isEqual';
|
|
@@ -35,12 +35,11 @@ export default function Recommendations(props) {
|
|
|
35
35
|
const caseDispatch = useCaseDispatch();
|
|
36
36
|
// Use Case Number
|
|
37
37
|
const { caseNumber } = useParams();
|
|
38
|
-
const { globalMetadataState: {
|
|
38
|
+
const { globalMetadataState: { loggedInUsersAccount }, } = useGlobalStateContext();
|
|
39
39
|
const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
|
|
40
40
|
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
41
41
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
42
42
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
43
|
-
const resultRowRef = useRef(null);
|
|
44
43
|
const [pageSize, setPageSize] = useState(null);
|
|
45
44
|
const { recommendationState } = useContext(RecommendationStateContext);
|
|
46
45
|
const prevMainRecommendations = usePrevious((_a = recommendationState === null || recommendationState === void 0 ? void 0 : recommendationState.visibleDocs) !== null && _a !== void 0 ? _a : []);
|
|
@@ -109,7 +108,7 @@ export default function Recommendations(props) {
|
|
|
109
108
|
useEffect(() => {
|
|
110
109
|
props.userSeenRecommendations && props.userSeenRecommendations(!recommendationState.isLoadingRecommendations);
|
|
111
110
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
112
|
-
}, [recommendationState
|
|
111
|
+
}, [recommendationState]);
|
|
113
112
|
useEffect(() => {
|
|
114
113
|
if (recommendationState.isLoadingRecommendations)
|
|
115
114
|
return;
|
|
@@ -138,7 +137,6 @@ export default function Recommendations(props) {
|
|
|
138
137
|
};
|
|
139
138
|
const onPaginationChange = () => {
|
|
140
139
|
const p = recommendationState.currentPage;
|
|
141
|
-
scrollIntoView(resultRowRef, { navBarRef, timeout: 0, onlyIfNotInViewport: true, offset: 30 });
|
|
142
140
|
const visDocs = recommendationState.allDocs.slice((p - 1) * recPageSize, (p - 1) * recPageSize + recPageSize);
|
|
143
141
|
setVisibleDocs(recommendationDispatch, visDocs);
|
|
144
142
|
};
|
|
@@ -154,7 +152,7 @@ export default function Recommendations(props) {
|
|
|
154
152
|
};
|
|
155
153
|
return (React.createElement(React.Fragment, null,
|
|
156
154
|
React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) && !isEmpty(issue) }),
|
|
157
|
-
React.createElement("div", { className: "recommendation-list pf-v5-u-pt-md", ref:
|
|
155
|
+
React.createElement("div", { className: "recommendation-list pf-v5-u-pt-md", ref: props.resultsRowRef },
|
|
158
156
|
recommendationState.visibleDocs.length !== 0 && (React.createElement(Label, { color: "purple", className: "pf-v5-u-mb-md" },
|
|
159
157
|
React.createElement(WatsonxAiIcon, { fillColor: "#6753ac", className: "pf-v5-u-mr-xs" }),
|
|
160
158
|
React.createElement(Trans, null, "Live search results powered by OpenShift AI"))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAQpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5E;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAmIhC;AACD,eAAe,UAAU,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Wizard, WizardContextConsumer, WizardFooter } from '@patternfly/react-core/deprecated';
|
|
2
2
|
import { LoadingIndicator } from '@rh-support/components';
|
|
3
3
|
import isEqual from 'lodash/isEqual';
|
|
4
|
-
import React, { Suspense, useContext, useState } from 'react';
|
|
4
|
+
import React, { Suspense, useContext, useRef, useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { Route } from 'react-router-dom';
|
|
7
7
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
@@ -20,15 +20,22 @@ function WizardMain(props) {
|
|
|
20
20
|
isCreatingCase: state.isCreatingCase,
|
|
21
21
|
}), isEqual);
|
|
22
22
|
const [userSeenRecommendations, setUserSeenRecommendations] = useState(false);
|
|
23
|
+
const [userClickedNextonRecommendations, setUserClickedNextonRecommendations] = useState(false);
|
|
24
|
+
const [userScrolledLabel, setUserScrolledLabel] = useState(false);
|
|
25
|
+
const resultsRowRef = useRef(null);
|
|
23
26
|
const { getStepsSequece } = useWizard(props.routeProps, {
|
|
24
27
|
userSeenRecommendationsfn: setUserSeenRecommendations,
|
|
25
28
|
userSeenRecommendationsValue: userSeenRecommendations,
|
|
29
|
+
userClickedNextonRecommendationsValue: userClickedNextonRecommendations,
|
|
30
|
+
resultsRowRef: resultsRowRef,
|
|
31
|
+
userScrolledLabel: userScrolledLabel,
|
|
26
32
|
});
|
|
27
33
|
const dispatchToRouteReducer = useContext(RouteDispatchContext);
|
|
28
34
|
const { t } = useTranslation();
|
|
29
35
|
const renderSubmitCasePage = () => (React.createElement(MainSection, { section: AppRouteSections.SUBMIT_CASE, title: t('Case has been submitted'), isLoading: isCreatingCase, description: t("We'll be in contact with you shortly. Look for updates on this case."), className: "case-submit-page" },
|
|
30
36
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
31
37
|
React.createElement(SubmitCase, { routeProps: props.routeProps }))));
|
|
38
|
+
// To focus the wizard main
|
|
32
39
|
const focusWizardMainPanel = () => {
|
|
33
40
|
setTimeout(() => {
|
|
34
41
|
var _a;
|
|
@@ -59,7 +66,7 @@ function WizardMain(props) {
|
|
|
59
66
|
}, onBack: () => {
|
|
60
67
|
onBack();
|
|
61
68
|
focusWizardMainPanel();
|
|
62
|
-
}, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations }));
|
|
69
|
+
}, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, setUserSeenRecommendations: setUserSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel }));
|
|
63
70
|
})));
|
|
64
71
|
// To add a new step to wizard first need to add the component to appRouteConfugurations
|
|
65
72
|
// in useWizard file then add it to step squences in RouteConstNTypes
|
|
@@ -10,6 +10,11 @@ interface IProps {
|
|
|
10
10
|
confirmSupportModal: (hasPreferredSecureSupportAccount: boolean) => void;
|
|
11
11
|
onShowRestUpdate: (flag: boolean) => void;
|
|
12
12
|
userSeenRecommendations?: boolean;
|
|
13
|
+
setUserSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
|
|
14
|
+
userClickedNextonRecommendationsFn?: (value: React.SetStateAction<boolean>) => void;
|
|
15
|
+
userClickedNextonRecommendationsValue?: boolean;
|
|
16
|
+
resultsRowRef?: any;
|
|
17
|
+
setUserScrolledLabel: (value: React.SetStateAction<boolean>) => void;
|
|
13
18
|
}
|
|
14
19
|
declare function WizardNavigation(props: IProps): React.JSX.Element;
|
|
15
20
|
declare namespace WizardNavigation {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAOA,OAAO,
|
|
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,cAAc,CAAC;AAOnD,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,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,qBAwOtC;kBAxOQ,gBAAgB;;;AA0OzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -11,12 +11,13 @@ import { pcm } from '@cee-eng/hydrajs';
|
|
|
11
11
|
import { Button, ButtonVariant } from '@patternfly/react-core';
|
|
12
12
|
import { useFetch } from '@rh-support/components';
|
|
13
13
|
import { GlobalMetadataStateContext, useCanCreateCase } from '@rh-support/react-context';
|
|
14
|
-
import { dtmTrackEventCaseStartStopped, getResTypeFromUrl } from '@rh-support/utils';
|
|
14
|
+
import { dtmTrackEventCaseStartStopped, getResTypeFromUrl, scrollIntoView } from '@rh-support/utils';
|
|
15
15
|
import find from 'lodash/find';
|
|
16
16
|
import isEqual from 'lodash/isEqual';
|
|
17
|
-
import React, { useContext, useState } from 'react';
|
|
17
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
19
19
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
20
|
+
import { RecommendationStateContext } from '../../context/RecommendationContext';
|
|
20
21
|
import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
|
|
21
22
|
import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
22
23
|
import { setCaseState } from '../../reducers/CaseReducer';
|
|
@@ -29,8 +30,9 @@ function WizardNavigation(props) {
|
|
|
29
30
|
var _a, _b;
|
|
30
31
|
const { t } = useTranslation();
|
|
31
32
|
const canCreateCase = useCanCreateCase();
|
|
33
|
+
const { recommendationState } = useContext(RecommendationStateContext);
|
|
32
34
|
const { routeState: { activeSection, isNextBtnClickedToShowValidationError, noValidEntitlement, isSearchIntent }, } = useContext(RouteContext);
|
|
33
|
-
const { globalMetadataState: { loggedInUsersAccount, allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
35
|
+
const { globalMetadataState: { loggedInUsersAccount, allProducts, navBarRef }, } = useContext(GlobalMetadataStateContext);
|
|
34
36
|
const { caseState } = useCaseSelector((state) => ({
|
|
35
37
|
caseState: state,
|
|
36
38
|
}), isEqual);
|
|
@@ -46,9 +48,67 @@ function WizardNavigation(props) {
|
|
|
46
48
|
isFileRecommendationsTriggered: state.isFileRecommendationsTriggered,
|
|
47
49
|
}), isEqual);
|
|
48
50
|
const caseDispatch = useCaseDispatch();
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
// we need this because when the user hits the troubleshoot tab, we only refresh the children but the state is managed in the parent
|
|
53
|
+
props.setUserSeenRecommendations(false);
|
|
54
|
+
props.userClickedNextonRecommendationsFn(false);
|
|
55
|
+
props.setUserScrolledLabel(false);
|
|
56
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
+
}, []);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (props.activeStep.id === AppRouteSections.TROUBLESHOOT) {
|
|
60
|
+
window.scrollTo({
|
|
61
|
+
top: 0,
|
|
62
|
+
behavior: 'instant',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
|
+
}, [props.activeStep.id]);
|
|
67
|
+
const [hasUserScrolled, setHasUserScrolled] = useState(false);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (props.activeStep.id !== AppRouteSections.SUMMARIZE || recommendationState.numFound <= 2) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
73
|
+
if (entry.isIntersecting) {
|
|
74
|
+
setHasUserScrolled(true);
|
|
75
|
+
props.setUserScrolledLabel(true);
|
|
76
|
+
if (props.userClickedNextonRecommendationsFn) {
|
|
77
|
+
props.userClickedNextonRecommendationsFn(true);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
root: null,
|
|
82
|
+
threshold: 0.6, // trigger when 60% of element in view
|
|
83
|
+
});
|
|
84
|
+
const resultsRowElement = props.resultsRowRef.current;
|
|
85
|
+
if (resultsRowElement) {
|
|
86
|
+
observer.observe(resultsRowElement);
|
|
87
|
+
}
|
|
88
|
+
return () => {
|
|
89
|
+
if (resultsRowElement) {
|
|
90
|
+
observer.unobserve(resultsRowElement);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}, [recommendationState.numFound, setHasUserScrolled, props]);
|
|
49
94
|
const onNext = () => {
|
|
50
95
|
var _a;
|
|
51
96
|
updateisNextBtnClickedToShowValidationError(dispatchToRouteReducer, true);
|
|
97
|
+
//handle the new changes for 13406:
|
|
98
|
+
if (props.activeStep.id === AppRouteSections.SUMMARIZE && recommendationState.numFound > 2) {
|
|
99
|
+
if (!props.userClickedNextonRecommendationsValue) {
|
|
100
|
+
if (!hasUserScrolled) {
|
|
101
|
+
scrollIntoView(props.resultsRowRef, {
|
|
102
|
+
navBarRef,
|
|
103
|
+
timeout: 0,
|
|
104
|
+
onlyIfNotInViewport: true,
|
|
105
|
+
offset: 120,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
props.userClickedNextonRecommendationsFn && props.userClickedNextonRecommendationsFn(true);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
52
112
|
const userCanNotOpenCase = props.activeStep.id === AppRouteSections.TROUBLESHOOT && canCreateCase.alert();
|
|
53
113
|
if (userCanNotOpenCase || !isSectionValidFn(props.activeStep.id))
|
|
54
114
|
return;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
interface IProps {
|
|
2
2
|
userSeenRecommendationsfn?: any;
|
|
3
3
|
userSeenRecommendationsValue: boolean;
|
|
4
|
+
userClickedNextonRecommendationsValue: boolean;
|
|
5
|
+
resultsRowRef: any;
|
|
6
|
+
userScrolledLabel: boolean;
|
|
4
7
|
}
|
|
5
8
|
export declare function useWizard(routeProps: any, props?: IProps): {
|
|
6
9
|
getStepsSequece: (showRest?: boolean) => any;
|
|
@@ -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;
|
|
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,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;iCAgQb,OAAO;EAwC7C"}
|
|
@@ -23,7 +23,7 @@ export function useWizard(routeProps, props) {
|
|
|
23
23
|
const { routeState: { activeSection, isSearchIntent, isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
|
|
24
24
|
// state value was available later - reading dirctly from url
|
|
25
25
|
const isCaseCreate = RouteUtils.getQueryParams(routeProps).caseCreate === 'true';
|
|
26
|
-
const { recommendationState: { isLoadingRecommendations }, } = useContext(RecommendationStateContext);
|
|
26
|
+
const { recommendationState: { isLoadingRecommendations, numFound }, } = useContext(RecommendationStateContext);
|
|
27
27
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
28
28
|
const { isSelectedAccounntSecureSupport, summary, caseType, issue } = useCaseSelector((state) => ({
|
|
29
29
|
isSelectedAccounntSecureSupport: state.selectedAccountDetails.data.secureSupport,
|
|
@@ -49,6 +49,9 @@ export function useWizard(routeProps, props) {
|
|
|
49
49
|
? AlertType.INFO
|
|
50
50
|
: AlertType.DANGER, isInline: true, title: title, className: "pf-v5-u-mb-lg", "data-tracking-id": isLoading ? 'wait-recommendations-loading' : 'proceed-address-errors' }));
|
|
51
51
|
};
|
|
52
|
+
let summarizeNextButtonLabelLogic = () => {
|
|
53
|
+
return props.userClickedNextonRecommendationsValue || props.userScrolledLabel;
|
|
54
|
+
};
|
|
52
55
|
// components that are used in wizard steps
|
|
53
56
|
const appRouteConfugurations = {
|
|
54
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,12 +61,16 @@ export function useWizard(routeProps, props) {
|
|
|
58
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?') },
|
|
59
62
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
60
63
|
alertMessage(),
|
|
61
|
-
React.createElement(ProductSelector, { routeProps: routeProps, userSeenRecommendations: props.userSeenRecommendationsfn })))), canJumpTo: isSectionValidFn(AppRouteSections.SUMMARIZE) || activeSection === AppRouteSections.SUMMARIZE, nextButtonLabel:
|
|
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) // do this so that when user refreshes tab and state persists we don't cause edge 'continue' render
|
|
66
|
+
? t('Continue')
|
|
67
|
+
: t('See more options') }),
|
|
62
68
|
[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') },
|
|
63
69
|
React.createElement(Suspense, { fallback: React.createElement(LoadingIndicator, { size: "sm" }) },
|
|
64
70
|
alertMessage(),
|
|
65
71
|
React.createElement(TroubleshootSection, null)))), canJumpTo: isSectionValidFn(AppRouteSections.TROUBLESHOOT || activeSection === AppRouteSections.TROUBLESHOOT) &&
|
|
66
|
-
(props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue)
|
|
72
|
+
(props === null || props === void 0 ? void 0 : props.userSeenRecommendationsValue) &&
|
|
73
|
+
props.userClickedNextonRecommendationsValue, nextButtonLabel: isCaseCreate ? t('Continue') : t('Convert to Case') }),
|
|
67
74
|
[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,
|
|
68
75
|
t('Case information'),
|
|
69
76
|
isEmpty(RouteUtils.seBasePath) && isSelectedAccounntSecureSupport && (React.createElement("span", { className: "secured-support" },
|
|
@@ -431,7 +431,7 @@ export default {
|
|
|
431
431
|
'The customer thinks the case is not moving appropriately': 'ケースが適切に処理されていないとお客様が判断された場合',
|
|
432
432
|
'The customer wants a new resource': 'お客様が新規リソースを希望される場合',
|
|
433
433
|
'The issue is more severe than originally thought': '当初の判断より問題が深刻な場合',
|
|
434
|
-
Title: '
|
|
434
|
+
Title: '件名 (問題の概要)',
|
|
435
435
|
Email: '電子メール',
|
|
436
436
|
Phone: '電話',
|
|
437
437
|
IRC: 'IRC',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.172",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
"defaults and supports es6-module",
|
|
132
132
|
"maintained node versions"
|
|
133
133
|
],
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "0ea5806f9d702fa69d66245c813ee1b0f887c0f7"
|
|
135
135
|
}
|