@rh-support/troubleshoot 2.6.358 → 2.6.363

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 (349) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +29 -19
  3. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  4. package/lib/esm/components/AccountInfo/OwnerSelector.js +16 -91
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +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 +4 -15
  15. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +55 -82
  17. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +0 -2
  18. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
  20. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -1
  21. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +6 -8
  23. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/CaseOverview/index.js +47 -79
  25. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +109 -203
  27. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +1 -0
  28. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
  30. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +3 -1
  31. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +9 -5
  33. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  34. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +17 -18
  35. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +47 -51
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  38. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +44 -49
  39. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +45 -51
  41. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +17 -63
  43. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
  44. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +2 -0
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +2 -3
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +55 -130
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +5 -10
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +65 -110
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +9 -16
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +25 -0
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +1 -0
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +102 -0
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +26 -40
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +4 -2
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +148 -122
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -4
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +145 -76
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  68. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +9 -22
  69. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  70. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +2 -9
  71. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
  72. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +1 -8
  73. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts +2 -2
  74. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts.map +1 -1
  75. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.js +7 -18
  76. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +3 -9
  77. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  78. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +267 -217
  79. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  80. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +4 -6
  81. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  82. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +1 -3
  83. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  84. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -35
  85. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  86. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +224 -63
  87. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +5 -4
  88. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  89. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +5 -18
  90. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  91. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -7
  92. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  93. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +52 -38
  94. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  95. package/lib/esm/components/CaseInformation/CaseGroup.js +61 -168
  96. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  97. package/lib/esm/components/CaseInformation/CaseInformation.js +9 -10
  98. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  99. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +31 -108
  100. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +2 -2
  101. package/lib/esm/components/CaseInformation/Description.js +1 -1
  102. package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
  103. package/lib/esm/components/CaseInformation/FileDiag.js +5 -2
  104. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  105. package/lib/esm/components/CaseInformation/Fts.js +17 -31
  106. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  107. package/lib/esm/components/CaseInformation/Severity.js +24 -33
  108. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  109. package/lib/esm/components/CaseInformation/SupportLevel.js +55 -36
  110. package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
  111. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +8 -2
  112. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  113. package/lib/esm/components/CaseManagement/CaseManagement.js +10 -13
  114. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  115. package/lib/esm/components/CaseManagement/Cep.js +9 -11
  116. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +1 -2
  117. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  118. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +3 -20
  119. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  120. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
  121. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +1 -0
  122. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  123. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +32 -19
  124. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  125. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +40 -34
  126. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  127. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +4 -8
  128. package/lib/esm/components/EditDescription/EditDescription.js +1 -1
  129. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  130. package/lib/esm/components/IdeaInformation/IdeaInformation.js +17 -23
  131. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  132. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
  133. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
  134. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  135. package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
  136. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  137. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
  138. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  139. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -37
  140. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  141. package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
  142. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  143. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -9
  144. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  145. package/lib/esm/components/Recommendations/AsideResults.js +3 -4
  146. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  147. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +4 -1
  148. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  149. package/lib/esm/components/Recommendations/ClusterRecommendations.js +4 -1
  150. package/lib/esm/components/Recommendations/InsightsResults.js +3 -3
  151. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  152. package/lib/esm/components/Recommendations/Recommendations.js +9 -3
  153. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  154. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +8 -10
  155. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  156. package/lib/esm/components/Review/Review.js +19 -25
  157. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  158. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
  159. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  160. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  161. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  162. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  163. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +91 -139
  164. package/lib/esm/components/shared/Constants.d.ts +0 -5
  165. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  166. package/lib/esm/components/shared/Constants.js +0 -5
  167. package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
  168. package/lib/esm/components/shared/fileUpload/FileLister.js +3 -3
  169. package/lib/esm/components/shared/fileUpload/FileUpload.js +3 -2
  170. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  171. package/lib/esm/components/shared/fileUpload/FileUploader.js +1 -3
  172. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +0 -1
  173. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  174. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +3 -4
  175. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts +1 -1
  176. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts.map +1 -1
  177. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +5 -22
  178. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  179. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +59 -307
  180. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +1 -5
  181. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  182. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +1 -36
  183. package/lib/esm/components/shared/fileUpload/types/index.d.ts +1 -5
  184. package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
  185. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +2 -2
  186. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
  187. package/lib/esm/components/shared/fileUpload/useFileUploader.js +47 -119
  188. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  189. package/lib/esm/components/shared/useIsSectionValid.js +57 -22
  190. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  191. package/lib/esm/components/shared/usePostComment.js +28 -16
  192. package/lib/esm/components/shared/utils.d.ts +0 -1
  193. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  194. package/lib/esm/components/shared/utils.js +3 -9
  195. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  196. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +38 -178
  197. package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
  198. package/lib/esm/components/wizardLayout/MainSection.js +1 -2
  199. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  200. package/lib/esm/components/wizardLayout/WizardAside.js +4 -2
  201. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  202. package/lib/esm/components/wizardLayout/WizardLayout.js +13 -12
  203. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  204. package/lib/esm/components/wizardLayout/WizardMain.js +0 -7
  205. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  206. package/lib/esm/components/wizardLayout/WizardNavigation.js +11 -14
  207. package/lib/esm/constants/caseDetailsConstants.d.ts +0 -5
  208. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  209. package/lib/esm/constants/caseDetailsConstants.js +0 -5
  210. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  211. package/lib/esm/css/app.css +0 -28
  212. package/lib/esm/css/case.css +209 -60
  213. package/lib/esm/hooks/useAB.d.ts.map +1 -1
  214. package/lib/esm/hooks/useAB.js +23 -45
  215. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -1
  216. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  217. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +11 -21
  218. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  219. package/lib/esm/hooks/useResetCaseCreate.js +11 -18
  220. package/lib/esm/hooks/useS3Upload.d.ts +4 -5
  221. package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
  222. package/lib/esm/hooks/useS3Upload.js +30 -28
  223. package/lib/esm/i18n/template-de.d.ts +2 -2
  224. package/lib/esm/i18n/template-de.js +2 -2
  225. package/lib/esm/i18n/template-es.d.ts +2 -2
  226. package/lib/esm/i18n/template-es.js +2 -2
  227. package/lib/esm/i18n/template-fr.d.ts +2 -2
  228. package/lib/esm/i18n/template-fr.js +2 -2
  229. package/lib/esm/i18n/template-it.d.ts +2 -2
  230. package/lib/esm/i18n/template-it.js +2 -2
  231. package/lib/esm/i18n/template-jp.d.ts +2 -2
  232. package/lib/esm/i18n/template-jp.js +2 -2
  233. package/lib/esm/i18n/template-ko.d.ts +2 -2
  234. package/lib/esm/i18n/template-ko.js +2 -2
  235. package/lib/esm/i18n/template-pt.d.ts +2 -2
  236. package/lib/esm/i18n/template-pt.js +2 -2
  237. package/lib/esm/i18n/template-ru.d.ts +2 -2
  238. package/lib/esm/i18n/template-ru.js +2 -2
  239. package/lib/esm/i18n/template-zh.d.ts +2 -2
  240. package/lib/esm/i18n/template-zh.js +2 -2
  241. package/lib/esm/index.js +0 -1
  242. package/lib/esm/models/cache.d.ts +2 -0
  243. package/lib/esm/models/cache.d.ts.map +1 -1
  244. package/lib/esm/reducers/CaseConstNTypes.d.ts +9 -123
  245. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  246. package/lib/esm/reducers/CaseConstNTypes.js +7 -31
  247. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +5 -7
  248. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  249. package/lib/esm/reducers/CaseDetailsPageReducer.js +26 -58
  250. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +12 -11
  251. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  252. package/lib/esm/reducers/CaseDiscussionTabReducer.js +70 -63
  253. package/lib/esm/reducers/CaseHelpers.d.ts +1 -11
  254. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  255. package/lib/esm/reducers/CaseHelpers.js +17 -119
  256. package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
  257. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  258. package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
  259. package/lib/esm/reducers/CaseReducer.d.ts +11 -56
  260. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  261. package/lib/esm/reducers/CaseReducer.js +100 -284
  262. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  263. package/lib/esm/reducers/RecommendationsReducer.js +18 -15
  264. package/lib/esm/scss/_main.scss +0 -9
  265. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +2 -1
  266. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  267. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  268. package/package.json +8 -9
  269. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +0 -8
  270. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +0 -1
  271. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +0 -18
  272. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -4
  273. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
  274. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -23
  275. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -29
  276. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
  277. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -29
  278. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
  279. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
  280. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -60
  281. package/lib/esm/components/CaseInformation/CaseLabels.d.ts +0 -3
  282. package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +0 -1
  283. package/lib/esm/components/CaseInformation/CaseLabels.js +0 -106
  284. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +0 -4
  285. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +0 -1
  286. package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +0 -141
  287. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +0 -3
  288. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +0 -1
  289. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +0 -9
  290. package/lib/esm/graphql/index.d.ts +0 -4
  291. package/lib/esm/graphql/index.d.ts.map +0 -1
  292. package/lib/esm/graphql/index.js +0 -3
  293. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
  294. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
  295. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
  296. package/lib/esm/graphql/mutations/index.d.ts +0 -2
  297. package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
  298. package/lib/esm/graphql/mutations/index.js +0 -1
  299. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
  300. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
  301. package/lib/esm/graphql/queries/getEscalationDetails.js +0 -31
  302. package/lib/esm/graphql/queries/index.d.ts +0 -2
  303. package/lib/esm/graphql/queries/index.d.ts.map +0 -1
  304. package/lib/esm/graphql/queries/index.js +0 -1
  305. package/lib/esm/graphql/schemas/escalation.d.ts +0 -66
  306. package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
  307. package/lib/esm/graphql/schemas/escalation.js +0 -1
  308. package/lib/esm/graphql/schemas/index.d.ts +0 -2
  309. package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
  310. package/lib/esm/graphql/schemas/index.js +0 -1
  311. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
  312. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
  313. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -52
  314. package/lib/esm/hooks/useCaseComments/index.d.ts +0 -7
  315. package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
  316. package/lib/esm/hooks/useCaseComments/index.js +0 -5
  317. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
  318. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
  319. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -75
  320. package/lib/esm/hooks/useCaseComments/types.d.ts +0 -85
  321. package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
  322. package/lib/esm/hooks/useCaseComments/types.js +0 -1
  323. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -17
  324. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
  325. package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -38
  326. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
  327. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
  328. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
  329. package/lib/esm/hooks/useCaseGroupUiState.d.ts +0 -3
  330. package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +0 -1
  331. package/lib/esm/hooks/useCaseGroupUiState.js +0 -10
  332. package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
  333. package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
  334. package/lib/esm/hooks/useCaseHistory.js +0 -98
  335. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +0 -23
  336. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +0 -1
  337. package/lib/esm/hooks/useCaseLabelLinkMutations.js +0 -84
  338. package/lib/esm/models/caseHistory.d.ts +0 -80
  339. package/lib/esm/models/caseHistory.d.ts.map +0 -1
  340. package/lib/esm/models/caseHistory.js +0 -1
  341. package/lib/esm/utils/TimelineUtils.d.ts +0 -41
  342. package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
  343. package/lib/esm/utils/TimelineUtils.js +0 -135
  344. package/lib/esm/utils/caseHistoryUtils.d.ts +0 -66
  345. package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
  346. package/lib/esm/utils/caseHistoryUtils.js +0 -165
  347. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +0 -6
  348. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +0 -1
  349. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +0 -26
