@rh-support/troubleshoot 2.6.46 → 2.6.48

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 (154) hide show
  1. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts +1 -0
  2. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  3. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +31 -5
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +33 -34
  6. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  7. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +3 -2
  8. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  9. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +1 -0
  10. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  11. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +14 -18
  12. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +1 -1
  13. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +16 -22
  15. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.js +2 -2
  17. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +53 -102
  19. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.js +1 -1
  21. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +23 -21
  23. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +4 -2
  24. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.d.ts.map +1 -1
  25. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +7 -4
  26. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  27. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -1
  28. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +7 -9
  30. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +0 -8
  31. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  32. package/lib/esm/components/CaseInformation/Fts.js +6 -2
  33. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  34. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  35. package/lib/esm/components/CaseInformation/SupportLevel.js +1 -1
  36. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +3 -0
  37. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  38. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +15 -20
  39. package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
  40. package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +5 -7
  41. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.d.ts.map +1 -1
  42. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.js +20 -18
  43. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  44. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +6 -9
  45. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  46. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +22 -15
  47. package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
  48. package/lib/esm/components/Cve/CveModal.js +2 -3
  49. package/lib/esm/components/Cve/CveSidebar.js +1 -1
  50. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +1 -1
  51. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  52. package/lib/esm/components/ProductSelector/AllProductsSelector.js +6 -9
  53. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  54. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +1 -10
  55. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  56. package/lib/esm/components/Recommendations/AsideResults.js +3 -3
  57. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
  58. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +4 -7
  59. package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.d.ts.map +1 -1
  60. package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.js +1 -3
  61. package/lib/esm/components/Recommendations/InsightsResults.js +1 -1
  62. package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
  63. package/lib/esm/components/Recommendations/InsightsRuleInfo.js +2 -9
  64. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.d.ts.map +1 -1
  65. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.js +4 -4
  66. package/lib/esm/components/Recommendations/Recommendations.js +2 -2
  67. package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
  68. package/lib/esm/components/Recommendations/RulesModal.js +4 -7
  69. package/lib/esm/components/Recommendations/WatsonxAiIcon.js +1 -1
  70. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.d.ts.map +1 -1
  71. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +3 -5
  72. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
  73. package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
  74. package/lib/esm/components/Suggestions/Suggestions.js +12 -17
  75. package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
  76. package/lib/esm/components/Suggestions/TopContent.js +13 -13
  77. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +7 -0
  78. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -0
  79. package/lib/esm/components/TroubleshootSection/AskRedHat.js +176 -0
  80. package/lib/esm/components/TroubleshootSection/CloseButton.d.ts +9 -0
  81. package/lib/esm/components/TroubleshootSection/CloseButton.d.ts.map +1 -0
  82. package/lib/esm/components/TroubleshootSection/CloseButton.js +5 -0
  83. package/lib/esm/components/TroubleshootSection/QuickResponse.d.ts +15 -0
  84. package/lib/esm/components/TroubleshootSection/QuickResponse.d.ts.map +1 -0
  85. package/lib/esm/components/TroubleshootSection/QuickResponse.js +26 -0
  86. package/lib/esm/components/TroubleshootSection/ResponseActionButton.d.ts +18 -0
  87. package/lib/esm/components/TroubleshootSection/ResponseActionButton.d.ts.map +1 -0
  88. package/lib/esm/components/TroubleshootSection/ResponseActionButton.js +28 -0
  89. package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts +20 -0
  90. package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts.map +1 -0
  91. package/lib/esm/components/TroubleshootSection/ResponseActions.js +52 -0
  92. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +7 -0
  93. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  94. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +99 -13
  95. package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts +12 -0
  96. package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts.map +1 -0
  97. package/lib/esm/components/TroubleshootSection/UserFeedback.js +44 -0
  98. package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts +10 -0
  99. package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts.map +1 -0
  100. package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.js +46 -0
  101. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts +9 -0
  102. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts.map +1 -0
  103. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.js +9 -0
  104. package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts +9 -0
  105. package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts.map +1 -0
  106. package/lib/esm/components/TroubleshootSection/icons/StarIcon.js +17 -0
  107. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +3 -3
  108. package/lib/esm/components/shared/fileUpload/css/fileSelector.css +0 -1
  109. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts +0 -1
  110. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts.map +1 -1
  111. package/lib/esm/components/shared/input/ContactSelectorInternal.js +1 -6
  112. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  113. package/lib/esm/components/shared/useIsSectionValid.js +1 -7
  114. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  115. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +2 -8
  116. package/lib/esm/components/wizardLayout/WizardAside.js +3 -3
  117. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  118. package/lib/esm/components/wizardLayout/WizardLayout.js +9 -6
  119. package/lib/esm/components/wizardLayout/WizardMain.d.ts +7 -1
  120. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  121. package/lib/esm/components/wizardLayout/WizardMain.js +217 -18
  122. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +4 -2
  123. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  124. package/lib/esm/components/wizardLayout/WizardNavigation.js +13 -16
  125. package/lib/esm/components/wizardLayout/index.d.ts +1 -0
  126. package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
  127. package/lib/esm/components/wizardLayout/index.js +1 -0
  128. package/lib/esm/constants/askRedHatMessages.d.ts +35 -0
  129. package/lib/esm/constants/askRedHatMessages.d.ts.map +1 -0
  130. package/lib/esm/constants/askRedHatMessages.js +36 -0
  131. package/lib/esm/context/AIResponseContext.d.ts +10 -0
  132. package/lib/esm/context/AIResponseContext.d.ts.map +1 -0
  133. package/lib/esm/context/AIResponseContext.js +26 -0
  134. package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
  135. package/lib/esm/context/RootTroubleshootProvider.js +8 -6
  136. package/lib/esm/css/AskRedHat.css +359 -0
  137. package/lib/esm/css/app.css +4 -5
  138. package/lib/esm/css/case.css +6 -39
  139. package/lib/esm/css/results.css +2 -2
  140. package/lib/esm/hooks/useWizard.d.ts +6 -0
  141. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  142. package/lib/esm/hooks/useWizard.js +1 -1
  143. package/lib/esm/reducers/AIResponseConstNTypes.d.ts +48 -0
  144. package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +1 -0
  145. package/lib/esm/reducers/AIResponseConstNTypes.js +18 -0
  146. package/lib/esm/reducers/AIResponseReducer.d.ts +9 -0
  147. package/lib/esm/reducers/AIResponseReducer.d.ts.map +1 -0
  148. package/lib/esm/reducers/AIResponseReducer.js +42 -0
  149. package/lib/esm/reducers/CaseConstNTypes.d.ts +2 -0
  150. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  151. package/lib/esm/reducers/CaseConstNTypes.js +2 -0
  152. package/lib/esm/scss/_main.scss +22 -84
  153. package/lib/esm/scss/_pf-overrides.scss +10 -37
  154. package/package.json +7 -6
