@rh-support/troubleshoot 2.6.361 → 2.6.364

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 (364) 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 +17 -92
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +2 -6
  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 +9 -19
  13. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +7 -28
  15. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +57 -88
  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 -3
  21. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +11 -24
  23. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/CaseOverview/index.js +57 -92
  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 +49 -55
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  38. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +46 -53
  39. package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.d.ts.map +1 -1
  40. package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.js +3 -6
  41. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +46 -52
  43. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  44. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +17 -63
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +2 -2
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +2 -0
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +3 -4
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +56 -131
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +6 -11
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseSbrGroups.d.ts.map +1 -1
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseSbrGroups.js +1 -3
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +71 -111
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +10 -17
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.d.ts.map +1 -1
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +2 -4
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +25 -0
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +1 -0
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +102 -0
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +26 -42
  68. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +4 -2
  69. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  70. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +148 -152
  71. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -10
  72. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  73. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +146 -252
  74. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  75. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +9 -22
  76. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  77. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +2 -9
  78. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
  79. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +1 -8
  80. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts +2 -2
  81. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts.map +1 -1
  82. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.js +7 -18
  83. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +3 -9
  84. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  85. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +271 -215
  86. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  87. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +4 -6
  88. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  89. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +2 -7
  90. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  91. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -36
  92. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  93. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +230 -62
  94. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +5 -4
  95. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  96. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +8 -24
  97. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  98. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -8
  99. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  100. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +52 -38
  101. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  102. package/lib/esm/components/CaseInformation/CaseGroup.js +62 -173
  103. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  104. package/lib/esm/components/CaseInformation/CaseInformation.js +9 -10
  105. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  106. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +31 -108
  107. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +2 -2
  108. package/lib/esm/components/CaseInformation/Description.js +1 -1
  109. package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
  110. package/lib/esm/components/CaseInformation/FileDiag.js +5 -2
  111. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  112. package/lib/esm/components/CaseInformation/Fts.js +19 -33
  113. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  114. package/lib/esm/components/CaseInformation/Severity.js +24 -33
  115. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  116. package/lib/esm/components/CaseInformation/SupportLevel.js +55 -36
  117. package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
  118. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +8 -2
  119. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  120. package/lib/esm/components/CaseManagement/CaseManagement.js +10 -13
  121. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  122. package/lib/esm/components/CaseManagement/Cep.js +10 -12
  123. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +1 -2
  124. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  125. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +3 -20
  126. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  127. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
  128. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +1 -0
  129. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  130. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +32 -19
  131. package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
  132. package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +2 -4
  133. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  134. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +2 -4
  135. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  136. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +40 -34
  137. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  138. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +4 -8
  139. package/lib/esm/components/EditDescription/EditDescription.d.ts.map +1 -1
  140. package/lib/esm/components/EditDescription/EditDescription.js +2 -4
  141. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  142. package/lib/esm/components/IdeaInformation/IdeaInformation.js +17 -23
  143. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  144. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
  145. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
  146. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  147. package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
  148. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  149. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
  150. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  151. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -37
  152. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  153. package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
  154. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  155. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -9
  156. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  157. package/lib/esm/components/Recommendations/AsideResults.js +3 -4
  158. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  159. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +4 -1
  160. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  161. package/lib/esm/components/Recommendations/ClusterRecommendations.js +4 -1
  162. package/lib/esm/components/Recommendations/InsightsResults.js +3 -3
  163. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  164. package/lib/esm/components/Recommendations/Recommendations.js +9 -3
  165. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  166. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +8 -10
  167. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  168. package/lib/esm/components/Review/Review.js +19 -25
  169. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  170. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
  171. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  172. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  173. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  174. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  175. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +93 -141
  176. package/lib/esm/components/shared/Constants.d.ts +0 -5
  177. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  178. package/lib/esm/components/shared/Constants.js +0 -5
  179. package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
  180. package/lib/esm/components/shared/fileUpload/FileLister.js +3 -3
  181. package/lib/esm/components/shared/fileUpload/FileUpload.js +3 -2
  182. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  183. package/lib/esm/components/shared/fileUpload/FileUploader.js +1 -3
  184. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +0 -1
  185. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  186. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +3 -4
  187. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts +1 -1
  188. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts.map +1 -1
  189. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +5 -22
  190. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  191. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +59 -307
  192. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +1 -5
  193. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  194. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +1 -36
  195. package/lib/esm/components/shared/fileUpload/types/index.d.ts +1 -5
  196. package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
  197. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +2 -2
  198. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
  199. package/lib/esm/components/shared/fileUpload/useFileUploader.js +47 -119
  200. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  201. package/lib/esm/components/shared/useIsSectionValid.js +57 -22
  202. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  203. package/lib/esm/components/shared/usePostComment.js +28 -16
  204. package/lib/esm/components/shared/utils.d.ts +0 -1
  205. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  206. package/lib/esm/components/shared/utils.js +3 -9
  207. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  208. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +38 -178
  209. package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
  210. package/lib/esm/components/wizardLayout/MainSection.js +1 -2
  211. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  212. package/lib/esm/components/wizardLayout/WizardAside.js +4 -2
  213. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  214. package/lib/esm/components/wizardLayout/WizardLayout.js +13 -12
  215. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  216. package/lib/esm/components/wizardLayout/WizardMain.js +0 -7
  217. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  218. package/lib/esm/components/wizardLayout/WizardNavigation.js +11 -14
  219. package/lib/esm/constants/caseDetailsConstants.d.ts +0 -5
  220. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  221. package/lib/esm/constants/caseDetailsConstants.js +0 -5
  222. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  223. package/lib/esm/css/app.css +0 -28
  224. package/lib/esm/css/case.css +212 -209
  225. package/lib/esm/hooks/useAB.d.ts.map +1 -1
  226. package/lib/esm/hooks/useAB.js +23 -45
  227. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -9
  228. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  229. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +11 -108
  230. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  231. package/lib/esm/hooks/useResetCaseCreate.js +11 -18
  232. package/lib/esm/hooks/useS3Upload.d.ts +4 -5
  233. package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
  234. package/lib/esm/hooks/useS3Upload.js +30 -28
  235. package/lib/esm/i18n/template-de.d.ts +2 -2
  236. package/lib/esm/i18n/template-de.js +2 -2
  237. package/lib/esm/i18n/template-es.d.ts +2 -2
  238. package/lib/esm/i18n/template-es.js +2 -2
  239. package/lib/esm/i18n/template-fr.d.ts +2 -2
  240. package/lib/esm/i18n/template-fr.js +2 -2
  241. package/lib/esm/i18n/template-it.d.ts +2 -2
  242. package/lib/esm/i18n/template-it.js +2 -2
  243. package/lib/esm/i18n/template-jp.d.ts +2 -2
  244. package/lib/esm/i18n/template-jp.js +2 -2
  245. package/lib/esm/i18n/template-ko.d.ts +2 -2
  246. package/lib/esm/i18n/template-ko.js +2 -2
  247. package/lib/esm/i18n/template-pt.d.ts +2 -2
  248. package/lib/esm/i18n/template-pt.js +2 -2
  249. package/lib/esm/i18n/template-ru.d.ts +2 -2
  250. package/lib/esm/i18n/template-ru.js +2 -2
  251. package/lib/esm/i18n/template-zh.d.ts +2 -2
  252. package/lib/esm/i18n/template-zh.js +2 -2
  253. package/lib/esm/index.js +0 -1
  254. package/lib/esm/models/cache.d.ts +2 -0
  255. package/lib/esm/models/cache.d.ts.map +1 -1
  256. package/lib/esm/reducers/CaseConstNTypes.d.ts +9 -123
  257. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  258. package/lib/esm/reducers/CaseConstNTypes.js +7 -31
  259. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +5 -7
  260. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  261. package/lib/esm/reducers/CaseDetailsPageReducer.js +26 -58
  262. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +12 -12
  263. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  264. package/lib/esm/reducers/CaseDiscussionTabReducer.js +73 -88
  265. package/lib/esm/reducers/CaseHelpers.d.ts +1 -11
  266. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  267. package/lib/esm/reducers/CaseHelpers.js +17 -119
  268. package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
  269. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  270. package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
  271. package/lib/esm/reducers/CaseReducer.d.ts +11 -56
  272. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  273. package/lib/esm/reducers/CaseReducer.js +100 -284
  274. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  275. package/lib/esm/reducers/RecommendationsReducer.js +18 -15
  276. package/lib/esm/scss/_main.scss +0 -9
  277. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +2 -1
  278. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  279. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  280. package/package.json +8 -10
  281. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +0 -8
  282. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +0 -1
  283. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +0 -18
  284. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -10
  285. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
  286. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -31
  287. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -29
  288. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
  289. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -29
  290. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
  291. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
  292. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -62
  293. package/lib/esm/components/CaseInformation/CaseLabels.d.ts +0 -3
  294. package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +0 -1
  295. package/lib/esm/components/CaseInformation/CaseLabels.js +0 -108
  296. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +0 -4
  297. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +0 -1
  298. package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +0 -141
  299. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +0 -3
  300. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +0 -1
  301. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +0 -9
  302. package/lib/esm/graphql/index.d.ts +0 -4
  303. package/lib/esm/graphql/index.d.ts.map +0 -1
  304. package/lib/esm/graphql/index.js +0 -3
  305. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
  306. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
  307. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
  308. package/lib/esm/graphql/mutations/index.d.ts +0 -2
  309. package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
  310. package/lib/esm/graphql/mutations/index.js +0 -1
  311. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
  312. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
  313. package/lib/esm/graphql/queries/getEscalationDetails.js +0 -36
  314. package/lib/esm/graphql/queries/index.d.ts +0 -2
  315. package/lib/esm/graphql/queries/index.d.ts.map +0 -1
  316. package/lib/esm/graphql/queries/index.js +0 -1
  317. package/lib/esm/graphql/schemas/escalation.d.ts +0 -66
  318. package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
  319. package/lib/esm/graphql/schemas/escalation.js +0 -1
  320. package/lib/esm/graphql/schemas/index.d.ts +0 -2
  321. package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
  322. package/lib/esm/graphql/schemas/index.js +0 -1
  323. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
  324. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
  325. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -57
  326. package/lib/esm/hooks/useCaseComments/index.d.ts +0 -8
  327. package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
  328. package/lib/esm/hooks/useCaseComments/index.js +0 -5
  329. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
  330. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
  331. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -75
  332. package/lib/esm/hooks/useCaseComments/types.d.ts +0 -93
  333. package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
  334. package/lib/esm/hooks/useCaseComments/types.js +0 -1
  335. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -26
  336. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
  337. package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -113
  338. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
  339. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
  340. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
  341. package/lib/esm/hooks/useCaseGroupUiState.d.ts +0 -3
  342. package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +0 -1
  343. package/lib/esm/hooks/useCaseGroupUiState.js +0 -10
  344. package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
  345. package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
  346. package/lib/esm/hooks/useCaseHistory.js +0 -107
  347. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +0 -23
  348. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +0 -1
  349. package/lib/esm/hooks/useCaseLabelLinkMutations.js +0 -84
  350. package/lib/esm/models/caseHistory.d.ts +0 -86
  351. package/lib/esm/models/caseHistory.d.ts.map +0 -1
  352. package/lib/esm/models/caseHistory.js +0 -1
  353. package/lib/esm/utils/TimelineUtils.d.ts +0 -41
  354. package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
  355. package/lib/esm/utils/TimelineUtils.js +0 -135
  356. package/lib/esm/utils/caseHistoryUtils.d.ts +0 -85
  357. package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
  358. package/lib/esm/utils/caseHistoryUtils.js +0 -196
  359. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +0 -6
  360. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +0 -1
  361. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +0 -26
  362. package/lib/esm/utils/linkifyHtmlTextNodes.d.ts +0 -8
  363. package/lib/esm/utils/linkifyHtmlTextNodes.d.ts.map +0 -1
  364. package/lib/esm/utils/linkifyHtmlTextNodes.js +0 -37