@@ -1,11 +1,9 @@
1
1
  import { CaseDiagnosticsStatus } from '@cee-eng/hydrajs/@types/api/pcm/preCaseDiagnostics';
2
2
  import { ISlowUploadDetectionConfig } from '@cee-eng/hydrajs/@types/models/attachment';
3
- import { ApolloQueryClient } from '@rh-support/utils';
4
3
  import { AnalysisStatusConstants, AttachmentReducerDispatchType, IAnalysisResults, ICaseFiles, IFileLocal, IUploadMetadata, UploadStatusConstants } from './AttachmentReducer';
5
4
  export declare const onDrop: (dispatchToAttachmentReducer: AttachmentReducerDispatchType, isSessionId: boolean, isPrivate?: boolean) => (acceptedFiles: File[]) => void;
6
5
  export declare const isUploadingOnSession: (status: string) => status is UploadStatusConstants.uploadingOnSession;
7
6
  export declare const isUploadingOnCase: (status: string) => status is UploadStatusConstants.uploadingOnCase;
8
- export declare const isAttachedOnCase: (status: string) => status is UploadStatusConstants.attachedOnCase;
9
7
  export declare const isVerifyingSessionUpload: (status: string) => status is UploadStatusConstants.verifyingSessionUpload;
10
8
  export declare const isVerifyingCaseUpload: (status: string) => status is UploadStatusConstants.verifyingCaseUpload;
11
9
  export declare const isRestoredFromSession: (status: string) => status is UploadStatusConstants.restoredFromSession;
