@rh-support/troubleshoot 2.6.353 → 2.6.357

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 (339) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +19 -29
  3. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  4. package/lib/esm/components/AccountInfo/OwnerSelector.js +91 -16
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +6 -2
  7. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +61 -32
  9. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +8 -0
  10. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +1 -0
  11. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +18 -0
  12. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/Case.js +60 -33
  14. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +19 -9
  16. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
  17. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +15 -4
  18. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +82 -55
  20. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +2 -0
  21. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
  23. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +1 -2
  24. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  25. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +8 -6
  26. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  27. package/lib/esm/components/CaseEditView/CaseOverview/index.js +76 -45
  28. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +203 -109
  30. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +0 -1
  31. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
  33. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +1 -3
  34. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  35. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +5 -9
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +18 -17
  38. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  39. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +51 -47
  40. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  41. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +49 -44
  42. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +4 -0
  43. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -0
  44. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +23 -0
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +51 -45
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +23 -10
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +0 -2
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +3 -2
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +132 -57
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +10 -5
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +110 -65
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +40 -26
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +2 -4
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +122 -148
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +4 -2
  68. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  69. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +76 -145
  70. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  71. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +22 -9
  72. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  73. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +9 -2
  74. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
  75. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +8 -1
  76. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +29 -0
  77. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +1 -0
  78. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +29 -0
  79. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +17 -0
  80. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -0
  81. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +60 -0
  82. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts +1 -2
  83. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts.map +1 -1
  84. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.js +13 -8
  85. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +9 -3
  86. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  87. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +217 -271
  88. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  89. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +6 -4
  90. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  91. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +3 -1
  92. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  93. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +35 -3
  94. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  95. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +63 -224
  96. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +4 -5
  97. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  98. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +18 -5
  99. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  100. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +7 -2
  101. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  102. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +38 -52
  103. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  104. package/lib/esm/components/CaseInformation/CaseGroup.js +168 -61
  105. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  106. package/lib/esm/components/CaseInformation/CaseInformation.js +10 -9
  107. package/lib/esm/components/CaseInformation/CaseLabels.d.ts +3 -0
  108. package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +1 -0
  109. package/lib/esm/components/CaseInformation/CaseLabels.js +103 -0
  110. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  111. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +108 -31
  112. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +2 -2
  113. package/lib/esm/components/CaseInformation/Description.js +1 -1
  114. package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
  115. package/lib/esm/components/CaseInformation/FileDiag.js +2 -5
  116. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  117. package/lib/esm/components/CaseInformation/Fts.js +31 -17
  118. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  119. package/lib/esm/components/CaseInformation/Severity.js +21 -13
  120. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  121. package/lib/esm/components/CaseInformation/SupportLevel.js +36 -55
  122. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +4 -0
  123. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +1 -0
  124. package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +110 -0
  125. package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
  126. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -8
  127. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  128. package/lib/esm/components/CaseManagement/CaseManagement.js +13 -10
  129. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  130. package/lib/esm/components/CaseManagement/Cep.js +11 -9
  131. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +2 -1
  132. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  133. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +22 -3
  134. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
  135. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  136. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +15 -22
  137. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  138. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +34 -40
  139. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  140. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +5 -4
  141. package/lib/esm/components/EditDescription/EditDescription.js +1 -1
  142. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  143. package/lib/esm/components/IdeaInformation/IdeaInformation.js +16 -18
  144. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  145. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  146. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  147. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  148. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
  149. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  150. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
  151. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  152. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +37 -50
  153. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +3 -0
  154. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +1 -0
  155. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +9 -0
  156. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  157. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  158. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  159. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +9 -1
  160. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  161. package/lib/esm/components/Recommendations/AsideResults.js +5 -5
  162. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  163. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -4
  164. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  165. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  166. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  167. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +10 -8
  168. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  169. package/lib/esm/components/Review/Review.js +25 -19
  170. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  171. package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
  172. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  173. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  174. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  175. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +104 -62
  176. package/lib/esm/components/shared/Constants.d.ts +1 -0
  177. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  178. package/lib/esm/components/shared/Constants.js +1 -0
  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 +2 -3
  182. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  183. package/lib/esm/components/shared/fileUpload/FileUploader.js +3 -1
  184. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +1 -0
  185. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  186. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +4 -3
  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 +21 -5
  190. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  191. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +207 -34
  192. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +5 -1
  193. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  194. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +36 -1
  195. package/lib/esm/components/shared/fileUpload/types/index.d.ts +5 -1
  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 +116 -47
  200. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  201. package/lib/esm/components/shared/useIsSectionValid.js +22 -57
  202. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  203. package/lib/esm/components/shared/usePostComment.js +16 -28
  204. package/lib/esm/components/shared/utils.d.ts +1 -0
  205. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  206. package/lib/esm/components/shared/utils.js +9 -3
  207. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  208. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +178 -38
  209. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  210. package/lib/esm/components/wizardLayout/WizardAside.js +2 -4
  211. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  212. package/lib/esm/components/wizardLayout/WizardLayout.js +9 -13
  213. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  214. package/lib/esm/components/wizardLayout/WizardMain.js +7 -0
  215. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  216. package/lib/esm/components/wizardLayout/WizardNavigation.js +13 -10
  217. package/lib/esm/constants/caseDetailsConstants.d.ts +5 -0
  218. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  219. package/lib/esm/constants/caseDetailsConstants.js +5 -0
  220. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  221. package/lib/esm/css/app.css +28 -0
  222. package/lib/esm/css/case.css +60 -209
  223. package/lib/esm/graphql/index.d.ts +4 -0
  224. package/lib/esm/graphql/index.d.ts.map +1 -0
  225. package/lib/esm/graphql/index.js +3 -0
  226. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
  227. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
  228. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
  229. package/lib/esm/graphql/mutations/index.d.ts +2 -0
  230. package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
  231. package/lib/esm/graphql/mutations/index.js +1 -0
  232. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
  233. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
  234. package/lib/esm/graphql/queries/getEscalationDetails.js +31 -0
  235. package/lib/esm/graphql/queries/index.d.ts +2 -0
  236. package/lib/esm/graphql/queries/index.d.ts.map +1 -0
  237. package/lib/esm/graphql/queries/index.js +1 -0
  238. package/lib/esm/graphql/schemas/escalation.d.ts +66 -0
  239. package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
  240. package/lib/esm/graphql/schemas/escalation.js +1 -0
  241. package/lib/esm/graphql/schemas/index.d.ts +2 -0
  242. package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
  243. package/lib/esm/graphql/schemas/index.js +1 -0
  244. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +4 -0
  245. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -0
  246. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +52 -0
  247. package/lib/esm/hooks/useCaseComments/index.d.ts +7 -0
  248. package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -0
  249. package/lib/esm/hooks/useCaseComments/index.js +5 -0
  250. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +25 -0
  251. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -0
  252. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +75 -0
  253. package/lib/esm/hooks/useCaseComments/types.d.ts +85 -0
  254. package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -0
  255. package/lib/esm/hooks/useCaseComments/types.js +1 -0
  256. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +17 -0
  257. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -0
  258. package/lib/esm/hooks/useCaseComments/useCaseComments.js +38 -0
  259. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +19 -0
  260. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -0
  261. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +33 -0
  262. package/lib/esm/hooks/useCaseGroupUiState.d.ts +3 -0
  263. package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +1 -0
  264. package/lib/esm/hooks/useCaseGroupUiState.js +10 -0
  265. package/lib/esm/hooks/useCaseHistory.d.ts +26 -0
  266. package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -0
  267. package/lib/esm/hooks/useCaseHistory.js +98 -0
  268. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +21 -0
  269. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -0
  270. package/lib/esm/hooks/useCaseLabelLinkMutations.js +91 -0
  271. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -1
  272. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  273. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +21 -11
  274. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  275. package/lib/esm/hooks/useResetCaseCreate.js +18 -11
  276. package/lib/esm/hooks/useS3Upload.d.ts +5 -4
  277. package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
  278. package/lib/esm/hooks/useS3Upload.js +28 -30
  279. package/lib/esm/i18n/template-de.d.ts +2 -2
  280. package/lib/esm/i18n/template-de.js +2 -2
  281. package/lib/esm/i18n/template-es.d.ts +2 -2
  282. package/lib/esm/i18n/template-es.js +2 -2
  283. package/lib/esm/i18n/template-fr.d.ts +2 -2
  284. package/lib/esm/i18n/template-fr.js +2 -2
  285. package/lib/esm/i18n/template-it.d.ts +2 -2
  286. package/lib/esm/i18n/template-it.js +2 -2
  287. package/lib/esm/i18n/template-jp.d.ts +2 -2
  288. package/lib/esm/i18n/template-jp.js +2 -2
  289. package/lib/esm/i18n/template-ko.d.ts +2 -2
  290. package/lib/esm/i18n/template-ko.js +2 -2
  291. package/lib/esm/i18n/template-pt.d.ts +2 -2
  292. package/lib/esm/i18n/template-pt.js +2 -2
  293. package/lib/esm/i18n/template-ru.d.ts +2 -2
  294. package/lib/esm/i18n/template-ru.js +2 -2
  295. package/lib/esm/i18n/template-zh.d.ts +2 -2
  296. package/lib/esm/i18n/template-zh.js +2 -2
  297. package/lib/esm/index.js +1 -0
  298. package/lib/esm/models/cache.d.ts +0 -2
  299. package/lib/esm/models/cache.d.ts.map +1 -1
  300. package/lib/esm/models/caseHistory.d.ts +80 -0
  301. package/lib/esm/models/caseHistory.d.ts.map +1 -0
  302. package/lib/esm/models/caseHistory.js +1 -0
  303. package/lib/esm/reducers/CaseConstNTypes.d.ts +123 -9
  304. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  305. package/lib/esm/reducers/CaseConstNTypes.js +31 -7
  306. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +7 -5
  307. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  308. package/lib/esm/reducers/CaseDetailsPageReducer.js +58 -26
  309. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +11 -12
  310. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  311. package/lib/esm/reducers/CaseDiscussionTabReducer.js +63 -70
  312. package/lib/esm/reducers/CaseHelpers.d.ts +11 -1
  313. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  314. package/lib/esm/reducers/CaseHelpers.js +117 -17
  315. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  316. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  317. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  318. package/lib/esm/reducers/CaseReducer.d.ts +56 -11
  319. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  320. package/lib/esm/reducers/CaseReducer.js +279 -99
  321. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  322. package/lib/esm/reducers/RecommendationsReducer.js +16 -19
  323. package/lib/esm/scss/_main.scss +9 -0
  324. package/lib/esm/utils/TimelineUtils.d.ts +41 -0
  325. package/lib/esm/utils/TimelineUtils.d.ts.map +1 -0
  326. package/lib/esm/utils/TimelineUtils.js +135 -0
  327. package/lib/esm/utils/caseHistoryUtils.d.ts +66 -0
  328. package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -0
  329. package/lib/esm/utils/caseHistoryUtils.js +165 -0
  330. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +1 -2
  331. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  332. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  333. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +6 -0
  334. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +1 -0
  335. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +26 -0
  336. package/package.json +9 -8
  337. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +0 -25
  338. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +0 -1
  339. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +0 -88
