@rh-support/troubleshoot 2.6.34 → 2.6.39

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 (153) 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.map +1 -1
  37. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +1 -13
  38. package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
  39. package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +5 -7
  40. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.d.ts.map +1 -1
  41. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.js +20 -18
  42. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  43. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +6 -9
  44. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  45. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +22 -15
  46. package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
  47. package/lib/esm/components/Cve/CveModal.js +2 -3
  48. package/lib/esm/components/Cve/CveSidebar.js +1 -1
  49. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +1 -1
  50. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  51. package/lib/esm/components/ProductSelector/AllProductsSelector.js +6 -9
  52. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  53. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +1 -10
  54. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  55. package/lib/esm/components/Recommendations/AsideResults.js +3 -3
  56. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
  57. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +4 -7
  58. package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.d.ts.map +1 -1
  59. package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.js +1 -3
  60. package/lib/esm/components/Recommendations/InsightsResults.js +1 -1
  61. package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
  62. package/lib/esm/components/Recommendations/InsightsRuleInfo.js +2 -9
  63. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.d.ts.map +1 -1
  64. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.js +4 -4
  65. package/lib/esm/components/Recommendations/Recommendations.js +2 -2
  66. package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
  67. package/lib/esm/components/Recommendations/RulesModal.js +4 -7
  68. package/lib/esm/components/Recommendations/WatsonxAiIcon.js +1 -1
  69. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.d.ts.map +1 -1
  70. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +3 -5
  71. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
  72. package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
  73. package/lib/esm/components/Suggestions/Suggestions.js +12 -17
  74. package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
  75. package/lib/esm/components/Suggestions/TopContent.js +13 -13
  76. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +7 -0
  77. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -0
  78. package/lib/esm/components/TroubleshootSection/AskRedHat.js +151 -0
  79. package/lib/esm/components/TroubleshootSection/CloseButton.d.ts +9 -0
  80. package/lib/esm/components/TroubleshootSection/CloseButton.d.ts.map +1 -0
  81. package/lib/esm/components/TroubleshootSection/CloseButton.js +5 -0
  82. package/lib/esm/components/TroubleshootSection/QuickResponse.d.ts +15 -0
  83. package/lib/esm/components/TroubleshootSection/QuickResponse.d.ts.map +1 -0
  84. package/lib/esm/components/TroubleshootSection/QuickResponse.js +26 -0
  85. package/lib/esm/components/TroubleshootSection/ResponseActionButton.d.ts +18 -0
  86. package/lib/esm/components/TroubleshootSection/ResponseActionButton.d.ts.map +1 -0
  87. package/lib/esm/components/TroubleshootSection/ResponseActionButton.js +28 -0
  88. package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts +20 -0
  89. package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts.map +1 -0
  90. package/lib/esm/components/TroubleshootSection/ResponseActions.js +52 -0
  91. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +7 -0
  92. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  93. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +99 -13
  94. package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts +12 -0
  95. package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts.map +1 -0
  96. package/lib/esm/components/TroubleshootSection/UserFeedback.js +44 -0
  97. package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts +10 -0
  98. package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts.map +1 -0
  99. package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.js +46 -0
  100. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts +9 -0
  101. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts.map +1 -0
  102. package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.js +9 -0
  103. package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts +9 -0
  104. package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts.map +1 -0
  105. package/lib/esm/components/TroubleshootSection/icons/StarIcon.js +17 -0
  106. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +3 -3
  107. package/lib/esm/components/shared/fileUpload/css/fileSelector.css +0 -1
  108. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts +0 -1
  109. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts.map +1 -1
  110. package/lib/esm/components/shared/input/ContactSelectorInternal.js +1 -6
  111. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  112. package/lib/esm/components/shared/useIsSectionValid.js +1 -7
  113. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  114. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +2 -8
  115. package/lib/esm/components/wizardLayout/WizardAside.js +3 -3
  116. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  117. package/lib/esm/components/wizardLayout/WizardLayout.js +9 -6
  118. package/lib/esm/components/wizardLayout/WizardMain.d.ts +7 -1
  119. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  120. package/lib/esm/components/wizardLayout/WizardMain.js +202 -18
  121. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +4 -2
  122. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  123. package/lib/esm/components/wizardLayout/WizardNavigation.js +13 -16
  124. package/lib/esm/components/wizardLayout/index.d.ts +1 -0
  125. package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
  126. package/lib/esm/components/wizardLayout/index.js +1 -0
  127. package/lib/esm/constants/askRedHatMessages.d.ts +35 -0
  128. package/lib/esm/constants/askRedHatMessages.d.ts.map +1 -0
  129. package/lib/esm/constants/askRedHatMessages.js +36 -0
  130. package/lib/esm/context/AIResponseContext.d.ts +10 -0
  131. package/lib/esm/context/AIResponseContext.d.ts.map +1 -0
  132. package/lib/esm/context/AIResponseContext.js +26 -0
  133. package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
  134. package/lib/esm/context/RootTroubleshootProvider.js +8 -6
  135. package/lib/esm/css/AskRedHat.css +359 -0
  136. package/lib/esm/css/app.css +4 -5
  137. package/lib/esm/css/case.css +6 -39
  138. package/lib/esm/css/results.css +2 -2
  139. package/lib/esm/hooks/useWizard.d.ts +6 -0
  140. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  141. package/lib/esm/hooks/useWizard.js +1 -1
  142. package/lib/esm/reducers/AIResponseConstNTypes.d.ts +48 -0
  143. package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +1 -0
  144. package/lib/esm/reducers/AIResponseConstNTypes.js +16 -0
  145. package/lib/esm/reducers/AIResponseReducer.d.ts +9 -0
  146. package/lib/esm/reducers/AIResponseReducer.d.ts.map +1 -0
  147. package/lib/esm/reducers/AIResponseReducer.js +43 -0
  148. package/lib/esm/reducers/CaseConstNTypes.d.ts +2 -0
  149. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  150. package/lib/esm/reducers/CaseConstNTypes.js +2 -0
  151. package/lib/esm/scss/_main.scss +22 -84
  152. package/lib/esm/scss/_pf-overrides.scss +10 -37
  153. package/package.json +7 -6