@@ -28,21 +26,10 @@ export declare const isFileDeleted: (status: string) => status is UploadStatusCo
28
26
  export declare const hasUploadedSomeAttachments: (selectedLocalFiles: IFileLocal[]) => boolean;
29
27
  export declare const hasAnalysedSomeAttachments: (selectedLocalFiles: IFileLocal[]) => boolean;
30
28
  export declare const hasSomeUnUploadedAttachments: (selectedLocalFiles: IFileLocal[]) => boolean;
31
- /**
32
- * Files still queued to start uploading. Aborted/failed are terminal and must not
33
- * block post-upload discussion refresh when other files in the batch succeeded.
34
- */
35
- export declare const hasQueuedAttachmentUploads: (selectedLocalFiles: IFileLocal[]) => boolean;
36
- /** Aborted/failed rows should stay in the upload panel until the user clicks Remove. */
37
- export declare const hasAbortedOrFailedAttachments: (selectedLocalFiles: IFileLocal[]) => boolean;
38
- /** True when at least one non-deleted file remains in the upload queue (UI visibility). */
39
29
  export declare const hasSomeSelectedFiles: (selectedLocalFiles: IFileLocal[]) => boolean;
40
- export declare const clearUploadRuntimeState: () => void;
41
30
  export declare const isUploadingAttachment: (selectedLocalFiles: IFileLocal[]) => boolean;
42
31
  export declare const isAnalysingAnyAttachment: (selectedLocalFiles: IFileLocal[]) => boolean;
43
32
  export declare const canShowProgressBar: (file: IFileLocal) => boolean;
44
- /** Case discussion: show radial progress while queued (attachedOnCase) or actively uploading. */
45
- export declare const shouldShowUploadProgressIndicator: (file: IFileLocal, isSessionUpload: boolean) => boolean;
46
33
  export declare const shouldHideDescription: (file: IFileLocal, isSessionUpload: boolean) => boolean;
47
34
  export declare const isUploadOnTrack: (file: IFileLocal) => boolean;
48
35
  export declare const isUploadedAndAnalyzed: (file: IFileLocal) => boolean;
@@ -50,34 +37,30 @@ export declare const isUploadedAndAnalysisFailed: (file: IFileLocal) => boolean;
50
37
  export declare const isUploadedSuccessfully: (file: IFileLocal) => string;
51
38
  export declare const isUploadedAndAnalysisSkipped: (file: IFileLocal) => boolean;
52
39
  export declare const updateUploadMetadata: (dispatch: AttachmentReducerDispatchType, fileIndexToEdit: number, newUploadMetadata: Partial<IUploadMetadata>) => void;
