@rh-support/troubleshoot 2.6.340 → 2.6.349

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 (331) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +29 -19
  3. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  4. package/lib/esm/components/AccountInfo/OwnerSelector.js +16 -91
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +1 -1
  7. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +32 -61
  9. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/Case.js +33 -60
  11. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +10 -39
  13. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +4 -15
  15. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +55 -82
  17. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +0 -2
  18. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
  20. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -1
  21. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +6 -8
  23. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/CaseOverview/index.js +45 -76
  25. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +109 -203
  27. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +1 -0
  28. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
  30. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +3 -1
  31. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +9 -5
  33. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  34. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +17 -18
  35. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +47 -51
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  38. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +44 -49
  39. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +45 -51
  41. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +10 -21
  43. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
  44. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +2 -0
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +2 -3
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +57 -132
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +4 -9
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +58 -93
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +9 -16
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +25 -0
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +1 -0
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +91 -0
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +33 -78
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +4 -2
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +153 -122
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -4
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +137 -74
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  68. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +9 -22
  69. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  70. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +2 -9
  71. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
  72. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +1 -8
  73. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts +2 -2
  74. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts.map +1 -1
  75. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.js +7 -18
  76. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +3 -9
  77. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  78. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +263 -211
  79. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  80. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +4 -6
  81. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  82. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +1 -3
  83. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  84. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -35
  85. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  86. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +224 -63
  87. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +5 -4
  88. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  89. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +5 -18
  90. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  91. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -7
  92. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  93. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +52 -38
  94. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  95. package/lib/esm/components/CaseInformation/CaseGroup.js +57 -123
  96. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  97. package/lib/esm/components/CaseInformation/CaseInformation.js +9 -10
  98. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  99. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +30 -107
  100. package/lib/esm/components/CaseInformation/Description.js +1 -1
  101. package/lib/esm/components/CaseInformation/FileDiag.js +7 -10
  102. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  103. package/lib/esm/components/CaseInformation/Fts.js +1 -2
  104. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  105. package/lib/esm/components/CaseInformation/SupportLevel.js +55 -36
  106. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  107. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  108. package/lib/esm/components/CaseManagement/CaseManagement.js +7 -8
  109. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  110. package/lib/esm/components/CaseManagement/Cep.js +9 -11
  111. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +1 -2
  112. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  113. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +3 -22
  114. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  115. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +7 -9
  116. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  117. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +18 -13
  118. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  119. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +40 -34
  120. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  121. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +3 -8
  122. package/lib/esm/components/EditDescription/EditDescription.js +1 -1
  123. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  124. package/lib/esm/components/IdeaInformation/IdeaInformation.js +18 -16
  125. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  126. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
  127. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
  128. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  129. package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
  130. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  131. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
  132. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  133. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -37
  134. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  135. package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
  136. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  137. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -9
  138. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  139. package/lib/esm/components/Recommendations/AsideResults.js +3 -4
  140. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  141. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +4 -1
  142. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  143. package/lib/esm/components/Recommendations/ClusterRecommendations.js +4 -1
  144. package/lib/esm/components/Recommendations/InsightsResults.js +3 -3
  145. package/lib/esm/components/Recommendations/Recommendations.js +2 -2
  146. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  147. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +8 -10
  148. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  149. package/lib/esm/components/Review/Review.js +16 -20
  150. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  151. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
  152. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  153. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  154. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  155. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  156. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +62 -135
  157. package/lib/esm/components/shared/Constants.d.ts +0 -5
  158. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  159. package/lib/esm/components/shared/Constants.js +0 -5
  160. package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
  161. package/lib/esm/components/shared/fileUpload/FileLister.js +3 -3
  162. package/lib/esm/components/shared/fileUpload/FileUpload.js +3 -2
  163. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  164. package/lib/esm/components/shared/fileUpload/FileUploader.js +1 -3
  165. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  166. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +2 -2
  167. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts +1 -1
  168. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts.map +1 -1
  169. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +5 -21
  170. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  171. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +34 -210
  172. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +1 -5
  173. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  174. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +1 -36
  175. package/lib/esm/components/shared/fileUpload/types/index.d.ts +1 -4
  176. package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
  177. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +2 -2
  178. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
  179. package/lib/esm/components/shared/fileUpload/useFileUploader.js +47 -116
  180. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  181. package/lib/esm/components/shared/useIsSectionValid.js +57 -22
  182. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  183. package/lib/esm/components/shared/usePostComment.js +28 -16
  184. package/lib/esm/components/shared/utils.d.ts +0 -1
  185. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  186. package/lib/esm/components/shared/utils.js +3 -9
  187. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  188. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +38 -160
  189. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  190. package/lib/esm/components/wizardLayout/WizardAside.js +4 -2
  191. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  192. package/lib/esm/components/wizardLayout/WizardLayout.js +12 -11
  193. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  194. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -11
  195. package/lib/esm/constants/caseDetailsConstants.d.ts +0 -5
  196. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  197. package/lib/esm/constants/caseDetailsConstants.js +0 -5
  198. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  199. package/lib/esm/css/case.css +202 -60
  200. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -1
  201. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  202. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +11 -21
  203. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  204. package/lib/esm/hooks/useResetCaseCreate.js +11 -18
  205. package/lib/esm/hooks/useS3Upload.d.ts +4 -5
  206. package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
  207. package/lib/esm/hooks/useS3Upload.js +30 -28
  208. package/lib/esm/i18n/template-de.d.ts +2 -2
  209. package/lib/esm/i18n/template-de.js +2 -2
  210. package/lib/esm/i18n/template-es.d.ts +2 -2
  211. package/lib/esm/i18n/template-es.js +2 -2
  212. package/lib/esm/i18n/template-fr.d.ts +2 -2
  213. package/lib/esm/i18n/template-fr.js +2 -2
  214. package/lib/esm/i18n/template-it.d.ts +2 -2
  215. package/lib/esm/i18n/template-it.js +2 -2
  216. package/lib/esm/i18n/template-jp.d.ts +2 -2
  217. package/lib/esm/i18n/template-jp.js +2 -2
  218. package/lib/esm/i18n/template-ko.d.ts +2 -2
  219. package/lib/esm/i18n/template-ko.js +2 -2
  220. package/lib/esm/i18n/template-pt.d.ts +2 -2
  221. package/lib/esm/i18n/template-pt.js +2 -2
  222. package/lib/esm/i18n/template-ru.d.ts +2 -2
  223. package/lib/esm/i18n/template-ru.js +2 -2
  224. package/lib/esm/i18n/template-zh.d.ts +2 -2
  225. package/lib/esm/i18n/template-zh.js +2 -2
  226. package/lib/esm/index.js +0 -1
  227. package/lib/esm/models/cache.d.ts +2 -0
  228. package/lib/esm/models/cache.d.ts.map +1 -1
  229. package/lib/esm/reducers/CaseConstNTypes.d.ts +9 -121
  230. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  231. package/lib/esm/reducers/CaseConstNTypes.js +7 -30
  232. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +5 -7
  233. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  234. package/lib/esm/reducers/CaseDetailsPageReducer.js +26 -58
  235. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +12 -11
  236. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  237. package/lib/esm/reducers/CaseDiscussionTabReducer.js +70 -63
  238. package/lib/esm/reducers/CaseHelpers.d.ts +2 -3
  239. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  240. package/lib/esm/reducers/CaseHelpers.js +15 -98
  241. package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
  242. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  243. package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
  244. package/lib/esm/reducers/CaseReducer.d.ts +11 -50
  245. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  246. package/lib/esm/reducers/CaseReducer.js +99 -270
  247. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  248. package/lib/esm/reducers/RecommendationsReducer.js +18 -15
  249. package/lib/esm/scss/_main.scss +0 -9
  250. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +2 -1
  251. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  252. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  253. package/package.json +8 -9
  254. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +0 -7
  255. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +0 -1
  256. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +0 -17
  257. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -4
  258. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
  259. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -23
  260. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -29
  261. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
  262. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -29
  263. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
  264. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
  265. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -60
  266. package/lib/esm/components/CaseInformation/CaseLabels.d.ts +0 -3
  267. package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +0 -1
  268. package/lib/esm/components/CaseInformation/CaseLabels.js +0 -103
  269. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +0 -4
  270. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +0 -1
  271. package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +0 -109
  272. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +0 -3
  273. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +0 -1
  274. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +0 -9
  275. package/lib/esm/graphql/index.d.ts +0 -4
  276. package/lib/esm/graphql/index.d.ts.map +0 -1
  277. package/lib/esm/graphql/index.js +0 -3
  278. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
  279. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
  280. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
  281. package/lib/esm/graphql/mutations/index.d.ts +0 -2
  282. package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
  283. package/lib/esm/graphql/mutations/index.js +0 -1
  284. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
  285. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
  286. package/lib/esm/graphql/queries/getEscalationDetails.js +0 -31
  287. package/lib/esm/graphql/queries/getParentId.d.ts +0 -2
  288. package/lib/esm/graphql/queries/getParentId.d.ts.map +0 -1
  289. package/lib/esm/graphql/queries/getParentId.js +0 -16
  290. package/lib/esm/graphql/queries/index.d.ts +0 -3
  291. package/lib/esm/graphql/queries/index.d.ts.map +0 -1
  292. package/lib/esm/graphql/queries/index.js +0 -2
  293. package/lib/esm/graphql/schemas/escalation.d.ts +0 -88
  294. package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
  295. package/lib/esm/graphql/schemas/escalation.js +0 -1
  296. package/lib/esm/graphql/schemas/index.d.ts +0 -2
  297. package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
  298. package/lib/esm/graphql/schemas/index.js +0 -1
  299. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
  300. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
  301. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -52
  302. package/lib/esm/hooks/useCaseComments/index.d.ts +0 -7
  303. package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
  304. package/lib/esm/hooks/useCaseComments/index.js +0 -5
  305. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
  306. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
  307. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -75
  308. package/lib/esm/hooks/useCaseComments/types.d.ts +0 -85
  309. package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
  310. package/lib/esm/hooks/useCaseComments/types.js +0 -1
  311. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -17
  312. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
  313. package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -38
  314. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
  315. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
  316. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
  317. package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
  318. package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
  319. package/lib/esm/hooks/useCaseHistory.js +0 -98
  320. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +0 -21
  321. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +0 -1
  322. package/lib/esm/hooks/useCaseLabelLinkMutations.js +0 -84
  323. package/lib/esm/models/caseHistory.d.ts +0 -80
  324. package/lib/esm/models/caseHistory.d.ts.map +0 -1
  325. package/lib/esm/models/caseHistory.js +0 -1
  326. package/lib/esm/utils/TimelineUtils.d.ts +0 -41
  327. package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
  328. package/lib/esm/utils/TimelineUtils.js +0 -135
  329. package/lib/esm/utils/caseHistoryUtils.d.ts +0 -66
  330. package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
  331. package/lib/esm/utils/caseHistoryUtils.js +0 -165