@@ -7,345 +7,291 @@ 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 { publicApi } from '@cee-eng/hydrajs';
11
- import { Button, ButtonVariant, Checkbox, debounce, Tooltip } from '@patternfly/react-core';
10
+ import { useApolloClient } from '@apollo/client/react';
11
+ import { Button, ButtonVariant, Checkbox } from '@patternfly/react-core';
12
12
  import PlusIcon from '@patternfly/react-icons/dist/js/icons/plus-icon';
13
- import { EditorMode, LoadingIndicator, MarkdownEditor, ToastNotification, useFetch, usePrevious, } from '@rh-support/components';
14
- import { FeatureAnnouncementKeys, GlobalMetadataStateContext, NewFeaturePopoverAnnouncement, useCanEditCase, useUserPreferences, } from '@rh-support/react-context';
15
- import { ability, CaseDiscussionFields, CaseListFields, resourceActions, resources, } from '@rh-support/user-permissions';
16
- import { pendoTrackEvent } from '@rh-support/utils';
13
+ import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
14
+ import { LoadingIndicator, RichTextEditor, ToastNotification, usePrevious } from '@rh-support/components';
15
+ import { GlobalMetadataStateContext, useCanEditCase, useUserPreferences } from '@rh-support/react-context';
16
+ import { ability, CaseDiscussionFields, resourceActions, resources } from '@rh-support/user-permissions';
17
+ import { formatDateTime, getHydraAttachmentImageUrl } from '@rh-support/utils';
17
18
  import isEmpty from 'lodash/isEmpty';