53
- export declare const uploadAllFiles: ({ dispatch, idToUploadTo, caseFiles, needsAnalyzing, isSessionId, slowUploadConfig, apolloClient, caseSalesforceId, onCaseFileUploaded, }: {
40
+ export declare const uploadAllFiles: ({ dispatch, idToUploadTo, caseFiles, isSecureSupport, needsAnalyzing, isSessionId, slowUploadConfig, }: {
54
41
  dispatch: AttachmentReducerDispatchType;
55
42
  idToUploadTo: string;
56
43
  caseFiles: ICaseFiles;
44
+ isSecureSupport: boolean;
57
45
  needsAnalyzing?: boolean;
58
46
  isSessionId?: boolean;
59
47
  slowUploadConfig?: ISlowUploadDetectionConfig;
60
- apolloClient?: ApolloQueryClient;
61
- caseSalesforceId?: string;
62
- onCaseFileUploaded?: () => void;
63
48
  }) => Promise<void>;
64
- export declare const uploadFile: ({ dispatch, idToUploadTo, localFile, originalFile, index, needsAnalyzing, isSessionId, slowUploadConfig, apolloClient, caseSalesforceId, onCaseFileUploaded, }: {
49
+ export declare const uploadFile: ({ dispatch, idToUploadTo, localFile, originalFile, index, isSecureSupport, needsAnalyzing, isSessionId, slowUploadConfig, }: {
65
50
  dispatch: AttachmentReducerDispatchType;
66
51
  idToUploadTo: string;
67
52
  localFile: IFileLocal;
68
53
  originalFile: File;
69
54
  index: number;
55
+ isSecureSupport: boolean;
70
56
  needsAnalyzing?: boolean;
71
57
  isSessionId?: boolean;
72
58
  slowUploadConfig?: ISlowUploadDetectionConfig;
73
- apolloClient?: ApolloQueryClient;
74
- caseSalesforceId?: string;
75
- onCaseFileUploaded?: () => void;
76
59
  }) => Promise<void>;
77
60
  export declare function doSosReportAnalysisForAllFiles(dispatch: any, idToUploadTo: string, localFiles: IFileLocal[], isSessionId: boolean): Promise<void>;
78
61
  export declare function doSosReportAnalysisForFile(dispatch: any, idToUploadTo: string, attachmentId: string, localFile: IFileLocal, isSessionId: boolean, fileIndex: number, fileUploadStatus?: UploadStatusConstants): Promise<void>;
79
62
  export declare function computeAnalysisResults(idToUploadTo: string, attachmentId: string, fileSize: number, isSessionId: boolean, listener: (status: CaseDiagnosticsStatus) => void): Promise<IAnalysisResults>;
80
- export declare function moveSessionAttachmentToCase(dispatch: any, caseNumber: string, sessionId: string, localFile: IFileLocal, fileIndex: number, apolloClient?: ApolloQueryClient, caseSalesforceId?: string): Promise<void>;
63
+ export declare function moveSessionAttachmentToCase(dispatch: any, caseNumber: string, sessionId: string, localFile: IFileLocal, fileIndex: number): Promise<void>;
81
64
  export declare function restoreFilesFromSession(dispatch: any, sessionId: string): Promise<void>;
82
65
  export declare function isFileAnalysisFailedForAllFiles(localFiles: IFileLocal[]): boolean;
83
66
  export declare function isAnyFileAttached(localFiles: IFileLocal[]): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAEvF,OAAO,EACH,iBAAiB,EAWpB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EACH,uBAAuB,EAEvB,6BAA6B,EAK7B,gBAA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,EACxB,WAAW,EAAE,OAAO,iBAMvB;AAED,wBAAsB,0BAA0B,CAC5C,QAAQ,KAAA,EACR,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,qBAAqB,iBA6D3C;AAED,wBAAsB,sBAAsB,CACxC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,GAClD,OAAO,CAAC,gBAAgB,CAAC,CAwB3B;AAID,wBAAsB,2BAA2B,CAC7C,QAAQ,KAAA,EACR,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,iBAAiB,EAChC,gBAAgB,CAAC,EAAE,MAAM,iBA4E5B;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,KAAA,EAAE,SAAS,EAAE,MAAM,iBA+CxE;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,UAAU,EAAE,WAEvE;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,WAKzD;AAED,eAAO,MAAM,uBAAuB,GAAI,YAAY,UAAU,KAAG,OAShE,CAAC;AAKF,eAAO,MAAM,2BAA2B,UAOvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,oBAAoB,UAAU,EAAE,YAE9E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,aAAQ,SAUvC,CAAC"}
1
+ {"version":3,"file":"AttachmentHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD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CAwB3B;AAED,wBAAsB,2BAA2B,CAC7C,QAAQ,KAAA,EACR,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,MAAM,iBA6BpB;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,KAAA,EAAE,SAAS,EAAE,MAAM,iBA+CxE;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,UAAU,EAAE,WAEvE;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,WAKzD;AAED,eAAO,MAAM,uBAAuB,GAAI,YAAY,UAAU,KAAG,OAShE,CAAC;AAKF,eAAO,MAAM,2BAA2B,UAOvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,oBAAoB,UAAU,EAAE,YAE9E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,aAAQ,SAOvC,CAAC"}
@@ -7,58 +7,45 @@ 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 { Config, pcm, sessionAttachments } from '@cee-eng/hydrajs';
10
+ import { caseAttachments, Config, pcm, sessionAttachments } from '@cee-eng/hydrajs';
11
11
  import { ToastNotification } from '@rh-support/components';
12
- import { CaseAttachmentUploadError, deleteCaseAttachment, fetchCaseDetailsByCaseNumber, GET_CONTENT_DOCUMENT_IDS, getText, MultipartUploadError, pendoTrackEvent, pollAttachmentUploadStatus, pollContentVersionStatus, uploadCaseAttachment, } from '@rh-support/utils';
12
+ import { getText } from '@rh-support/utils';
13
13
  import find from 'lodash/find';
14
+ import forEach from 'lodash/forEach';
14
15
  import includes from 'lodash/includes';
15
16
  import isEmpty from 'lodash/isEmpty';
16
17
  import isUndefined from 'lodash/isUndefined';
17
18
  import { AnalysisStatusConstants, AttachmentReducerConstants, defaultAnalysisMetadata, defaultUploadMetadata, onFilesSelect, resetAttachment, udpateFileUploadMetadata, updateAnalysisMetadata, updateAttachmentIdForFile, UploadStatusConstants, } from './AttachmentReducer';
18
19
  import { FileStatusHelper } from './FileStatusHelper';
19
20
  export const onDrop = (dispatchToAttachmentReducer, isSessionId, isPrivate = false) => (acceptedFiles) => {
20
- if (!acceptedFiles.length) {
21
- return;
22
- }
23
- void (() => __awaiter(void 0, void 0, void 0, function* () {
24
- const results = yield Promise.all(acceptedFiles.map((file) => __awaiter(void 0, void 0, void 0, function* () {
25
- try {
26
- const fileAccessDetails = yield getFileAccessDetails(file);
27
- const localFile = {
28
- name: file.name,
29
- size: file.size,
30
- lastModified: file.lastModified,
31
- type: file.type,
32
- description: '',
33
- isPrivate: isPrivate,
34
- uploadProgress: Object.assign(Object.assign({}, defaultUploadMetadata), { uploadStatus: isSessionId
35
- ? UploadStatusConstants.attachedOnSession
36
- : UploadStatusConstants.attachedOnCase }),
37
- analysisMetadata: Object.assign({}, defaultAnalysisMetadata),
38
- uploadability: Object.assign({}, fileAccessDetails),
39
- includeResults: true,
40
- };
41
- return { localFile, file };
42
- }
43
- catch (e) {
44
- if (!e.ableToUpload) {
45
- ToastNotification.addDangerMessage(e.ableToUploadMessage);
46
- }
47
- return null;
48
- }
49
- })));
50
- const selectedLocalFiles = [];
51
- const selectedOriginalFiles = [];
52
- results.forEach((result) => {
53
- if (result) {
54
- selectedLocalFiles.push(result.localFile);
55
- selectedOriginalFiles.push(result.file);
21
+ const onFilesSelectLocal = (caseFiles) => {
22
+ onFilesSelect(dispatchToAttachmentReducer, caseFiles);
23
+ };
24
+ forEach(acceptedFiles, (file) => __awaiter(void 0, void 0, void 0, function* () {
25
+ try {
26
+ const fileAccessDetails = yield getFileAccessDetails(file);
27
+ const localFile = {
28
+ name: file.name,
29
+ size: file.size,
30
+ lastModified: file.lastModified,
31
+ type: file.type,
32
+ description: '',
33
+ isPrivate: isPrivate,
34
+ uploadProgress: Object.assign(Object.assign({}, defaultUploadMetadata), { uploadStatus: isSessionId
35
+ ? UploadStatusConstants.attachedOnSession
36
+ : UploadStatusConstants.attachedOnCase }),
37
+ analysisMetadata: Object.assign({}, defaultAnalysisMetadata),
38
+ uploadability: Object.assign({}, fileAccessDetails),
39
+ includeResults: true,
40
+ };
41
+ onFilesSelectLocal({ selectedLocalFiles: [localFile], selectedOriginalFiles: [file] });
42
+ }
43
+ catch (e) {
44
+ if (!e.ableToUpload) {
45
+ ToastNotification.addDangerMessage(e.ableToUploadMessage);
56
46
  }
57
- });
58
- if (selectedLocalFiles.length > 0) {
59
- onFilesSelect(dispatchToAttachmentReducer, { selectedLocalFiles, selectedOriginalFiles });
60
47
  }
61
- }))();
48
+ }));
62
49
  };
63
50
  const getFileAccessDetails = (file) => __awaiter(void 0, void 0, void 0, function* () {
64
51
  const fileName = (file === null || file === void 0 ? void 0 : file.name) || '';
@@ -75,7 +62,6 @@ const getFileAccessDetails = (file) => __awaiter(void 0, void 0, void 0, functio
75
62
  });
76
63
  export const isUploadingOnSession = (status) => status === UploadStatusConstants.uploadingOnSession;
77
64
  export const isUploadingOnCase = (status) => status === UploadStatusConstants.uploadingOnCase;
78
- export const isAttachedOnCase = (status) => status === UploadStatusConstants.attachedOnCase;
79
65
  export const isVerifyingSessionUpload = (status) => status === UploadStatusConstants.verifyingSessionUpload;
80
66
  export const isVerifyingCaseUpload = (status) => status === UploadStatusConstants.verifyingCaseUpload;
81
67
  export const isRestoredFromSession = (status) => status === UploadStatusConstants.restoredFromSession;
@@ -100,69 +86,16 @@ export const hasAnalysedSomeAttachments = (selectedLocalFiles) => !isEmpty(find(
100
86
  export const hasSomeUnUploadedAttachments = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => !isUploading(localFile.uploadProgress.uploadStatus) &&
101
87
  !isUploadComplete(localFile.uploadProgress.uploadStatus) &&
102
88
  !isFileDeleted(localFile.uploadProgress.uploadStatus)));
103
- /**
104
- * Files still queued to start uploading. Aborted/failed are terminal and must not
105
- * block post-upload discussion refresh when other files in the batch succeeded.
106
- */
107
- export const hasQueuedAttachmentUploads = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => !isUploading(localFile.uploadProgress.uploadStatus) &&
108
- !isUploadComplete(localFile.uploadProgress.uploadStatus) &&
109
- !isFileDeleted(localFile.uploadProgress.uploadStatus) &&
110
- !isUploadAborted(localFile.uploadProgress.uploadStatus) &&
111
- !isUploadFailed(localFile.uploadProgress.uploadStatus)));
112
- /** Aborted/failed rows should stay in the upload panel until the user clicks Remove. */
113
- export const hasAbortedOrFailedAttachments = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => isUploadAborted(localFile.uploadProgress.uploadStatus) ||
114
- isUploadFailed(localFile.uploadProgress.uploadStatus)));
115
- /** True when at least one non-deleted file remains in the upload queue (UI visibility). */
116
- export const hasSomeSelectedFiles = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => !isFileDeleted(localFile.uploadProgress.uploadStatus)));
117
- const MAX_CONCURRENT_SESSION_UPLOADS = 3;
118
- const SESSION_UPLOAD_MAX_ATTEMPTS = 2;
119
- const SESSION_UPLOAD_RETRY_DELAY_MS = 500;
120
- const activeUploadLockKeys = new Set();
121
- const sessionUploadQueues = new Map();
122
- const buildUploadLockKey = (idToUploadTo, localFile) => `${idToUploadTo}:${localFile.name}:${localFile.size}:${localFile.lastModified}`;
123
- export const clearUploadRuntimeState = () => {
124
- activeUploadLockKeys.clear();
125
- sessionUploadQueues.clear();
126
- };
127
- const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
128
- const acquireSessionUploadSlot = (sessionId) => new Promise((resolve) => {
129
- const tryAcquire = () => {
130
- var _a;
131
- const queue = (_a = sessionUploadQueues.get(sessionId)) !== null && _a !== void 0 ? _a : { activeCount: 0, waiting: [] };
132
- sessionUploadQueues.set(sessionId, queue);
133
- if (queue.activeCount < MAX_CONCURRENT_SESSION_UPLOADS) {
134
- queue.activeCount++;
135
- resolve(() => {
136
- queue.activeCount--;
137
- const next = queue.waiting.shift();
138
- if (next) {
139
- next();
140
- }
141
- else if (queue.activeCount === 0) {
142
- sessionUploadQueues.delete(sessionId);
143
- }
144
- });
145
- return;
146
- }
147
- queue.waiting.push(tryAcquire);
148
- };
149
- tryAcquire();
150
- });
89
+ export const hasSomeSelectedFiles = (selectedLocalFiles) => !isEmpty(selectedLocalFiles);
151
90
  export const isUploadingAttachment = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => isUploading(localFile.uploadProgress.uploadStatus)));
