@rh-support/troubleshoot 2.2.169 → 2.2.171

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseInformation.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAkE5C"}
1
+ {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseInformation.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAwD5C"}
@@ -1,7 +1,6 @@
1
1
  import { encodeAngularBrackets, linkifyBZIDs, linkifyWithCaseIDs } from '@cee-eng/ui-toolkit';
2
2
  import { MoreOrLess } from '@rh-support/components';
3
3
  import { useGlobalStateContext } from '@rh-support/react-context';
4
- import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
5
4
  import { PreviousCaseTypes } from '@rh-support/utils';
6
5
  import DOMPurify from 'dompurify';
7
6
  import isEqual from 'lodash/isEqual';
@@ -9,7 +8,6 @@ import React from 'react';
9
8
  import { Trans } from 'react-i18next';
10
9
  import { useCaseSelector } from '../../../../context/CaseContext';
11
10
  import { KtQuestionConstant } from '../../../../reducers/CaseConstNTypes';
12
- import EditDescription from '../../../EditDescription/EditDescription';
13
11
  import { CaseHostname } from './CaseHostname';
14
12
  import { CaseOpenshiftClusterId } from './CaseOpenshiftClusterId/CaseOpenshiftClusterId';
15
13
  import ProductVersion from './ProductVersion';
@@ -33,17 +31,20 @@ export function CaseInformation(props) {
33
31
  text = linkifyBZIDs(text);
34
32
  return { __html: DOMPurify.sanitize(text) };
35
33
  };
36
- const canEditDescription = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_DESCRIPTION);
34
+ /**
35
+ * JIRA: https://issues.redhat.com/browse/PCM-13457
36
+ * As per our current requirements, the description field should not be editable by users.
37
+ * Therefore, we are removing the edit functionality for this field.
38
+ */
37
39
  return (React.createElement("section", { className: "card card-sm card-white" },
38
40
  React.createElement("form", null,
39
41
  React.createElement(ProductVersion, null),
40
42
  React.createElement(CaseOpenshiftClusterId, null),
41
43
  React.createElement(CaseHostname, { inlineEditable: true }),
42
- React.createElement("div", { className: "form-group" }, !canEditDescription ? (React.createElement(React.Fragment, null,
44
+ React.createElement("div", { className: "form-group" },
43
45
  React.createElement("label", { htmlFor: "case-description" },
44
46
  React.createElement(Trans, null, "Description")),
45
47
  React.createElement(MoreOrLess, { maxHeight: 600, appStickyHeaderRef: navBarRef },
46
48
  React.createElement("pre", { id: "case-description" },
47
- React.createElement("div", { dangerouslySetInnerHTML: linkifiedDescription(replaceDescriptionHeading(description)) }))))) : (React.createElement(MoreOrLess, { maxHeight: 600, appStickyHeaderRef: navBarRef },
48
- React.createElement(EditDescription, { inlineEditable: true })))))));
49
+ React.createElement("div", { dangerouslySetInnerHTML: linkifiedDescription(replaceDescriptionHeading(description)) })))))));
49
50
  }
@@ -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;CAC5E;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAoFpD"}
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":"AAmBA,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;CAC5E;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBA0RpD"}
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, scrollIntoView, } from '@rh-support/utils';
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: { navBarRef, loggedInUsersAccount }, } = useGlobalStateContext();
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.isLoadingRecommendations]);
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: resultRowRef },
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"))),
@@ -37,15 +37,14 @@ function TroubleshootSection(props) {
37
37
  React.createElement("section", null,
38
38
  React.createElement("header", null,
39
39
  React.createElement("p", { className: "pf-v5-u-pt-md" },
40
- React.createElement("span", { className: "pf-v5-u-font-family-heading pf-v5-u-pr-xs" }, "Product"),
40
+ React.createElement("span", { className: "pf-v5-u-font-family-heading pf-v5-u-pr-xs" }, t('Product')),
41
41
  " ",
42
42
  product,
43
- React.createElement("span", { className: "pf-v5-u-font-family-heading pf-v5-u-ml-xl pf-v5-u-pr-xs" }, "Version"),
44
- ' ',
43
+ React.createElement("span", { className: "pf-v5-u-font-family-heading pf-v5-u-ml-xl pf-v5-u-pr-xs" }, t('Version')),
45
44
  version),
46
- React.createElement("div", { className: "pf-v5-u-font-family-heading" }, "Title"),
45
+ React.createElement("div", { className: "pf-v5-u-font-family-heading" }, t('Title')),
47
46
  React.createElement("p", null, summary),
48
- React.createElement("div", { className: "pf-v5-u-font-family-heading" }, "Problem description"),
47
+ React.createElement("div", { className: "pf-v5-u-font-family-heading" }, t('Problem description')),
49
48
  React.createElement("p", { className: "pf-v5-u-mb-xl" },
50
49
  React.createElement(MoreOrLess, { maxHeight: 93 }, issue))),
51
50
  !isCreatingCase && (React.createElement(OpenShiftClusterId, { className: "push-bottom", "data-tracking-id": "troubleshoot-section-openshift-cluster-id" })),
@@ -1 +1 @@
1
- {"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,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,qBAsHhC;AACD,eAAe,UAAU,CAAC"}
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,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,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;CACrC;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAqKtC;kBArKQ,gBAAgB;;;AAuKzB,eAAe,gBAAgB,CAAC"}
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;CACzC;AAED,wBAAgB,SAAS,CAAC,UAAU,KAAA,EAAE,KAAK,CAAC,EAAE,MAAM;iCAqPb,OAAO;EAwC7C"}
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: t('Continue') }),
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), nextButtonLabel: isCaseCreate ? t('Continue') : t('Convert to Case') }),
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" },
@@ -435,7 +435,7 @@ export default {
435
435
  'The customer thinks the case is not moving appropriately': '고객이 케이스가 적절하게 처리되지 않는다고 생각하는 경우',
436
436
  'The customer wants a new resource': '고객이 새로운 리소스를 원하는 경우',
437
437
  'The issue is more severe than originally thought': '예상했던 것보다 문제가 심각한 경우',
438
- Title: '직위',
438
+ Title: '제목',
439
439
  Email: '이메일',
440
440
  Phone: '전화',
441
441
  IRC: 'IRC',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.169",
3
+ "version": "2.2.171",
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": "0faf05f8d5b78692220811e21f35e5cdc0d5c2d7"
134
+ "gitHead": "14b3b0cbffd9aafd516b7bb84041888e1a7a1a5e"
135
135
  }