18
19
  import isEqual from 'lodash/isEqual';
19
- import uniqBy from 'lodash/uniqBy';
20
- import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
20
+ import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
21
21
  import { useDropzone } from 'react-dropzone';
22
22
  import { Trans, useTranslation } from 'react-i18next';
23
23
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
24
- import { CaseDetailsCacheNamespaces } from '../../../../enums/cache';
25
- import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
26
- import { DiscussionType } from '../../../../reducers/CaseDiscussionTabReducer';
27
- import { addingNotifiedUsers, checkForCaseStatusToggleOnAttachOrComment, setNotifiedUser, } from '../../../../reducers/CaseReducer';
28
- import { CaseDetailsCacheUtils } from '../../../../utils/caseDetailsCacheUtils';
29
- import { markdownFilePasteEvent } from '../../../shared/Constants';
30
- import { AttachmentDispatchContext, AttachmentStateContext, hasSomeSelectedFiles, hasSomeUnUploadedAttachments, isUploadingAttachment, resetAttachment, } from '../../../shared/fileUpload';
24
+ import { useCreateCaseComment } from '../../../../hooks/useCaseComments';
25
+ import { useS3Upload } from '../../../../hooks/useS3Upload';
26
+ import { checkForCaseStatusToggleOnAttachOrComment } from '../../../../reducers/CaseReducer';
27
+ import { AttachmentDispatchContext, AttachmentStateContext, hasAbortedOrFailedAttachments, hasQueuedAttachmentUploads, hasSomeSelectedFiles, isUploadingAttachment, resetAttachment, } from '../../../shared/fileUpload';
31
28
  import FileSelectorButton from '../../../shared/fileUpload/fileSelectors/FileSelectorButton';
32
29
  import FileUpload from '../../../shared/fileUpload/FileUpload';
33
30
  import { PDFContext } from '../../PDFContainer';
31
+ import { useAttachmentUploadCompletion } from './PostComment/useAttachmentUploadCompletion';
32
+ import { useCommentDrafts } from './PostComment/useCommentDrafts';
34
33
  import { useMarkdownFileUploader } from './PostComment/useMarkdownFileUploader';
35
34
  import { VerifyCaseStatusModal } from './VerifyCaseStatusModal/VerifyCaseStatusModal';
36
35
  export function PostComment(props) {
37
- var _a, _b;
36
+ var _a, _b, _c, _d, _e, _f, _g;
38
37
  const { t } = useTranslation();
39
- const caseUpdateError = useCaseUpdateErrorMessage();
40
38
  let { caseNumber } = props;
41
39
  const [isTextAreaFocused, setIsTextAreaFocused] = useState(false);
42
- const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
43
40
  const canPostPrivateComments = ability.can(resourceActions.PATCH, resources.CASE_COMMENTS, CaseDiscussionFields.POST_PRIVATE_COMMENT);
44
- const { request, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
45
- propgateErrors: true,
46
- });
41
+ const { createComment, loading: isPostingComment } = useCreateCaseComment();
47
42
  const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
48
43
  const { attachmentState } = useContext(AttachmentStateContext);
49
- const [commentText, setCommentText] = useState(props.commentText || '');
50
- const [isPublic, setIsPublic] = useState(props.defaultIsPublic === null ? true : props.defaultIsPublic);
51
- const isPublicRef = useRef(isPublic);
52
44
  const isUploadingAttachmentPrevious = useRef(false);
45
+ const batchSuccessCountRef = useRef(0);
53
46
  const isUploadingAttachments = isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles);
54
- const hasSomeUnUploadedFiles = hasSomeUnUploadedAttachments(attachmentState.caseFiles.selectedLocalFiles);
47
+ const hasQueuedUploads = hasQueuedAttachmentUploads(attachmentState.caseFiles.selectedLocalFiles);
48
+ const hasAbortedOrFailed = hasAbortedOrFailedAttachments(attachmentState.caseFiles.selectedLocalFiles);
55
49
  const hasSomeSelectedFilesLocal = hasSomeSelectedFiles(attachmentState.caseFiles.selectedLocalFiles);
56
- const [commentType, setCommentType] = useState(EditorMode.PLAIN);
50
+ const [isPublic, setIsPublic] = useState((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true);
57
51
  const [commentSignature, setCommentSignature] = useState('');
52
+ const [commentText, setCommentText] = useState('');
58
53
  const { isExportingPDF } = useContext(PDFContext);
59
54
  const { getCommentTypeFromPreference, getCommentSignature } = useUserPreferences();
60
- const userOriginalCommentPrefs = () => __awaiter(this, void 0, void 0, function* () {
61
- try {
62
- const retrievedComment = yield getCommentTypeFromPreference();
63
- const retrievedCommentSignature = yield getCommentSignature();
64
- const defaultCommentType = retrievedComment ? retrievedComment : EditorMode.PLAIN;
65
- // @ts-ignore
66
- setCommentType(defaultCommentType);
67
- const defaultCommentSignature = retrievedCommentSignature || '';
68
- setCommentSignature(defaultCommentSignature);
69
- if (isEmpty(commentText) && !isEmpty(defaultCommentSignature)) {
70
- setCommentText(`\n ${defaultCommentSignature}` || '');
71
- }
72
- }
73
- catch (error) {
74
- console.log(error);
75
- }
76
- });
55
+ const applySignature = useCallback((text) => {
56
+ if (isEmpty(commentSignature))
57
+ return;
58
+ const signatureHtml = `<p>${commentSignature}</p>`;
59
+ const signed = text.includes(commentSignature) ? text : text + signatureHtml;
60
+ setCommentText(signed);
61
+ }, [commentSignature]);
77
62
  useEffect(() => {
78
- userOriginalCommentPrefs();
63
+ function loadPrefs() {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ try {
66
+ yield getCommentTypeFromPreference();
67
+ const sig = (yield getCommentSignature()) || '';
68
+ setCommentSignature(sig);
69
+ if (isEmpty(commentText) && !isEmpty(sig)) {
70
+ setCommentText(`<p><br></p><p>${sig}</p>`);
71
+ }
72
+ }
73
+ catch (error) {
74
+ console.error('Failed to load comment preferences:', error);
75
+ }
76
+ });
77
+ }
78
+ loadPrefs();
79
79
  // eslint-disable-next-line react-hooks/exhaustive-deps
80
80
  }, []);