@@ -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,CA0PtC,CAAC"}
@@ -0,0 +1,151 @@
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
+ const answer = (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.answer) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.content) || 'No AI response available yet.';
43
+ const sources = (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.sources) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.references) || [];
44
+ const sourcesCount = sources.length || 0;
45
+ const isLoading = aiResponseState.isLoading || !aiResponse;
46
+ const { parseMarkdown } = useParseRuleMarkdown();
47
+ const config = {
48
+ appSourceId: appSourceId_ARH,
49
+ packageVersion: (_a = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _a === void 0 ? void 0 : _a.packageVersion,
50
+ 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 : '',
51
+ appEnv: Env.getEnvName(),
52
+ };
53
+ const handleFeedbackSubmit = (selectedResponse, additionalFeedback) => __awaiter(void 0, void 0, void 0, function* () {
54
+ setShowFeedbackCard(false);
55
+ try {
56
+ const payload = {
57
+ rating: (feedbackType === 'positive' ? 'positive' : 'negative'),
58
+ freeform: additionalFeedback || undefined,
59
+ predefined_response: selectedResponse,
60
+ };
61
+ yield sendRHDirectMessageFeedback(conversationId, messageId, payload, config);
62
+ setShowFeedbackComplete(true);
63
+ setSubmittedFeedbackTypes(prev => [...prev, feedbackType]);
64
+ }
65
+ catch (error) {
66
+ setShowFeedbackCard(false);
67
+ }
68
+ });
69
+ const responseActions = {
70
+ positive: Object.assign({ onClick: () => {
71
+ setFeedbackType('positive');
72
+ setShowFeedbackCard(true);
73
+ } }, TOOLTIP_MESSAGES.positive),
74
+ negative: Object.assign({ onClick: () => {
75
+ setFeedbackType('negative');
76
+ setShowFeedbackCard(true);
77
+ } }, TOOLTIP_MESSAGES.negative),
78
+ copy: Object.assign({ onClick: () => {
79
+ navigator.clipboard.writeText(answer);
80
+ } }, TOOLTIP_MESSAGES.copy),
81
+ };
82
+ if (isLoading) {
83
+ return (React.createElement("div", { className: "ask-redhat" },
84
+ React.createElement("p", { className: "ask-redhat-title" },
85
+ React.createElement(StarIcon, { width: 20, height: 20 }),
86
+ "Resolve your issue now with AI insights"),
87
+ React.createElement("div", { className: "ask-redhat-content-wrapper" },
88
+ React.createElement("div", { className: "ask-redhat-content", style: { textAlign: 'center', padding: '2rem' } },
89
+ React.createElement(Spinner, { size: "lg" }),
90
+ React.createElement("p", { style: { marginTop: '1rem' } }, "Getting AI insights..."))),
91
+ !aiResponseState.isLoading && (React.createElement("div", { className: "ask-redhat-toggle-button" },
92
+ React.createElement(Button, { variant: "link", onClick: handleChatWithAIClick, className: "ask-redhat-chat-button" }, "Chat with AI to get started")))));
93
+ }
94
+ if (aiResponseState.error) {
95
+ return (React.createElement("div", { className: "ask-redhat" },
96
+ React.createElement("p", { className: "ask-redhat-title" },
97
+ React.createElement(StarIcon, { width: 20, height: 20 }),
98
+ "Resolve your issue now with AI insights"),
99
+ React.createElement("div", { className: "ask-redhat-content-wrapper" },
100
+ React.createElement("div", { className: "ask-redhat-content", style: { textAlign: 'center', padding: '2rem' } },
101
+ React.createElement("p", { style: { color: '#d73502', marginBottom: '1rem' } }, "Unable to get AI insights. Please try again later."),
102
+ React.createElement(Button, { variant: "link", onClick: handleChatWithAIClick, className: "ask-redhat-chat-button", icon: React.createElement(StarIcon, null) }, "Try again with AI Chat")))));
103
+ }
104
+ return (React.createElement("div", { className: "ask-redhat" },
105
+ React.createElement("p", { className: "ask-redhat-title" },
106
+ React.createElement(StarIcon, { width: 20, height: 20 }),
107
+ "Resolve your issue now with AI insights"),
108
+ React.createElement("div", { className: "ask-redhat-content-wrapper" },
109
+ React.createElement("div", { ref: contentRef, className: `ask-redhat-content ${isExpanded ? 'ask-redhat-content--expanded' : ''}` },
110
+ React.createElement("div", { className: `ask-redhat-content-scrollable ${isExpanded ? 'ask-redhat-content--expanded-scrollable' : ''}` },
111
+ React.createElement("div", null,
112
+ React.createElement("div", { dangerouslySetInnerHTML: { __html: parseMarkdown(answer) } }),
113
+ sourcesCount > 0 && (React.createElement(React.Fragment, null,
114
+ React.createElement("p", null, "2 sources"),
115
+ React.createElement("div", { className: "ask-redhat-cards" }, sources.map((source, index) => (React.createElement(Card, { className: "ask-redhat-card", key: index },
116
+ React.createElement(CardHeader, null,
117
+ React.createElement("h3", { className: "ask-redhat-card-title" },
118
+ React.createElement("a", { href: source.link, target: "_blank", rel: "noopener noreferrer" }, source.title))),
119
+ React.createElement(CardBody, null,
120
+ React.createElement("p", null, source.snippet)))))))),
121
+ React.createElement("div", { className: "response-actions-wrapper" },
122
+ React.createElement(ResponseActions, { actions: responseActions, submittedFeedbackTypes: submittedFeedbackTypes })))),
123
+ React.createElement("div", { className: "ask-redhat-footer-wrapper" },
124
+ React.createElement("div", { className: "ask-redhat-footer" },
125
+ React.createElement("p", { className: "ask-redhat-footer-text" }, "Want to continue the conversation? Dive deeper with our AI assistant"),
126
+ React.createElement(Button, { onClick: handleChatWithAIClick, className: 'ask-redhat-chat-button', icon: React.createElement(StarIcon, null) }, "Chat with AI"))),
127
+ !isExpanded && React.createElement("div", { className: "ask-redhat-fade-overlay" }))),
128
+ React.createElement("div", { className: "ask-redhat-toggle-button-wrapper" },
129
+ React.createElement("div", { className: "ask-redhat-border-line" }),
130
+ React.createElement(Button, { onClick: onToggle, className: isExpanded ? 'ask-redhat-toggle-button-collapsed' : 'ask-redhat-toggle-button' },
131
+ isExpanded ? React.createElement(CollapseIcon, null) : React.createElement(StarIcon, { width: 20, height: 20 }),
132
+ isExpanded ? '' : 'Read more')),
133
+ React.createElement(Modal, { variant: ModalVariant.small, isOpen: showFeedbackCard, onClose: () => {
134
+ setShowFeedbackCard(false);
135
+ setFeedbackType('');
136
+ } },
137
+ React.createElement(UserFeedback, { title: feedbackType === 'positive'
138
+ ? MODAL_MESSAGES.feedback.positive
139
+ : MODAL_MESSAGES.feedback.negative, hasTextArea: true, quickResponses: feedbackType === 'positive' ? QUICK_RESPONSES.positive : QUICK_RESPONSES.negative, onSubmit: handleFeedbackSubmit, onClose: () => {
140
+ setShowFeedbackCard(false);
141
+ setFeedbackType('');
142
+ } })),
143
+ React.createElement(Modal, { variant: ModalVariant.small, isOpen: showFeedbackComplete, onClose: () => {
144
+ setShowFeedbackComplete(false);
145
+ setFeedbackType('');
146
+ } },
147
+ React.createElement(UserFeedbackComplete, { title: MODAL_MESSAGES.complete.title, body: MODAL_MESSAGES.complete.body, onClose: () => {
148
+ setShowFeedbackComplete(false);
149
+ setFeedbackType('');
150
+ } }))));
151
+ };
@@ -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;
@@ -0,0 +1,20 @@
1
+ import { ButtonProps } from '@patternfly/react-core';
2
+ import React, { type FunctionComponent, type MouseEvent } from 'react';
3
+ export interface ActionProps extends Omit<ButtonProps, 'ref'> {
4
+ ariaLabel?: string;
5
+ clickedAriaLabel?: string;
6
+ onClick?: ((event: MouseEvent | React.MouseEvent<Element, MouseEvent> | KeyboardEvent) => void) | undefined;
7
+ tooltipContent?: string;
8
+ clickedTooltipContent?: string;
9
+ }
10
+ export interface ResponseActionProps {
11
+ actions: {
12
+ positive?: ActionProps;
13
+ negative?: ActionProps;
14
+ copy?: ActionProps;
15
+ };
16
+ submittedFeedbackTypes?: string[];
17
+ }
18
+ export declare const ResponseActions: FunctionComponent<ResponseActionProps>;
19
+ export default ResponseActions;
20
+ //# sourceMappingURL=ResponseActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseActions.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/ResponseActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAA+B,MAAM,OAAO,CAAC;AAIpG,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,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;CAClC;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE;QACL,QAAQ,CAAC,EAAE,WAAW,CAAC;QACvB,QAAQ,CAAC,EAAE,WAAW,CAAC;QACvB,IAAI,CAAC,EAAE,WAAW,CAAC;KACtB,CAAC;IACF,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,mBAAmB,CA4FlE,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,52 @@
1
+ import OutlinedCopyIcon from '@patternfly/react-icons/dist/esm/icons/outlined-copy-icon';
2
+ import OutlinedThumbsDownIcon from '@patternfly/react-icons/dist/esm/icons/outlined-thumbs-down-icon';
3
+ import OutlinedThumbsUpIcon from '@patternfly/react-icons/dist/esm/icons/outlined-thumbs-up-icon';
4
+ import React, { useEffect, useRef, useState } from 'react';
5
+ import ResponseActionButton from './ResponseActionButton';
6
+ export const ResponseActions = ({ actions, submittedFeedbackTypes = [], }) => {
7
+ var _a, _b, _c, _d, _e, _f;
8
+ const [activeButton, setActiveButton] = useState();
9
+ const [clickStatePersisted, setClickStatePersisted] = useState(false);
10
+ useEffect(() => {
11
+ // Define the order of precedence for checking initial `isClicked`
12
+ const actionPrecedence = ['positive', 'negative', 'copy'];
13
+ let initialActive;
14
+ // Check predefined actions first based on precedence
15
+ for (const actionName of actionPrecedence) {
16
+ const actionProp = actions[actionName];
17
+ if (actionProp === null || actionProp === void 0 ? void 0 : actionProp.isClicked) {
18
+ initialActive = actionName;
19
+ break;
20
+ }
21
+ }
22
+ if (initialActive) {
23
+ // Click state is explicitly controlled by consumer.
24
+ setClickStatePersisted(true);
25
+ }
26
+ setActiveButton(initialActive);
27
+ // eslint-disable-next-line react-hooks/exhaustive-deps
28
+ }, [actions]);
29
+ const { positive, negative, copy } = actions;
30
+ const responseActions = useRef(null);
31
+ useEffect(() => {
32
+ const handleClickOutside = (e) => {
33
+ if (responseActions.current && !responseActions.current.contains(e.target) && !clickStatePersisted) {
34
+ setActiveButton(undefined);
35
+ }
36
+ };
37
+ window.addEventListener('click', handleClickOutside);
38
+ return () => {
39
+ window.removeEventListener('click', handleClickOutside);
40
+ };
41
+ }, [clickStatePersisted]);
42
+ const handleClick = (e, id, onClick) => {
43
+ setClickStatePersisted(false);
44
+ setActiveButton(id);
45
+ onClick && onClick(e);
46
+ };
47
+ return (React.createElement("div", { ref: responseActions, className: "pf-chatbot__response-actions" },
48
+ positive && (React.createElement(ResponseActionButton, { ariaLabel: "Good response", clickedAriaLabel: "Response recorded", onClick: (e) => handleClick(e, 'positive', positive.onClick), tooltipContent: (_a = positive.tooltipContent) !== null && _a !== void 0 ? _a : 'Good response', clickedTooltipContent: (_b = positive.clickedTooltipContent) !== null && _b !== void 0 ? _b : 'Response recorded', icon: React.createElement(OutlinedThumbsUpIcon, null), isClicked: activeButton === 'positive', isDisabled: submittedFeedbackTypes === null || submittedFeedbackTypes === void 0 ? void 0 : submittedFeedbackTypes.includes('positive') })),
49
+ negative && (React.createElement(ResponseActionButton, { ariaLabel: "Bad response", clickedAriaLabel: "Response recorded", onClick: (e) => handleClick(e, 'negative', negative.onClick), tooltipContent: (_c = negative.tooltipContent) !== null && _c !== void 0 ? _c : 'Bad response', clickedTooltipContent: (_d = negative.clickedTooltipContent) !== null && _d !== void 0 ? _d : 'Response recorded', icon: React.createElement(OutlinedThumbsDownIcon, null), isClicked: activeButton === 'negative', isDisabled: submittedFeedbackTypes === null || submittedFeedbackTypes === void 0 ? void 0 : submittedFeedbackTypes.includes('negative') })),
50
+ copy && (React.createElement(ResponseActionButton, { ariaLabel: "Copy", clickedAriaLabel: "Copied", onClick: (e) => handleClick(e, 'copy', copy.onClick), tooltipContent: (_e = copy.tooltipContent) !== null && _e !== void 0 ? _e : 'Copy', clickedTooltipContent: (_f = copy.clickedTooltipContent) !== null && _f !== void 0 ? _f : 'Copied', icon: React.createElement(OutlinedCopyIcon, null), isClicked: activeButton === 'copy' }))));
51
+ };
52
+ export default ResponseActions;
@@ -1,3 +1,4 @@
1
+ import '@ifd-ui/ask-redhat-core/ask-redhat-core.css';
1
2
  import React from 'react';
2
3
  interface IProps {
3
4
  inlineEditable: boolean;
@@ -6,6 +7,12 @@ interface IProps {
6
7
  collapseOnBlur?: boolean;
7
8
  autoFocus?: boolean;
8
9
  hideSaveCancel?: boolean;
10
+ isAIChatMode: boolean;
11
+ setIsAIChatMode: (value: boolean) => void;
12
+ onChatWithAIClick?: () => void;
13
+ aiServicesAvailable: boolean;
14
+ isSecureSupport?: boolean;
15
+ hasConfirmedStatesideSupport?: boolean;
9
16
  }
10
17
  declare function TroubleshootSection(props: IProps): React.JSX.Element;
11
18
  declare namespace TroubleshootSection {
@@ -1 +1 @@
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,qBAoFzC;kBApFQ,mBAAmB;;;AAuF5B,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AAUrD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAc1C,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;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAUD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAgLzC;kBAhLQ,mBAAmB;;;AAmL5B,eAAe,mBAAmB,CAAC"}