@@ -7,15 +7,13 @@ 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 { useApolloClient } from '@apollo/client/react';
10
+ import { caseAttachments, kase } from '@cee-eng/hydrajs';
11
11
  import { Button, ButtonVariant, Icon, Tooltip, TooltipPosition } from '@patternfly/react-core';
12
12
  import PaperclipIcon from '@patternfly/react-icons/dist/js/icons/paperclip-icon';
13
13
  import { InlineEdit, LoadingIndicator, ToastNotification, useConfirmation, useCopyToClipboard, useFetch, } from '@rh-support/components';
14
- // TODO: Re-enable when secure support download restrictions are needed again
15
- // import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
16
- import { useCanEditCase } from '@rh-support/react-context';
14
+ import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
17
15
  import { ability, CaseDiscussionFields, resourceActions, resources } from '@rh-support/user-permissions';
18
- import { deleteCaseAttachment, formatDateTime, humanizeSize, updateCaseAttachmentDescriptionByGraphQL, } from '@rh-support/utils';
16
+ import { formatDateTime, humanizeSize } from '@rh-support/utils';
19
17
  import isEmpty from 'lodash/isEmpty';
20
18
  import React, { useContext, useRef, useState } from 'react';
21
19
  import { Trans, useTranslation } from 'react-i18next';