152
91
  export const isAnalysingAnyAttachment = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => isAnalysingFile(localFile.analysisMetadata.analysisStatus)));
153
92
  export const canShowProgressBar = (file) => isUploading(file.uploadProgress.uploadStatus) || isAnalysingFile(file.analysisMetadata.analysisStatus);
154
- /** Case discussion: show radial progress while queued (attachedOnCase) or actively uploading. */
155
- export const shouldShowUploadProgressIndicator = (file, isSessionUpload) => isUploading(file.uploadProgress.uploadStatus) ||
156
- (!isSessionUpload && isAttachedOnCase(file.uploadProgress.uploadStatus));
157
93
  export const shouldHideDescription = (file, isSessionUpload) => !file.uploadability.ableToUpload ||
158
94
  isUploading(file.uploadProgress.uploadStatus) ||
159
95
  (!isSessionUpload &&
160
- (isAttachedOnCase(file.uploadProgress.uploadStatus) ||
161
- isUploadAborted(file.uploadProgress.uploadStatus) ||
162
- isUploadFailed(file.uploadProgress.uploadStatus) ||
163
- (file.uploadability.ableToUpload &&
164
- file.uploadProgress.percentUploaded > 0 &&
165
- (file.description || '').length === 0) ||
96
+ ((file.uploadability.ableToUpload &&
97
+ file.uploadProgress.percentUploaded > 0 &&
98
+ (file.description || '').length === 0) ||
166
99
  isUploadComplete(file.uploadProgress.uploadStatus)));
167
100
  export const isUploadOnTrack = (file) => !isUploadFailed(file.uploadProgress.uploadStatus) &&
168
101
  !isUploadAborted(file.uploadProgress.uploadStatus) &&
@@ -177,50 +110,30 @@ export const isUploadedAndAnalysisSkipped = (file) => isSessionUploadComplete(fi
177
110
  export const updateUploadMetadata = (dispatch, fileIndexToEdit, newUploadMetadata) => {
178
111
  udpateFileUploadMetadata(dispatch, newUploadMetadata, fileIndexToEdit);
179
112
  };
180
- export const uploadAllFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, caseFiles,
181
- // isSecureSupport, // TODO: Re-enable when Hydra/GraphQL attachment APIs support secure support again
182
- needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient, caseSalesforceId, onCaseFileUploaded, }) {
183
- const eligibleIndices = [];
184
- caseFiles.selectedLocalFiles.forEach((localFile, index) => {
113
+ export const uploadAllFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, caseFiles, isSecureSupport, needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, }) {
114
+ forEach(caseFiles.selectedLocalFiles, (localFile, index) => __awaiter(void 0, void 0, void 0, function* () {
185
115
  const fileStatus = new FileStatusHelper(localFile);
186
116
  if (fileStatus.isUploadComplete() ||
187
117
  fileStatus.isAnalysingFile() ||
188
118
  fileStatus.isAnalysisFailed() ||
189
119
  fileStatus.isUploading() ||
190
120
  fileStatus.isVerifyingUpload() ||
191
- fileStatus.isFileDeleted()) {
121
+ fileStatus.isFileDeleted())
192
122
  return;
193
- }
194
- eligibleIndices.push(index);
195
- });
196
- const eligibleCount = eligibleIndices.length;
197
- if (eligibleCount === 0) {
198
- return;
199
- }
200
- const startEligibleUpload = (index) => {
201
- const localFile = caseFiles.selectedLocalFiles[index];
202
- return uploadFile({
123
+ uploadFile({
203
124
  dispatch,
204
125
  idToUploadTo,
205
126
  localFile,
206
127
  originalFile: caseFiles.selectedOriginalFiles[index],
207
128
  index,
129
+ isSecureSupport,
208
130
  needsAnalyzing,
209
131
  isSessionId,
210
132
  slowUploadConfig,
211
- apolloClient,
212
- caseSalesforceId,
213
- onCaseFileUploaded,
214
133
  });
215
- };
216
- eligibleIndices.forEach((index) => {
217
- void startEligibleUpload(index);
218
- });
134
+ }));
219
135
  });
