@rh-support/troubleshoot 2.4.5-beta.2 → 2.4.5-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  2. package/lib/esm/components/CaseInformation/Description.js +24 -19
  3. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +2 -2
  4. package/lib/esm/components/Cve/CveItem.d.ts +2 -0
  5. package/lib/esm/components/Cve/CveItem.d.ts.map +1 -1
  6. package/lib/esm/components/Cve/CveItem.js +78 -20
  7. package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
  8. package/lib/esm/components/Cve/CveModal.js +9 -5
  9. package/lib/esm/components/Cve/CvePanel.js +1 -1
  10. package/lib/esm/components/Cve/CveSidebar.d.ts.map +1 -1
  11. package/lib/esm/components/Cve/CveSidebar.js +1 -2
  12. package/lib/esm/components/OpenCase/OpenCase.d.ts +3 -0
  13. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  14. package/lib/esm/components/OpenCase/OpenCase.js +9 -0
  15. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +3 -0
  16. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  17. package/lib/esm/components/ProductSelector/AllProductsSelector.js +26 -5
  18. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -0
  19. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  20. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +2 -2
  21. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +1 -1
  22. package/lib/esm/components/ProductSelector/ProductSelector.d.ts +4 -2
  23. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  24. package/lib/esm/components/ProductSelector/ProductSelector.js +41 -23
  25. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  26. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +6 -1
  27. package/lib/esm/components/Recommendations/AsideResults.js +1 -1
  28. package/lib/esm/components/Recommendations/EARules/EARuleWidget.d.ts.map +1 -1
  29. package/lib/esm/components/Recommendations/EARules/EARuleWidget.js +5 -6
  30. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  31. package/lib/esm/components/Recommendations/Recommendations.js +66 -31
  32. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  33. package/lib/esm/components/Review/Review.js +5 -3
  34. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  35. package/lib/esm/components/SessionRestore/SessionRestore.js +5 -3
  36. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  37. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  38. package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
  39. package/lib/esm/components/Suggestions/Suggestions.js +8 -3
  40. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  41. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +13 -13
  42. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  43. package/lib/esm/components/shared/useIsSectionValid.js +69 -13
  44. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  45. package/lib/esm/components/wizardLayout/WizardAside.js +10 -9
  46. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  47. package/lib/esm/components/wizardLayout/WizardLayout.js +31 -4
  48. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  49. package/lib/esm/components/wizardLayout/WizardNavigation.js +50 -10
  50. package/lib/esm/css/results.css +6 -0
  51. package/lib/esm/hooks/useFetchCVEData.d.ts.map +1 -1
  52. package/lib/esm/hooks/useFetchCVEData.js +58 -21
  53. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  54. package/lib/esm/hooks/useWizard.js +9 -8
  55. package/lib/esm/models/caseCreationWorkflows.d.ts +2 -0
  56. package/lib/esm/models/caseCreationWorkflows.d.ts.map +1 -1
  57. package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -1
  58. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  59. package/lib/esm/reducers/CaseConstNTypes.js +2 -0
  60. package/lib/esm/reducers/CaseReducer.d.ts +1 -0
  61. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  62. package/lib/esm/reducers/CaseReducer.js +9 -0
  63. package/lib/esm/reducers/RouteConstNTypes.d.ts +2 -2
  64. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  65. package/lib/esm/reducers/RouteConstNTypes.js +9 -1
  66. package/lib/esm/reducers/SessionRestoreReducer.d.ts +7 -4
  67. package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
  68. package/lib/esm/reducers/SessionRestoreReducer.js +26 -13
  69. package/lib/esm/scss/_main.scss +65 -0
  70. package/lib/esm/scss/_pf-overrides.scss +1 -1
  71. package/lib/esm/utils/caseUtils.d.ts +13 -1
  72. package/lib/esm/utils/caseUtils.d.ts.map +1 -1
  73. package/lib/esm/utils/caseUtils.js +32 -5
  74. package/package.json +9 -8
@@ -1,13 +1,15 @@
1
1
  import { Alert, AlertVariant } from '@patternfly/react-core';
2
2
  import { AlertMessage, AlertType, ErrorBoundary } from '@rh-support/components';
3
3
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
+ import { getConfigField, PCM_CONFIG_FIELD_TYPE } from '@rh-support/utils';
4
5
  import isEmpty from 'lodash/isEmpty';
5
6
  import isEqual from 'lodash/isEqual';
6
- import React, { useContext, useRef } from 'react';
7
+ import React, { useContext, useEffect, useRef } from 'react';
7
8
  import { Trans, useTranslation } from 'react-i18next';
8
- import { useCaseSelector } from '../../context/CaseContext';
9
+ import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
9
10
  import { RouteContext } from '../../context/RouteContext';
10
11
  import { useFetchCVEData } from '../../hooks/useFetchCVEData';