@@ -7,173 +7,103 @@ 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';
11
- import { Button, MenuToggle, Select, SelectList, SelectOption } from '@patternfly/react-core';
10
+ import { caseAttachments } from '@cee-eng/hydrajs';
11
+ import { Alert, MenuToggle, Select, SelectList, SelectOption } from '@patternfly/react-core';
12
12
  import { AlertMessage, AlertType, ErrorBoundary, LoadingIndicator, ToastNotification } from '@rh-support/components';
13
13
  import { useGlobalStateContext } from '@rh-support/react-context';
14
14
  import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
15
- import { downloadCaseAttachment, dtmTrackEventCaseStepEncountered, getDropdownBtnPlaceholder, getUrlParsedParams, scrollIntoView, } from '@rh-support/utils';
15
+ import { dtmTrackEventCaseStepEncountered, getDropdownBtnPlaceholder, getUrlParsedParams, scrollIntoView, } from '@rh-support/utils';
16
16
  import cloneDeep from 'lodash/cloneDeep';
17
17
  import filter from 'lodash/filter';
18
18
  import findIndex from 'lodash/findIndex';
19
19
  import isEmpty from 'lodash/isEmpty';
20
20
  import isEqual from 'lodash/isEqual';
21
- import orderBy from 'lodash/orderBy';
22
21
  import Mark from 'mark.js';
23
- import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
22
+ import React, { useContext, useEffect, useRef, useState } from 'react';
24
23
  import { Trans, useTranslation } from 'react-i18next';
25
- import { useInView } from 'react-intersection-observer';
26
24
  import { useLocation } from 'react-router-dom';
27
25
  import { AutoSizer, CellMeasurer, CellMeasurerCache, List, WindowScroller } from 'react-virtualized';
28
26
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
29
27
  import { useCaseDetailsPageDispatchContext, useCaseDetailsPageStateContext, } from '../../../../context/CaseDetailsPageContext';
30
28
  import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../../context/CaseDiscussionTabContext';
31
- import { clearReplyingTo, discussionSortOrderConst, DiscussionType, setDiscussions, setFilter, setReplyingTo, setSort, updateAttachment, updateAttacmentsAfterRemoval, updateDiscussionStateAttachments, } from '../../../../reducers/CaseDiscussionTabReducer';
29
+ import { clearReplyComment, discussionSortOrderConst, DiscussionType, setCommentText, setDiscussions, setFilter, setSort, updateAttachment, updateAttacmentsAfterRemoval, updateCommentStateFeedback, updateDiscussionStateAttachments, updateDiscussionStateComments, } from '../../../../reducers/CaseDiscussionTabReducer';
32
30
  import { setCaseState } from '../../../../reducers/CaseReducer';