@@ -29,35 +27,18 @@ const CaseAttachment = React.forwardRef((props, ref) => {
29
27
  const { t } = useTranslation();
30
28
  const clipboardRef = useRef(null);
31
29
  const { clipboardText, copyToClipboard } = useCopyToClipboard(clipboardRef);
32
- const { request, isFetching: isDeleting } = useFetch(deleteCaseAttachment, { propgateErrors: true });
30
+ const { request, isFetching: isDeleting } = useFetch(caseAttachments.deleteAttachment, { propgateErrors: true });
33
31
  const canSeePrivateAttachments = ability.can(resourceActions.PATCH, resources.CASE_COMMENTS, CaseDiscussionFields.VIEW_PRIVATE_ATTACHMENT);
34
- // TODO: Re-enable when secure support download restrictions are needed again
35
- // const {
36
- // globalMetadataState: { loggedInUsersAccount },
37
- // } = useContext(GlobalMetadataStateContext);
32
+ const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
38
33
  const [isCardIsDeleted, setIsCardIsDeleted] = useState(false); // adds a class name needed for anim when card is removed
39
34
  const { isExportingPDF } = useContext(PDFContext);
40
35
  const confirm = useConfirmation();
41
36
  const [attachmentDescription, setAttachmentDescription] = useState(props.attachment.description);
42
- const [isUpdating, setIsUpdating] = useState(false);
43
- const apolloClient = useApolloClient();
37
+ const { request: updateDescriptionRequest, isFetching: isUpdating } = useFetch(kase.updateAttachment);
44
38
  const canEditCase = useCanEditCase();
45
39
  const onDescriptionSave = () => __awaiter(void 0, void 0, void 0, function* () {
46
- if (!apolloClient.mutate) {
47
- ToastNotification.addDangerMessage(t('Failed to update attachment description'));
48
- return;
49
- }
50
- setIsUpdating(true);
51
- try {
52
- const updatedAttachment = yield updateCaseAttachmentDescriptionByGraphQL(apolloClient, props.attachment, attachmentDescription);
53
- props.onMetadataUpdate && props.onMetadataUpdate(props.attachment.uuid, updatedAttachment);
54
- }
55
- catch (_a) {
56
- ToastNotification.addDangerMessage(t('Failed to update attachment description'));
57
- }
58
- finally {
59
- setIsUpdating(false);
60
- }
40
+ const updatedAttachment = yield updateDescriptionRequest(props.attachment.caseNumber, props.attachment.uuid, [{ path: 'description', op: 'update', value: attachmentDescription }], loggedInUsersAccount.data.secureSupport);
41
+ props.onMetadataUpdate && props.onMetadataUpdate(props.attachment.uuid, updatedAttachment);
61
42
  });
62
43
  const onDescriptionChange = (event) => {
63
44
  if (canEditCase.alert())
@@ -80,9 +61,7 @@ const CaseAttachment = React.forwardRef((props, ref) => {
80
61
  "?")),
81
62
  });
82
63
  try {
83
- // TODO: Re-enable when delete API accepts isSecureSupport again
84
- // await request!(attachment.caseNumber!, attachment.uuid!, loggedInUsersAccount.data.secureSupport);
85
- yield request(attachment.caseNumber, attachment.uuid);
64
+ yield request(attachment.caseNumber, attachment.uuid, loggedInUsersAccount.data.secureSupport);
86
65
  ToastNotification.addSuccessMessage(t('Successfully deleted attachment: {{file}}', { file: attachment.fileName }));
87
66
  setIsCardIsDeleted(true);
88
67
  window.setTimeout(() => {
@@ -106,53 +85,29 @@ const CaseAttachment = React.forwardRef((props, ref) => {
106
85
  name: fileName,
107
86
  });
108
87
  };
109
- // Prefer size (bytes); fall back to sizeKB when GraphQL only populated the KB field.
110
- const attachmentSizeBytes = props.attachment.size > 0
111
- ? props.attachment.size
112
- : props.attachment.sizeKB > 0
113
- ? props.attachment.sizeKB * 1024
114
- : 0;
115
- const attachmentSizeLabel = attachmentSizeBytes > 0 ? humanizeSize(attachmentSizeBytes) : '';
116
- const attachmentLinkLabel = attachmentSizeLabel
117
- ? `${props.attachment.fileName} (${attachmentSizeLabel})`
118
- : props.attachment.fileName;
119
88
  const renderAttachmentLink = () => {
120
- // TODO: Re-enable secure support download gating when needed again
121
- // if (!loggedInUsersAccount.data.secureSupport) {
122
- // if (isExportingPDF) {
123
- // return (
124
- // <a href={props.attachment.link}>
125
- // <span>{attachmentLinkLabel}</span>
126
- // </a>
127
- // );
128
- // }
129
- // return (
130
- // <Button
131
- // className="attachment-download-btn"
132
- // title={t('Download {{fileName}}', { fileName: props.attachment.fileName })}
133
- // variant={ButtonVariant.link}
134
- // isInline
135
- // onClick={onAttachmentDownloadClick}
136
- // data-tracking-id="attachment-download-button"
137
- // >
138
- // <span>{attachmentLinkLabel}</span>
139
- // </Button>
140
- // );
141
- // }
142
- // return (
143
- // <Tooltip
144
- // position={TooltipPosition.top}
145
- // content={t(`You don't have appropriate permissions to download the attachment`)}
146
- // >
147
- // <strong>{attachmentLinkLabel}</strong>
148
- // </Tooltip>
149
- // );
150
- if (isExportingPDF) {
151
- return (React.createElement("a", { href: props.attachment.link },
152
- React.createElement("span", null, attachmentLinkLabel)));
89
+ if (!loggedInUsersAccount.data.secureSupport) {
90
+ if (isExportingPDF) {
91
+ return (React.createElement("a", { href: props.attachment.link },
92
+ React.createElement("span", null,
93
+ props.attachment.fileName,
94
+ " (",
95
+ humanizeSize(props.attachment.size),
96
+ ")")));
97
+ }
98
+ return (React.createElement(Button, { className: "attachment-download-btn", title: t('Download {{fileName}}', { fileName: props.attachment.fileName }), variant: ButtonVariant.link, onClick: onAttachmentDownloadClick, "data-tracking-id": "attachment-download-button" },
99
+ React.createElement("span", null,
100
+ props.attachment.fileName,
101
+ " (",
102
+ humanizeSize(props.attachment.size),
103
+ ")")));
153
104
  }
154
- return (React.createElement(Button, { className: "attachment-download-btn", title: t('Download {{fileName}}', { fileName: props.attachment.fileName }), variant: ButtonVariant.link, isInline: true, onClick: onAttachmentDownloadClick, "data-tracking-id": "attachment-download-button" },
155
- React.createElement("span", null, attachmentLinkLabel)));
105
+ return (React.createElement(Tooltip, { position: TooltipPosition.top, content: t(`You don't have appropriate permissions to download the attachment`) },
106
+ React.createElement("strong", null,
107
+ props.attachment.fileName,
108
+ " (",
109
+ humanizeSize(props.attachment.size),
110
+ ")")));
156
111
  };
157
112
  const onJumpToComment = (attachmentId) => () => props.showJumpToComment && props.onJumpToComment && props.onJumpToComment(attachmentId);
158
113
  if (((_a = props.attachment) === null || _a === void 0 ? void 0 : _a.isPrivate) && !canSeePrivateAttachments)
@@ -170,7 +125,7 @@ const CaseAttachment = React.forwardRef((props, ref) => {
170
125
  React.createElement("h4", null,
171
126
  React.createElement(Icon, { className: "pf-v6-u-mr-xs" },
172
127
  React.createElement(PaperclipIcon, null)),
173
- props.attachment.createdBy),
128
+ props.attachment.modifiedBy),
174
129
  React.createElement("time", { className: "text-right" }, formatDateTime(props.attachment.lastModifiedDate))),
175
130
  React.createElement("div", { className: "comment-body" },
176
131
  React.createElement(Trans, null, "Attached file"),
@@ -186,7 +141,7 @@ const CaseAttachment = React.forwardRef((props, ref) => {
186
141
  React.createElement("code", { ref: clipboardRef }, props.attachment.checksum)),
187
142
  React.createElement(Tooltip, { position: TooltipPosition.top, content: clipboardText, trigger: "click" },
188
143
  React.createElement("button", { "aria-label": "Copy to clipboard", className: "nimbus-icon-clipboard clip-code-raw-btn xs-icon", onClick: copyToClipboard, type: "button" }))))),
189
- React.createElement(InlineEdit, { labelProps: { htmlFor: `case-details-file-description-${props.attachment.id}` }, allowInlineEdit: !canEditCase.isCaseNotEditable, labelContent: React.createElement(Trans, null, "Description"), content: React.createElement("div", { className: "clip-content-wrapper code-block" }, props.attachment.description), hideSaveCancel: false, onSave: onDescriptionSave, onCancel: onDescriptionCancel, dataTrackingId: "case-details-file-description", initialIsEditing: props.attachment.description ? false : true, saveDisabled: isCaseAttachmentDescriptionLengthy ||
144
+ React.createElement(InlineEdit, { labelProps: { htmlFor: `case-details-file-description-${props.attachment.id}` }, allowInlineEdit: true, labelContent: React.createElement(Trans, null, "Description"), content: React.createElement("div", { className: "clip-content-wrapper code-block" }, props.attachment.description), hideSaveCancel: false, onSave: onDescriptionSave, onCancel: onDescriptionCancel, dataTrackingId: "case-details-file-description", initialIsEditing: props.attachment.description ? false : true, saveDisabled: isCaseAttachmentDescriptionLengthy ||
190
145
  isCaseAttachmentDescription ||
191
146
  attachmentDescription === props.attachment.description ||
192
147
  isUpdating, loadingIndicator: isUpdating ? React.createElement(LoadingIndicator, { isInline: true }) : undefined, isExportingPDF: isExportingPDF },
@@ -198,7 +153,7 @@ const CaseAttachment = React.forwardRef((props, ref) => {
198
153
  React.createElement("span", { className: "pull-right pf-v6-l-flex pf-m-align-items-center" },
199
154
  props.showJumpToComment && (React.createElement(DiscussionItemLink, { onClick: onJumpToComment(props.attachment.id), discussionType: DiscussionType.ATTACHMENT, itemId: props.attachment.id, caseNumber: props.attachment.caseNumber, isCopyLink: false },
200
155
  React.createElement(Trans, null, "Jump to attachment"))),
201
- React.createElement("button", { className: `btn btn-app btn-link text-danger ${isExportingPDF ? 'hide-in-pdf' : ''}`, title: "Delete attachment", onClick: deleteAttachment(props.attachment), "data-tracking-id": "delete-attachmentid-button", type: "button", disabled: canEditCase.isCaseNotEditable },
156
+ React.createElement("button", { className: `btn btn-app btn-link text-danger ${isExportingPDF ? 'hide-in-pdf' : ''}`, title: "Delete attachment", onClick: deleteAttachment(props.attachment), "data-tracking-id": "delete-attachmentid-button", type: "button" },
202
157
  React.createElement(Trans, null, "Delete")),
203
158
  React.createElement(JumpAndCopyLink, { caseNumber: props.attachment.caseNumber, cardId: props.attachment.id, discussionType: DiscussionType.ATTACHMENT })))));
204
159
  });
@@ -1,12 +1,14 @@
1
1
  import { ICaseComment } from '@cee-eng/hydrajs/@types/api/public/case';
2
2
  import React from 'react';
3
+ export declare const AUTOMATED_SUPPORT_ASSISTANT = "Support AI Assistant";
3
4
  interface IProps {
4
5
  caseNumber: string;
5
6
  comment: ICaseComment;
6
7
  feedback: number;
7
- onFeedBackUpdate: (id: string, feedback: number) => void;
8
+ feedbackReason?: string;
9
+ onFeedBackUpdate: (id: string, feedback: number, feedbackReason?: string) => void;
8
10
  accountNumber: string;
9
- onReply: (author: string, commentId: string, timestamp: string) => void;
11
+ onReply: (commentText: string, commentCreator: string, isPublic: boolean) => void;
10
12
  showJumpToComment?: boolean;
11
13
  onJumpToComment?: (commentId: string) => void;
12
14
  downloadAttachment: ({ caseNumber, uuid, name }: {
@@ -1 +1 @@
1
- {"version":3,"file":"CaseComments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AA2BvE,OAAO,KAAwC,MAAM,OAAO,CAAC;AAU7D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,YAAY,4EA8UhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"CaseComments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AA+BvE,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAElE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClF,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAClF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,YAAY,4EAqdhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -1,104 +1,122 @@
1
- // TODO: Re-enable after GraphQL migration of feedback (Allowed Regression #5)
2
- // import { ICommentFeedback } from '@cee-eng/hydrajs/@types/api/public/commentFeedback';
3
- import { EventTypes, linkifyBZIDs, linkifyWithCaseIDs, processRME } from '@cee-eng/ui-toolkit';
4
- import { Icon } from '@patternfly/react-core';
5
- // TODO: Re-enable after GraphQL migration of feedback (Allowed Regression #5)
6
- // import { Tooltip, TooltipPosition } from '@patternfly/react-core';
7
- // import FrownIcon from '@patternfly/react-icons/dist/js/icons/frown-icon';
8
- // import MehIcon from '@patternfly/react-icons/dist/js/icons/meh-icon';
9
- // import OutlinedFrownIcon from '@patternfly/react-icons/dist/js/icons/outlined-frown-icon';
10
- // import OutlinedMehIcon from '@patternfly/react-icons/dist/js/icons/outlined-meh-icon';
11
- // import OutlinedSmileIcon from '@patternfly/react-icons/dist/js/icons/outlined-smile-icon';
12
- // import SmileIcon from '@patternfly/react-icons/dist/js/icons/smile-icon';
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 { publicApi } from '@cee-eng/hydrajs';
11
+ import { encodeAngularBrackets, EventTypes, htmlEntitiesEncode, linkifyBZIDs, linkifyWithCaseIDs, parseCommentMarkdown, processRME, } from '@cee-eng/ui-toolkit';
12
+ import { Alert, AlertActionLink, Button, ButtonVariant, Icon, Tooltip, TooltipPosition } from '@patternfly/react-core';
13
+ import FrownIcon from '@patternfly/react-icons/dist/js/icons/frown-icon';
14
+ import MehIcon from '@patternfly/react-icons/dist/js/icons/meh-icon';
15
+ import OutlinedFrownIcon from '@patternfly/react-icons/dist/js/icons/outlined-frown-icon';
16
+ import OutlinedMehIcon from '@patternfly/react-icons/dist/js/icons/outlined-meh-icon';
17
+ import OutlinedSmileIcon from '@patternfly/react-icons/dist/js/icons/outlined-smile-icon';
18
+ import SmileIcon from '@patternfly/react-icons/dist/js/icons/smile-icon';
13
19
  import UserCircleIcon from '@patternfly/react-icons/dist/js/icons/user-circle-icon';
14
- // TODO: Re-enable after GraphQL migration of feedback (Allowed Regression #5)
15
- // import { LoadingIndicator, ToastNotification } from '@rh-support/components';
16
- import { AbilityContext,
17
- // CaseDetailsFields, // TODO: Re-enable after GraphQL migration of feedback
18
- CaseDiscussionFields, resourceActions, resources, } from '@rh-support/user-permissions';
20
+ import { EditorMode, LoadingIndicator, ToastNotification } from '@rh-support/components';
21
+ import { AbilityContext, CaseDetailsFields, CaseDiscussionFields, resourceActions, resources, } from '@rh-support/user-permissions';
19
22
  import { formatDateTime, linkifyLinks } from '@rh-support/utils';
20
23
  import DOMPurify from 'dompurify';
21
24
  import isEmpty from 'lodash/isEmpty';
22
25
  import isEqual from 'lodash/isEqual';
23
- import React, { useContext, useEffect, useRef } from 'react';
24
- import { Trans } from 'react-i18next';
25
- // TODO: Re-enable after GraphQL migration of feedback
26
- // import { useTranslation } from 'react-i18next';
26
+ import React, { useContext, useEffect, useRef, useState } from 'react';
27
+ import { Trans, useTranslation } from 'react-i18next';
27
28
  import { DiscussionType } from '../../../../reducers/CaseDiscussionTabReducer';
28
29
  import { PDFContext } from '../../PDFContainer';
30
+ import { AsaCommentFeedbackModal } from './AsaCommentFeedbackModal';
29
31
  import { DiscussionItemLink } from './DiscussionItemLink';
30
32
  import { JumpAndCopyLink } from './JumpAndCopyLink';
33
+ export const AUTOMATED_SUPPORT_ASSISTANT = 'Support AI Assistant';
31
34
  const CaseComments = React.forwardRef((props, ref) => {
32
- var _a;
35
+ var _a, _b;
33
36
  const { caseNumber } = props;
34
37
  const markdownRef = useRef(null);
35
- // TODO: Re-enable `t` after GraphQL migration of feedback (Allowed Regression #5)
36
- // const { t } = useTranslation();
38
+ const { t } = useTranslation();
37
39
  const ability = useContext(AbilityContext);
38
40
  const canSeePrivateComments = ability.can(resourceActions.PATCH, resources.CASE_COMMENTS, CaseDiscussionFields.VIEW_PRIVATE_COMMENT);
39
- // TODO: Re-enable after GraphQL migration of feedback (Allowed Regression #5)
40
- // const canSeeFeedbackButtons =
41
- // ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_FEEDBACK_BUTTONS) &&
42
- // props.comment.isPublic &&
43
- // props.comment.createdBy !== 'Automated Support Assistant';
44
- // TODO: Re-enable after GraphQL migration of feedback (Allowed Regression #5)
45
- // const [isFeedbackUpdating, setIsFeedbackUpdating] = useState(false);
41
+ const isAsaComment = props.comment.createdBy === AUTOMATED_SUPPORT_ASSISTANT;
42
+ const canGiveCommentFeedback = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_FEEDBACK_BUTTONS);
43
+ const canSeeFeedbackButtons = canGiveCommentFeedback && props.comment.isPublic && !isAsaComment;
44
+ const [isFeedbackUpdating, setIsFeedbackUpdating] = useState(false);
45
+ const [isAsaFeedbackModalOpen, setIsAsaFeedbackModalOpen] = useState(false);
46
+ const [savedFeedbackValue, setSavedFeedbackValue] = useState(props.feedback);
47
+ const [savedFeedbackReason, setSavedFeedbackReason] = useState((_a = props.feedbackReason) !== null && _a !== void 0 ? _a : '');
46
48
  const { isExportingPDF } = useContext(PDFContext);
49
+ useEffect(() => {
50
+ setSavedFeedbackValue(props.feedback);
51
+ }, [props.feedback]);
52
+ useEffect(() => {
53
+ var _a;
54
+ setSavedFeedbackReason((_a = props.feedbackReason) !== null && _a !== void 0 ? _a : '');
55
+ }, [props.feedbackReason]);
56
+ const commentReply = (comment) => () => {
57
+ props.onReply(comment.commentBody, comment.createdBy, comment.isPublic);
58
+ };
47
59
  const onJumpToComment = (commentId) => () => props.showJumpToComment && props.onJumpToComment && props.onJumpToComment(commentId);
48
- // TODO: Re-enable after GraphQL migration of feedback (Allowed Regression #5)
49
- // const applyCommentFeedback = (comment: ICaseComment, feedback) => async (e) => {
50
- // e.preventDefault();
51
- // if (props.feedback === feedback) return;
52
- // const commJson: ICommentFeedback = {
53
- // feedback,
54
- // accountNumber: props.accountNumber,
55
- // commentId: comment.id,
56
- // commentCreatedBy: comment.createdBy,
57
- // };
58
- // try {
59
- // setIsFeedbackUpdating(true);
60
- // if (props.feedback !== undefined) {
61
- // await publicApi.commentFeedback.updateCommentFeedback(caseNumber, commJson);
62
- // } else {
63
- // await publicApi.commentFeedback.createCommentFeedback(caseNumber, commJson);
64
- // }
65
- // setIsFeedbackUpdating(false);
66
- // props.onFeedBackUpdate(comment.id, feedback);
67
- // ToastNotification.addSuccessMessage(t(`Comment feedback has been successfully updated`));
68
- // } catch (e) {
69
- // setIsFeedbackUpdating(false);
70
- // ToastNotification.addDangerMessage(t(`Comment feedback failed to update`));
71
- // }
72
- // };
73
- // TODO: Re-enable after GraphQL migration of feedback (Allowed Regression #5)
74
- // const commentFeedbackButtons = (comment: ICaseComment, feedback: number) => (
75
- // <span className="comment-feedback-buttons">
76
- // <LoadingIndicator isInline={true} show={isFeedbackUpdating} />
77
- // <Tooltip position={TooltipPosition.top} content={t('Positive feedback')}>
78
- // <button className="btn btn-app btn-link" onClick={applyCommentFeedback(comment, 1)}
79
- // data-tracking-id="case-comment-feedback-up" type="button">
80
- // {feedback === 1 ? <SmileIcon title={t('Remove positive feedback')} />
81
- // : <OutlinedSmileIcon title={t('Leave positive feedback')} />}
82
- // </button>
83
- // </Tooltip>
84
- // <Tooltip position={TooltipPosition.top} content={t('Neutral feedback')}>
85
- // <button className="btn btn-app btn-link" onClick={applyCommentFeedback(comment, 0)}
86
- // data-tracking-id="case-comment-feedback-neutral" type="button">
87
- // {feedback === 0 ? <MehIcon title={t('Remove neutral feedback')} />
88
- // : <OutlinedMehIcon title={t('Leave neutral feedback')} />}
89
- // </button>
90
- // </Tooltip>
91
- // <Tooltip position={TooltipPosition.top} content={t('Negative feedback')}>
92
- // <button className="btn btn-app btn-link" onClick={applyCommentFeedback(comment, -1)}
93
- // data-tracking-id="case-comment-feedback-down" type="button">
94
- // {feedback === -1 ? <FrownIcon title={t('Remove negative feedback')} aria-label={t('Remove negative feedback')} />
95
- // : <OutlinedFrownIcon title={t('Leave negative feedback')} aria-label={t('Leave negative feedback')} />}
96
- // </button>
97
- // </Tooltip>
98
- // </span>
99
- // );
60
+ const applyCommentFeedback = (comment, feedback) => (e) => __awaiter(void 0, void 0, void 0, function* () {
61
+ e.preventDefault();
62
+ if (props.feedback === feedback) {
63
+ return;
64
+ }
65
+ yield submitCommentFeedback(comment, feedback);
66
+ });
67
+ const submitCommentFeedback = (comment, feedback, feedbackReason) => __awaiter(void 0, void 0, void 0, function* () {
68
+ var _a;
69
+ const commJson = Object.assign({ feedback, accountNumber: props.accountNumber, commentId: comment.id, commentCreatedBy: comment.createdBy }, (feedbackReason !== undefined ? { feedbackReason } : {}));
70
+ try {
71
+ setIsFeedbackUpdating(true);
72
+ const hasExistingFeedback = savedFeedbackValue !== undefined;
73
+ const response = hasExistingFeedback
74
+ ? yield publicApi.commentFeedback.updateCommentFeedback(caseNumber, commJson)
75
+ : yield publicApi.commentFeedback.createCommentFeedback(caseNumber, commJson);
76
+ setIsFeedbackUpdating(false);
77
+ const responseFeedback = (response === null || response === void 0 ? void 0 : response.feedback) !== undefined && (response === null || response === void 0 ? void 0 : response.feedback) !== null && `${response.feedback}` !== ''
78
+ ? parseInt(String(response.feedback), 10)
79
+ : feedback;
80
+ const savedFeedback = Number.isNaN(responseFeedback) ? feedback : responseFeedback;
81
+ const savedReason = (_a = response === null || response === void 0 ? void 0 : response.feedbackReason) !== null && _a !== void 0 ? _a : feedbackReason;
82
+ setSavedFeedbackValue(savedFeedback);
83
+ if (feedbackReason !== undefined) {
84
+ setSavedFeedbackReason(savedReason !== null && savedReason !== void 0 ? savedReason : '');
85
+ props.onFeedBackUpdate(comment.id, savedFeedback, savedReason !== null && savedReason !== void 0 ? savedReason : '');
86
+ }
87
+ else {
88
+ props.onFeedBackUpdate(comment.id, savedFeedback);
89
+ }
90
+ ToastNotification.addSuccessMessage(t(`Comment feedback has been successfully updated`));
91
+ return true;
92
+ }
93
+ catch (e) {
94
+ setIsFeedbackUpdating(false);
95
+ ToastNotification.addDangerMessage(t(`Comment feedback failed to update`));
96
+ return false;
97
+ }
98
+ });
99
+ const openAsaFeedbackModal = (e) => {
100
+ e === null || e === void 0 ? void 0 : e.preventDefault();
101
+ setIsAsaFeedbackModalOpen(true);
102
+ };
103
+ const onSubmitAsaFeedback = (feedback, feedbackReason) => __awaiter(void 0, void 0, void 0, function* () {
104
+ const didSubmit = yield submitCommentFeedback(props.comment, feedback, feedbackReason);
105
+ if (didSubmit) {
106
+ setIsAsaFeedbackModalOpen(false);
107
+ }
108
+ return didSubmit;
109
+ });
110
+ const commentFeedbackButtons = (comment, feedback) => (React.createElement("span", { className: "comment-feedback-buttons" },
111
+ React.createElement(LoadingIndicator, { isInline: true, show: isFeedbackUpdating }),
112
+ React.createElement(Tooltip, { position: TooltipPosition.top, content: t('Positive feedback') },
113
+ React.createElement("button", { className: "btn btn-app btn-link", onClick: applyCommentFeedback(comment, 1), "data-tracking-id": "case-comment-feedback-up", type: "button" }, feedback === 1 ? (React.createElement(SmileIcon, { title: t('Remove positive feedback') })) : (React.createElement(OutlinedSmileIcon, { title: t('Leave positive feedback') })))),
114
+ React.createElement(Tooltip, { position: TooltipPosition.top, content: t('Neutral feedback') },
115
+ React.createElement("button", { className: "btn btn-app btn-link", onClick: applyCommentFeedback(comment, 0), "data-tracking-id": "case-comment-feedback-neutral", type: "button" }, feedback === 0 ? (React.createElement(MehIcon, { title: t('Remove neutral feedback') })) : (React.createElement(OutlinedMehIcon, { title: t('Leave neutral feedback') })))),
116
+ React.createElement(Tooltip, { position: TooltipPosition.top, content: t('Negative feedback') },
117
+ React.createElement("button", { className: "btn btn-app btn-link", onClick: applyCommentFeedback(comment, -1), "data-tracking-id": "case-comment-feedback-down", type: "button" }, feedback === -1 ? (React.createElement(FrownIcon, { title: t('Remove negative feedback'), "aria-label": t('Remove negative feedback') })) : (React.createElement(OutlinedFrownIcon, { title: t('Leave negative feedback'), "aria-label": t('Leave negative feedback') }))))));
100
118
  const computeDiscussionCardCalss = (comment) => {
101
- if (comment.createdByType === 'Associate' && comment.createdBy === 'Automated Support Assistant') {
119
+ if (comment.createdByType === 'Associate' && comment.createdBy === AUTOMATED_SUPPORT_ASSISTANT) {
102
120
  return 'comment-automated';
103
121
  }
104
122
  else if (comment.createdByType === 'Associate') {
@@ -123,8 +141,9 @@ const CaseComments = React.forwardRef((props, ref) => {
123
141
  }
124
142
  };
125
143
  const computeCommentAuthorIcon = (comment) => {
126
- if (comment.createdByType === 'Associate' && comment.createdBy === 'Automated support assistant') {
127
- return (React.createElement("img", { src: "https://static.redhat.com/libs/redhat/brand-assets/2/corp/logo--hat-only.svg", height: "18", width: "18", "aria-hidden": "true", alt: "Automated support assistant comment", title: "Automated support assistant", style: { verticalAlign: '-0.125em', marginRight: '6px' } }));
144
+ if (comment.createdByType === 'Associate' && comment.createdBy === AUTOMATED_SUPPORT_ASSISTANT) {
145
+ return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1rem", height: "1rem", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", className: "asa-comment-author-icon" },
146
+ React.createElement("path", { d: "M6.12402 2.4082C6.35218 2.4082 6.55997 2.60182 6.57812 2.8291C6.78299 5.41264 8.80708 7.4365 11.3906 7.6416C11.6179 7.65955 11.8115 7.86755 11.8115 8.0957C11.8115 8.32428 11.6179 8.53142 11.3906 8.5498C8.8071 8.75486 6.78376 10.7792 6.5791 13.3623C6.56075 13.5894 6.35227 13.7832 6.12402 13.7832C5.89623 13.783 5.68905 13.5895 5.6709 13.3623C5.46602 10.7788 3.44185 8.75501 0.858398 8.5498C0.63091 8.53187 0.43752 8.32385 0.4375 8.0957C0.4375 7.86636 0.632444 7.65796 0.861328 7.6416C3.44144 7.43655 5.46526 5.41223 5.66992 2.8291C5.68823 2.60207 5.89611 2.4084 6.12402 2.4082ZM6.125 4.69824C5.5068 6.24907 4.27802 7.47745 2.72656 8.0957C4.27872 8.71393 5.50601 9.94227 6.12402 11.4932C6.74225 9.94227 7.97113 8.71393 9.52246 8.0957C7.9703 7.47747 6.74301 6.24914 6.125 4.69824ZM10.9385 0.875C11.0648 0.875158 11.1728 0.966445 11.1963 1.09277C11.3749 2.06984 12.1518 2.84681 13.1289 3.02539C13.2552 3.04901 13.3467 3.15687 13.3467 3.2832C13.3467 3.40957 13.2552 3.51741 13.1289 3.54102C12.1518 3.7196 11.3749 4.49653 11.1963 5.47363C11.1728 5.6 11.0648 5.69125 10.9385 5.69141C10.812 5.69141 10.7032 5.60007 10.6797 5.47363C10.5015 4.49667 9.72542 3.71971 8.74805 3.54102C8.62158 3.51752 8.52931 3.40962 8.5293 3.2832C8.5293 3.15677 8.62157 3.04888 8.74805 3.02539C9.7254 2.8467 10.5015 2.06971 10.6797 1.09277C10.7032 0.966292 10.812 0.875 10.9385 0.875Z", fill: "#1F1F1F", stroke: "#1F1F1F", strokeWidth: "0.6", strokeLinejoin: "round" })));
128
147
  }
129
148
  else if (comment.createdByType === 'Associate') {
130
149
  return (React.createElement("img", { src: "https://static.redhat.com/libs/redhat/brand-assets/2/corp/logo--hat-only.svg", height: "18", width: "18", "aria-hidden": "true", alt: "Red Hat associate comment", title: "Red Hat associate", style: { verticalAlign: '-0.125em', marginRight: '6px' } }));
@@ -149,19 +168,8 @@ const CaseComments = React.forwardRef((props, ref) => {
149
168
  return React.createElement(Trans, null, "Automated comment");
150
169
  }
151
170
  };
152
- const sanitizeHtml = (html) => {
153
- DOMPurify.addHook('afterSanitizeAttributes', (node) => {
154
- if (node.tagName === 'A') {
155
- node.setAttribute('target', '_blank');
156
- node.setAttribute('rel', 'noopener noreferrer');
157
- }
158
- });
159
- const clean = DOMPurify.sanitize(html, { ADD_ATTR: ['target', 'rel'] });
160
- DOMPurify.removeHook('afterSanitizeAttributes');
161
- return clean;
162
- };
163
171
  const commentText = (text) => {
164
- return { __html: sanitizeHtml(text) };
172
+ return { __html: DOMPurify.sanitize(text) };
165
173
  };
166
174
  // Transforms <strong> and <em> tags in HTML string to styled <span> tags to fix incorrect bold/italic rendering in exported PDF
167
175
  function formatMarkdownHtmlForPDF(htmlString) {
@@ -177,6 +185,15 @@ const CaseComments = React.forwardRef((props, ref) => {
177
185
  // Remove <ul> and </ul> tags completely
178
186
  .replace(/<\/?ul>/gi, ''));
179
187
  }
188
+ const commentMarkdown = (markdown) => {
189
+ let htmlString = parseCommentMarkdown(markdown, { showButtonForAttachmentLink: true, disableImagePreview: isExportingPDF },
190
+ // @ts-ignore
191
+ { openLinksInNewTab: true, gfm: true, breaks: true });
192
+ if (isExportingPDF) {
193
+ htmlString = formatMarkdownHtmlForPDF(htmlString);
194
+ }
195
+ return { __html: DOMPurify.sanitize(htmlString) };
196
+ };
180
197
  const onCommentAreaClick = (e) => {
181
198
  let { event } = e.target['dataset'];
182
199
  if (!event) {
@@ -192,13 +209,11 @@ const CaseComments = React.forwardRef((props, ref) => {
192
209
  };
193
210
  const parseCommentHtml = (commentText, contentType) => {
194
211
  let text = commentText;
195
- if (contentType === 'plaintext') {
196
- // Legacy plain-text comments: normalize SFDC HTML line breaks
197
- text = text
198
- .replace(/<br\s*\/?>/gi, '\n')
199
- .replace(/<\/p>/gi, '\n')
200
- .replace(/<p>/gi, '');
201
- text = text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
212
+ if (contentType === EditorMode.PLAIN) {
213
+ text = HTMLEntityChecker(commentText);
214
+ // fix issue something like this <h1>ajhdjaj<d</h1>
215
+ text = htmlEntitiesEncode(text);
216
+ text = encodeAngularBrackets(text);
202
217
  text = linkifyLinks(text);
203
218
  text = linkifyWithCaseIDs(text);
204
219
  text = linkifyBZIDs(text);
@@ -206,20 +221,28 @@ const CaseComments = React.forwardRef((props, ref) => {
206
221
  }
207
222
  return text;
208
223
  };
224
+ /* Purpose of this method is to break the default HTML Entity rendering on the UI when in plaintext mode.
225
+ This is achieved by directly swapping the '&' in any html entity to `&amp` in e.g. &euro swaps to &ampeuro
226
+ so it is rendered -> &euro on the UI instead of '€' */
227
+ //PCM-10968
228
+ const HTMLEntityChecker = (comment) => {
229
+ if (comment.includes('&')) {
230
+ return comment.replace(/&/g, '&amp;');
231
+ }
232
+ else
233
+ return comment;
234
+ };
209
235
  const computeCommentText = (comment) => {
210
- if (isEmpty(comment.commentBody))
211
- return null;
212
- // Legacy plain-text comments still need escaping and linkification
213
- if (comment.contentType === 'plaintext') {
214
- const parseComment = parseCommentHtml(comment.commentBody, comment.contentType);
236
+ const parseComment = parseCommentHtml(comment.commentBody, comment.contentType);
237
+ if (!isEmpty(comment.commentBody) && comment.contentType === EditorMode.MARKDOWN) {
238
+ return (React.createElement("div", { className: "push-top-narrow comment-markdown-text", dangerouslySetInnerHTML: commentMarkdown(comment.commentBody) }));
239
+ }
240
+ else if (!isEmpty(comment.commentBody) && comment.contentType === EditorMode.PLAIN) {
215
241
  return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(parseComment), style: { fontFamily: isExportingPDF ? 'DejaVu Sans' : '' } }));
216
242
  }
217
- // HTML comments (new rich text or legacy markdown — both stored as HTML)
218
- let htmlString = comment.commentBody;
219
- if (isExportingPDF) {
220
- htmlString = formatMarkdownHtmlForPDF(htmlString);
243
+ else {
244
+ return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(parseComment), style: { fontFamily: isExportingPDF ? 'DejaVu Sans' : '' } }));
221
245
  }
222
- return (React.createElement("div", { className: "push-top-narrow comment-richtext", dangerouslySetInnerHTML: { __html: sanitizeHtml(htmlString) }, style: { fontFamily: isExportingPDF ? 'DejaVu Sans' : '' } }));
223
246
  };
224
247
  useEffect(() => {
225
248
  if ((markdownRef === null || markdownRef === void 0 ? void 0 : markdownRef.current) && isExportingPDF) {
@@ -231,28 +254,36 @@ const CaseComments = React.forwardRef((props, ref) => {
231
254
  });
232
255
  }
233
256
  }, [props.comment, isExportingPDF]);
234
- if (!((_a = props.comment) === null || _a === void 0 ? void 0 : _a.isPublic) && !canSeePrivateComments)
257
+ if (!((_b = props.comment) === null || _b === void 0 ? void 0 : _b.isPublic) && !canSeePrivateComments)
235
258
  return React.createElement(React.Fragment, null);
236
- return (React.createElement("article", { ref: ref, id: props.comment.id, "aria-label": `Comment by ${props.comment.lastModifiedById}`, className: `prevent-split ${computePrivateComment(props.comment)} support-comment ${computeDiscussionCardCalss(props.comment)} ${ref ? 'selected-case-comment' : ''}` },
259
+ return (React.createElement("section", { ref: ref, id: props.comment.id, className: `prevent-split ${computePrivateComment(props.comment)} support-comment ${computeDiscussionCardCalss(props.comment)} ${ref ? 'selected-case-comment' : ''}` },
237
260
  React.createElement("header", null,
238
261
  React.createElement("h4", null,
239
262
  computeCommentAuthorIcon(props.comment),
240
- " ",
241
- props.comment.lastModifiedById,
263
+ isAsaComment ? React.createElement(Trans, null, "Automated support assistant") : React.createElement(React.Fragment, null,
264
+ " ",
265
+ props.comment.lastModifiedById),
242
266
  props.comment.createdByType === 'Partner' && (React.createElement("span", null,
243
267
  ' ',
244
268
  "(",
245
269
  React.createElement(Trans, null, "Partner"),
246
270
  ")"))),
247
271
  React.createElement("time", null, formatDateTime(props.comment.lastModifiedDate))),
272
+ isAsaComment && (React.createElement(Alert, { className: `asa-comment-alert ${isExportingPDF ? 'hide-in-pdf' : ''}`, isInline: true, variant: "custom", title: t('AI-generated comment: Please review for accuracy, as AI may make mistakes.'), actionLinks: React.createElement(AlertActionLink, { className: "asa-send-feedback-link", onClick: openAsaFeedbackModal, "data-tracking-id": "case-asa-comment-send-feedback-alert" },
273
+ React.createElement(Trans, null, "Send Feedback")) },
274
+ React.createElement("p", null,
275
+ React.createElement(Trans, null, "This comment is based on information from your support case. It may not be up to date or completely accurate. Please review it and share your feedback to help us improve this feature.")))),
248
276
  React.createElement("div", { className: "comment-body", onClick: onCommentAreaClick, ref: markdownRef }, computeCommentText(props.comment)),
249
277
  React.createElement("footer", null,
250
278
  React.createElement("span", { className: "comment-note" }, computeCommentFooter(props.comment)),
279
+ canSeeFeedbackButtons && commentFeedbackButtons(props.comment, props.feedback),
251
280
  React.createElement("span", { className: "pull-right pf-v6-l-flex pf-m-align-items-center" },
252
281
  props.showJumpToComment && (React.createElement(DiscussionItemLink, { onClick: onJumpToComment(props.comment.id), discussionType: DiscussionType.COMMENT, itemId: props.comment.id, caseNumber: caseNumber, isCopyLink: false },
253
282
  React.createElement(Trans, null, "Jump to comment"))),
254
- React.createElement(JumpAndCopyLink, { caseNumber: caseNumber, cardId: props.comment.id, discussionType: DiscussionType.COMMENT }),
255
- React.createElement("button", { onClick: () => props.onReply(props.comment.lastModifiedById, props.comment.id, props.comment.lastModifiedDate), className: `btn btn-app btn-link case-reply-button ${isExportingPDF ? 'hide-in-pdf' : ''}`, "data-tracking-id": "case-comment-reply", type: "button" },
256
- React.createElement(Trans, null, "Reply"))))));
283
+ isAsaComment ? (React.createElement(Button, { variant: ButtonVariant.link, isInline: true, className: `asa-send-feedback-link ${isExportingPDF ? 'hide-in-pdf' : ''}`, onClick: openAsaFeedbackModal, "data-tracking-id": "case-asa-comment-send-feedback-footer" },
284
+ React.createElement(Trans, null, "Send feedback"))) : (React.createElement("button", { onClick: commentReply(props.comment), className: `btn btn-app btn-link case-reply-button ${isExportingPDF ? 'hide-in-pdf' : ''}`, "data-tracking-id": "case-comment-reply", type: "button" },
285
+ React.createElement(Trans, null, "Reply"))),
286
+ React.createElement(JumpAndCopyLink, { caseNumber: caseNumber, cardId: props.comment.id, discussionType: DiscussionType.COMMENT }))),
287
+ isAsaComment && (React.createElement(AsaCommentFeedbackModal, { isOpen: isAsaFeedbackModalOpen, isSubmitting: isFeedbackUpdating, initialFeedback: savedFeedbackValue, initialFeedbackReason: savedFeedbackReason, onClose: () => setIsAsaFeedbackModalOpen(false), onSubmit: onSubmitAsaFeedback }))));
257
288
  });
258
289
  export default CaseComments;
@@ -1,14 +1,12 @@
1
- import { ICaseComment } from '@cee-eng/hydrajs/@types/api/public/case';
1
+ import { ICaseChat, ICaseComment } from '@cee-eng/hydrajs/@types/api/public/case';
2
2
  import React from 'react';
3
3
  interface IProps {
4
4
  caseNumber: string;
5
5
  caseComments: ICaseComment[];
6
- commentsLoading?: boolean;
7
- commentsError?: unknown;
6
+ caseChats: ICaseChat[];
8
7
  accountNumber: string;
9
8
  tabRef: React.MutableRefObject<HTMLDivElement>;
10
9
  isDiscussionTab: boolean;
11
- refetchComments: () => Promise<unknown> | void;
12
10
  }
13
11
  export default function CaseDiscussion(props: IProps): React.JSX.Element;
14
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAkBvE,OAAO,KAAoE,MAAM,OAAO,CAAC;AAsCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CAClD;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBAshBnD"}
1
+ {"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAkB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAyCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBA6oBnD"}