12
+ import { setCaseState } from '../../reducers/CaseReducer';
11
13
  import { CveModal } from '../Cve/CveModal';
12
14
  import { EARuleWidget } from '../Recommendations/EARules/EARuleWidget';
13
15
  import Recommendations from '../Recommendations/Recommendations';
@@ -24,37 +26,53 @@ import { ProductSelectorLoader } from './ProductSelectorLoader';
24
26
  export default function ProductSelector(props) {
25
27
  const { cveRecommendation } = useFetchCVEData();
26
28
  const { t } = useTranslation();
27
- const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
28
- const { product, version } = useCaseSelector((state) => ({
29
+ const { globalMetadataState: { allProducts, pcmConfig }, } = useContext(GlobalMetadataStateContext);
30
+ const { product, version, ABTestVariation } = useCaseSelector((state) => ({
29
31
  product: state.caseDetails.product,
30
32
  version: state.caseDetails.version,
33
+ ABTestVariation: state.ABTestVariation,
31
34
  }), isEqual);
32
35
  const { routeState: { isCaseCreate }, } = useContext(RouteContext);
36
+ const caseDispatch = useCaseDispatch();
37
+ const cveModalEnabledConfig = getConfigField(pcmConfig.data, 'isCVEModalEnabled', PCM_CONFIG_FIELD_TYPE.STRING);
38
+ const isCVEModalEnabled = cveModalEnabledConfig === '1';
39
+ const isATestvariation = ABTestVariation === 'A';
40
+ const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
41
+ useEffect(() => {
42
+ if (!isCVEModalEnabled) {
43
+ setCaseState(caseDispatch, {
44
+ isCveModalOpened: false,
45
+ });
46
+ }
47
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48
+ }, [isCVEModalEnabled]);
33
49
  /**
34
50
  * The all product selector and top product selector should always be "selected" because
35
51
  * the all product selector needs to show the selection from the top products selector and the top product selector
36
52
  * doesn't matter becasue it will be hidden whenever a product is selected.
37
53
  */
38
54
  const productSelectorRef = useRef(null);
55
+ const rederProductSelect = (React.createElement("form", null,
56
+ (cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && isCVEModalEnabled && React.createElement(CveModal, null),
57
+ React.createElement(AllProductsSelector, { routeProps: props.routeProps, checkEntitledProduct: isCaseCreate ? true : false, ref: productSelectorRef, isOnSummaryPage: true, isOnGetSupportPage: props === null || props === void 0 ? void 0 : props.isOnGetSupportPage, caseCreateExperience: props.caseCreateExperience })));
39
58
  return (React.createElement(React.Fragment, null,
40
- allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
59
+ isBTestvariation && allProducts.isFetching && React.createElement(ProductSelectorLoader, null),
41
60
  React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
42
- !allProducts.isFetching && !allProducts.isError && (React.createElement(React.Fragment, null,
43
- React.createElement("form", null,
44
- (cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && React.createElement(CveModal, null),
45
- React.createElement(AllProductsSelector, { routeProps: props.routeProps, checkEntitledProduct: isCaseCreate ? true : false, ref: productSelectorRef, isOnSummaryPage: true }),
46
- product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
47
- ' ',
48
- "If you're having a subscription issue that doesn't relate to",
49
- ' ',
50
- React.createElement("a", { href: "/products/subscription-central", rel: "noopener noreferrer", target: "_blank" }, "Subscription Watch"),
51
- "product, then please contact",
52
- ' ',
53
- React.createElement("a", { href: "/support/contact", "data-tracking-id": "contact-customer-service" }, "customer service"),
54
- ' ',
55
- "for help.") })),
56
- React.createElement(EARuleWidget, null)),
57
- React.createElement("div", { className: "suggestions-result-section" },
58
- React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
59
- React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef })))))))));
61
+ isBTestvariation
62
+ ? !allProducts.isFetching && !allProducts.isError && rederProductSelect
63
+ : isATestvariation && rederProductSelect,
64
+ product === 'Subscription Watch' && (React.createElement(Alert, { isInline: true, variant: AlertVariant.warning, title: React.createElement(Trans, null,
65
+ ' ',
66
+ "If you're having a subscription issue that doesn't relate to",
67
+ ' ',
68
+ React.createElement("a", { href: "/products/subscription-central", rel: "noopener noreferrer", target: "_blank" }, "Subscription Watch"),
69
+ "product, then please contact",
70
+ ' ',
71
+ React.createElement("a", { href: "/support/contact", "data-tracking-id": "contact-customer-service" }, "customer service"),
72
+ ' ',
73
+ "for help.") })),
74
+ isBTestvariation && React.createElement(EARuleWidget, null),
75
+ !(props === null || props === void 0 ? void 0 : props.isOnGetSupportPage) && (React.createElement("div", { className: "suggestions-result-section" },
76
+ React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading recommendations') } }, !isEmpty(version) && (React.createElement("div", { className: "common-suggestions" },
77
+ React.createElement(Recommendations, { routeProps: props.routeProps, userSeenRecommendations: props.userSeenRecommendations, userClickedNextonRecommendationsValue: props.userClickedNextonRecommendations, resultsRowRef: props.resultsRowRef }))))))));
60
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAiC,MAAM,OAAO,CAAC;AAOtD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAOD,QAAA,MAAM,8BAA8B,wEAuClC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
1
+ {"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAiC,MAAM,OAAO,CAAC;AAOtD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAOD,QAAA,MAAM,8BAA8B,wEAuDlC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
@@ -16,7 +16,12 @@ const ProductVersionDropdownSelector = forwardRef((props, ref) => {
16
16
  React.createElement(Trans, null, "Product"),
17
17
  ' ',
18
18
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
19
- React.createElement(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage })),
19
+ React.createElement("div", { className: "pf-v5-u-display-flex pf-v5-u-align-items-center" },
20
+ React.createElement("div", { className: "pf-v5-u-flex-1" },
21
+ React.createElement(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage, isLoading: props.isLoading })),
22
+ props.isLoading && (React.createElement("div", { className: "pf-v5-u-flex-basis-auto" },
23
+ React.createElement(LoadingIndicator, { className: "pf-v5-u-ml-sm", isInline: true, show: props.isLoading, size: "sm" })))),
24
+ React.createElement(React.Fragment, null)),
20
25
  React.createElement("div", { className: "version-selector-wrapper" },
21
26
  React.createElement("label", { htmlFor: "version-selector-dropdown-toggle" },
22
27
  React.createElement(Trans, null, "Version"),
@@ -122,7 +122,7 @@ export function AsideResults(props) {
122
122
  useEffect(() => {
123
123
  if (isSelectedAccounntSecureSupport)
124
124
  return;
125
- createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS_ASIDE, getSessResFromRecs(recommendationState.sideRecommendation, SessionResourceVisibility.PRESENTED), JSON.stringify(payload));
125
+ createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS_ASIDE, getSessResFromRecs(recommendationState.sideRecommendation, SessionResourceVisibility.PRESENTED), typeof payload === 'string' ? payload : JSON.stringify(payload));
126
126
  // eslint-disable-next-line react-hooks/exhaustive-deps
127
127
  }, [recommendationState.sideRecommendation, activeSessionId, activeSection]);
128
128
  const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
@@ -1 +1 @@
1
- {"version":3,"file":"EARuleWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,wBAAgB,YAAY,sBAqD3B"}
1
+ {"version":3,"file":"EARuleWidget.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAWrD,wBAAgB,YAAY,sBAmD3B"}
@@ -14,11 +14,10 @@ export function EARuleWidget() {
14
14
  const { rulesState: { isEARuleWidgetVisible, EARules }, } = useContext(RulesStateContext);
15
15
  const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
16
16
  const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
17
- const { product, version, summary, issue } = useCaseSelector((state) => ({
17
+ const { product, version, summary } = useCaseSelector((state) => ({
18
18
  product: state.caseDetails.product,
19
19
  version: state.caseDetails.version,
20
20
  summary: state.caseDetails.summary,
21
- issue: state.caseDetails.issue,
22
21
  }), isEqual);
23
22
  const validEARules = filter(EARules.rules, (r) => r.visible && r.rule_sub_type !== 'attachment');
24
23
  useEffect(() => {
@@ -28,10 +27,10 @@ export function EARuleWidget() {
28
27
  if (visibleValidEARules &&
29
28
  differenceBy([visibleValidEARules === null || visibleValidEARules === void 0 ? void 0 : visibleValidEARules.rule_id], presentedIds).length > 0 &&
30
29
  !isEmpty(activeSessionId)) {
31
- !isEmpty(issue) &&
32
- createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, [
33
- getSessResFromRules(visibleValidEARules.cta, SessionResourceVisibility.PRESENTED, 1, visibleValidEARules.rule_id),
34
- ], JSON.stringify({ product, version, summary, description: issue }));
30
+ createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.EDMOUND_ABOTT, [
31
+ getSessResFromRules(visibleValidEARules.cta, SessionResourceVisibility.PRESENTED, 1, visibleValidEARules.rule_id),
32
+ ], JSON.stringify({ product, version, summary }) // To trigger EA rules, we don't pass KT questions
33
+ );
35
34
  }
36
35
  // eslint-disable-next-line react-hooks/exhaustive-deps
37
36
  }, [validEARules, activeSessionId]);
@@ -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;AAYpF,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,qBAoSpD"}
1
+ {"version":3,"file":"Recommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/Recommendations.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAelE,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAYpF,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,qBAkXpD"}
@@ -1,10 +1,11 @@
1
1
  import { pcm } from '@cee-eng/hydrajs';
2
- import { Label, Pagination, PaginationVariant, Spinner } from '@patternfly/react-core';
2
+ import { Label, Pagination, PaginationVariant, Popover, Spinner } from '@patternfly/react-core';
3
3
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
4
- import { useDebounce, usePrevious } from '@rh-support/components';
5
- import { useGlobalStateContext } from '@rh-support/react-context';
6
- import { computeRecommendationAbstract, computeRecommendationTitle, dtmTrackEventCaseStartStopped, formatDate, } from '@rh-support/utils';
4
+ import StarIcon from '@patternfly/react-icons/dist/js/icons/star-icon';
5
+ import { LoadingDots, useDebounce, usePrevious } from '@rh-support/components';
6
+ import { computeRecommendationAbstract, computeRecommendationTitle, dtmTrackEventCaseStartStopped, formatDate, getRecommendationTitle, } from '@rh-support/utils';
7
7
  import differenceBy from 'lodash/differenceBy';
8
+ import find from 'lodash/find';
8
9
  import isEmpty from 'lodash/isEmpty';
9
10
  import isEqual from 'lodash/isEqual';
10
11
  import map from 'lodash/map';
@@ -17,7 +18,7 @@ import { RouteContext } from '../../context/RouteContext';
17
18
  import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
18
19
  import { getRecommendationObject } from '../../reducers/CaseHelpers';
19
20
  import { setCaseRecommendations } from '../../reducers/CaseReducer';
20
- import { fetchRecommendations, fetchWatsonXRecommendations, RecommendationsConstants, setCurrentPage, setVisibleDocs, } from '../../reducers/RecommendationsReducer';
21
+ import { fetchWatsonXRecommendations, RecommendationsConstants, setCurrentPage, setVisibleDocs, } from '../../reducers/RecommendationsReducer';
21
22
  import { AppRouteSections } from '../../reducers/RouteConstNTypes';
22
23
  import { createOrUpdateSessionResources, getSessResFromRec, getSessResFromRecs, } from '../../reducers/SessionRestoreReducer';
23
24
  import RouteUtils from '../../utils/routeUtils';
@@ -26,19 +27,18 @@ import { WatsonxAiIcon } from './WatsonxAiIcon';
26
27
  const { SessionResourceSource, SessionResourceVisibility } = pcm.preCase.session;
27
28
  export default function Recommendations(props) {
28
29
  var _a, _b, _c;
29
- const { product, version, environment, summary, caseResourceLinks, issue } = useCaseSelector((state) => ({
30
+ const { product, version, environment, summary, caseResourceLinks, issue, ABTestVariation, cveWorkflowRecommendation, } = useCaseSelector((state) => ({
30
31
  product: state.caseDetails.product,
31
32
  version: state.caseDetails.version,
32
33
  environment: state.caseDetails.environment,
33
34
  summary: state.caseDetails.summary,
34
35
  issue: state.caseDetails.issue,
35
36
  caseResourceLinks: state.caseDetails.caseResourceLinks,
37
+ ABTestVariation: state.ABTestVariation,
38
+ cveWorkflowRecommendation: state.cveWorkflowRecommendation,
36
39
  }), isEqual);
37
40
  const caseDispatch = useCaseDispatch();
38
- // Use Case Number
39
41
  const { caseNumber } = useParams();
40
- const { globalMetadataState: { loggedInUsersAccount }, } = useGlobalStateContext();
41
- const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
42
42
  const { routeState: { activeSection }, } = useContext(RouteContext);
43
43
  const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
44
44
  const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
@@ -56,11 +56,16 @@ export default function Recommendations(props) {
56
56
  summary: summary,
57
57
  description: issue, // we don't need to truncate to 20k as Watsonx max recs is 4000 done for us already
58
58
  };
59
+ const isATestvariation = ABTestVariation === 'A';
60
+ const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
59
61
  const isRecSearchPayloadSame = isEqual(payload, recommendationState.prevRecommendationsBody);
60
62
  useEffect(() => {
61
63
  // currently due to the debounce we use after the page load leads to some delay in the disbaling of next button
62
64
  // since the state of the next button depends on the loading rec flag so we force the flag to be true every time the
63
65
  // rec section is rendered for the first time except the case when we won't make a new search since there was no change in the rec payload.
66
+ if (activeSection !== AppRouteSections.SUMMARIZE || !summary || isRecSearchPayloadSame) {
67
+ return;
68
+ }
64
69
  !isRecSearchPayloadSame &&
65
70
  recommendationDispatch({
66
71
  type: RecommendationsConstants.setIsLoadingRecommendations,
@@ -73,7 +78,7 @@ export default function Recommendations(props) {
73
78
  * Also, log the newly presented resources on the session
74
79
  */
75
80
  useDebounce(() => {
76
- if (activeSection !== AppRouteSections.SUMMARIZE || !summary || isRecSearchPayloadSame) {
81
+ if (activeSection !== AppRouteSections.SUMMARIZE || isRecSearchPayloadSame) {
77
82
  return;
78
83
  }
79
84
  setCurrentPage(recommendationDispatch, 1);
@@ -88,9 +93,7 @@ export default function Recommendations(props) {
88
93
  let controller = new AbortController();
89
94
  abortControllerRef.current = controller;
90
95
  if (!isEmpty(issue) || !isEmpty(summary)) {
91
- !loggedInUsersAccount.data.secureSupport
92
- ? fetchWatsonXRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, queryFilters, controller.signal)
93
- : fetchRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, caseNumber, isSecureSupportAccount, queryFilters, controller.signal);
96
+ fetchWatsonXRecommendations(recommendationDispatch, payload, MAXROW, recPageSize, 0, true, queryFilters, controller.signal);
94
97
  recommendationDispatch({
95
98
  type: RecommendationsConstants.userViewedDocs,
96
99
  payload: { userViewedDocs: true },
@@ -108,7 +111,7 @@ export default function Recommendations(props) {
108
111
  recommendationState.insightsKcsIds,
109
112
  ], 1000);
110
113
  useEffect(() => {
111
- props.userSeenRecommendations && props.userSeenRecommendations(!recommendationState.isLoadingRecommendations); //reset userSeenRecommendations when recommendationState changes
114
+ props.userSeenRecommendations && props.userSeenRecommendations(false); //reset userSeenRecommendations when recommendationState changes
112
115
  // eslint-disable-next-line react-hooks/exhaustive-deps
113
116
  }, [recommendationState.numFound]);
114
117
  useEffect(() => {
@@ -122,7 +125,7 @@ export default function Recommendations(props) {
122
125
  if (newRecommendations.length > 0) {
123
126
  setCaseRecommendations(caseDispatch, recommendationState.visibleDocs, caseResourceLinks);
124
127
  }
125
- createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS, getSessResFromRecs(recommendationState.visibleDocs, SessionResourceVisibility.PRESENTED, pageSize || DEFAULTPAGESIZE, recommendationState.currentPage || 1), JSON.stringify(payload));
128
+ createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS, getSessResFromRecs(recommendationState.visibleDocs, SessionResourceVisibility.PRESENTED, pageSize || DEFAULTPAGESIZE, recommendationState.currentPage || 1), typeof payload === 'string' ? payload : JSON.stringify(payload));
126
129
  // eslint-disable-next-line react-hooks/exhaustive-deps
127
130
  }, [caseDispatch, recommendationState.visibleDocs, activeSessionId]);
128
131
  useEffect(() => {
@@ -149,30 +152,63 @@ export default function Recommendations(props) {
149
152
  const onResourceClick = (doc, index) => (event) => {
150
153
  createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS, [
151
154
  getSessResFromRec(doc, SessionResourceVisibility.VISITED, index + 1 + (pageSize || DEFAULTPAGESIZE) * ((recommendationState.currentPage || 1) - 1)),
152
- ], JSON.stringify(payload));
155
+ ], typeof payload === 'string' ? payload : JSON.stringify(payload));
153
156
  dtmTrackEventCaseStartStopped('recommendation click', caseNumber, `${product}|${version}`);
154
157
  };
158
+ const infoPopover = (React.createElement(Popover, { triggerAction: "hover", "aria-label": "Hoverable popover", headerContent: React.createElement("div", null,
159
+ React.createElement(Trans, null, "Powered by Openshift AI")), bodyContent: React.createElement("div", null,
160
+ React.createElement(Trans, null, "These articles have been selected based on the information provided."),
161
+ React.createElement("br", null)) },
162
+ React.createElement(InfoCircleIcon, { color: "white" })));
163
+ function getRankPercentage(decimal) {
164
+ return Math.round(decimal * 100);
165
+ }
166
+ const computeLabel = (recommendationDoc) => {
167
+ const { rerank_score } = recommendationDoc;
168
+ const title = getRecommendationTitle(recommendationDoc);
169
+ const isCveExist = !isEmpty(find(cveWorkflowRecommendation, (cveW) => (cveW === null || cveW === void 0 ? void 0 : cveW.title) === title));
170
+ const percentage = getRankPercentage(rerank_score);
171
+ return (React.createElement(React.Fragment, null,
172
+ (percentage >= 80 || isCveExist) && (React.createElement(Label, { color: "green", className: "match-label", icon: React.createElement(StarIcon, null) }, isCveExist ? 'Exact match' : 'Best match')),
173
+ !isCveExist && (React.createElement(Label, { className: "match-label", color: "purple" },
174
+ percentage,
175
+ "% Match"))));
176
+ };
155
177
  return (React.createElement(React.Fragment, null,
178
+ isBTestvariation && (React.createElement(LoadingDots, { className: "recommendation-loading-dots", show: recommendationState.isLoadingRecommendations && !isEmpty(summary) })),
156
179
  React.createElement("div", { className: "recommendation-list pf-v5-u-pt-md", ref: props.resultsRowRef },
157
- (recommendationState.visibleDocs.length !== 0 || recommendationState.isLoadingRecommendations) && (React.createElement(Label, { id: "DeepPurpleColorAILabel", className: "pf-v5-u-mb-md" },
158
- recommendationState.isLoadingRecommendations ? (React.createElement(React.Fragment, null,
159
- React.createElement(Spinner, { size: "sm", className: "pf-v5-u-mr-xs" }),
160
- ' ',
161
- React.createElement(Trans, null, "Recommending articles using OpenShift AI"))) : (React.createElement(React.Fragment, null,
162
- React.createElement(WatsonxAiIcon, { fillColor: "#FFFFFF", className: "pf-v5-u-mr-xs" }),
163
- ' ',
164
- React.createElement(Trans, null, "Articles recommended by OpenShift AI"))),
165
- ' ',
166
- React.createElement(InfoCircleIcon, { color: "white" }))),
167
- recommendationState.isLoadingRecommendations ? ( // as much as it pains me to add these <br /> the pf docs has it this way
168
- React.createElement(RecommendationsLoader, null)) : (React.createElement("ul", { className: "list-flat" }, map(recommendationState.visibleDocs, (doc, i) => {
180
+ isATestvariation
181
+ ? (recommendationState.visibleDocs.length !== 0 ||
182
+ recommendationState.isLoadingRecommendations) && (React.createElement("div", { className: `${recommendationState.isLoadingRecommendations ? 'gradient' : ''} label-container-icon` },
183
+ React.createElement(Label, { id: "DeepPurpleColorAILabel", className: "pf-v5-u-mb-md" },
184
+ recommendationState.isLoadingRecommendations ? (React.createElement(React.Fragment, null,
185
+ React.createElement(Spinner, { size: "sm", className: "pf-v5-u-mr-xs" }),
186
+ ' ',
187
+ React.createElement(Trans, null,
188
+ recommendationState.visibleDocs.length
189
+ ? 'Updating recommendations '
190
+ : 'Recommending articles ',
191
+ "using OpenShift AI"),
192
+ ' ',
193
+ React.createElement(InfoCircleIcon, { color: "white" }))) : (React.createElement(React.Fragment, null,
194
+ React.createElement(WatsonxAiIcon, { fillColor: "#FFFFFF", className: "pf-v5-u-mr-xs" }),
195
+ ' ',
196
+ React.createElement(Trans, null, "Articles recommended by OpenShift AI"),
197
+ " ",
198
+ infoPopover)),
199
+ ' ')))
200
+ : recommendationState.visibleDocs.length !== 0 && (React.createElement(Label, { color: "purple", className: "pf-v5-u-mb-md" },
201
+ React.createElement(WatsonxAiIcon, { fillColor: "#6753ac", className: "pf-v5-u-mr-xs" }),
202
+ React.createElement(Trans, null, "Live search results powered by OpenShift AI"))),
203
+ isATestvariation && recommendationState.isLoadingRecommendations ? (React.createElement(RecommendationsLoader, null)) : (React.createElement("ul", { className: "list-flat" }, map(recommendationState.visibleDocs, (doc, i) => {
169
204
  var _a, _b;
170
205
  return (React.createElement("li", { className: "result", key: doc.id },
171
206
  React.createElement("header", { className: "result-header" },
172
207
  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) }),
173
208
  React.createElement("div", { className: "header-meta" },
209
+ isATestvariation && doc.rerank_score && computeLabel(doc),
174
210
  doc.kcsState === 'verified' && (React.createElement(React.Fragment, null,
175
- React.createElement("span", { className: "status-verified" }, "verified"),
211
+ React.createElement("span", { className: "status-verified pf-v5-u-font-weight-bold pf-v5-u-success-color-100" }, "verified"),
176
212
  React.createElement("span", { className: "list-separator" }, "\u2013"))),
177
213
  React.createElement("span", { className: "meta" }, doc.documentKind),
178
214
  React.createElement("span", { className: "list-separator" }, "\u2013"),
@@ -181,11 +217,10 @@ export default function Recommendations(props) {
181
217
  }))),
182
218
  recommendationState.numFound !== 0 && recommendationState.numFound > DEFAULTPAGESIZE && (React.createElement("div", { className: "pagination-footer" },
183
219
  React.createElement(Pagination, { className: "push-top", itemCount: (_c = (_b = recommendationState.allDocs) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0, perPage: recPageSize, page: recommendationState.currentPage, variant: PaginationVariant.bottom, onSetPage: pageChanged, dropDirection: "up", onPerPageSelect: onPageSizeChanged })))),
184
- recommendationState.visibleDocs.length === 0 &&
220
+ recommendationState.numFound === 0 &&
185
221
  !recommendationState.isLoadingRecommendations &&
186
222
  !recommendationState.isLoadingRecommendationsError &&
187
223
  !isEmpty(issue) &&
188
- !isEmpty(summary) &&
189
224
  isEmpty(prevMainRecommendations) && (React.createElement("p", null,
190
225
  React.createElement(Trans, null, "We couldn't find any matches. Revise your search for better results.")))));
191
226
  }
@@ -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,qBA6E3C"}
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, ABTestVariation } = useCaseSelector((state) => ({
34
34
  contactInfo24x7: state.caseDetails.contactInfo24x7,
35
35
  product: state.caseDetails.product,
36
+ ABTestVariation: state.ABTestVariation,
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,14 +42,15 @@ export default function Review(props) {
41
42
  const onSeverityChange = (payload) => {
42
43
  setCaseDetails(caseDispatch, payload);
43
44
  };
45
+ const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
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
+ isBTestvariation && 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),
51
- React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true, checkEntitledProduct: true }),
53
+ React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true, checkEntitledProduct: true, isOnReviewPage: true }),
52
54
  React.createElement(OpenShiftClusterId, null),
53
55
  React.createElement(Hostname, null),
54
56
  React.createElement(KtQuestions, { inlineEditable: true, hideSaveCancel: true }),
@@ -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,qBAwV3C"}
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, ABTestVariation } = 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
+ ABTestVariation: state.ABTestVariation,
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 + (ABTestVariation ? '-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(),
@@ -298,7 +300,7 @@ export function SessionRestore(props) {
298
300
  ], 1000);
299
301
  if (!sessionRestoreCardSections.includes(activeSection))
300
302
  return React.createElement(React.Fragment, null);
301
- return (React.createElement(React.Fragment, null,
303
+ return (React.createElement("div", { className: "pf-v5-u-mb-md pf-v5-u-mt-0" },
302
304
  ' ',
303
305
  React.createElement(SessionRestoreCard, { onRestore: restoreSession, previousSessions: previousSessions, onCardDismiss: onSessionRestoreCardDismiss }),
304
306
  React.createElement(RestoreLastSessionModal, { onRestore: restoreSession, errorSession: sessionRestore.sessionOfCaseCreationError })));
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAQ,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAQ1E,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAWrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,qBA8Z/C"}
1
+ {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAQ,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAQ1E,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAWrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,qBAwZ/C"}
@@ -233,5 +233,5 @@ export default function SubmitCase(props) {
233
233
  React.createElement(InsightsResults, { isDisplayOnMain: true })),
234
234
  React.createElement(ClusterRecommendations, { showClusterRecommendationsModal: false }))),
235
235
  React.createElement("div", { className: "pf-v5-u-mt-lg" }, isIdea ? (React.createElement(AsideResults, { routeProps: props.routeProps })) : (!isEmpty(topContent.data) &&
236
- isNotAnIdea && (React.createElement(Suggestions, { title: t('RedHat recommended results'), showTitleDescription: true, showMax: 6 })))))))));
236
+ isNotAnIdea && React.createElement(Suggestions, { showTitleDescription: true, showMax: 6 }))))))));
237
237
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Suggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/Suggestions.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAU5D,UAAU,MAAM;IACZ,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBAwGhD"}
1
+ {"version":3,"file":"Suggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/Suggestions.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAU5D,UAAU,MAAM;IACZ,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBAqHhD"}
@@ -1,4 +1,6 @@
1
1
  import { pcm } from '@cee-eng/hydrajs';
2
+ import { Tooltip } from '@patternfly/react-core';
3
+ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
2
4
  import { TopContentSearch } from '@rh-support/components';
3
5
  import { FeatureFlagKey, useIsFeatureAvailable } from '@rh-support/react-context';
4
6
  import isEqual from 'lodash/isEqual';
@@ -44,10 +46,13 @@ export default function Suggestions(props) {
44
46
  };
45
47
  return (React.createElement("div", { className: "top-content-suggestion-accordion" },
46
48
  showTitleDescription && (React.createElement("div", { className: "card card-support" },
47
- !isTCSearchEnabled && (React.createElement(Trans, null,
48
- React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" }, props.title
49
+ !isTCSearchEnabled && (React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" },
50
+ props.title
49
51
  ? props.title
50
- : t('i18nKeyPopularSolutions', 'Red Hat recommended results')))),
52
+ : t('i18nKeyPopularSolutions', 'Red Hat hand picked support articles'),
53
+ React.createElement(Tooltip, { content: React.createElement("div", null,
54
+ React.createElement(Trans, null, "Support articles are matched to the product and version details you selected, not the problem details you entered.")) },
55
+ React.createElement(InfoCircleIcon, { className: "pf-v5-u-ml-sm", "aria-label": t('More info about how support articles are matched') })))),
51
56
  isTCSearchEnabled && (React.createElement("div", { className: "card-body" },
52
57
  React.createElement(TopContentSearch, { topContentData: topContent.data, topContentResultsWrapperRef: accordionRef, onSearch: onSearchChange, dataTrackingId: "top-content-filter-troubleshoot", enableEventTracking: true }))))),
53
58
  React.createElement("pfe-accordion", { ref: accordionRef }, map(filteredTC.slice(0, maxTC), (sug, index) => {
@@ -1 +1 @@
1
- {"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA2EzC;kBA3EQ,mBAAmB;;;AA8E5B,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAyFzC;kBAzFQ,mBAAmB;;;AA4F5B,eAAe,mBAAmB,CAAC"}
@@ -1,5 +1,6 @@
1
- import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core';
2
- import { ErrorBoundary, LoadingDots, MoreOrLess } from '@rh-support/components';
1
+ import { Card, CardBody, CardHeader, CardTitle, Tooltip } from '@patternfly/react-core';
2
+ import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
3
+ import { ErrorBoundary, LoadingDots } from '@rh-support/components';
3
4
  import { PreviousCaseTypes } from '@rh-support/utils';
4
5
  import isEmpty from 'lodash/isEmpty';
5
6
  import isEqual from 'lodash/isEqual';
@@ -22,7 +23,7 @@ function TroubleshootSection(props) {
22
23
  var _a;
23
24
  const { t } = useTranslation();
24
25
  const { topContentState: { topContent }, } = useContext(TCStateContext);
25
- const { product, version, summary, isCreatingCase, caseType, issue } = useCaseSelector((state) => ({
26
+ const { product, version, isCreatingCase, caseType } = useCaseSelector((state) => ({
26
27
  product: state.caseDetails.product,
27
28
  version: state.caseDetails.version,
28
29
  summary: state.caseDetails.summary,
@@ -39,20 +40,19 @@ function TroubleshootSection(props) {
39
40
  React.createElement("p", { className: "pf-v5-u-pt-md" },
40
41
  React.createElement("span", { className: "pf-v5-u-font-family-heading pf-v5-u-pr-xs" }, t('Product')),
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" }, t('Version')),
44
- version),
45
- React.createElement("div", { className: "pf-v5-u-font-family-heading" }, t('Title')),
46
- React.createElement("p", null, summary),
47
- React.createElement("div", { className: "pf-v5-u-font-family-heading" }, t('Problem description')),
48
- React.createElement("p", { className: "pf-v5-u-mb-xl" },
49
- React.createElement(MoreOrLess, { maxHeight: 93 }, issue))),
43
+ product),
44
+ React.createElement("p", null,
45
+ React.createElement("span", { className: "pf-v5-u-font-family-heading pf-v5-u-pr-xs" }, t('Version')),
46
+ version)),
50
47
  !isCreatingCase && (React.createElement(OpenShiftClusterId, { className: "push-bottom", "data-tracking-id": "troubleshoot-section-openshift-cluster-id" })),
51
48
  React.createElement(LoadingDots, { show: topContent.isFetching }),
52
49
  topContent.data.length === 0 && (React.createElement(Card, { id: "card", className: "card-support top-recommendations pf-v5-u-mb-md", isCompact: true },
53
- React.createElement(CardHeader, { "aria-label": t('Red Hat recommended results'), className: "popular-solutions" },
50
+ React.createElement(CardHeader, { "aria-label": t('Red Hat hand picked support articles'), className: "popular-solutions" },
54
51
  React.createElement(CardTitle, { id: "card-title", className: "card-title" },
55
- React.createElement(Trans, { i18nKey: 'i18nKeyPopularSolutions' }, "Red Hat recommended results"))),
52
+ React.createElement(Trans, { i18nKey: 'i18nKeyPopularSolutions' }, "Red Hat hand picked support articles"),
53
+ React.createElement(Tooltip, { content: React.createElement("div", null,
54
+ React.createElement(Trans, null, "Support articles are matched to the product and version details you selected, not the problem details you entered.")) },
55
+ React.createElement(InfoCircleIcon, { className: "pf-v5-u-ml-sm", "aria-label": "More info about how support articles are matched" })))),
56
56
  React.createElement(CardBody, { "aria-label": t('No recommendations for this product'), className: "file-recs-no-recommendation pf-v5-u-mt-md" },
57
57
  React.createElement(Trans, null, "No recommendations for this product")))),
58
58
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading suggestions') } }, canShowTopContent && !isEmpty(version) && React.createElement(Suggestions, null)),
@@ -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;AAInE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAuM9D"}
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;;;;;EA2Q9D"}