33
31
  import { AttachmentContextProvider } from '../../../shared/fileUpload/reducer/AttachmentReducerContext';
34
32
  import { PDFContext } from '../../PDFContainer';
35
33
  import CaseAttachment from './CaseAttachment';
36
- import CaseComments from './CaseComments';
37
- // import CaseExternalTrackerUpdate from './CaseExternalTrackerUpdate';
34
+ import CaseChat from './CaseChat';
35
+ import CaseComments, { AUTOMATED_SUPPORT_ASSISTANT } from './CaseComments';
36
+ import CaseExternalTrackerUpdate from './CaseExternalTrackerUpdate';
38
37
  import { CommentSearch } from './CommentSearch';
39
38
  import { PostComment } from './PostComment';
40
- /** Threshold above which comments render in a virtualized (windowed) list for performance. */
41
39
  const VC_MINIMUM_COMMENT = 150;
40
+ let cellMeasureCache = new CellMeasurerCache({
41
+ fixedWidth: true,
42
+ defaultHeight: 100,
43
+ });
42
44
  export default function CaseDiscussion(props) {
43
- var _a;
44
45
  const { t } = useTranslation();
45
- const { isPostingRemoteRequestCommentCompleted, product, version, caseSalesforceId } = useCaseSelector((state) => ({
46
+ const { isPostingRemoteRequestCommentCompleted, screenSessionRequested, product, version } = useCaseSelector((state) => ({
46
47
  isPostingRemoteRequestCommentCompleted: state.isPostingRemoteRequestCommentCompleted,
48
+ screenSessionRequested: state.caseDetails.screenSessionRequested,
47
49
  product: state.caseDetails.product,
48
50
  version: state.caseDetails.version,
49
- caseSalesforceId: state.caseDetails.id,
50
51
  }), isEqual);
51
52
  const urlSearchParams = getUrlParsedParams(useLocation().search);
52
- const discussionIdFromUrl = ((urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.commentId) || (urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.attachmentId));
53
+ const discussionIdFromUrl = ((urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.commentId) ||
54
+ (urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.externalTrackerId) ||
55
+ (urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.attachmentId) ||
56
+ (urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.chatId));
53
57
  const activeDiscussionElementRef = useRef(null);
54
- const { sort, discussionFiltersListState, replyingToAuthor, replyingToTimestamp } = useCaseDiscussionTabStateContext();
55
- const { globalMetadataState: { navBarRef, loggedInUsersAccount }, } = useGlobalStateContext();
58
+ const { sort, discussionFiltersListState, allDiscussions, replyCommentText, replyCommentCreator } = useCaseDiscussionTabStateContext();
59
+ const { globalMetadataState: { loggedInUsersAccount, navBarRef }, } = useGlobalStateContext();
56
60
  const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
57
- const { caseDetailsPageState: { caseAttachmentHydra }, } = useCaseDetailsPageStateContext();
58
- const dispatchCaseDetailsHydraAttachments = useCaseDetailsPageDispatchContext();
59
61
  const caseDispatch = useCaseDispatch();
60
- const apolloClient = useApolloClient();
61
- const ability = useContext(AbilityContext);
62
- const canSeeAttachments = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEE_ATTACHMENTS);
62
+ const { caseDetailsPageState: { caseFeedbacksHydra, caseAttachmentHydra, caseExternalTrackersUpdate }, } = useCaseDetailsPageStateContext();
63
+ const dispatchCaseDetailsHydraAttachments = useCaseDetailsPageDispatchContext();
63
64
  const { caseNumber } = props;
64
65
  const activeElementId = useRef(null);
66
+ const ability = useContext(AbilityContext);
67
+ const canSeeExternalTracker = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_EXTERNAL_TRACKER);
68
+ const canSeeChat = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_CHAT);
69
+ const canSeeAttachments = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEE_ATTACHMENTS);
65
70
  const listRef = React.useRef(null);
66
71
  const windowScrollerRef = React.useRef(null);
67
72
  const commentRef = React.useRef(null);
68
- const cellMeasureCacheRef = useRef(new CellMeasurerCache({ fixedWidth: true, defaultHeight: 100 }));
69
73
  const { isExportingPDF } = useContext(PDFContext);
70
- const { ref: sentinelRef, inView } = useInView({ threshold: 0, rootMargin: '200px' });
71
74
  const [searchResult, setSearchResult] = useState([]);
72
75
  const [searchCommentText, setSearchCommentText] = useState('');
73
76
  const [commentIndex, setCommentIndex] = useState(-1);
74
77
  const [isCommentSearchCleared, setIsCommentSearchCleared] = useState(false);
75
78
  const [isJumpToCommentClicked, setJumpToCommentClicked] = useState(false);
76
79
  const [canUpdateScrollTop, setCanUpdateScrollTop] = useState(true);
80
+ const [replyingToPrivateComment, setReplyingToPrivateComment] = useState(null);
81
+ // used for tracking comment section width changes
77
82
  const [discussionSectionWidth, setDiscussionSectionWidth] = useState(null);
78
- const [debouncedShowSkeleton, setDebouncedShowSkeleton] = useState(false);
79
83
  const [isOpen, setIsOpen] = useState(false);
80
84
  const [selectedFilterItems, setSelectedFilterItems] = useState([]);
81
85
  const [isSortOpen, setIsSortOpen] = useState(false);
82
86
  const [sortSelected, setSortSelected] = useState('Select a value');