220
- export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, localFile, originalFile, index,
221
- // isSecureSupport = false, // TODO: Re-enable when Hydra/GraphQL attachment APIs support secure support again
222
- needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient, caseSalesforceId, onCaseFileUploaded, }) {
223
- var _b;
136
+ export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, localFile, originalFile, index, isSecureSupport, needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, }) {
224
137
  if (!localFile.uploadability.ableToUpload) {
225
138
  return;
226
139
  }
@@ -229,12 +142,6 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
229
142
  if (isUploading(uploadStatus) || isUploadComplete(uploadStatus)) {
230
143
  return;
231
144
  }
232
- const uploadLockKey = buildUploadLockKey(idToUploadTo, localFile);
233
- if (activeUploadLockKeys.has(uploadLockKey)) {
234
- return;
235
- }
236
- activeUploadLockKeys.add(uploadLockKey);
237
- let releaseSessionUploadSlot;
238
145
  // For Metadata you must add x-amz-meta
239
146
  // only add x-amz-meta if the value is present else the aws throws signature invalid errors
240
147
  const putObjectRequest = {
@@ -243,8 +150,6 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
243
150
  Metadata: Object.assign(Object.assign(Object.assign(Object.assign({}, (localFile.description && { 'x-amz-meta-description': localFile.description })), (localFile.name && { 'x-amz-meta-fileName': localFile.name })), (localFile.size && { 'x-amz-meta-byteLength': localFile.size.toString() })), (localFile.type && { 'x-amz-meta-content-type': localFile.type })),
244
151
  };
245
152
  let triggerTrackSlowUpload = true;
246
- // Hoisted so catch can treat S3 403-after-abort as user cancel, not a hard failure.
247
- let userAborted = false;
248
153
  try {
249
154
  const listener = (progress, abort, isUploadingWithSlowConfig) => {
250
155
  if (isUploadingWithSlowConfig && triggerTrackSlowUpload) {
@@ -290,108 +195,22 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
290
195
  updateUploadMetadata(dispatch, index, initialUploadPayload);
291
196
  let attachmentId = '';
292
197
  if (isSessionId) {
293
- releaseSessionUploadSlot = yield acquireSessionUploadSlot(idToUploadTo);
294
- for (let attempt = 1; attempt <= SESSION_UPLOAD_MAX_ATTEMPTS; attempt++) {
295
- try {
296
- attachmentId = yield sessionAttachments.uploadSessionAttachmentS3(idToUploadTo, {
297
- description: localFile.description,
298
- fileName: localFile.name,
299
- sessionId: idToUploadTo,
300
- size: localFile.size,
301
- }, putObjectRequest, listener, true, { partSize: 5 * 1024 * 1024, queueSize: 5 }, Object.assign(Object.assign({}, slowUploadConfig), { preferSlowS3Upload: Config.userConfig.preferSlowS3Upload }));
302
- break;
303
- }
304
- catch (error) {
305
- const isUserAbort = (error === null || error === void 0 ? void 0 : error.message) === 'Request aborted by user';
306
- if (isUserAbort || attempt >= SESSION_UPLOAD_MAX_ATTEMPTS) {
307
- throw error;
308
- }
309
- updateUploadMetadata(dispatch, index, {
310
- uploadStatus: UploadStatusConstants.uploadingOnSession,
311
- uploadErrorMessage: '',
312
- percentUploaded: 0,
313
- onAbort: undefined,
314
- });
315
- yield delay(SESSION_UPLOAD_RETRY_DELAY_MS * attempt);
316
- }
317
- }
198
+ attachmentId = yield sessionAttachments.uploadSessionAttachmentS3(idToUploadTo, {
199
+ description: localFile.description,
200
+ fileName: localFile.name,
201
+ sessionId: idToUploadTo,
202
+ size: localFile.size,
203
+ }, putObjectRequest, listener, true, { partSize: 5 * 1024 * 1024, queueSize: 5 }, Object.assign(Object.assign({}, slowUploadConfig), { preferSlowS3Upload: Config.userConfig.preferSlowS3Upload }));
318
204
  }
319
205
  else {
320
- // Mirror master Hydra listener behavior for circular progress + abort button.
321
- let abortUpload;
322
- const onAbort = (abortedFileIndex) => {
323
- userAborted = true;
324
- const abortPayload = {
325
- percentUploaded: 0,
326
- onAbort: undefined,
327
- uploadStatus: UploadStatusConstants.aborted,
328
- };
329
- abortUpload === null || abortUpload === void 0 ? void 0 : abortUpload();
330
- updateUploadMetadata(dispatch, abortedFileIndex, abortPayload);
331
- };
332
- // Register abort handler immediately so Cancel works before first progress tick
333
- updateUploadMetadata(dispatch, index, {
334
- uploadStatus: UploadStatusConstants.uploadingOnCase,
335
- percentUploaded: 0,
336
- uploadErrorMessage: '',
337
- onAbort,
338
- });
339
- attachmentId = yield uploadCaseAttachment(idToUploadTo, originalFile, (percent) => {
340
- if (userAborted)
341
- return;
342
- const verifyingUpdate = percent === 100;
343
- updateUploadMetadata(dispatch, index, {
344
- uploadStatus: verifyingUpdate
345
- ? UploadStatusConstants.verifyingCaseUpload
346
- : UploadStatusConstants.uploadingOnCase,
347
- percentUploaded: percent,
348
- uploadErrorMessage: '',
349
- onAbort: verifyingUpdate ? undefined : onAbort,
350
- });
351
- }, (abort) => {
352
- abortUpload = abort;
353
- if (userAborted) {
354
- abort();
355
- return;
356
- }
357
- updateUploadMetadata(dispatch, index, {
358
- uploadStatus: UploadStatusConstants.uploadingOnCase,
359
- onAbort,
360
- });
361
- }, undefined, localFile.uploadProgress.multipartResumeState
362
- ? {
363
- attachmentId: localFile.uploadProgress.multipartResumeState.attachmentId,
364
- uploadId: localFile.uploadProgress.multipartResumeState.uploadId,
365
- parts: localFile.uploadProgress.multipartResumeState.parts,
366
- completedParts: localFile.uploadProgress.multipartResumeState.completedParts,
367
- }
368
- : undefined, (initAttachmentId) => {
369
- updateAttachmentIdForFile(dispatch, initAttachmentId, index);
370
- });
371
- if (userAborted) {
372
- return;
373
- }
374
- if (apolloClient && caseSalesforceId) {
375
- updateUploadMetadata(dispatch, index, {
376
- uploadStatus: UploadStatusConstants.verifyingCaseUpload,
377
- percentUploaded: 100,
378
- onAbort: undefined,
379
- });
380
- yield pollAttachmentUploadStatus(apolloClient, caseSalesforceId, attachmentId);
381
- }
206
+ attachmentId = yield caseAttachments.uploadAttachmentS3(idToUploadTo, {
207
+ description: localFile.description,
208
+ fileName: localFile.name,
209
+ isPrivate: localFile.isPrivate,
210
+ size: localFile.size,
211
+ }, putObjectRequest, listener, true, { partSize: 5 * 1024 * 1024, queueSize: 5 }, isSecureSupport, Object.assign(Object.assign({}, slowUploadConfig), { preferSlowS3Upload: Config.userConfig.preferSlowS3Upload }));
382
212
  }
383
213
  attachmentId && updateAttachmentIdForFile(dispatch, attachmentId, index);
384
- if (!isSessionId && attachmentId) {
385
- // Hide from upload queue without shifting indices of in-flight siblings, then refresh discussion
386
- updateUploadMetadata(dispatch, index, {
387
- uploadStatus: UploadStatusConstants.deleted,
388
- uploadErrorMessage: '',
389
- percentUploaded: 100,
390
- onAbort: undefined,
391
- });
392
- onCaseFileUploaded === null || onCaseFileUploaded === void 0 ? void 0 : onCaseFileUploaded();
393
- return;
394
- }
395
214
  const uploadPayload = {
396
215
  uploadStatus: isSessionId ? UploadStatusConstants.uploadedOnSession : UploadStatusConstants.uploadedOnCase,
397
216
  uploadErrorMessage: '',
@@ -405,24 +224,8 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
405
224
  }
406
225
  }
407
226
  catch (error) {
408
- const isUserAbort = userAborted || (error === null || error === void 0 ? void 0 : error.message) === 'Request aborted by user';
409
- const attachmentIdFromError = (error instanceof MultipartUploadError && ((_b = error.resumeData) === null || _b === void 0 ? void 0 : _b.attachmentId)) ||
410
- (error instanceof CaseAttachmentUploadError && error.attachmentId) ||
411
- undefined;
412
- if (attachmentIdFromError) {
413
- updateAttachmentIdForFile(dispatch, attachmentIdFromError, index);
414
- }
415
- if (isUserAbort) {
416
- if (!isSessionId && attachmentIdFromError) {
417
- try {
418
- yield deleteCaseAttachment(idToUploadTo, attachmentIdFromError);
419
- }
420
- catch (_c) {
421
- // Best-effort: file stays in queue as ABORTED for retry
422
- }
423
- }
424
- const resumeState = error instanceof MultipartUploadError ? error.resumeData : undefined;
425
- updateUploadMetadata(dispatch, index, Object.assign({ uploadStatus: UploadStatusConstants.aborted, uploadErrorMessage: '', onAbort: undefined, percentUploaded: 0 }, (resumeState && resumeState.completedParts.length > 0 ? { multipartResumeState: resumeState } : {})));
227
+ if (error.message === 'Request aborted by user') {
228
+ // Show alert if needed
426
229
  }
427
230
  else {
428
231
  console.error(error);
@@ -431,19 +234,13 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
431
234
  ? UploadStatusConstants.uploadOnSessionFailed
432
235
  : UploadStatusConstants.uploadOnCaseFailed,
433
236
  uploadErrorMessage: error.message,
237
+ percentUploaded: 0,
434
238
  onAbort: undefined,
435
- multipartResumeState: error instanceof MultipartUploadError ? error.resumeData : undefined,
436
239
  };
437
- if (!uploadErrorPayload.multipartResumeState) {
438
- uploadErrorPayload.percentUploaded = 0;
439
- }
240
+ updateAttachmentIdForFile(dispatch, null, index);
440
241
  updateUploadMetadata(dispatch, index, uploadErrorPayload);
441
242
  }
442
243
  }
443
- finally {
444
- releaseSessionUploadSlot === null || releaseSessionUploadSlot === void 0 ? void 0 : releaseSessionUploadSlot();
445
- activeUploadLockKeys.delete(uploadLockKey);
446
- }
447
244
  });
448
245
  export function doSosReportAnalysisForAllFiles(dispatch, idToUploadTo, localFiles, isSessionId) {
449
246
  return __awaiter(this, void 0, void 0, function* () {
@@ -524,10 +321,8 @@ export function computeAnalysisResults(idToUploadTo, attachmentId, fileSize, isS
524
321
  return analysisResults;
525
322
  });
526
323
  }
527
- const SCT_PART_SIZE = 5 * 1024 * 1024;
528
- export function moveSessionAttachmentToCase(dispatch, caseNumber, sessionId, localFile, fileIndex, apolloClient, caseSalesforceId) {
324
+ export function moveSessionAttachmentToCase(dispatch, caseNumber, sessionId, localFile, fileIndex) {
529
325
  return __awaiter(this, void 0, void 0, function* () {
530
- var _a, _b, _c, _d, _e;
531
326
  if (!caseNumber || !sessionId || !localFile.attachmentId)
532
327
  return;
533
328
  const currentUploadPayload = {
@@ -535,49 +330,9 @@ export function moveSessionAttachmentToCase(dispatch, caseNumber, sessionId, loc
535
330
  uploadStatus: UploadStatusConstants.movingToCase,
536
331
  };
537
332
  updateUploadMetadata(dispatch, fileIndex, currentUploadPayload);
333
+ const fileMetadata = yield sessionAttachments.moveSessionAttachmentsToCase(sessionId, [localFile.attachmentId], caseNumber);
538
334
  try {
539
- let resolvedCaseSalesforceId = caseSalesforceId;
540
- if (apolloClient && !resolvedCaseSalesforceId) {
541
- const caseDetails = yield fetchCaseDetailsByCaseNumber(apolloClient, caseNumber);
542
- resolvedCaseSalesforceId = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.id;
543
- }
544
- const totalChunks = Math.ceil(localFile.size / SCT_PART_SIZE);
545
- const moveResponse = yield sessionAttachments.moveSessionAttachmentsToCaseSCT(sessionId, {
546
- caseNumber,
547
- attachments: [
548
- {
549
- attachmentId: localFile.attachmentId,
550
- fileName: localFile.name,
551
- fileSize: String(localFile.size),
552
- totalChunks: String(totalChunks),
553
- clientId: 'pcm',
554
- description: localFile.description || '',
555
- },
556
- ],
557
- });
558
- const sctAttachmentId = (_a = moveResponse === null || moveResponse === void 0 ? void 0 : moveResponse[0]) === null || _a === void 0 ? void 0 : _a.attachmentId;
559
- if (!sctAttachmentId) {
560
- throw new Error('Missing attachmentId from SCT move response');
561
- }
562
- if (!resolvedCaseSalesforceId || !apolloClient) {
563
- updateUploadMetadata(dispatch, fileIndex, {
564
- uploadStatus: UploadStatusConstants.uploadedOnCase,
565
- });
566
- return;
567
- }
568
- const { data: docLinkData } = yield apolloClient.query({
569
- query: GET_CONTENT_DOCUMENT_IDS,
570
- variables: { linkedEntityId: { eq: resolvedCaseSalesforceId } },
571
- fetchPolicy: 'network-only',
572
- });
573
- const contentDocumentIds = ((_e = (_d = (_c = (_b = docLinkData === null || docLinkData === void 0 ? void 0 : docLinkData.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.RedHatSupportContentDocumentLink) === null || _d === void 0 ? void 0 : _d.edges) !== null && _e !== void 0 ? _e : []).map((edge) => edge.node.ContentDocumentId.value);
574
- if (contentDocumentIds.length === 0) {
575
- updateUploadMetadata(dispatch, fileIndex, {
576
- uploadStatus: UploadStatusConstants.uploadedOnCase,
577
- });
578
- return;
579
- }
580
- yield pollContentVersionStatus(apolloClient, contentDocumentIds, sctAttachmentId);
335
+ yield sessionAttachments.pollFileMoveProcess(sessionId, fileMetadata[0].id, fileMetadata[0]);
581
336
  updateUploadMetadata(dispatch, fileIndex, {
582
337
  uploadStatus: UploadStatusConstants.uploadedOnCase,
583
338
  });
@@ -677,13 +432,10 @@ export const isAnyFileDiagnosticsAttachment = (selectedLocalFiles) => {
677
432
  return selectedLocalFiles.some(isDiagnosticsAttachment);
678
433
  };
679
434
  export const trackSlowUpload = (dispatch) => {
680
- // show an alert
681
- //track in pendo
682
435
  dispatch({
683
436
  type: AttachmentReducerConstants.setShowUploadingOnSlowConnectionMsg,
684
437
  payload: {
685
438
  showUploadingOnSlowConnectionMsg: true,
686
439
  },
687
440
  });
688
- pendoTrackEvent('PCM-Next > S3-Slow-Upload');
689
441
  };
@@ -1,7 +1,6 @@
1
1
  import { CaseDiagnosticsStatus, ICaseDiagnosticsResponse } from '@cee-eng/hydrajs/@types/api/pcm/preCaseDiagnostics';
2
2
  import { Report } from '@cee-eng/hydrajs/@types/models/insights';
3
3
  import { IAction } from '@rh-support/types/shared';
4
- import { IMultipartResumeData } from '@rh-support/utils';
5
4
  export declare enum AttachmentReducerConstants {
6
5
  caseFileSelected = "caseFileSelected",
7
6
  caseLocalFileEdited = "caseLocalFileEdited",
@@ -11,8 +10,7 @@ export declare enum AttachmentReducerConstants {
11
10
  updateAttachmentIdForFile = "updateAttachmentIdForFile",
12
11
  updateAnalysisMetadata = "updateAnalysisMetadata",
13
12
  udpateFileUploadMetadata = "udpateFileUploadMetadata",
14
- setShowUploadingOnSlowConnectionMsg = "setShowUploadingOnSlowConnectionMsg",
15
- clearCompletedAttachments = "clearCompletedAttachments"
13
+ setShowUploadingOnSlowConnectionMsg = "setShowUploadingOnSlowConnectionMsg"
16
14
  }
17
15
  export declare enum UploadStatusConstants {
18
16
  attachedOnCase = "ATTACHED_ON_CASE",
@@ -55,7 +53,6 @@ export interface IUploadMetadata {
55
53
  uploadErrorMessage: string;
56
54
  onAbort: (abortedFileIndex: number) => void;
57
55
  percentUploaded: number;
58
- multipartResumeState?: IMultipartResumeData;
59
56
  }
60
57
  export interface IAnalysisMetadata {
61
58
  analysisErrorMesssage?: string;
@@ -105,7 +102,6 @@ export declare const onFilesSelect: (dispatch: AttachmentReducerDispatchType, ca
105
102
  export declare const onFileEdit: (dispatch: AttachmentReducerDispatchType, editedLocalFile: IFileLocal, fileIndexToEdit: number) => void;
106
103
  export declare const onFileRemove: (dispatch: AttachmentReducerDispatchType, fileIndexToRemove: number) => void;
107
104
  export declare const resetAttachment: (dispatch: AttachmentReducerDispatchType) => void;
108
- export declare const clearCompletedAttachments: (dispatch: AttachmentReducerDispatchType) => void;
109
105
  export declare const onIncludeExcludeResults: (dispatch: AttachmentReducerDispatchType, includeResults: boolean) => void;
110
106
  export declare const updateAttachmentIdForFile: (dispatch: AttachmentReducerDispatchType, attachmentId: string, fileIndexToEdit: number) => void;
111
107
  export declare const updateAnalysisMetadata: (dispatch: AttachmentReducerDispatchType, analysisMetadata: Partial<IAnalysisMetadata>, fileIndexToEdit: number) => void;