@@ -2,7 +2,6 @@ import { pcm } from '@cee-eng/hydrajs';
2
2
  import { Accordion, AccordionContent, AccordionItem, AccordionToggle, Label, LabelGroup } from '@patternfly/react-core';
3
3
  import BullseyeIcon from '@patternfly/react-icons/dist/js/icons/bullseye-icon';
4
4
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
5
- import { haltEvent } from '@rh-support/utils';
6
5
  import DOMPurify from 'dompurify';
7
6
  import isEmpty from 'lodash/isEmpty';
8
7
  import React, { useContext, useEffect, useRef, useState } from 'react';
@@ -70,10 +69,7 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys, rank }) {
70
69
  React.createElement(AccordionContent, null,
71
70
  React.createElement(Accordion, { asDefinitionList: false, className: "push-bottom-narrow" },
72
71
  React.createElement(AccordionItem, { isExpanded: isIssueExpanded },
73
- React.createElement(AccordionToggle, { onClick: (e) => {
74
- haltEvent(e);
75
- setIsIssueExpanded(!isIssueExpanded);
76
- }, id: `${doc.id}-detected-issue` },
72
+ React.createElement(AccordionToggle, { onClick: () => setIsIssueExpanded(!isIssueExpanded), id: `${doc.id}-detected-issue` },
77
73
  React.createElement(BullseyeIcon, { className: "pf-v6-u-mr-sm" }),
78
74
  React.createElement(Trans, null, "Detected issues")),
79
75
  React.createElement(AccordionContent, null,
@@ -82,10 +78,7 @@ export function InsightsRuleInfo({ doc, showNewTag, duplicateKeys, rank }) {
82
78
  'N/A'),
83
79
  } }))),
84
80
  ((_f = ruleData === null || ruleData === void 0 ? void 0 : ruleData.more_info) !== null && _f !== void 0 ? _f : false) && (React.createElement(AccordionItem, { isExpanded: isAdditionalExpanded },
85
- React.createElement(AccordionToggle, { onClick: (e) => {
86
- haltEvent(e);
87
- setIsAdditionalExpanded(!isAdditionalExpanded);
88
- }, id: `${doc.id}-additional-info` },
81
+ React.createElement(AccordionToggle, { onClick: () => setIsAdditionalExpanded(!isAdditionalExpanded), id: `${doc.id}-additional-info` },
89
82
  React.createElement(InfoCircleIcon, { className: "pf-v6-u-mr-sm" }),
90
83
  React.createElement(Trans, null, "Additional info")),
91
84
  React.createElement(AccordionContent, null,
@@ -1 +1 @@
1
- {"version":3,"file":"RecommendationFeedbackModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RecommendationFeedbackModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACxB;AACD,wBAAgB,2BAA2B,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,EAAE,MAAM,qBA4BnG"}
1
+ {"version":3,"file":"RecommendationFeedbackModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RecommendationFeedbackModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACxB;AACD,wBAAgB,2BAA2B,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,EAAE,MAAM,qBA+BnG"}
@@ -1,12 +1,12 @@
1
- import { Button, Modal, ModalFooter, ModalHeader, ModalVariant } from '@patternfly/react-core';
1
+ import { Button, Modal, ModalFooter, ModalVariant } from '@patternfly/react-core';
2
2
  import React from 'react';
3
3
  import { Trans } from 'react-i18next';
4
+ import { Link } from 'react-router-dom';
4
5
  export function RecommendationFeedbackModal({ isModalOpen, handleModalToggle, modalContent }) {
5
6
  return (React.createElement(Modal, { variant: ModalVariant.small, id: "resolved-feedback-modal", "aria-describedby": "rec-feedback-modal", "aria-label": "Feedback modal", isOpen: isModalOpen, onClose: handleModalToggle },
6
- React.createElement(ModalHeader, null,
7
- React.createElement("h2", { id: "rec-feedback-modal" }, modalContent)),
7
+ React.createElement("h1", { id: "rec-feedback-modal" }, modalContent),
8
8
  React.createElement(ModalFooter, null,
9
- React.createElement(Button, { "data-tracking-id": "resolved-feedback-cases", key: "view", component: "a", href: "#/case/list" },
9
+ React.createElement(Link, { "data-tracking-id": "resolved-feedback-cases", key: "view", className: "pf-v6-c-button pf-m-primary", to: "/case/list" },
10
10
  React.createElement(Trans, null, "View your cases")),
11
11
  React.createElement(Button, { "data-tracking-id": "resolved-feedback-continue", key: "continue", variant: "link", onClick: handleModalToggle },
12
12
  React.createElement(Trans, null, "Continue troubleshooting")))));
@@ -184,7 +184,7 @@ export default function Recommendations(props) {
184
184
  isATestvariation
185
185
  ? (recommendationState.visibleDocs.length !== 0 ||
186
186
  recommendationState.isLoadingRecommendations) && (React.createElement("div", { className: `${recommendationState.isLoadingRecommendations ? 'gradient' : ''} label-container-icon` },
187
- React.createElement(Label, { id: "DeepPurpleColorAILabel", color: "purple" },
187
+ React.createElement("div", { id: "DeepPurpleColorAILabel", className: "pf-v6-u-mb-md", color: "purple" },
188
188
  recommendationState.isLoadingRecommendations ? (React.createElement(React.Fragment, null,
189
189
  React.createElement("span", { className: "loading-text" },
190
190
  React.createElement(Spinner, { size: "sm", className: "pf-v6-u-mr-xs" }),
@@ -200,7 +200,7 @@ export default function Recommendations(props) {
200
200
  React.createElement(WatsonxAiIcon, { fillColor: "#FFFFFF", className: "pf-v6-u-mr-xs" }),
201
201
  ' ',
202
202
  React.createElement("span", { className: "ai-label-text1" },
203
- React.createElement(Trans, null, "Articles recommended by OpenShift AI"),
203
+ React.createElement(Trans, null, "Recommended search results"),
204
204
  " ",
205
205
  infoPopover)))),
206
206
  ' ')))
@@ -1 +1 @@
1
- {"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,UAAU,MAAM;IACZ,cAAc,EAAE,wBAAwB,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBAqM/C"}
1
+ {"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,UAAU,MAAM;IACZ,cAAc,EAAE,wBAAwB,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBAiM/C"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { pcm } from '@cee-eng/hydrajs';
11
- import { Accordion, Button, Card, CardBody, CardExpandableContent, CardHeader, CardTitle, Modal, ModalBody, ModalFooter, ModalHeader, } from '@patternfly/react-core';
11
+ import { Accordion, Button, Card, CardBody, CardExpandableContent, CardHeader, CardTitle, Modal, ModalFooter, } from '@patternfly/react-core';
12
12
  import { useFetch } from '@rh-support/components';
13
13
  import { getResTypeFromUrl } from '@rh-support/utils';
14
14
  import React, { useContext, useEffect, useState } from 'react';
@@ -107,12 +107,9 @@ export function InsightResultModal(props) {
107
107
  }
108
108
  return (React.createElement(React.Fragment, null,
109
109
  React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
110
- React.createElement(Modal, { className: "critical-solutions-modal", "data-tracking-id": "critical-solutions-modal-body", onClose: props.onModalToggle, isOpen: props.isOpen },
111
- React.createElement(ModalHeader, null,
112
- React.createElement("h2", null, t('Critical solutions for your system'))),
113
- React.createElement(ModalBody, null,
114
- React.createElement("p", null, t('Solutions have been triggered for you based on file upload or common issues that currently have high visibility.')),
115
- React.createElement(Accordion, { className: "push-top-narrow rules-modal-items", headingLevel: "h2", asDefinitionList: false, isBordered: true }, props.insightResults.map((doc, index) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc, rank: index + 1 }))))),
110
+ React.createElement(Modal, { className: "critical-solutions-modal", title: t('Critical solutions for your system'), "data-tracking-id": "critical-solutions-modal-body", onClose: props.onModalToggle, isOpen: props.isOpen },
111
+ React.createElement("p", null, t('Solutions have been triggered for you based on file upload or common issues that currently have high visibility.')),
112
+ React.createElement(Accordion, { className: "push-top-narrow rules-modal-items", headingLevel: "h2", asDefinitionList: false, isBordered: true }, props.insightResults.map((doc, index) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc, rank: index + 1 })))),
116
113
  React.createElement(ModalFooter, null,
117
114
  React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, onClick: handleSolvedIssue, key: "solved-my-issue", variant: "primary", "data-tracking-id": "solved-my-issue-critical-solutions-modal" }, t('I solved my issue')),
118
115
  React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel'))))));
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export const WatsonxAiIcon = (props) => {
3
3
  return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "17", viewBox: "0 0 16 17", fill: "none" },
4
- React.createElement("g", { clipPath: "url(#clip0_2742_18241)" },
4
+ React.createElement("g", { "clip-path": "url(#clip0_2742_18241)" },
5
5
  React.createElement("path", { d: "M13 12.5007C12.4477 12.5007 12 12.9484 12 13.5007C12 13.5389 12.0071 13.5751 12.0112 13.6122C10.8708 14.5103 9.47165 15.0007 8 15.0007C5.86915 15.0007 4 13.0146 4 10.7507C4 8.40722 5.9065 6.50072 8.25 6.50072H8.5V5.50072H8.25C5.3552 5.50072 3 7.85592 3 10.7507C3 11.6927 3.2652 12.5955 3.71855 13.379C2.3619 12.1868 1.5 10.4445 1.5 8.50072C1.5 7.44312 1.74585 6.43432 2.23095 5.50292L1.34375 5.04102C0.79175 6.10157 0.5 7.29787 0.5 8.50072C0.5 12.6362 3.8645 16.0007 8 16.0007C9.6872 16.0007 11.2909 15.4411 12.6024 14.4176C12.7244 14.4706 12.8586 14.5007 13 14.5007C13.5523 14.5007 14 14.053 14 13.5007C14 12.9484 13.5523 12.5007 13 12.5007Z", fill: "#1F0066" }),
6
6
  React.createElement("path", { d: "M6.5 11.5V10.5H5.5V11.5H6.5Z", fill: "#1F0066" }),
7
7
  React.createElement("path", { d: "M10.5 6.5V5.5H9.5V6.5H10.5Z", fill: "#1F0066" }),
@@ -1 +1 @@
1
- {"version":3,"file":"RestoreLastSessionModal.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/RestoreLastSessionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAGnF,OAAc,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAQ9C,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,YAAY,EAAE,YAAY,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,MAAM,CAuE9C,CAAC"}
1
+ {"version":3,"file":"RestoreLastSessionModal.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/RestoreLastSessionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAGnF,OAAc,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAQ9C,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,YAAY,EAAE,YAAY,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,MAAM,CAmE9C,CAAC"}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { Button, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant } from '@patternfly/react-core';
10
+ import { Button, Modal, ModalFooter, ModalVariant } from '@patternfly/react-core';
11
11
  import isEqual from 'lodash/isEqual';
12
12
  import React, { useContext } from 'react';
13
13
  import { Trans, useTranslation } from 'react-i18next';
@@ -38,10 +38,8 @@ export const RestoreLastSessionModal = ({ onRestore, errorSession }) => {
38
38
  updateCaseCreationErrorStatus(caseDispatch, false);
39
39
  updateSession(sessionDispatch, errorSession.session.id, errorSession.sessionDetails, Object.assign(Object.assign({}, errorSession.session), { caseCreationError: false }));
40
40
  };
41
- return (React.createElement(Modal, { "data-tracking-id": "restore-session-modal", variant: ModalVariant.small, isOpen: !caseCreationError && caseCreation500ErrorStatus, onClose: onOpenNewCase, "aria-labelledby": "restore-session-modal-title", "aria-describedby": "restore-session-modal-body" },
42
- React.createElement(ModalHeader, { title: t('Restore last session?'), labelId: "restore-session-modal-title" }),
43
- React.createElement(ModalBody, { id: "restore-session-modal-body" },
44
- React.createElement(Trans, null, "It looks like an error prevented your last case from being submitted. Would you like to restore the last session or open a new case?")),
41
+ return (React.createElement(Modal, { "data-tracking-id": "restore-session-modal", variant: ModalVariant.small, title: t('Restore last session?'), isOpen: !caseCreationError && caseCreation500ErrorStatus, onClose: onOpenNewCase },
42
+ React.createElement(Trans, null, "It looks like an error prevented your last case from being submitted. Would you like to restore the last session or open a new case?"),
45
43
  React.createElement(ModalFooter, null,
46
44
  React.createElement(Button, { key: "restore", variant: "primary", onClick: onRestoreClick, "data-tracking-id": "restore-session-button" },
47
45
  React.createElement(Trans, null, " Restore")),
@@ -305,7 +305,7 @@ export function SessionRestore(props) {
305
305
  ], 1000);
306
306
  if (!sessionRestoreCardSections.includes(activeSection))
307
307
  return React.createElement(React.Fragment, null);
308
- return (React.createElement("div", { className: "pf-v6-u-mb-lg pf-v6-u-mt-0" },
308
+ return (React.createElement("div", { className: "pf-v6-u-mb-md pf-v6-u-mt-0" },
309
309
  ' ',
310
310
  React.createElement(SessionRestoreCard, { onRestore: restoreSession, previousSessions: previousSessions, onCardDismiss: onSessionRestoreCardDismiss }),
311
311
  React.createElement(RestoreLastSessionModal, { onRestore: restoreSession, errorSession: sessionRestore.sessionOfCaseCreationError })));
@@ -1 +1 @@
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,qBAgIhD"}
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,5 +1,5 @@
1
1
  import { pcm } from '@cee-eng/hydrajs';
2
- import { Accordion, Tooltip } from '@patternfly/react-core';
2
+ import { Tooltip } from '@patternfly/react-core';
3
3
  import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
4
4
  import { TopContentSearch } from '@rh-support/components';
5
5
  import { FeatureFlagKey, useIsFeatureAvailable } from '@rh-support/react-context';
@@ -17,7 +17,6 @@ export default function Suggestions(props) {
17
17
  const { topContentState: { topContent }, } = useContext(TCStateContext);
18
18
  const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
19
19
  const accordionRef = useRef(null);
20
- const toggleButtonRefs = useRef([]);
21
20
  const { version, product } = useCaseSelector((state) => ({
22
21
  version: state.caseDetails.version,
23
22
  product: state.caseDetails.product,
@@ -36,32 +35,28 @@ export default function Suggestions(props) {
36
35
  setMaxTC(topContent.data.length);
37
36
  };
38
37
  const onSearchChange = (searchTerm, filteredData) => {
38
+ var _a, _b;
39
39
  setFilteredTC(filteredData);
40
- setTimeout(() => {
41
- const shouldBeExpanded = Boolean(searchTerm);
42
- for (const id of toggleButtonRefs.current) {
43
- const button = document.getElementById(`${id}`);
44
- const isExpanded = (button === null || button === void 0 ? void 0 : button.getAttribute('aria-expanded')) === 'true';
45
- if (button && isExpanded !== shouldBeExpanded) {
46
- button.click();
47
- }
48
- }
49
- });
40
+ if (searchTerm) {
41
+ (_a = accordionRef.current) === null || _a === void 0 ? void 0 : _a.expandAll();
42
+ }
43
+ else {
44
+ (_b = accordionRef.current) === null || _b === void 0 ? void 0 : _b.collapseAll();
45
+ }
50
46
  };
51
47
  return (React.createElement("div", { className: "top-content-suggestion-accordion" },
52
48
  showTitleDescription && (React.createElement("div", { className: "card card-support top-content-card-wrapper" },
53
- isTCSearchEnabled && (React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" },
49
+ !isTCSearchEnabled && (React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" },
54
50
  props.title
55
51
  ? props.title
56
52
  : t('i18nKeyPopularSolutions', 'Red Hat hand picked support articles'),
57
53
  React.createElement(Tooltip, { content: React.createElement("div", null,
58
54
  React.createElement(Trans, null, "Support articles are matched to the product and version details you selected, not the problem details you entered.")) },
59
55
  React.createElement(InfoCircleIcon, { className: "pf-v6-u-ml-sm", "aria-label": t('More info about how support articles are matched') })))),
60
- !isTCSearchEnabled && (React.createElement("div", { className: "card-body" },
61
- React.createElement(TopContentSearch, { className: "pf-v6-u-text-color-regular", topContentData: topContent.data, topContentResultsWrapperRef: accordionRef, onSearch: onSearchChange, dataTrackingId: "top-content-filter-troubleshoot", enableEventTracking: true }))))),
62
- React.createElement(Accordion, { className: "pf-v6-u-ml-sm pf-v6-u-mr-sm" }, map(filteredTC.slice(0, maxTC), (sug, index) => {
56
+ isTCSearchEnabled && (React.createElement("div", { className: "card-body" },
57
+ React.createElement(TopContentSearch, { topContentData: topContent.data, topContentResultsWrapperRef: accordionRef, onSearch: onSearchChange, dataTrackingId: "top-content-filter-troubleshoot", enableEventTracking: true }))))),
58
+ React.createElement("pfe-accordion", { ref: accordionRef }, map(filteredTC.slice(0, maxTC), (sug, index) => {
63
59
  var _a, _b;
64
- toggleButtonRefs.current.push(index);
65
60
  return (React.createElement(TopContent, { seSessionId: activeSessionId, seResourceOriginID: (_b = (_a = sessionResourceTracking[SessionResourceSource.TOP_CONTENT]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', topContentIndex: index, onResourceClick: onResourceClick, name: sug.categoryName, key: sug.categoryName, items: sug.content, helperText: (sug === null || sug === void 0 ? void 0 : sug.helperText) || '' }));
66
61
  })),
67
62
  showMax && filteredTC.length > maxTC && (React.createElement("div", { className: "text-right" },
@@ -1 +1 @@
1
- {"version":3,"file":"TopContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/TopContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AAKxF,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,UAAU,MAAM;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,qBAmI/C"}
1
+ {"version":3,"file":"TopContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/TopContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AAIxF,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,UAAU,MAAM;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,qBAsI/C"}
@@ -1,6 +1,5 @@
1
1
  import { pcm } from '@cee-eng/hydrajs';
2
- import { AccordionContent, AccordionItem, AccordionToggle, Tooltip } from '@patternfly/react-core';
3
- import { haltEvent } from '@rh-support/utils';
2
+ import { Accordion, AccordionContent, AccordionItem, AccordionToggle, Tooltip } from '@patternfly/react-core';
4
3
  import isEqual from 'lodash/isEqual';
5
4
  import map from 'lodash/map';
6
5
  import React, { useState } from 'react';
@@ -45,22 +44,23 @@ export default function TopContent(props) {
45
44
  }));
46
45
  };
47
46
  return (React.createElement(React.Fragment, null, props.helperText ? (React.createElement(Tooltip, { content: React.createElement("div", null, props.helperText) },
47
+ React.createElement(Accordion, { className: "top-content-accordion" },
48
+ React.createElement(AccordionItem, { isExpanded: expanded === `${props.topContentIndex}` },
49
+ React.createElement(AccordionToggle, { onClick: () => {
50
+ onToggle(`${props.topContentIndex}`);
51
+ }, "data-tracking-id": `top-content-accordion-header-${props.topContentIndex}`, id: `${props.topContentIndex}` },
52
+ React.createElement("h3", null, props.name)),
53
+ React.createElement(AccordionContent, { id: `${props.topContentIndex}` },
54
+ React.createElement("ul", { className: "list-flushleft", style: { listStyleType: 'disc' } }, map(props.items, (item, i) => (React.createElement("li", { key: i + item.contentTitle },
55
+ React.createElement("p", null,
56
+ React.createElement("a", { className: "se-recommended ts-top-problems", "data-tracking-id": "se-recommended-top-content", onClick: onLinkClick(item), href: `${item.contentUrl}?${RouteUtils.getSEResourceQueryParams(props.seSessionId, props.seResourceOriginID, SessionResourceSource.TOP_CONTENT)}`, target: "_blank", rel: "noopener noreferrer" }, item.contentTitle))))))))))) : (React.createElement(Accordion, null,
48
57
  React.createElement(AccordionItem, { isExpanded: expanded === `${props.topContentIndex}` },
49
- React.createElement(AccordionToggle, { onClick: (e) => {
50
- haltEvent(e);
58
+ React.createElement(AccordionToggle, { onClick: () => {
51
59
  onToggle(`${props.topContentIndex}`);
52
60
  }, "data-tracking-id": `top-content-accordion-header-${props.topContentIndex}`, id: `${props.topContentIndex}` },
53
61
  React.createElement("h3", null, props.name)),
54
62
  React.createElement(AccordionContent, { id: `${props.topContentIndex}` },
55
63
  React.createElement("ul", { className: "list-flushleft", style: { listStyleType: 'disc' } }, map(props.items, (item, i) => (React.createElement("li", { key: i + item.contentTitle },
56
64
  React.createElement("p", null,
57
- React.createElement("a", { className: "se-recommended ts-top-problems", "data-tracking-id": "se-recommended-top-content", onClick: onLinkClick(item), href: `${item.contentUrl}?${RouteUtils.getSEResourceQueryParams(props.seSessionId, props.seResourceOriginID, SessionResourceSource.TOP_CONTENT)}`, target: "_blank", rel: "noopener noreferrer" }, item.contentTitle)))))))))) : (React.createElement(AccordionItem, { isExpanded: expanded === `${props.topContentIndex}` },
58
- React.createElement(AccordionToggle, { onClick: () => {
59
- onToggle(`${props.topContentIndex}`);
60
- }, "data-tracking-id": `top-content-accordion-header-${props.topContentIndex}`, id: `${props.topContentIndex}` },
61
- React.createElement("h3", null, props.name)),
62
- React.createElement(AccordionContent, { id: `${props.topContentIndex}` },
63
- React.createElement("ul", { className: "list-flushleft", style: { listStyleType: 'disc' } }, map(props.items, (item, i) => (React.createElement("li", { key: i + item.contentTitle },
64
- React.createElement("p", null,
65
- React.createElement("a", { className: "se-recommended ts-top-problems", "data-tracking-id": "se-recommended-top-content", onClick: onLinkClick(item), href: `${item.contentUrl}?${RouteUtils.getSEResourceQueryParams(props.seSessionId, props.seResourceOriginID, SessionResourceSource.TOP_CONTENT)}`, target: "_blank", rel: "noopener noreferrer" }, item.contentTitle)))))))))));
65
+ React.createElement("a", { className: "se-recommended ts-top-problems", "data-tracking-id": "se-recommended-top-content", onClick: onLinkClick(item), href: `${item.contentUrl}?${RouteUtils.getSEResourceQueryParams(props.seSessionId, props.seResourceOriginID, SessionResourceSource.TOP_CONTENT)}`, target: "_blank", rel: "noopener noreferrer" }, item.contentTitle))))))))))));
66
66
  }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ onChatWithAIClick?: () => void;
4
+ }
5
+ export declare const AskRedHat: React.FC<IProps>;
6
+ export {};
7
+ //# sourceMappingURL=AskRedHat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAYhD,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CA+StC,CAAC"}
@@ -0,0 +1,176 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Env } from '@cee-eng/hydrajs';
11
+ import { sendRHDirectMessageFeedback } from '@ifd-ui/ask-redhat-core';
12
+ import { Button, Card, CardBody, CardHeader, Modal, ModalVariant, Spinner } from '@patternfly/react-core';
13
+ import React, { useRef, useState } from 'react';
14
+ import { MODAL_MESSAGES, QUICK_RESPONSES, TOOLTIP_MESSAGES } from '../../constants/askRedHatMessages';
15
+ import { useAIResponseState } from '../../context/AIResponseContext';
16
+ import { useParseRuleMarkdown } from '../../hooks/useParseRuleMarkdown';
17
+ import { appSourceId_ARH } from '../../reducers/CaseConstNTypes';
18
+ import { CollapseIcon } from './icons/CollapseIcon';
19
+ import { StarIcon } from './icons/StarIcon';
20
+ import ResponseActions from './ResponseActions';
21
+ import UserFeedback from './UserFeedback';
22
+ import UserFeedbackComplete from './UserFeedbackComplete';
23
+ export const AskRedHat = ({ onChatWithAIClick }) => {
24
+ var _a, _b, _c;
25
+ const [isExpanded, setIsExpanded] = useState(false);
26
+ const [showFeedbackCard, setShowFeedbackCard] = useState(false);
27
+ const [showFeedbackComplete, setShowFeedbackComplete] = useState(false);
28
+ const [feedbackType, setFeedbackType] = useState('');
29
+ const [submittedFeedbackTypes, setSubmittedFeedbackTypes] = useState([]);
30
+ const aiResponseState = useAIResponseState();
31
+ const contentRef = useRef(null);
32
+ const onToggle = () => {
33
+ if (isExpanded && contentRef.current) {
34
+ contentRef.current.scrollTop = 0;
35
+ }
36
+ setIsExpanded((prev) => !prev);
37
+ };
38
+ const handleChatWithAIClick = () => onChatWithAIClick === null || onChatWithAIClick === void 0 ? void 0 : onChatWithAIClick();
39
+ const aiResponse = aiResponseState.aiResponse;
40
+ const messageId = aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.messageId;
41
+ const conversationId = aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.conversationId;
42
+ // Use accumulated response if streaming, otherwise use the final response
43
+ const answer = aiResponseState.isStreaming && aiResponseState.accumulatedResponse
44
+ ? aiResponseState.accumulatedResponse
45
+ : (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.answer) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.content) || 'No AI response available yet.';
46
+ const sources = (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.sources) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.references) || [];
47
+ const sourcesCount = sources.length || 0;
48
+ // Show loading only when streaming has started but no content received yet
49
+ const isLoading = aiResponseState.isStreaming && aiResponseState.accumulatedResponse === '';
50
+ const isStreaming = aiResponseState.isStreaming;
51
+ const { parseMarkdown } = useParseRuleMarkdown();
52
+ const config = {
53
+ appSourceId: appSourceId_ARH,
54
+ packageVersion: (_a = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _a === void 0 ? void 0 : _a.packageVersion,
55
+ authToken: (_c = (_b = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _b === void 0 ? void 0 : _b.getEncodedToken()) !== null && _c !== void 0 ? _c : '',
56
+ appEnv: Env.getEnvName(),
57
+ };
58
+ const handleFeedbackSubmit = (selectedResponse, additionalFeedback) => __awaiter(void 0, void 0, void 0, function* () {
59
+ setShowFeedbackCard(false);
60
+ try {
61
+ const payload = {
62
+ rating: (feedbackType === 'positive' ? 'positive' : 'negative'),
63
+ freeform: additionalFeedback || undefined,
64
+ predefined_response: selectedResponse,
65
+ };
66
+ yield sendRHDirectMessageFeedback(conversationId, messageId, payload, config);
67
+ setShowFeedbackComplete(true);
68
+ setSubmittedFeedbackTypes((prev) => [...prev, feedbackType]);
69
+ }
70
+ catch (error) {
71
+ setShowFeedbackCard(false);
72
+ }
73
+ });
74
+ const responseActions = {
75
+ positive: Object.assign({ onClick: () => {
76
+ setFeedbackType('positive');
77
+ setShowFeedbackCard(true);
78
+ } }, TOOLTIP_MESSAGES.positive),
79
+ negative: Object.assign({ onClick: () => {
80
+ setFeedbackType('negative');
81
+ setShowFeedbackCard(true);
82
+ } }, TOOLTIP_MESSAGES.negative),
83
+ copy: Object.assign({ onClick: () => {
84
+ navigator.clipboard.writeText(answer);
85
+ } }, TOOLTIP_MESSAGES.copy),
86
+ };
87
+ if (isLoading) {
88
+ return (React.createElement("div", { className: "ask-redhat" },
89
+ React.createElement("p", { className: "ask-redhat-title" },
90
+ React.createElement(StarIcon, { width: 20, height: 20 }),
91
+ "Resolve your issue now with AI insights"),
92
+ React.createElement("div", { className: "ask-redhat-content-wrapper" },
93
+ React.createElement("div", { className: "ask-redhat-content", style: { textAlign: 'center', padding: '2rem' } },
94
+ React.createElement(Spinner, { size: "lg" }),
95
+ React.createElement("p", { style: { marginTop: '1rem' } }, "Getting AI insights..."))),
96
+ !aiResponseState.isStreaming && (React.createElement("div", { className: "ask-redhat-toggle-button" },
97
+ React.createElement(Button, { variant: "link", onClick: handleChatWithAIClick, className: "ask-redhat-chat-button" }, "Chat with AI to get started")))));
98
+ }
99
+ // Show streaming content
100
+ if (isStreaming && aiResponseState.accumulatedResponse && aiResponseState.accumulatedResponse !== '') {
101
+ return (React.createElement("div", { className: "ask-redhat" },
102
+ React.createElement("p", { className: "ask-redhat-title" },
103
+ React.createElement(StarIcon, { width: 20, height: 20 }),
104
+ "Resolve your issue now with AI insights"),
105
+ React.createElement("div", { className: "ask-redhat-content-wrapper" },
106
+ React.createElement("div", { ref: contentRef, className: `ask-redhat-content ${isExpanded ? 'ask-redhat-content--expanded' : ''}` },
107
+ React.createElement("div", { className: `ask-redhat-content-scrollable ${isExpanded ? 'ask-redhat-content--expanded-scrollable' : ''}` },
108
+ React.createElement("div", null,
109
+ React.createElement("div", { dangerouslySetInnerHTML: { __html: parseMarkdown(answer) } }),
110
+ React.createElement("div", { style: { display: 'inline-block' } },
111
+ React.createElement(Spinner, { size: "sm" })))),
112
+ !isExpanded && React.createElement("div", { className: "ask-redhat-fade-overlay" }))),
113
+ React.createElement("div", { className: "ask-redhat-toggle-button-wrapper" },
114
+ React.createElement("div", { className: "ask-redhat-border-line" }),
115
+ React.createElement(Button, { onClick: onToggle, className: isExpanded ? 'ask-redhat-toggle-button-collapsed' : 'ask-redhat-toggle-button' },
116
+ isExpanded ? React.createElement(CollapseIcon, null) : React.createElement(StarIcon, { width: 20, height: 20 }),
117
+ isExpanded ? '' : 'Read more'))));
118
+ }
119
+ if (aiResponseState.error) {
120
+ return (React.createElement("div", { className: "ask-redhat" },
121
+ React.createElement("p", { className: "ask-redhat-title" },
122
+ React.createElement(StarIcon, { width: 20, height: 20 }),
123
+ "Resolve your issue now with AI insights"),
124
+ React.createElement("div", { className: "ask-redhat-content-wrapper" },
125
+ React.createElement("div", { className: "ask-redhat-content", style: { textAlign: 'center', padding: '2rem' } },
126
+ React.createElement("p", { style: { color: '#d73502', marginBottom: '1rem' } }, "Unable to get AI insights. Please try again later."),
127
+ React.createElement(Button, { variant: "link", onClick: handleChatWithAIClick, className: "ask-redhat-chat-button", icon: React.createElement(StarIcon, null) }, "Try again with AI Chat")))));
128
+ }
129
+ return (React.createElement("div", { className: "ask-redhat" },
130
+ React.createElement("p", { className: "ask-redhat-title" },
131
+ React.createElement(StarIcon, { width: 20, height: 20 }),
132
+ "Resolve your issue now with AI insights"),
133
+ React.createElement("div", { className: "ask-redhat-content-wrapper" },
134
+ React.createElement("div", { ref: contentRef, className: `ask-redhat-content ${isExpanded ? 'ask-redhat-content--expanded' : ''}` },
135
+ React.createElement("div", { className: `ask-redhat-content-scrollable ${isExpanded ? 'ask-redhat-content--expanded-scrollable' : ''}` },
136
+ React.createElement("div", null,
137
+ React.createElement("div", { dangerouslySetInnerHTML: { __html: parseMarkdown(answer) } }),
138
+ sourcesCount > 0 && (React.createElement(React.Fragment, null,
139
+ React.createElement("p", null, "2 sources"),
140
+ React.createElement("div", { className: "ask-redhat-cards" }, sources.map((source, index) => (React.createElement(Card, { className: "ask-redhat-card", key: index },
141
+ React.createElement(CardHeader, null,
142
+ React.createElement("h3", { className: "ask-redhat-card-title" },
143
+ React.createElement("a", { href: source.link, target: "_blank", rel: "noopener noreferrer" }, source.title))),
144
+ React.createElement(CardBody, null,
145
+ React.createElement("p", null, source.snippet)))))))),
146
+ React.createElement("div", { className: "response-actions-wrapper" },
147
+ React.createElement(ResponseActions, { actions: responseActions, submittedFeedbackTypes: submittedFeedbackTypes })))),
148
+ React.createElement("div", { className: "ask-redhat-footer-wrapper" },
149
+ React.createElement("div", { className: "ask-redhat-footer" },
150
+ React.createElement("p", { className: "ask-redhat-footer-text" }, "Want to continue the conversation? Dive deeper with our AI assistant"),
151
+ React.createElement(Button, { onClick: handleChatWithAIClick, className: 'ask-redhat-chat-button', icon: React.createElement(StarIcon, null) }, "Chat with AI"))),
152
+ !isExpanded && React.createElement("div", { className: "ask-redhat-fade-overlay" }))),
153
+ React.createElement("div", { className: "ask-redhat-toggle-button-wrapper" },
154
+ React.createElement("div", { className: "ask-redhat-border-line" }),
155
+ React.createElement(Button, { onClick: onToggle, className: isExpanded ? 'ask-redhat-toggle-button-collapsed' : 'ask-redhat-toggle-button' },
156
+ isExpanded ? React.createElement(CollapseIcon, null) : React.createElement(StarIcon, { width: 20, height: 20 }),
157
+ isExpanded ? '' : 'Read more')),
158
+ React.createElement(Modal, { variant: ModalVariant.small, isOpen: showFeedbackCard, onClose: () => {
159
+ setShowFeedbackCard(false);
160
+ setFeedbackType('');
161
+ } },
162
+ React.createElement(UserFeedback, { title: feedbackType === 'positive'
163
+ ? MODAL_MESSAGES.feedback.positive
164
+ : MODAL_MESSAGES.feedback.negative, hasTextArea: true, quickResponses: feedbackType === 'positive' ? QUICK_RESPONSES.positive : QUICK_RESPONSES.negative, onSubmit: handleFeedbackSubmit, onClose: () => {
165
+ setShowFeedbackCard(false);
166
+ setFeedbackType('');
167
+ } })),
168
+ React.createElement(Modal, { variant: ModalVariant.small, isOpen: showFeedbackComplete, onClose: () => {
169
+ setShowFeedbackComplete(false);
170
+ setFeedbackType('');
171
+ } },
172
+ React.createElement(UserFeedbackComplete, { title: MODAL_MESSAGES.complete.title, body: MODAL_MESSAGES.complete.body, onClose: () => {
173
+ setShowFeedbackComplete(false);
174
+ setFeedbackType('');
175
+ } }))));
176
+ };
@@ -0,0 +1,9 @@
1
+ import { ButtonProps } from '@patternfly/react-core';
2
+ import { type FunctionComponent } from 'react';
3
+ export interface CloseButtonProps extends ButtonProps {
4
+ onClose?: () => void;
5
+ ariaLabel?: string;
6
+ }
7
+ declare const CloseButton: FunctionComponent<CloseButtonProps>;
8
+ export default CloseButton;
9
+ //# sourceMappingURL=CloseButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloseButton.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/CloseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAEpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Button } from '@patternfly/react-core';
2
+ import CloseIcon from '@patternfly/react-icons/dist/esm/icons/close-icon';
3
+ import React from 'react';
4
+ const CloseButton = ({ onClose, ariaLabel }) => (React.createElement(Button, { variant: "plain", onClick: onClose, icon: React.createElement(CloseIcon, null), "aria-label": ariaLabel }));
5
+ export default CloseButton;
@@ -0,0 +1,15 @@
1
+ import { LabelGroupProps, LabelProps } from '@patternfly/react-core';
2
+ import { type FunctionComponent } from 'react';
3
+ export interface QuickResponse extends Omit<LabelProps, 'children'> {
4
+ content: string;
5
+ id: string;
6
+ }
7
+ export interface QuickResponseProps {
8
+ quickResponses: QuickResponse[];
9
+ quickResponseContainerProps?: Omit<LabelGroupProps, 'ref'>;
10
+ onSelect?: (id: string) => void;
11
+ isCompact?: boolean;
12
+ }
13
+ export declare const QuickResponse: FunctionComponent<QuickResponseProps>;
14
+ export default QuickResponse;
15
+ //# sourceMappingURL=QuickResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuickResponse.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/QuickResponse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAc,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAEhE,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IAC/B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,2BAA2B,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IAC3D,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CAqC/D,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,26 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { Label, LabelGroup } from '@patternfly/react-core';
13
+ import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
14
+ import React, { useState } from 'react';
15
+ export const QuickResponse = ({ quickResponses, quickResponseContainerProps = { numLabels: 5 }, onSelect, isCompact, }) => {
16
+ const [selectedQuickResponse, setSelectedQuickResponse] = useState();
17
+ const handleQuickResponseClick = (id) => {
18
+ setSelectedQuickResponse(id);
19
+ onSelect && onSelect(id);
20
+ };
21
+ return (React.createElement(LabelGroup, Object.assign({ className: `pf-chatbot__message-quick-response ${(quickResponseContainerProps === null || quickResponseContainerProps === void 0 ? void 0 : quickResponseContainerProps.className) ? quickResponseContainerProps === null || quickResponseContainerProps === void 0 ? void 0 : quickResponseContainerProps.className : ''}` }, quickResponseContainerProps), quickResponses.map((_a) => {
22
+ var { id, content, className } = _a, props = __rest(_a, ["id", "content", "className"]);
23
+ return (React.createElement(Label, Object.assign({ variant: id === selectedQuickResponse ? undefined : 'outline', icon: id === selectedQuickResponse ? React.createElement(CheckIcon, null) : undefined, color: "blue", key: id, onClick: () => handleQuickResponseClick(id), className: `${id === selectedQuickResponse ? 'pf-chatbot__message-quick-response--selected' : ''} ${className ? className : ''}`, isCompact: isCompact }, props), content));
24
+ })));
25
+ };
26
+ export default QuickResponse;
@@ -0,0 +1,18 @@
1
+ import { ButtonProps } from '@patternfly/react-core';
2
+ import React, { type FunctionComponent, type MouseEvent } from 'react';
3
+ export interface ResponseActionButtonProps extends ButtonProps {
4
+ ariaLabel?: string;
5
+ clickedAriaLabel?: string;
6
+ icon: React.ReactNode;
7
+ onClick?: ((event: MouseEvent | React.MouseEvent<Element, MouseEvent> | KeyboardEvent) => void) | undefined;
8
+ tooltipContent?: string;
9
+ clickedTooltipContent?: string;
10
+ /** Props to control if the button should be disabled */
11
+ isDisabled?: boolean;
12
+ isClicked?: boolean;
13
+ innerRef?: React.Ref<HTMLButtonElement>;
14
+ }
15
+ export declare const ResponseActionButtonBase: FunctionComponent<ResponseActionButtonProps>;
16
+ declare const ResponseActionButton: React.ForwardRefExoticComponent<ResponseActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
17
+ export default ResponseActionButton;
18
+ //# sourceMappingURL=ResponseActionButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseActionButton.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/ResponseActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAiB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAwB,MAAM,OAAO,CAAC;AAE7F,MAAM,WAAW,yBAA0B,SAAQ,WAAW;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,aAAa,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,wDAAwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,yBAAyB,CAmDjF,CAAC;AAEF,QAAA,MAAM,oBAAoB,qGAExB,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,28 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { Button, Icon, Tooltip } from '@patternfly/react-core';
13
+ import React, { forwardRef } from 'react';
14
+ export const ResponseActionButtonBase = (_a) => {
15
+ var { ariaLabel, clickedAriaLabel = ariaLabel, icon, onClick, tooltipContent, clickedTooltipContent = tooltipContent, isDisabled, isClicked = false, innerRef } = _a, props = __rest(_a, ["ariaLabel", "clickedAriaLabel", "icon", "onClick", "tooltipContent", "clickedTooltipContent", "isDisabled", "isClicked", "innerRef"]);
16
+ const generateAriaLabel = () => {
17
+ if (ariaLabel) {
18
+ return isClicked ? clickedAriaLabel : ariaLabel;
19
+ }
20
+ return isClicked ? clickedTooltipContent : tooltipContent;
21
+ };
22
+ return (React.createElement(Tooltip, { id: `pf-chatbot__tooltip-response-action-${tooltipContent}`, content: isClicked ? clickedTooltipContent : tooltipContent, "aria-live": "polite", position: "bottom", entryDelay: 0, exitDelay: 0, distance: 8, animationDuration: 0,
23
+ // prevents VO announcements of both aria label and tooltip
24
+ aria: "none" },
25
+ React.createElement(Button, Object.assign({ variant: "plain", className: `pf-chatbot__button--response-action ${isClicked ? 'pf-chatbot__button--response-action-clicked' : ''}`, "aria-label": generateAriaLabel(), icon: React.createElement(Icon, { isInline: true, size: "lg" }, icon), isDisabled: isDisabled, onClick: onClick, size: "sm", ref: innerRef }, props))));
26
+ };
27
+ const ResponseActionButton = forwardRef((props, ref) => (React.createElement(ResponseActionButtonBase, Object.assign({ innerRef: ref }, props))));
28
+ export default ResponseActionButton;