81
81
  const [isModalOpen, setIsModalOpen] = useState(false);
82
82
  const [cssCommentAgreed, setCssCommentAgreed] = useState(false);
83
- const [isProcessing, setIsProcessing] = useState(isPostingComment || isUploadingAttachments);
83
+ const [isProcessing, setIsProcessing] = useState(false);
84
84
  const { globalMetadataState: { loggedInUser, loggedInUserRights, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
85
- const { onFileSelect, onFileAttach, onFileDelete, isUploadingFile, isMarkdownFileUploadInProgress, cancelFileUpload, } = useMarkdownFileUploader({
85
+ const { onFileAttach, cancelFileUpload } = useMarkdownFileUploader({
86
86
  caseNumber,
87
- secureSupport: loggedInUsersAccount.data.secureSupport,
88
- onAttachmentAdded: props.onAttachmentAdded,
87
+ onAttachmentAdded: (_b = props.onAttachmentAdded) !== null && _b !== void 0 ? _b : (() => undefined),
89
88
  });
90
- const { selectedNotificationContacts, status, contactSSOName, selectedAccountDetails } = useCaseSelector((state) => ({
89
+ const { getRootProps, getInputProps } = useDropzone({
90
+ onDrop: (files) => onFileAttach(files, isPublic),
91
+ multiple: false,
92
+ noClick: true,
93
+ noKeyboard: true,
94
+ });
95
+ const { status, caseSalesforceId, existingCaseDetails } = useCaseSelector((state) => ({
91
96
  status: state.caseDetails.status,
92
- contactSSOName: state.caseDetails.contactSSOName,
93
- selectedNotificationContacts: state.selectedNotificationContacts,
94
- selectedAccountDetails: state.selectedAccountDetails,
97
+ caseSalesforceId: state.caseDetails.id,
98
+ existingCaseDetails: state.caseDetails,
95
99
  }), isEqual);
96
- const isConfirmedStateSideSupport = ((_a = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.hasConfirmedStatesideSupport) ||
97
- ((_b = selectedAccountDetails === null || selectedAccountDetails === void 0 ? void 0 : selectedAccountDetails.data) === null || _b === void 0 ? void 0 : _b.hasConfirmedStatesideSupport);
100
+ const apolloClient = useApolloClient();
101
+ const { uploadFile: uploadImageFile } = useS3Upload(caseNumber, apolloClient, caseSalesforceId);
102
+ const onImageUpload = useCallback((file) => __awaiter(this, void 0, void 0, function* () {
103
+ const attachmentId = yield uploadImageFile({ file });
104
+ if (!attachmentId) {
105
+ throw new Error('Upload did not return an attachment id.');
106
+ }
107
+ return getHydraAttachmentImageUrl(caseNumber, attachmentId);
108
+ }), [caseNumber, uploadImageFile]);
109
+ const isConfirmedStateSideSupport = (_c = loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data) === null || _c === void 0 ? void 0 : _c.hasConfirmedStatesideSupport;
98
110
  const caseDispatch = useCaseDispatch();
99
111
  const [isCommentTooLong, setIsCommentTooLong] = useState(false);
100
- const canEditCase = useCanEditCase();
112
+ const canEditCase = useCanEditCase(status);
113
+ const isCaseReadOnly = canEditCase.isCaseNotEditable;
101
114
  const componentRef = useRef(null);
102
- let passedReply = props.commentText;
103
- const { getRootProps, getInputProps, open } = useDropzone({
104
- onDrop: (files) => onFileAttach(files, isPublic),
105
- multiple: false,
106
- });
107
- // Allows the isPublic default state to be changed by the parent component
108
- const resetIsPublic = useCallback(() => setIsPublic(props.defaultIsPublic === null ? true : props.defaultIsPublic), [props.defaultIsPublic]);
115
+ const resetIsPublic = useCallback(() => { var _a; return setIsPublic((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true); }, [props.defaultIsPublic]);
109
116
  const previousDefaultIsPublic = usePrevious(props.defaultIsPublic);
110
117
  useEffect(() => {
118
+ var _a;
111
119
  if (previousDefaultIsPublic === props.defaultIsPublic)
112
120
  return;
113
- props.defaultIsPublic === null ? resetIsPublic() : setIsPublic(props.defaultIsPublic);
121
+ setIsPublic((_a = props.defaultIsPublic) !== null && _a !== void 0 ? _a : true);
114
122
  }, [props.defaultIsPublic, resetIsPublic, previousDefaultIsPublic]);
115
- // why usecallback instead of useRef?
116
- // https://reactjs.org/docs/hooks-faq.html#how-can-i-measure-a-dom-node
117
- const textAreaRef = useCallback((node) => {
118
- if (node !== null &&
119
- props.commentText &&
120
- props.commentCreator &&
121
- commentText &&
122
- commentText === getReplyText(props.commentText, props.commentCreator)) {
123
- node.scrollTop = node.scrollHeight;
124
- node.focus();
125
- }
126
- },
127
- // eslint-disable-next-line react-hooks/exhaustive-deps
128
- [commentText]);
123
+ const quillEditorRef = useRef(null);
124
+ const loggedInUserSSO = loggedInUserRights.data.getSSOUsername();
125
+ const { saveDraft, clearDraft } = useCommentDrafts({
126
+ caseNumber,
127
+ loggedInUserSSO,
128
+ isInternal: loggedInUserRights.data.isInternal(),
129
+ commentSignature,
130
+ canPostPrivateComments,
131
+ setCommentText,
132
+ setIsPublic,
133
+ applySignature,
134
+ });
129
135
  const resetCommentSection = () => __awaiter(this, void 0, void 0, function* () {
130
136
  setCommentText('');
131
137
  setIsTextAreaFocused(false);
132
138
  resetIsPublic();
133
- const { value: prevDraftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserRights.data.getSSOUsername())) || {};
134
- if (prevDraftComments[caseNumber]) {
135
- delete prevDraftComments[caseNumber];
136
- }
137
- CaseDetailsCacheUtils.set(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserRights.data.getSSOUsername(), { value: prevDraftComments });
138
- props.onCommentClear && props.onCommentClear();
139
- setCommentText(`\n ${commentSignature}` || '');
139
+ yield clearDraft();
140
+ setCommentText(commentSignature ? `<p><br></p><p>${commentSignature}</p>` : '');
140
141
  });
141
142
  const resetAttachmentSection = () => {
142
143
  resetAttachment(dispatchToAttachmentReducer);
143
144
  };
145
+ const onCaseFileUploaded = () => {
146
+ ToastNotification.addSuccessMessage(t('Attachment uploaded successfully'));
147
+ batchSuccessCountRef.current += 1;
148
+ };
149
+ useAttachmentUploadCompletion({
150
+ isUploadingAttachments,
151
+ hasQueuedUploads,
152
+ hasAbortedOrFailed,
153
+ isUploadingAttachmentPrevious,
154
+ batchSuccessCountRef,
155
+ caseDispatch,
156
+ apolloClient,
157
+ caseNumber,
158
+ existingCaseDetails,
159
+ isInternal: loggedInUserRights.data.isInternal(),
160
+ status,
161
+ resetAttachmentSection,
162
+ setCssCommentAgreed,
163
+ onAttachmentBatchAdded: props.onAttachmentAdded,
164
+ });
144
165
  const onCancelClick = () => {
166
+ // Cancel only clears comment text; file removal stays on FileLister Remove.
145
167
  resetCommentSection();
146
- resetAttachmentSection();
147
168
  cancelFileUpload();
148
169
  };
149
- const loggedInUserSSO = loggedInUserRights.data.getSSOUsername();
150
- // https://github.com/facebook/react/issues/19240
151
- const debouncedCacheSave = useMemo(() => debounce(function (value, mode, publicFlag) {
152
- return __awaiter(this, void 0, void 0, function* () {
153
- const { value: prevDraftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO)) || {};
154
- if (prevDraftComments[caseNumber]) {
155
- }
156
- prevDraftComments[caseNumber] = { text: value, privateFlag: !publicFlag, type: mode };
157
- CaseDetailsCacheUtils.set(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserSSO, {
158
- value: prevDraftComments,
159
- });
160
- });
161
- }, 500), [caseNumber, loggedInUserSSO]);
162
- const onCommentTextChange = (value, mode) => __awaiter(this, void 0, void 0, function* () {
163
- setCommentType(mode);
164
- setCommentText(value);
165
- debouncedCacheSave(value, mode, isPublic);
166
- });
167
- const addUserToNotifyList = () => __awaiter(this, void 0, void 0, function* () {
168
- const loggedInUserSSO = loggedInUserRights.data.getSSOUsername();
169
- if (loggedInUserSSO !== contactSSOName &&
170
- !(selectedNotificationContacts || []).map((item) => item.ssoUsername).includes(loggedInUserSSO)) {
171
- yield addingNotifiedUsers(caseDispatch, caseNumber, [{ ssoUsername: loggedInUserSSO }]);
172
- setNotifiedUser(caseDispatch, uniqBy([...selectedNotificationContacts, loggedInUser.data], 'ssoUsername'));
173
- }
174
- });
175
- useEffect(() => {
176
- isPublicRef.current = isPublic;
177
- }, [isPublic]);
178
- useEffect(() => {
179
- if (isCommentEmpty) {
180
- props.onCommentClear && props.onCommentClear();
181
- }
182
- // eslint-disable-next-line react-hooks/exhaustive-deps
183
- }, [commentText]);
184
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
170
+ const onCommentTextChange = (html) => {
171
+ setCommentText(html);
172
+ saveDraft(html, isPublic);
173
+ };
174
+ const onCancel = () => {
175
+ setIsModalOpen(false);
176
+ };
177
+ const isNotInternalConfirm = () => {
178
+ onPostComment();
179
+ };
180
+ const onConfirm = () => {
181
+ setIsModalOpen(false);
182
+ isNotInternalConfirm();
183
+ };
184
+ const onBtnClick = () => {
185
+ setIsModalOpen(true);
186
+ };
187
+ // TODO: Re-enable after GraphQL migration (REST notification)
188
+ // const addUserToNotifyList = async () => {
189
+ // const sso = loggedInUserRights.data.getSSOUsername();
190
+ // const alreadyNotified = (selectedNotificationContacts || []).some((item) => item.ssoUsername === sso);
191
+ // if (sso === contactSSOName || alreadyNotified) return;
192
+ // await addingNotifiedUsers(caseDispatch, caseNumber, [{ ssoUsername: sso }]);
193
+ // setNotifiedUser(caseDispatch, uniqBy([...selectedNotificationContacts, loggedInUser.data], 'ssoUsername'));
194
+ // };
195
+ const plainTextContent = (_g = (_f = (_e = (_d = quillEditorRef.current) === null || _d === void 0 ? void 0 : _d.getText) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.trim()) !== null && _g !== void 0 ? _g : '';
196
+ const checkCommentSignature = plainTextContent.replace(commentSignature, '');
197
+ const isCommentEmpty = isEmpty(checkCommentSignature === null || checkCommentSignature === void 0 ? void 0 : checkCommentSignature.trim());
185
198
  const onPostComment = () => __awaiter(this, void 0, void 0, function* () {
199
+ var _a, _b;
186
200
  if (canEditCase.alert())
187
201
  return;
188
- if (commentText) {
189
- try {
190
- setIsProcessing(true);
191
- const newCommentText = commentText.replace(/(^|\n)(-\s.+)(\n(?![-\s]))/g, '$1$2\n\n');
192
- yield request({ caseNumber, commentBody: newCommentText, isPublic, contentType: commentType });
193
- checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status);
194
- !isPublic && setIsPublic(true);
195
- addUserToNotifyList();
196
- // update state
197
- yield props.onCommentAdded();
198
- resetCommentSection();
199
- ToastNotification.addSuccessMessage(t('Comment submitted'));
200
- setCssCommentAgreed(false);
201
- }
202
- catch (e) {
203
- caseUpdateError.showError(e, t('Could not submit comment'));
204
- }
205
- finally {
206
- setIsProcessing(false);
207
- }
202
+ if (!commentText)
203
+ return;
204
+ if (!caseSalesforceId)
205
+ return;
206
+ let body = commentText;
207
+ if (props.replyingToAuthor) {
208
+ const formattedTimestamp = props.replyingToTimestamp ? formatDateTime(props.replyingToTimestamp) : '';
209
+ const replyPrefix = formattedTimestamp
210
+ ? t('(replying to {{commentCreator}}, {{timestamp}}) \n', {
211
+ commentCreator: props.replyingToAuthor,
212
+ timestamp: formattedTimestamp,
213
+ })
214
+ : t('(replying to {{commentCreator}}) \n', {
215
+ commentCreator: props.replyingToAuthor,
216
+ });
217
+ body = `<p>${replyPrefix}</p>${body}`;
218
+ }
219
+ try {
220
+ setIsProcessing(true);
221
+ yield createComment({
222
+ caseId: caseSalesforceId,
223
+ body,
224
+ isPublic,
225
+ isAssociate: loggedInUserRights.data.isInternal(),
226
+ });
227
+ yield checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status, {
228
+ apolloClient,
229
+ caseNumber,
230
+ existingCaseDetails,
231
+ });
232
+ if (!isPublic)
233
+ setIsPublic(true);
234
+ // TODO: Re-enable after GraphQL migration (REST notification)
235
+ // addUserToNotifyList();
236
+ yield ((_a = props.onCommentAdded) === null || _a === void 0 ? void 0 : _a.call(props));
237
+ resetCommentSection();
238
+ (_b = props.onClearReply) === null || _b === void 0 ? void 0 : _b.call(props);
239
+ ToastNotification.addSuccessMessage(t('Comment submitted'));
240
+ setCssCommentAgreed(false);
241
+ }
242
+ catch (_c) {
243
+ ToastNotification.addDangerMessage(t('Could not submit comment. Please refresh the page and try again.'));
244
+ }
245
+ finally {
246
+ setIsProcessing(false);
208
247
  }
209
248
  });
210
249
  const handleCheckboxToggle = () => {
211
250
  setIsPublic((publicComment) => !publicComment);
212
251
  };
213
252
  function isCommentSignatureMatch() {
214
- return commentText.trim() === commentSignature;
253
+ var _a, _b, _c, _d;
254
+ const plainText = (_d = (_c = (_b = (_a = quillEditorRef.current) === null || _a === void 0 ? void 0 : _a.getText) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : commentText.trim();
255
+ return plainText === commentSignature;
215
256
  }
216
257
  const isPostCommentDisabled = isProcessing || !commentText || isCommentSignatureMatch();
217
- const isFileUploadDisabled = isConfirmedStateSideSupport && !cssCommentAgreed;
258
+ const isFileUploadDisabled = (isConfirmedStateSideSupport && !cssCommentAgreed) || isCaseReadOnly;
218
259
  const onFileUploadClick = () => {
219
260
  ToastNotification.addInfoMessage(t('Uploading Attachment(s)'));
220
261
  };
221
- const getReplyText = (replyText, commentCreator) => {
222
- const person = t(`(replying to {{commentCreator}}) \n`, { commentCreator });
223
- const reply = replyText
224
- .substring(0, 1000)
225
- .split(/\n/)
226
- .reduce((acc, line) => (acc += '> ' + line + '\n'), person);
227
- return reply;
228
- };
229
- const addCommentSignature = (preSigComment) => {
230
- if (!isEmpty(commentSignature)) {
231
- let signedComment = '';
232
- // Checks if somment signature already exists and depending on that check, adds the signature
233
- if (preSigComment.includes(commentSignature)) {
234
- signedComment = preSigComment;
235
- }
236
- else {
237
- signedComment = preSigComment + '\n' + commentSignature;
238
- }
239
- setCommentText(signedComment);
240
- }
241
- };
242
- useEffect(() => {
243
- if (!props.commentText || !props.commentCreator) {
244
- return;
245
- }
246
- const reply = getReplyText(props.commentText, props.commentCreator);
247
- if (reply.includes(commentSignature)) {
248
- setCommentText(reply);
249
- }
250
- else {
251
- addCommentSignature(reply);
252
- }
253
- // eslint-disable-next-line react-hooks/exhaustive-deps
254
- }, [props.commentText, props.commentCreator]);
255
- useEffect(() => {
256
- if (isUploadingAttachmentPrevious.current && !isUploadingAttachments && !hasSomeUnUploadedFiles) {
257
- ToastNotification.addSuccessMessage(t('Attachment(s) uploaded successfully'));
258
- checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status);
259
- // update state
260
- resetAttachmentSection();
261
- props.onAttachmentAdded();
262
- setCssCommentAgreed(false);
263
- }
264
- isUploadingAttachmentPrevious.current = isUploadingAttachments;
265
- // eslint-disable-next-line react-hooks/exhaustive-deps
266
- }, [isUploadingAttachments]);
267
- useEffect(() => {
268
- function getDraftComments() {
269
- return __awaiter(this, void 0, void 0, function* () {
270
- const { value: draftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserRights.data.getSSOUsername())) || {};
271
- if (draftComments[caseNumber]) {
272
- const { text, privateFlag, type } = draftComments[caseNumber];
273
- if (text.trim()) {
274
- addCommentSignature(text);
275
- privateFlag === true && setIsPublic(false);
276
- setCommentType(type);
277
- }
278
- }
279
- });
280
- }
281
- getDraftComments();
282
- // eslint-disable-next-line react-hooks/exhaustive-deps
283
- }, [commentSignature]);
284
262
  const onTextAreaBlur = () => {
285
- !commentText && setIsTextAreaFocused(false);
263
+ if (!commentText)
264
+ setIsTextAreaFocused(false);
286
265
  };
287
266
  const onCommentExceedCharsLimit = (lengthExceededNew) => {
288
267
  if (isCommentTooLong !== lengthExceededNew)
289
268
  setIsCommentTooLong(lengthExceededNew);
290
269
  };
291
- const showCaseIsNotEditableAlert = () => {
292
- if (canEditCase.alert())
293
- return;
294
- };
295
- const fileUploadButton = (React.createElement(React.Fragment, null, canEditCase.isCaseNotEditable ? (React.createElement(Button, { variant: ButtonVariant.secondary, onClick: showCaseIsNotEditableAlert, isDisabled: isFileUploadDisabled }, t(isPublic || !canPostPrivateComments ? 'Attach files' : 'Attach private files'))) : (React.createElement(FileSelectorButton, { buttonLabel: t(isPublic || !canPostPrivateComments ? 'Attach files' : 'Attach private files'), isSessionId: false, isPrivate: !isPublic, "data-tracking-id": "case-discussion-file-selector-button", isDisabled: isFileUploadDisabled }))));
296
- const markdownToolbarFileSelectorBtn = (React.createElement(Button, { type: "button", onClick: open, "data-tracking-id": "inline-image-attach-file", isDisabled: isUploadingFile, variant: ButtonVariant.link, icon: React.createElement(PlusIcon, null) }, t(isPublic ? 'Attach files' : 'Attach private files')));
297
- // This is where we get all attachments to show in dropdown
298
- const getAllAttachments = () => {
299
- return (props.allDiscussions || [])
300
- .filter((item) => item.discussionType === DiscussionType.ATTACHMENT)
301
- .map((elem) => elem.item);
302
- };
303
- const onClipboardPaste = (files) => {
304
- pendoTrackEvent(markdownFilePasteEvent);
305
- onFileAttach(files, isPublicRef.current);
306
- };
307
- const onCancel = () => {
308
- setIsModalOpen(false);
309
- };
310
- const isNotInternalConfirm = () => {
311
- onPostComment();
312
- };
313
- const onConfirm = (commentText) => {
314
- setIsModalOpen(false);
315
- isNotInternalConfirm();
316
- };
317
- const onBtnClick = () => {
318
- setIsModalOpen(true);
319
- };
320
- // To check is commment is empty
321
- const checkCommentSignature = commentText.replace(commentSignature, '');
322
- const isCommentEmpty = isEmpty(checkCommentSignature === null || checkCommentSignature === void 0 ? void 0 : checkCommentSignature.trim());
323
- // To check is comment reply is empty and disable if it is
324
- const isReplyDisabled = () => {
325
- let parsedPassedReply = getReplyText(passedReply, props.commentCreator);
326
- return (parsedPassedReply === null || parsedPassedReply === void 0 ? void 0 : parsedPassedReply.trim()) === (commentText === null || commentText === void 0 ? void 0 : commentText.trim());
327
- };
328
- const isSubmitDisabled = isReplyDisabled() ||
329
- isCommentEmpty ||
330
- isPostCommentDisabled ||
331
- (isConfirmedStateSideSupport && !cssCommentAgreed);
270
+ // Submit stays independent of attachment upload so comments can be posted mid-upload (PCM-15915).
271
+ const isSubmitDisabled = isCommentEmpty || isPostCommentDisabled || (isConfirmedStateSideSupport && !cssCommentAgreed) || isCaseReadOnly;
332
272
  return (React.createElement("div", { className: `pf-v6-u-mb-md ${isExportingPDF ? 'hide-in-pdf' : ''}`, ref: componentRef },
333
- React.createElement(MarkdownEditor, { className: `${!isPublic && canPostPrivateComments ? 'is-private' : ''}`, disabled: isProcessing || canEditCase.isCaseNotEditable, "aria-label": "comment text area", showMarkdownPlainTextToggle: true, editorMode: commentType, onFocus: () => setIsTextAreaFocused(true), onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, rows: isTextAreaFocused ? 12 : 4, bindTextArea: textAreaRef, onCommentExceedCharsLimit: onCommentExceedCharsLimit, mdPlaceholder: isPublic || !canPostPrivateComments
334
- ? 'Add a comment using markdown'
335
- : 'Add a comment or attach a file privately', plainTextPlaceholder: isPublic || !canPostPrivateComments
336
- ? 'Add a comment to this case'
337
- : 'Add a comment or attach a file privately', fileSelectorProps: {
338
- showFileSelectorInToolbar: !loggedInUsersAccount.data.secureSupport,
339
- filesList: getAllAttachments(),
340
- onFileSelect: onFileSelect,
341
- onFileDelete: onFileDelete,
342
- isSupportedFile: (extension) => true,
343
- attachFileBtn: markdownToolbarFileSelectorBtn,
344
- isUploadingFile: isMarkdownFileUploadInProgress,
345
- onClipboardPaste,
273
+ props.replyingToAuthor && (React.createElement("div", { className: "post-comment-reply-banner pf-v6-u-mb-sm", "data-tracking-id": "reply-banner" },
274
+ React.createElement("span", null,
275
+ React.createElement(Trans, null, "Replying to"),
276
+ " ",
277
+ React.createElement("strong", null, props.replyingToAuthor),
278
+ props.replyingToTimestamp && (React.createElement("span", { className: "pf-v6-u-ml-xs pf-v6-u-color-200" },
279
+ "(",
280
+ formatDateTime(props.replyingToTimestamp),
281
+ ")"))),
282
+ React.createElement(Button, { variant: ButtonVariant.plain, "aria-label": t('Cancel reply'), onClick: props.onClearReply, "data-tracking-id": "cancel-reply-button" },
283
+ React.createElement(TimesIcon, null)))),
284
+ React.createElement(RichTextEditor, { key: `${caseNumber}-${isCaseReadOnly}`, className: `${!isPublic && canPostPrivateComments ? 'is-private' : ''}`, disabled: isProcessing || isCaseReadOnly, hideToolbar: isCaseReadOnly, "aria-label": "comment text area", onFocus: () => {
285
+ if (isCaseReadOnly)
286
+ return;
287
+ setIsTextAreaFocused(true);
288
+ }, onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, height: isTextAreaFocused ? 313 : 120, onCharLimitExceeded: onCommentExceedCharsLimit, placeholder: !isPublic && canPostPrivateComments
289
+ ? 'Add a comment or attach a file privately'
290
+ : 'Add a comment to this case', charLimit: 32000, onImageUpload: onImageUpload, bindEditor: (editor) => {
291
+ quillEditorRef.current = editor;
346
292
  } }),
347
293
  isConfirmedStateSideSupport && (React.createElement("div", { className: "pf-v6-u-mt-md pf-v6-u-mb-lg" },
348
- React.createElement("input", { type: "checkbox", id: "css-case-comment-agreement", name: "css-case-comment-agreement", "data-tracking-id": "css-case-comment-agreement", checked: cssCommentAgreed, onChange: (e) => setCssCommentAgreed(e.target.checked) }),
294
+ React.createElement("input", { type: "checkbox", id: "css-case-comment-agreement", name: "css-case-comment-agreement", "data-tracking-id": "css-case-comment-agreement", checked: cssCommentAgreed, disabled: isCaseReadOnly, onChange: (e) => setCssCommentAgreed(e.target.checked) }),
349
295
  React.createElement("label", { htmlFor: "css-case-comment-agreement", className: "pf-v6-u-font-weight-normal pf-v6-u-font-size-sm" },
350
296
  React.createElement(Trans, null, "I will not transmit controlled unclassified information to or export it from the Red Hat Customer Portal."),
351
297
  React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*")))),
@@ -353,15 +299,15 @@ export function PostComment(props) {
353
299
  isModalOpen && loggedInUserRights.data.isInternal() && isPublic && (React.createElement(VerifyCaseStatusModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: isPostingComment, caseNumber: props.caseNumber })),
354
300
  React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isSubmitDisabled, className: "postcomment-submit" },
355
301
  React.createElement(Trans, null, "Submit")),
356
- canAddAttachments &&
357
- (isPublic && canPostPrivateComments ? (React.createElement(Tooltip, { content: t('You can attach files privately') }, fileUploadButton)) : (fileUploadButton)),
358
- React.createElement(Button, { className: "secondary-button-pill", "data-tracking-id": "postcomment-cancel-button", type: "button", variant: ButtonVariant.link, onClick: onCancelClick, isDisabled: isPostCommentDisabled },
302
+ React.createElement(FileSelectorButton, { isSessionId: false, isDisabled: isFileUploadDisabled, buttonLabel: React.createElement(React.Fragment, null,
303
+ React.createElement(PlusIcon, null),
304
+ " ",
305
+ React.createElement(Trans, null, "Attach files")) }),
306
+ React.createElement(Button, { className: "secondary-button-pill", "data-tracking-id": "postcomment-cancel-button", type: "button", variant: ButtonVariant.link, onClick: onCancelClick, isDisabled: isCommentEmpty || isProcessing || isCaseReadOnly },
359
307
  React.createElement(Trans, null, "Cancel")),
360
308
  canPostPrivateComments && (React.createElement("span", { className: "post-comment-checkbox" },
361
- React.createElement(Checkbox, { label: t('Private'), isChecked: !isPublic && canPostPrivateComments, onChange: handleCheckboxToggle, "aria-label": t('Private'), id: "private-comment", name: "private-comment", "data-tracking-id": "private-comment-checkbox" }))))),
362
- React.createElement(FileUpload, { className: `file-upload-section ${hasSomeSelectedFilesLocal ? 'card card-white pf-v6-u-mt-lg pf-v6-u-p-lg' : ''}`, idToUploadTo: caseNumber, onUploadClick: onFileUploadClick, isSessionId: false, isSecureSupport: loggedInUsersAccount.data.secureSupport, isPrivate: !isPublic, autoUploadOnSelect: true, showDescriptionInfoMsg: true }),
363
- React.createElement("span", Object.assign({}, getRootProps(), { tabIndex: -1 }),
364
- React.createElement("input", Object.assign({ style: { display: 'none !important' } }, getInputProps()))),
365
- !loggedInUsersAccount.data.secureSupport && (React.createElement(NewFeaturePopoverAnnouncement, { "aria-label": "Attach and embed images! You'll find all of your uploaded images here.", featureName: FeatureAnnouncementKeys.MARKDOWN_INLINE_IMAGES, sectionRef: componentRef, bodyContent: React.createElement("div", null,
366
- React.createElement(Trans, null, "Attach and embed images! You'll find all of your uploaded images here.")), triggerRef: () => document.getElementById('md-editor-toolbar-file-selector') }))));
309
+ React.createElement(Checkbox, { label: t('Private'), isChecked: !isPublic && canPostPrivateComments, isDisabled: isCaseReadOnly, onChange: handleCheckboxToggle, "aria-label": t('Private'), id: "private-comment", name: "private-comment", "data-tracking-id": "private-comment-checkbox" }))))),
310
+ React.createElement("div", Object.assign({}, getRootProps(), { className: "post-comment-dropzone" }),
311
+ React.createElement("input", Object.assign({}, getInputProps())),
312
+ React.createElement(FileUpload, { className: `file-upload-section ${hasSomeSelectedFilesLocal ? 'card card-white pf-v6-u-mt-lg pf-v6-u-p-lg' : ''}`, idToUploadTo: caseNumber, caseSalesforceId: caseSalesforceId, onUploadClick: onFileUploadClick, onCaseFileUploaded: onCaseFileUploaded, isSessionId: false, needsAnalyzing: false, autoUploadOnSelect: loggedInUsersAccount.data.secureSupport ? false : true, isPrivate: !isPublic, showDescriptionInfoMsg: true }))));
367
313
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA6IlD"}
1
+ {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBAiJlD"}
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { useApolloClient } from '@apollo/client/react';
10
11
  import { Button, ButtonVariant, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, } from '@patternfly/react-core';
11
12
  import { SingleSelectDropdown, ToastNotification } from '@rh-support/components';
12
13
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
@@ -43,11 +44,12 @@ export function VerifyCaseStatusModal(props) {
43
44
  selectedAccountDetails: state.selectedAccountDetails,
44
45
  }), isEqual);
45
46
  const { status } = caseState.caseDetails;
46
- const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
47
+ const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
48
+ const apolloClient = useApolloClient();
47
49
  const canManageCase = loggedInUserRights.data.canManageCases();
48
50
  useEffect(() => {
49
- fetchAllStatuses(caseOverviewDispatch, loggedInUsersAccount.data.secureSupport);
50
- }, [caseOverviewDispatch, loggedInUsersAccount.data.secureSupport]);
51
+ fetchAllStatuses(caseOverviewDispatch, apolloClient);
52
+ }, [caseOverviewDispatch, apolloClient]);
51
53
  const { isCaseUpdating } = caseState;
52
54
  const canEditCase = useCanEditCase();
53
55
  const caseDispatch = useCaseDispatch();
@@ -69,7 +71,7 @@ export function VerifyCaseStatusModal(props) {
69
71
  }
70
72
  catch (e) {
71
73
  setStatusUpdating(caseOverviewDispatch, false);
72
- caseUpdateError.showError(e, t('Status failed to update'));
74
+ caseUpdateError.showError(e, t('Status failed to update, try refreshing the page. Please contact us if the problem persists.'));
73
75
  }
74
76
  }
75
77
  else {