83
- const { hasNextPage, isLoadingMore, loadMoreError, fetchMore } = props;
84
- const isCommentFilterActive = discussionFiltersListState.some((f) => (f.value === DiscussionType.COMMENT || f.value === DiscussionType.ALL) && f.isSelected);
85
- useEffect(() => {
86
- console.log('[CaseDiscussion] fetchMore useEffect', {
87
- inView,
88
- hasNextPage,
89
- isLoadingMore,
90
- loadMoreError,
91
- hasFetchMore: !!fetchMore,
92
- isCommentFilterActive,
93
- willFetch: inView && hasNextPage && !isLoadingMore && !loadMoreError && !!fetchMore && isCommentFilterActive,
87
+ if (props.isDiscussionTab) {
88
+ cellMeasureCache = new CellMeasurerCache({
89
+ fixedWidth: true,
90
+ defaultHeight: 100,
94
91
  });
95
- if (inView && hasNextPage && !isLoadingMore && !loadMoreError && fetchMore && isCommentFilterActive) {
96
- fetchMore();
97
- }
98
- }, [inView, hasNextPage, isLoadingMore, loadMoreError, fetchMore, isCommentFilterActive]);
99
- useEffect(() => {
100
- if (props.isLoadingMore && props.hasNextPage) {
101
- const timer = setTimeout(() => setDebouncedShowSkeleton(true), 300);
102
- return () => clearTimeout(timer);
103
- }
104
- setDebouncedShowSkeleton(false);
105
- }, [props.isLoadingMore, props.hasNextPage]);
106
- const cellMeasureCache = cellMeasureCacheRef.current;
107
- const allDiscussions = useMemo(() => {
108
- var _a, _b, _c;
109
- const allComments = (props.caseComments || [])
110
- .filter((comment) => comment.isDraft === false)
111
- .map((comment) => ({
112
- item: Object.assign(Object.assign({}, comment), { isPublic: comment.isPublic === undefined ? true : comment.isPublic, last_modified_date: comment.lastModifiedDate || comment.createdDate }),
113
- discussionType: DiscussionType.COMMENT,
114
- last_modified_date: comment.lastModifiedDate || comment.createdDate,
115
- }));
116
- let allAttachments = canSeeAttachments
117
- ? (caseAttachmentHydra.data || [])
118
- .filter((attachment) => (attachment === null || attachment === void 0 ? void 0 : attachment.lastModifiedDate) || (attachment === null || attachment === void 0 ? void 0 : attachment.createdDate))
119
- .map((attachment) => ({
120
- item: Object.assign(Object.assign({}, attachment), { lastModifiedDate: attachment.lastModifiedDate || attachment.createdDate }),
121
- last_modified_date: (attachment.lastModifiedDate || attachment.createdDate),
122
- discussionType: DiscussionType.ATTACHMENT,
123
- }))
124
- : [];
125
- if (props.hasNextPage && allComments.length > 0) {
126
- const sortOrder = (_a = sort === null || sort === void 0 ? void 0 : sort.sortOrder) !== null && _a !== void 0 ? _a : 'desc';
127
- const commentDates = allComments.map((c) => c.last_modified_date).filter(Boolean);
128
- if (commentDates.length > 0) {
129
- if (sortOrder === 'desc') {
130
- const oldestLoaded = commentDates.reduce((min, d) => (d < min ? d : min));
131
- allAttachments = allAttachments.filter((a) => a.last_modified_date >= oldestLoaded);
132
- }
133
- else {
134
- const newestLoaded = commentDates.reduce((max, d) => (d > max ? d : max));
135
- allAttachments = allAttachments.filter((a) => a.last_modified_date <= newestLoaded);
136
- }
137
- }
138
- }
139
- const merged = [...allComments, ...allAttachments];
140
- return orderBy(merged, ['last_modified_date', (d) => { var _a; return (_a = d.item.id) !== null && _a !== void 0 ? _a : ''; }], [(_b = sort === null || sort === void 0 ? void 0 : sort.sortOrder) !== null && _b !== void 0 ? _b : 'desc', (_c = sort === null || sort === void 0 ? void 0 : sort.sortOrder) !== null && _c !== void 0 ? _c : 'desc']);
141
- }, [props.caseComments, caseAttachmentHydra.data, canSeeAttachments, sort, props.hasNextPage]);
142
- const usedPaginationRef = useRef(false);
143
- if (props.hasNextPage || props.isLoadingMore) {
144
- usedPaginationRef.current = true;
145
92
  }
146
- const shouldRenderRVComponent = !isExportingPDF && allDiscussions.length > VC_MINIMUM_COMMENT && !usedPaginationRef.current;
147
- const list = discussionFiltersListState.filter((f) => f.canSee);
148
93
  const computeFilterComment = () => {
149
94
  return filter(allDiscussions, (discussion) => {
150
- const activeFilter = discussionFiltersListState.filter((f) => f.value === discussion.discussionType && f.isSelected);
95
+ const activeFilter = discussionFiltersListState.filter((filter) => filter.value === discussion.discussionType && filter.isSelected);
151
96
  return activeFilter.length === 1 ? discussion : null;
152
97
  });
153
98
  };
99
+ const shouldRenderRVComponent = !isExportingPDF && allDiscussions.length > VC_MINIMUM_COMMENT;
100
+ const hasAsaComment = (props.caseComments || []).some((comment) => (comment === null || comment === void 0 ? void 0 : comment.createdBy) === AUTOMATED_SUPPORT_ASSISTANT);
101
+ // filter comments on the basis of filterBy and search api
154
102
  const computeFilteredComments = computeFilterComment();
155
103
  const comuteSearchedComments = searchResult.length === 0
156
104
  ? cloneDeep(computeFilteredComments)
157
105
  : filter([...computeFilteredComments], (o) => { var _a; return searchResult.indexOf((_a = o === null || o === void 0 ? void 0 : o.item) === null || _a === void 0 ? void 0 : _a.id) !== -1; });
158
- const isRefetching = props.commentsLoading && !props.isLoadingMore;
159
- const isSearchResultEmpty = !isRefetching &&
160
- !isEmpty(searchCommentText) &&
161
- (searchResult.length === 0 || comuteSearchedComments.length === 0);
162
- // DEBUG: track every render of CaseDiscussion
163
- console.log('[CaseDiscussion] render', {
164
- commentsLoading: props.commentsLoading,
165
- isLoadingMore: props.isLoadingMore,
166
- hasNextPage: props.hasNextPage,
167
- loadMoreError: props.loadMoreError,
168
- isRefetching,
169
- isSearchResultEmpty,
170
- allDiscussionsLen: allDiscussions.length,
171
- filteredLen: computeFilteredComments.length,
172
- searchedLen: comuteSearchedComments.length,
173
- caseCommentsLen: (_a = props.caseComments) === null || _a === void 0 ? void 0 : _a.length,
174
- inView,
175
- isCommentFilterActive,
176
- });
106
+ const isSearchResultEmpty = !isEmpty(searchCommentText) && (searchResult.length === 0 || comuteSearchedComments.length === 0);
177
107
  const setVRCommentIndex = (cId) => {
178
108
  setCommentIndex(cId < 0 ? 0 : cId);
179
109
  setJumpToCommentClicked(true);
@@ -187,15 +117,13 @@ export default function CaseDiscussion(props) {
187
117
  (allDiscussions || []).length === 0) {
188
118
  return;
189
119
  }
190
- const targetIndex = findIndex([...comuteSearchedComments], (discussion) => discussion.item.id === discussionIdFromUrl);
191
- // Comment is on a later page — wait until keep-fetching brings it in.
192
- if (targetIndex < 0) {
193
- return;
194
- }
195
120
  activeElementId.current = discussionIdFromUrl;
196
121
  if (allDiscussions.length > VC_MINIMUM_COMMENT) {
197
- setVRCommentIndex(targetIndex);
198
- if (targetIndex <= 3) {
122
+ const commentIndex = findIndex([...comuteSearchedComments], (discussion) => discussion.item.id === discussionIdFromUrl);
123
+ setVRCommentIndex(commentIndex);
124
+ // to fix scrolling to comment index when scrollTop value from window scroller is 0
125
+ // initial list items
126
+ if (0 <= commentIndex && commentIndex <= 3) {
199
127
  const offset = 80;
200
128
  const scrollTopValue = ((_a = windowScrollerRef === null || windowScrollerRef === void 0 ? void 0 : windowScrollerRef.current) === null || _a === void 0 ? void 0 : _a._positionFromTop) - offset;
201
129
  const scrollLeftValue = (_b = windowScrollerRef === null || windowScrollerRef === void 0 ? void 0 : windowScrollerRef.current) === null || _b === void 0 ? void 0 : _b._positionFromLeft;
@@ -217,39 +145,58 @@ export default function CaseDiscussion(props) {
217
145
  });
218
146
  }
219
147
  // eslint-disable-next-line react-hooks/exhaustive-deps
220
- }, [discussionIdFromUrl]);
221
- useEffect(() => {
222
- if (isExportingPDF)
223
- return;
224
- setDiscussions(dispatchDiscussion, props.caseComments, [], caseAttachmentHydra.data, [], [], discussionFiltersListState, false, false, canSeeAttachments, sort);
225
- // eslint-disable-next-line react-hooks/exhaustive-deps
226
- }, [props.caseComments, caseAttachmentHydra, canSeeAttachments, sort]);
148
+ }, [discussionIdFromUrl, allDiscussions, activeElementId.current]);
227
149
  useEffect(() => {
228
150
  if (!caseAttachmentHydra.isFetching && caseAttachmentHydra.isError) {
229
- ToastNotification.addDangerMessage(t('There was an error loading attachments.'));
151
+ ToastNotification.addDangerMessage(t(`There was an error loading attachments.`));
230
152
  }
231
- }, [caseAttachmentHydra.isFetching, caseAttachmentHydra.isError, t]);
232
- const onCommentAdded = () => __awaiter(this, void 0, void 0, function* () {
233
- try {
234
- yield props.refetchComments();
153
+ if (!caseExternalTrackersUpdate.isFetching && caseExternalTrackersUpdate.isError) {
154
+ ToastNotification.addDangerMessage(t(`There was an error loading external trackers.`));
235
155
  }
236
- catch (e) {
237
- console.error('Failed to refetch comments:', e);
156
+ if (!caseFeedbacksHydra.isFetching && caseFeedbacksHydra.isError) {
157
+ console.log(`There was an error loading feedback.`);
238
158
  }
159
+ // Attachments, feedbacks and external tracker updates apis are called in advance
160
+ if (!isExportingPDF &&
161
+ !caseAttachmentHydra.isFetching &&
162
+ !caseFeedbacksHydra.isFetching &&
163
+ !caseExternalTrackersUpdate.isFetching) {
164
+ setDiscussions(dispatchDiscussion, props.caseComments, props.caseChats, caseAttachmentHydra.data, caseFeedbacksHydra.data, caseExternalTrackersUpdate.data, discussionFiltersListState, canSeeExternalTracker, canSeeChat, canSeeAttachments);
165
+ }
166
+ // eslint-disable-next-line react-hooks/exhaustive-deps
167
+ }, [props.caseComments, caseAttachmentHydra, props.caseChats, caseFeedbacksHydra, caseExternalTrackersUpdate]);
168
+ const onAttachmentRemove = (uuid_removed) => {
169
+ updateAttacmentsAfterRemoval(dispatchDiscussion, uuid_removed, allDiscussions, discussionFiltersListState);
170
+ };
171
+ const onFeedbackUpdate = (comment_id, feedback, feedbackReason) => {
172
+ updateCommentStateFeedback(dispatchDiscussion, comment_id, feedback, allDiscussions, feedbackReason);
173
+ };
174
+ const onCommentAdded = () => __awaiter(this, void 0, void 0, function* () {
175
+ yield updateDiscussionStateComments(dispatchDiscussion, caseDispatch, caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
239
176
  dtmTrackEventCaseStepEncountered('comment', caseNumber, product, version);
240
177
  });
241
- const onReply = (author, commentId, timestamp) => {
242
- setReplyingTo(dispatchDiscussion, author, commentId, timestamp);
178
+ const onAttachmentAdded = () => __awaiter(this, void 0, void 0, function* () {
179
+ ToastNotification.addSuccessMessage(t('Attachment(s) uploaded successfully'));
180
+ yield updateDiscussionStateAttachments(dispatchDiscussion, caseNumber, allDiscussions, sort, loggedInUsersAccount.data.secureSupport, discussionFiltersListState, dispatchCaseDetailsHydraAttachments);
181
+ });
182
+ const onReply = (commentText, commentCreator, isPublic) => {
183
+ var _a;
184
+ setReplyingToPrivateComment(!isPublic);
185
+ setCommentText(dispatchDiscussion, commentText, commentCreator);
243
186
  scrollIntoView(props.tabRef, { navBarRef, timeout: 0, onlyIfNotInViewport: true, offset: 30 });
187
+ commentIndex !== -1 && setCommentIndex(-1);
188
+ isCommentSearchCleared && setIsCommentSearchCleared(false);
189
+ (_a = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _a === void 0 ? void 0 : _a.scrollToPosition(0);
244
190
  };
245
- const onClearReply = () => {
246
- clearReplyingTo(dispatchDiscussion);
191
+ const resetReplyComment = () => {
192
+ clearReplyComment(dispatchDiscussion);
193
+ setReplyingToPrivateComment(null);
247
194
  };
248
- /** Strips special chars to prevent regex injection, then HTML-escapes via DOM round-trip to prevent XSS. */
249
195
  const sanitizedSearchInput = (value) => {
250
196
  if (!value)
251
197
  return '';
252
198
  const sanitizedValue = value.replace(/[^a-zA-Z0-9]/g, '');
199
+ // To escape HTML-like characters (e.g., <, >, &) in sanitizedValue
253
200
  const div = document.createElement('div');
254
201
  div.textContent = sanitizedValue;
255
202
  return div.innerHTML;
@@ -263,10 +210,10 @@ export default function CaseDiscussion(props) {
263
210
  isCommentSearchCleared && setIsCommentSearchCleared(false);
264
211
  };
265
212
  const highlightSearchResults = (searchTerm) => {
266
- // Delay allows the DOM (especially virtualized rows) to finish rendering before mark.js can highlight matches.
267
213
  setTimeout(() => {
214
+ // to mark attachment link button text
268
215
  if (!isEmpty(sanitizedSearchInput(searchTerm))) {
269
- const sanitizedSearchTerm = sanitizedSearchInput(searchTerm);
216
+ const sanitizedSearchTerm = sanitizedSearchInput(searchTerm); // Sanitize the search term
270
217
  document.querySelectorAll('button.attachment-download-btn').forEach((button) => {
271
218
  var _a, _b;
272
219
  if ((_a = button === null || button === void 0 ? void 0 : button.textContent) === null || _a === void 0 ? void 0 : _a.includes(sanitizedSearchTerm)) {
@@ -280,6 +227,9 @@ export default function CaseDiscussion(props) {
280
227
  done: () => {
281
228
  if (isEmpty(searchTerm))
282
229
  return;
230
+ // removed { separateWordSearch: false }
231
+ // so the search term is split into individual words, and each word is matched separately.
232
+ // Search Term: "frontend developer" Matches: Text containing "frontend" or "developer".
283
233
  markInstance.mark(searchTerm);
284
234
  },
285
235
  });
@@ -291,26 +241,22 @@ export default function CaseDiscussion(props) {
291
241
  highlightSearchResults('');
292
242
  setSearchResult([]);
293
243
  if (cId === discussionIdFromUrl) {
244
+ // reason to reset activeElementId if comment id is same in the url on click jump to comment button
245
+ // we need to re compute filtered comments after clear search results.
246
+ // it will call useEffect and will set virtual comment Index(setVRCommentIndex())
294
247
  activeElementId.current = '';
295
248
  }
296
249
  };
297
- const onAttachmentRemove = (uuid_removed) => {
298
- updateAttacmentsAfterRemoval(dispatchDiscussion, uuid_removed, allDiscussions, discussionFiltersListState);
299
- };
300
- const onAttachmentAdded = () => __awaiter(this, void 0, void 0, function* () {
301
- var _a;
302
- yield updateDiscussionStateAttachments(dispatchDiscussion, caseNumber, allDiscussions, sort, discussionFiltersListState, dispatchCaseDetailsHydraAttachments, apolloClient, caseSalesforceId, Boolean((_a = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.secureSupport));
303
- });
304
250
  const onMetadataUpdate = (attachmentId, updatedAttachment) => {
305
251
  updateAttachment(dispatchDiscussion, attachmentId, updatedAttachment, allDiscussions);
306
252
  };
307
- const downloadAttachment = ({ caseNumber: attachmentCaseNumber, uuid, name }) => {
253
+ const downloadAttachment = (_a) => __awaiter(this, [_a], void 0, function* ({ caseNumber, uuid, name }) {
308
254
  const tempToastId = ToastNotification.addInfoMessage(t('Starting file download'));
309
255
  try {
310
- downloadCaseAttachment(attachmentCaseNumber, uuid, name);
256
+ yield caseAttachments.downloadAttachmentS3(caseNumber, uuid, name, false, loggedInUsersAccount.data.secureSupport);
311
257
  }
312
258
  catch (e) {
313
- ToastNotification.addDangerMessage(t('Could not download {{filename}}: {{error}}', {
259
+ ToastNotification.addDangerMessage(t(`Could not download {{filename}}: {{error}}`, {
314
260
  filename: name,
315
261
  error: e === null || e === void 0 ? void 0 : e.message,
316
262
  }));
@@ -318,7 +264,11 @@ export default function CaseDiscussion(props) {
318
264
  finally {
319
265
  tempToastId && ToastNotification.clearToast(tempToastId);
320
266
  }
321
- };
267
+ });
268
+ /**
269
+ * We need to clear the cell measurer cache if user resizes the window or discussion section width is changed
270
+ * so that the height of the rows are re-calculated
271
+ */
322
272
  useEffect(() => {
323
273
  if (discussionSectionWidth && shouldRenderRVComponent) {
324
274
  cellMeasureCache && cellMeasureCache.clearAll();
@@ -329,19 +279,11 @@ export default function CaseDiscussion(props) {
329
279
  }
330
280
  // eslint-disable-next-line react-hooks/exhaustive-deps
331
281
  }, [discussionSectionWidth, shouldRenderRVComponent]);
332
- useEffect(() => {
333
- var _a;
334
- if (shouldRenderRVComponent) {
335
- cellMeasureCache.clearAll();
336
- (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.recomputeRowHeights();
337
- }
338
- usedPaginationRef.current = false;
339
- // eslint-disable-next-line react-hooks/exhaustive-deps
340
- }, [sort]);
341
282
  const renderVRCommentElement = () => {
342
283
  return (React.createElement(WindowScroller, { ref: windowScrollerRef, onScroll: handleScroll }, ({ height, registerChild, onChildScroll, isScrolling, scrollTop }) => {
343
284
  return (React.createElement("div", { ref: commentRef, "data-tracking-id": "vr-case-comments" },
344
285
  React.createElement(AutoSizer, { disableHeight: true }, ({ width }) => {
286
+ // setTimeout to update state in the next tick and avoid bad setState warnings
345
287
  discussionSectionWidth !== width &&
346
288
  setTimeout(() => setDiscussionSectionWidth(width), 0);
347
289
  return (React.createElement("div", { ref: registerChild },
@@ -355,19 +297,16 @@ export default function CaseDiscussion(props) {
355
297
  if (isEmpty(discussion) || isEmpty(discussion.item))
356
298
  return null;
357
299
  return (React.createElement("div", { "data-tracking-id": "discussion-elements", key: discussion.item.id },
358
- discussion.discussionType === DiscussionType.COMMENT && (React.createElement(CaseComments, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, comment: discussion.item, onFeedBackUpdate: () => { }, feedback: discussion.feedback, accountNumber: props.accountNumber, onReply: onReply, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment })),
359
- discussion.discussionType === DiscussionType.ATTACHMENT && (React.createElement(CaseAttachment, { attachment: discussion.item, onAttachmentRemove: onAttachmentRemove, onMetadataUpdate: onMetadataUpdate, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null }))));
300
+ discussion.discussionType === DiscussionType.COMMENT && (React.createElement(CaseComments, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, comment: discussion.item, onFeedBackUpdate: onFeedbackUpdate, feedback: discussion.feedback, feedbackReason: discussion.feedbackReason, accountNumber: props.accountNumber, onReply: onReply, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment })),
301
+ discussion.discussionType === DiscussionType.ATTACHMENT && (React.createElement(CaseAttachment, { attachment: discussion.item, onAttachmentRemove: onAttachmentRemove, onMetadataUpdate: onMetadataUpdate, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null })),
302
+ discussion.discussionType === DiscussionType.CHAT && (React.createElement(CaseChat, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, chat: discussion.item, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment })),
303
+ discussion.discussionType === DiscussionType.EXTERNAL_TRACKER && (React.createElement(CaseExternalTrackerUpdate, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, trackerUpdate: discussion.item, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment }))));
360
304
  };
361
- const rowRenderer = ({ index, parent, key, style, }) => {
305
+ const rowRenderer = ({ index, parent, key, style }) => {
362
306
  const discussion = comuteSearchedComments[index];
363
307
  return (React.createElement(CellMeasurer, { key: key, cache: cellMeasureCache, parent: parent, columnIndex: 0, rowIndex: index },
364
308
  React.createElement("div", { className: "comment-virtualized-row", key: key, style: style }, renderCaseCommentElement(discussion))));
365
309
  };
366
- /**
367
- * One-shot scroll override used after search/filter changes.
368
- * Resets the virtualized list to the top, then yields control back to
369
- * WindowScroller's default onChildScroll for subsequent scroll events.
370
- */
371
310
  const customChildScroll = ({ scrollTop }) => {
372
311
  var _a;
373
312
  if (!canUpdateScrollTop) {
@@ -380,25 +319,23 @@ export default function CaseDiscussion(props) {
380
319
  };
381
320
  const handleScroll = ({ scrollTop }) => {
382
321
  var _a, _b, _c, _d, _e, _f;
322
+ // here we are doing couple of things
323
+ // 1. check scroll position on the first comment, 2. set scrollposition as par window top
324
+ // 3. if user click on jump to comment button then select row as per commentid and adding css class.
383
325
  isCommentSearchCleared && setIsCommentSearchCleared(false);
384
326
  if (listRef && commentRef) {
385
- // Skip one scroll cycle after a search/filter reset to let customChildScroll re-sync
386
327
  if (!canUpdateScrollTop) {
387
328
  setCanUpdateScrollTop(true);
388
329
  return;
389
330
  }
390
331
  const commentTop = (_b = (_a = commentRef === null || commentRef === void 0 ? void 0 : commentRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.top;
391
- // Re-apply search highlights on scroll since virtualized rows re-mount
392
332
  !isEmpty(searchCommentText) && highlightSearchResults(searchCommentText);
393
- // Normal browsing or comment section visible above viewport — sync list position
394
333
  if (isEmpty(discussionIdFromUrl) || commentTop > 0) {
395
334
  (_c = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _c === void 0 ? void 0 : _c.scrollToPosition(commentTop > 0 ? 0 : Math.abs(commentTop));
396
335
  }
397
336
  else if (commentTop < 0 && !isEmpty(discussionIdFromUrl) && !isJumpToCommentClicked) {
398
- // Deep-link navigation: let WindowScroller drive the list scroll position
399
337
  (_d = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _d === void 0 ? void 0 : _d.scrollToPosition(scrollTop);
400
338
  }
401
- // After a "jump to comment" click, scroll the virtualized list to the target row
402
339
  if (isJumpToCommentClicked) {
403
340
  (_e = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _e === void 0 ? void 0 : _e.scrollToRow(commentIndex);
404
341
  (_f = windowScrollerRef === null || windowScrollerRef === void 0 ? void 0 : windowScrollerRef.current) === null || _f === void 0 ? void 0 : _f.updatePosition();
@@ -406,6 +343,7 @@ export default function CaseDiscussion(props) {
406
343
  }
407
344
  }
408
345
  };
346
+ const list = discussionFiltersListState.filter((filter) => filter.canSee);
409
347
  useEffect(() => {
410
348
  if (isPostingRemoteRequestCommentCompleted) {
411
349
  onCommentAdded();
@@ -417,109 +355,65 @@ export default function CaseDiscussion(props) {
417
355
  e.stopPropagation();
418
356
  setIsOpen(!isOpen);
419
357
  };
358
+ const onSortToggleClick = (e) => {
359
+ e.stopPropagation();
360
+ setIsSortOpen(!isSortOpen);
361
+ };
420
362
  const onFilterSelect = (_event, prevOption) => {
421
- const isFilterSelected = !prevOption.isSelected;
422
- const prevSelectedFilters = list.filter((option) => option.isSelected && option.value !== prevOption.value);
363
+ const isFilterSelected = !prevOption.isSelected; // to get updated state of changed filter
364
+ const prevSelectedFilters = list.filter((option) => option.isSelected && option.value !== prevOption.value); // to get previously selected filters
423
365
  const prevSelectedFiltersValue = prevSelectedFilters.map((option) => option.value);
424
- const newSelectedFilters = isFilterSelected
366
+ const newSelectedFilters = isFilterSelected // has all the selected values of filter with the updated selected filter state
425
367
  ? [...prevSelectedFiltersValue, prevOption.value]
426
368
  : prevSelectedFiltersValue;
427
369
  setFilter(dispatchDiscussion, newSelectedFilters, discussionFiltersListState);
428
370
  shouldRenderRVComponent && setCanUpdateScrollTop(false);
429
371
  setSelectedFilterItems(prevSelectedFiltersValue);
430
372
  };
431
- const filterToggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen, isFullWidth: true }, getDropdownBtnPlaceholder(t('Select a filter'), list.filter((i) => i.isSelected).map((i) => i.filterLabel), ' ', list.length, t('All comments'))));
432
- const onSortToggleClick = (e) => {
433
- e.stopPropagation();
434
- setIsSortOpen(!isSortOpen);
435
- };
436
- const onSortSelect = (_event, value) => {
437
- const selectedSort = discussionSortOrderConst.find((option) => option.name === value);
438
- if (selectedSort) {
439
- setSort(dispatchDiscussion, selectedSort, allDiscussions);
440
- setSortSelected(selectedSort.name);
441
- }
373
+ const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen, isFullWidth: true }, getDropdownBtnPlaceholder(t('Select a filter'), list.filter((i) => i.isSelected).map((i) => i.filterLabel), ' ', list.length, t('All comments'))));
374
+ const onSortSelect = (_event, selectedSort) => {
375
+ setSort(dispatchDiscussion, selectedSort, allDiscussions);
376
+ setSortSelected(selectedSort.value);
442
377
  setIsSortOpen(false);
443
378
  };
444
379
  const onSortToggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onSortToggleClick, isExpanded: isSortOpen, isFullWidth: true }, sort.name));
445
380
  return (React.createElement(React.Fragment, null,
446
- (() => {
447
- const showInitialLoading = props.commentsLoading && allDiscussions.length === 0;
448
- const showNoComments = !props.commentsLoading && !props.commentsError && allDiscussions.length === 0;
449
- const showDiscussions = allDiscussions.length !== 0;
450
- const showSkeleton = debouncedShowSkeleton;
451
- const showNoMore = !props.hasNextPage &&
452
- !props.isLoadingMore &&
453
- !props.commentsLoading &&
454
- !props.loadMoreError &&
455
- comuteSearchedComments.length > 0;
456
- console.log('[CaseDiscussion] RENDER DECISION', {
457
- showInitialLoading,
458
- showNoComments,
459
- showDiscussions,
460
- isRefetching,
461
- showSkeleton,
462
- showNoMore,
463
- isSearchResultEmpty,
464
- shouldRenderRVComponent,
465
- });
466
- return null;
467
- })(),
381
+ hasAsaComment && (React.createElement(Alert, { className: `asa-discussion-alert ${isExportingPDF ? 'hide-in-pdf' : ''}`, isInline: true, variant: "info", title: t('Important'), "data-tracking-id": "case-discussion-asa-notice" },
382
+ React.createElement(Trans, null,
383
+ "This feature uses AI technology to analyze interactions and provide you with support. Interactions may be used to improve Red Hat products or services. For more information about Red Hat's privacy practices, please refer to the",
384
+ ' ',
385
+ React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" }, "Red Hat Privacy Statement")))),
468
386
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading post comment section') } },
469
387
  React.createElement(AttachmentContextProvider, null,
470
- React.createElement(PostComment, { caseNumber: caseNumber, allDiscussions: allDiscussions, onCommentAdded: onCommentAdded, onAttachmentAdded: onAttachmentAdded, onAttachmentRemove: onAttachmentRemove, replyingToAuthor: replyingToAuthor, replyingToTimestamp: replyingToTimestamp, onClearReply: onClearReply }))),
471
- props.commentsLoading && allDiscussions.length === 0 && React.createElement(LoadingIndicator, { size: "sm" }),
472
- props.commentsError && allDiscussions.length === 0 && (React.createElement(AlertMessage, { variant: AlertType.DANGER, show: true, title: t('Failed to load comments. Try refreshing.') })),
473
- !props.commentsLoading && !props.commentsError && allDiscussions.length === 0 && (React.createElement("p", null,
474
- React.createElement(Trans, null, "No comments"))),
475
- allDiscussions.length !== 0 && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading comments. Try refreshing.') } },
388
+ React.createElement(PostComment, { caseNumber: caseNumber, allDiscussions: allDiscussions, onCommentAdded: onCommentAdded, onAttachmentAdded: onAttachmentAdded, commentText: replyCommentText, onCommentClear: resetReplyComment, commentCreator: replyCommentCreator, defaultIsPublic: replyingToPrivateComment === null ? replyingToPrivateComment : !replyingToPrivateComment }))),
389
+ React.createElement(LoadingIndicator, { className: "text-center", isInline: true, show: caseAttachmentHydra.isFetching ||
390
+ caseExternalTrackersUpdate.isFetching ||
391
+ caseFeedbacksHydra.isFetching ||
392
+ (screenSessionRequested && allDiscussions.length === 0) }),
393
+ !caseAttachmentHydra.isFetching &&
394
+ !caseFeedbacksHydra.isFetching &&
395
+ !caseExternalTrackersUpdate.isFetching &&
396
+ !screenSessionRequested &&
397
+ allDiscussions.length === 0 && React.createElement(Trans, null, "No comments"),
398
+ !caseAttachmentHydra.isFetching &&
399
+ !caseFeedbacksHydra.isFetching &&
400
+ !caseExternalTrackersUpdate.isFetching &&
401
+ allDiscussions.length !== 0 && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading comments. Try refreshing.') } },
476
402
  React.createElement("div", { className: `pfe-l-grid pfe-m-all-6-col pfe-m-gutters push-bottom ${isExportingPDF ? 'hide-in-pdf' : ''}` },
477
403
  React.createElement("div", { className: "pfe-m-12-col" }, allDiscussions.length > 20 && (React.createElement(CommentSearch, { caseDiscussions: computeFilteredComments || [], onCommentSearch: onCaseCommentSearch, isCommentSearchCleared: isCommentSearchCleared }))),
478
404
  React.createElement("span", { className: "push-top-narrow" },
479
405
  React.createElement("label", { htmlFor: "case-list-comments-dropdown", className: "pf-v6-u-mb-sm" }, t('Filter by')),
480
- React.createElement(Select, { "data-tracking-id": "discussions-filter-comments-dropdown", id: "case-list-comments-dropdown", role: "menu", isOpen: isOpen, selected: selectedFilterItems, onSelect: onFilterSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: filterToggle, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
481
- React.createElement(SelectList, null, list.map((option) => (React.createElement(SelectOption, { key: option.value, hasCheckbox: true, value: option, isSelected: option.isSelected, isDisabled: option.isDisabled }, option.filterLabel)))))),
406
+ React.createElement(Select, { "data-tracking-id": "discussions-filter-comments-dropdown", id: "case-list-comments-dropdown", role: "menu", isOpen: isOpen, selected: selectedFilterItems, onSelect: onFilterSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
407
+ React.createElement(SelectList, null, list.map((option) => (React.createElement(SelectOption, { hasCheckbox: true, value: option, isSelected: option.isSelected, isDisabled: option.isDisabled }, option.filterLabel)))))),
482
408
  React.createElement("span", { className: "push-top-narrow" },
483
409
  React.createElement("label", { htmlFor: "se-discussion-sort", className: "pf-v6-u-mb-sm" }, t('Sort by')),
484
410
  React.createElement(Select, { id: "se-discussion-sort", "data-tracking-id": "discussions-sort-dropdown", isOpen: isSortOpen, selected: sortSelected, onSelect: onSortSelect, onOpenChange: (isSortOpen) => setIsSortOpen(isSortOpen), toggle: onSortToggle, shouldFocusToggleOnSelect: true, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
485
- React.createElement(SelectList, null, discussionSortOrderConst.map((option) => (React.createElement(SelectOption, { key: option.name, value: option.name, isSelected: isEqual(sort.name, option.name) }, option.name))))))),
486
- React.createElement("div", { className: "support-comment-section" },
487
- isRefetching && React.createElement(LoadingIndicator, { size: "sm" }),
488
- !isRefetching &&
489
- !shouldRenderRVComponent &&
490
- !isSearchResultEmpty &&
491
- comuteSearchedComments.map((discussion, index) => {
492
- return renderCaseCommentElement(discussion);
493
- })),
494
- isSearchResultEmpty && (React.createElement("p", { className: "infinite-scroll-end-status" },
495
- React.createElement(Trans, null, "No results found"))),
496
- !isRefetching && shouldRenderRVComponent && !isSearchResultEmpty && renderVRCommentElement(),
497
- React.createElement("div", { ref: sentinelRef, "aria-hidden": "true", style: { height: 10, marginBottom: -10 } }),
498
- debouncedShowSkeleton && (React.createElement("div", { className: "load-more-skeleton", role: "status", "aria-label": t('Loading more comments') },
499
- React.createElement("div", { className: "load-more-skeleton__header" },
500
- React.createElement("div", { className: "load-more-skeleton__avatar" }),
501
- React.createElement("div", { className: "load-more-skeleton__name" }),
502
- React.createElement("div", { className: "load-more-skeleton__timestamp" })),
503
- React.createElement("div", { className: "load-more-skeleton__body" },
504
- React.createElement("div", { className: "load-more-skeleton__line", style: { width: '100%' } }),
505
- React.createElement("div", { className: "load-more-skeleton__line", style: { width: '85%' } }),
506
- React.createElement("div", { className: "load-more-skeleton__line", style: { width: '60%' } })))),
507
- props.loadMoreError && props.loadMoreRetryCount <= 1 && (React.createElement("div", { className: "infinite-scroll-footer-message" },
508
- React.createElement(Button, { variant: "secondary", onClick: props.retryLoadMore, icon: React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" },
509
- React.createElement("polyline", { points: "23 4 23 10 17 10" }),
510
- React.createElement("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })) },
511
- React.createElement(Trans, null, "try loading again")))),
512
- props.loadMoreError && props.loadMoreRetryCount > 1 && (React.createElement("p", { className: "infinite-scroll-end-status" },
513
- React.createElement(Trans, null, "We're having trouble loading your comments. Please refresh or"),
514
- ' ',
515
- React.createElement(Button, { variant: "link", isInline: true, onClick: props.retryLoadMore },
516
- React.createElement(Trans, null, "try again")),
517
- ".")),
518
- !props.hasNextPage &&
519
- !props.isLoadingMore &&
520
- !props.commentsLoading &&
521
- !props.loadMoreError &&
522
- comuteSearchedComments.length > 0 &&
523
- props.retryLoadMore !== undefined && (React.createElement("p", { className: "infinite-scroll-end-status" },
524
- React.createElement(Trans, null, "No more comments to load")))))));
411
+ React.createElement(SelectList, null, discussionSortOrderConst.map((option) => (React.createElement(SelectOption, { value: option, isSelected: isEqual(sort.name, option.name) }, option.name))))))),
412
+ React.createElement("div", { className: "support-comment-section" }, !shouldRenderRVComponent &&
413
+ !isSearchResultEmpty &&
414
+ comuteSearchedComments.map((discussion, index) => {
415
+ return renderCaseCommentElement(discussion);
416
+ })),
417
+ isSearchResultEmpty && (React.createElement(AlertMessage, { variant: AlertType.WARNING, show: true, title: t('No result found') })),
418
+ shouldRenderRVComponent && !isSearchResultEmpty && renderVRCommentElement()))));
525
419
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CommentSearch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.tsx"],"names":[],"mappings":"AASA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5F,UAAU,MAAM;IACZ,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBA6G1C"}
1
+ {"version":3,"file":"CommentSearch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5F,UAAU,MAAM;IACZ,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBAgG1C"}