@rh-support/troubleshoot 2.6.361 → 2.6.364

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +29 -19
  3. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  4. package/lib/esm/components/AccountInfo/OwnerSelector.js +17 -92
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +2 -6
  7. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +32 -61
  9. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/Case.js +33 -60
  11. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +9 -19
  13. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +7 -28
  15. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +57 -88
  17. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +0 -2
  18. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
  20. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -3
  21. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +11 -24
  23. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/CaseOverview/index.js +57 -92
  25. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +109 -203
  27. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +1 -0
  28. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
  30. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +3 -1
  31. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +9 -5
  33. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  34. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +17 -18
  35. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +49 -55
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  38. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +46 -53
  39. package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.d.ts.map +1 -1
  40. package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.js +3 -6
  41. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +46 -52
  43. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  44. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +17 -63
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +2 -2
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +2 -0
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +3 -4
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +56 -131
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +6 -11
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseSbrGroups.d.ts.map +1 -1
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseSbrGroups.js +1 -3
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +71 -111
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +10 -17
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.d.ts.map +1 -1
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +2 -4
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +25 -0
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +1 -0
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +102 -0
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +26 -42
  68. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +4 -2
  69. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  70. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +148 -152
  71. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -10
  72. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  73. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +146 -252
  74. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  75. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +9 -22
  76. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  77. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +2 -9
  78. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
  79. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +1 -8
  80. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts +2 -2
  81. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts.map +1 -1
  82. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.js +7 -18
  83. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +3 -9
  84. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  85. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +271 -215
  86. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  87. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +4 -6
  88. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  89. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +2 -7
  90. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  91. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -36
  92. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  93. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +230 -62
  94. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +5 -4
  95. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  96. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +8 -24
  97. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  98. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -8
  99. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  100. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +52 -38
  101. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  102. package/lib/esm/components/CaseInformation/CaseGroup.js +62 -173
  103. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  104. package/lib/esm/components/CaseInformation/CaseInformation.js +9 -10
  105. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  106. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +31 -108
  107. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +2 -2
  108. package/lib/esm/components/CaseInformation/Description.js +1 -1
  109. package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
  110. package/lib/esm/components/CaseInformation/FileDiag.js +5 -2
  111. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  112. package/lib/esm/components/CaseInformation/Fts.js +19 -33
  113. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  114. package/lib/esm/components/CaseInformation/Severity.js +24 -33
  115. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  116. package/lib/esm/components/CaseInformation/SupportLevel.js +55 -36
  117. package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
  118. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +8 -2
  119. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  120. package/lib/esm/components/CaseManagement/CaseManagement.js +10 -13
  121. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  122. package/lib/esm/components/CaseManagement/Cep.js +10 -12
  123. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +1 -2
  124. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  125. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +3 -20
  126. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  127. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
  128. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +1 -0
  129. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  130. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +32 -19
  131. package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
  132. package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +2 -4
  133. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  134. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +2 -4
  135. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  136. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +40 -34
  137. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  138. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +4 -8
  139. package/lib/esm/components/EditDescription/EditDescription.d.ts.map +1 -1
  140. package/lib/esm/components/EditDescription/EditDescription.js +2 -4
  141. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  142. package/lib/esm/components/IdeaInformation/IdeaInformation.js +17 -23
  143. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  144. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
  145. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
  146. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  147. package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
  148. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  149. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
  150. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  151. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -37
  152. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  153. package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
  154. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  155. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +1 -9
  156. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  157. package/lib/esm/components/Recommendations/AsideResults.js +3 -4
  158. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  159. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +4 -1
  160. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  161. package/lib/esm/components/Recommendations/ClusterRecommendations.js +4 -1
  162. package/lib/esm/components/Recommendations/InsightsResults.js +3 -3
  163. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  164. package/lib/esm/components/Recommendations/Recommendations.js +9 -3
  165. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  166. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +8 -10
  167. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  168. package/lib/esm/components/Review/Review.js +19 -25
  169. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  170. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
  171. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  172. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  173. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  174. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  175. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +93 -141
  176. package/lib/esm/components/shared/Constants.d.ts +0 -5
  177. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  178. package/lib/esm/components/shared/Constants.js +0 -5
  179. package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
  180. package/lib/esm/components/shared/fileUpload/FileLister.js +3 -3
  181. package/lib/esm/components/shared/fileUpload/FileUpload.js +3 -2
  182. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  183. package/lib/esm/components/shared/fileUpload/FileUploader.js +1 -3
  184. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +0 -1
  185. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  186. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +3 -4
  187. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts +1 -1
  188. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts.map +1 -1
  189. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +5 -22
  190. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  191. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +59 -307
  192. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +1 -5
  193. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  194. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +1 -36
  195. package/lib/esm/components/shared/fileUpload/types/index.d.ts +1 -5
  196. package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
  197. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +2 -2
  198. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
  199. package/lib/esm/components/shared/fileUpload/useFileUploader.js +47 -119
  200. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  201. package/lib/esm/components/shared/useIsSectionValid.js +57 -22
  202. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  203. package/lib/esm/components/shared/usePostComment.js +28 -16
  204. package/lib/esm/components/shared/utils.d.ts +0 -1
  205. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  206. package/lib/esm/components/shared/utils.js +3 -9
  207. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  208. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +38 -178
  209. package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
  210. package/lib/esm/components/wizardLayout/MainSection.js +1 -2
  211. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  212. package/lib/esm/components/wizardLayout/WizardAside.js +4 -2
  213. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  214. package/lib/esm/components/wizardLayout/WizardLayout.js +13 -12
  215. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  216. package/lib/esm/components/wizardLayout/WizardMain.js +0 -7
  217. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  218. package/lib/esm/components/wizardLayout/WizardNavigation.js +11 -14
  219. package/lib/esm/constants/caseDetailsConstants.d.ts +0 -5
  220. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  221. package/lib/esm/constants/caseDetailsConstants.js +0 -5
  222. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  223. package/lib/esm/css/app.css +0 -28
  224. package/lib/esm/css/case.css +212 -209
  225. package/lib/esm/hooks/useAB.d.ts.map +1 -1
  226. package/lib/esm/hooks/useAB.js +23 -45
  227. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -9
  228. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  229. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +11 -108
  230. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  231. package/lib/esm/hooks/useResetCaseCreate.js +11 -18
  232. package/lib/esm/hooks/useS3Upload.d.ts +4 -5
  233. package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
  234. package/lib/esm/hooks/useS3Upload.js +30 -28
  235. package/lib/esm/i18n/template-de.d.ts +2 -2
  236. package/lib/esm/i18n/template-de.js +2 -2
  237. package/lib/esm/i18n/template-es.d.ts +2 -2
  238. package/lib/esm/i18n/template-es.js +2 -2
  239. package/lib/esm/i18n/template-fr.d.ts +2 -2
  240. package/lib/esm/i18n/template-fr.js +2 -2
  241. package/lib/esm/i18n/template-it.d.ts +2 -2
  242. package/lib/esm/i18n/template-it.js +2 -2
  243. package/lib/esm/i18n/template-jp.d.ts +2 -2
  244. package/lib/esm/i18n/template-jp.js +2 -2
  245. package/lib/esm/i18n/template-ko.d.ts +2 -2
  246. package/lib/esm/i18n/template-ko.js +2 -2
  247. package/lib/esm/i18n/template-pt.d.ts +2 -2
  248. package/lib/esm/i18n/template-pt.js +2 -2
  249. package/lib/esm/i18n/template-ru.d.ts +2 -2
  250. package/lib/esm/i18n/template-ru.js +2 -2
  251. package/lib/esm/i18n/template-zh.d.ts +2 -2
  252. package/lib/esm/i18n/template-zh.js +2 -2
  253. package/lib/esm/index.js +0 -1
  254. package/lib/esm/models/cache.d.ts +2 -0
  255. package/lib/esm/models/cache.d.ts.map +1 -1
  256. package/lib/esm/reducers/CaseConstNTypes.d.ts +9 -123
  257. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  258. package/lib/esm/reducers/CaseConstNTypes.js +7 -31
  259. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +5 -7
  260. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  261. package/lib/esm/reducers/CaseDetailsPageReducer.js +26 -58
  262. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +12 -12
  263. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  264. package/lib/esm/reducers/CaseDiscussionTabReducer.js +73 -88
  265. package/lib/esm/reducers/CaseHelpers.d.ts +1 -11
  266. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  267. package/lib/esm/reducers/CaseHelpers.js +17 -119
  268. package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
  269. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  270. package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
  271. package/lib/esm/reducers/CaseReducer.d.ts +11 -56
  272. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  273. package/lib/esm/reducers/CaseReducer.js +100 -284
  274. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  275. package/lib/esm/reducers/RecommendationsReducer.js +18 -15
  276. package/lib/esm/scss/_main.scss +0 -9
  277. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +2 -1
  278. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  279. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  280. package/package.json +8 -10
  281. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +0 -8
  282. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +0 -1
  283. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +0 -18
  284. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -10
  285. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
  286. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -31
  287. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -29
  288. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
  289. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -29
  290. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
  291. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
  292. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -62
  293. package/lib/esm/components/CaseInformation/CaseLabels.d.ts +0 -3
  294. package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +0 -1
  295. package/lib/esm/components/CaseInformation/CaseLabels.js +0 -108
  296. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +0 -4
  297. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +0 -1
  298. package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +0 -141
  299. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +0 -3
  300. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +0 -1
  301. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +0 -9
  302. package/lib/esm/graphql/index.d.ts +0 -4
  303. package/lib/esm/graphql/index.d.ts.map +0 -1
  304. package/lib/esm/graphql/index.js +0 -3
  305. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
  306. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
  307. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
  308. package/lib/esm/graphql/mutations/index.d.ts +0 -2
  309. package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
  310. package/lib/esm/graphql/mutations/index.js +0 -1
  311. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
  312. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
  313. package/lib/esm/graphql/queries/getEscalationDetails.js +0 -36
  314. package/lib/esm/graphql/queries/index.d.ts +0 -2
  315. package/lib/esm/graphql/queries/index.d.ts.map +0 -1
  316. package/lib/esm/graphql/queries/index.js +0 -1
  317. package/lib/esm/graphql/schemas/escalation.d.ts +0 -66
  318. package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
  319. package/lib/esm/graphql/schemas/escalation.js +0 -1
  320. package/lib/esm/graphql/schemas/index.d.ts +0 -2
  321. package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
  322. package/lib/esm/graphql/schemas/index.js +0 -1
  323. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
  324. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
  325. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -57
  326. package/lib/esm/hooks/useCaseComments/index.d.ts +0 -8
  327. package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
  328. package/lib/esm/hooks/useCaseComments/index.js +0 -5
  329. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
  330. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
  331. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -75
  332. package/lib/esm/hooks/useCaseComments/types.d.ts +0 -93
  333. package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
  334. package/lib/esm/hooks/useCaseComments/types.js +0 -1
  335. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -26
  336. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
  337. package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -113
  338. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
  339. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
  340. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
  341. package/lib/esm/hooks/useCaseGroupUiState.d.ts +0 -3
  342. package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +0 -1
  343. package/lib/esm/hooks/useCaseGroupUiState.js +0 -10
  344. package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
  345. package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
  346. package/lib/esm/hooks/useCaseHistory.js +0 -107
  347. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +0 -23
  348. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +0 -1
  349. package/lib/esm/hooks/useCaseLabelLinkMutations.js +0 -84
  350. package/lib/esm/models/caseHistory.d.ts +0 -86
  351. package/lib/esm/models/caseHistory.d.ts.map +0 -1
  352. package/lib/esm/models/caseHistory.js +0 -1
  353. package/lib/esm/utils/TimelineUtils.d.ts +0 -41
  354. package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
  355. package/lib/esm/utils/TimelineUtils.js +0 -135
  356. package/lib/esm/utils/caseHistoryUtils.d.ts +0 -85
  357. package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
  358. package/lib/esm/utils/caseHistoryUtils.js +0 -196
  359. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +0 -6
  360. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +0 -1
  361. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +0 -26
  362. package/lib/esm/utils/linkifyHtmlTextNodes.d.ts +0 -8
  363. package/lib/esm/utils/linkifyHtmlTextNodes.d.ts.map +0 -1
  364. package/lib/esm/utils/linkifyHtmlTextNodes.js +0 -37
@@ -7,30 +7,50 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useApolloClient } from '@apollo/client/react';
11
10
  import { publicApi } from '@cee-eng/hydrajs';
12
- import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, Progress, ProgressMeasureLocation, ProgressSize, ProgressVariant, TextArea, TextInput, } from '@patternfly/react-core';
11
+ import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
13
12
  import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
14
13
  import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
15
14
  import { SingleSelectDropdown, useFetch } from '@rh-support/components';
16
- import { resolveSalesforceUserIdByFederationId } from '@rh-support/utils';
17
15
  import isEqual from 'lodash/isEqual';
18
16
  import React, { useEffect, useState } from 'react';
19
17
  import { Trans, useTranslation } from 'react-i18next';
20
18
  import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
21
- import { GET_CASE_COMMENTS, useCreateCaseComment } from '../../../hooks/useCaseComments';
22
- import { checkForCaseStatusToggleOnAttachOrComment, updateCaseDetailsGraphQL } from '../../../reducers/CaseReducer';
23
- import { buildRemoteSessionRequestCaseUpdate, formatSessionLinks, getLocaleNameFromLocalCode, REMOTE_SESSION_FIELD_LENGTH_LIMIT, } from './remoteSessionUtils';
19
+ import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
20
+ import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
21
+ import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
22
+ import { checkForCaseStatusToggleOnAttachOrComment, updateCaseDetails } from '../../../reducers/CaseReducer';
23
+ const getLocaleNameFromLocalCode = (localeCode) => {
24
+ if ('Intl' in window && 'DisplayNames' in Intl) {
25
+ try {
26
+ const [lang, locale] = localeCode.includes('_') ? localeCode.split('_') : localeCode.split('-');
27
+ // https://github.com/microsoft/TypeScript/issues/41338
28
+ const langName = new Intl.DisplayNames([lang], { type: 'language' });
29
+ const regionNamesInLang = new Intl.DisplayNames([lang], { type: 'region' });
30
+ return `${regionNamesInLang.of(locale)} (${langName.of(lang)})`;
31
+ }
32
+ catch (e) {
33
+ return localeCode;
34
+ }
35
+ }
36
+ return localeCode;
37
+ };
38
+ const formatSessionLinks = (sessionLink) => {
39
+ const links = sessionLink
40
+ .split(/[;,| \n\r\t]+/)
41
+ .map((link) => link.trim())
42
+ .filter(Boolean);
43
+ const formattedLinks = links.map((link) => `[${link}](${link})`).join('\n');
44
+ return formattedLinks;
45
+ };
24
46
  export function NewEssTermsModal(props) {
25
47
  const { t } = useTranslation();
26
48
  const { remoteSessionTermsAcked } = useCaseSelector((state) => ({
27
49
  remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
28
50
  }), isEqual);
29
51
  const [isTermsChecked, setIsTermsChecked] = useState(false);
30
- const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
31
52
  const { request } = useFetch(publicApi.terms.getRequiredTerms);
32
53
  const caseDispatch = useCaseDispatch();
33
- const apolloClient = useApolloClient();
34
54
  const [selectedTranslation, setSelectedTranslation] = useState({
35
55
  id: '5001',
36
56
  isDefault: false,
@@ -73,32 +93,15 @@ export function NewEssTermsModal(props) {
73
93
  fetchTerms();
74
94
  // eslint-disable-next-line react-hooks/exhaustive-deps
75
95
  }, []);
76
- const client = useApolloClient();
77
- const { createComment, loading: isPostingComment } = useCreateCaseComment();
78
- const caseSalesforceId = useCaseSelector((state) => state.caseDetails.id, isEqual);
96
+ const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
97
+ propgateErrors: true,
98
+ });
99
+ const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
100
+ const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
101
+ const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
79
102
  const updateSessionExpectation = (event, value) => setSessionExpectations(value);
80
103
  const updateImpact = (event, value) => setImpact(value);
81
104
  const updateSessionLink = (event, value) => setSessionLink(value);
82
- const getVariantSessionExpectations = () => {
83
- if (!sessionExpectations)
84
- return ProgressVariant.success;
85
- if (sessionExpectations.length > REMOTE_SESSION_FIELD_LENGTH_LIMIT / 2) {
86
- return ProgressVariant.warning;
87
- }
88
- else {
89
- return ProgressVariant.success;
90
- }
91
- };
92
- const getVariantImpact = () => {
93
- if (!impact)
94
- return ProgressVariant.success;
95
- if (impact.length > REMOTE_SESSION_FIELD_LENGTH_LIMIT / 2) {
96
- return ProgressVariant.warning;
97
- }
98
- else {
99
- return ProgressVariant.success;
100
- }
101
- };
102
105
  // To handle modal cancel and close
103
106
  const onCancel = () => {
104
107
  if (agreeLoading || isPostingComment)
@@ -124,27 +127,21 @@ export function NewEssTermsModal(props) {
124
127
  };
125
128
  // Function to ack remote session terms and post comment
126
129
  const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
127
- const requestComment = t(`<p><strong>Thank you for submitting the request for a remote session. A support manager will review the request, and updates will be provided in the support case. Please continue to provide any data requested by the support engineers in the case prior to the remote session (if applicable).</strong></p><p>Submitted a remote session request with following details:</p><p><strong>Preferred Time and Expectations of remote session</strong></p><p>${sessionExpectations}</p><p><strong>Describe the impact to you or the business</strong></p><p>${impact}</p>${sessionLink
128
- ? `<p><strong>Remote session link</strong></p><p>${formatSessionLinks(sessionLink)}</p>`
129
- : ''}<p>This action does not initiate a remote session. A Red Hat Associate will get back to you soon.</p>`);
130
+ const requestComment = t(`\n**Thank you for submitting the request for a remote session. A support manager will review the request, and updates will be provided in the support case. Please continue to provide any data requested by the support engineers in the case prior to the remote session (if applicable).**\n\nSubmitted a remote session request with following details:\n\n**Preferred Time and Expectations of remote session**\n${sessionExpectations}\n\n**Describe the impact to you or the business**\n${impact}\n\n${sessionLink ? `**Remote session link**\n${formatSessionLinks(sessionLink)}\n\n` : ''}This action does not initiate a remote session. A Red Hat Associate will get back to you soon.`);
130
131
  try {
131
- const ackedByUserId = yield resolveSalesforceUserIdByFederationId(apolloClient, props.loggedInUser);
132
- if (!ackedByUserId) {
133
- throw new Error('Salesforce user id is required to request a remote session');
134
- }
135
- yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, buildRemoteSessionRequestCaseUpdate(ackedByUserId), false, { existingCaseDetails });
132
+ yield updateCaseDetails(caseDispatch, props.caseNumber, {
133
+ remoteSessionTermsAcked: true,
134
+ screenSessionRequested: true,
135
+ waitingOnCallback: true,
136
+ });
136
137
  try {
137
- yield createComment({
138
- caseId: caseSalesforceId,
139
- body: requestComment,
140
- isPublic: true,
141
- });
142
- client.refetchQueries({ include: [GET_CASE_COMMENTS] });
143
- yield checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus, {
144
- apolloClient,
138
+ yield postCommentRequest({
145
139
  caseNumber: props.caseNumber,
146
- existingCaseDetails,
140
+ commentBody: requestComment,
141
+ contentType: 'markdown',
147
142
  });
143
+ updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
144
+ checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
148
145
  setAgreeLoading(false);
149
146
  setHasSubmitted(true);
150
147
  // ToastNotification.addSuccessMessage(
@@ -173,9 +170,8 @@ export function NewEssTermsModal(props) {
173
170
  onCancel();
174
171
  setAgreeLoading(false);
175
172
  setIsTermsChecked(false);
176
- yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, {
177
- remoteSessionTermsAcked: false,
178
- waitingOnCallback: false,
173
+ yield updateCaseDetails(caseDispatch, props.caseNumber, {
174
+ screenSessionRequested: false,
179
175
  });
180
176
  // ToastNotification.addDangerMessage(
181
177
  // t('Could not submit a request for remote session'),
@@ -219,14 +215,12 @@ export function NewEssTermsModal(props) {
219
215
  React.createElement("label", { className: "pf-v6-u-mt-md" },
220
216
  React.createElement(Trans, null, "Preferred Time and Expectations for Remote Session"),
221
217
  React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*")),
222
- React.createElement(TextArea, { value: sessionExpectations, onChange: updateSessionExpectation, rows: 3, placeholder: "Please share anything that will help prepare for our meeting?", isRequired: true, maxLength: REMOTE_SESSION_FIELD_LENGTH_LIMIT, "aria-label": "Preferred Time and Expectations for Remote Session" }),
223
- React.createElement(Progress, { value: sessionExpectations === null || sessionExpectations === void 0 ? void 0 : sessionExpectations.length, min: 0, max: REMOTE_SESSION_FIELD_LENGTH_LIMIT, size: ProgressSize.sm, label: `${sessionExpectations === null || sessionExpectations === void 0 ? void 0 : sessionExpectations.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, valueText: `${sessionExpectations === null || sessionExpectations === void 0 ? void 0 : sessionExpectations.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${sessionExpectations === null || sessionExpectations === void 0 ? void 0 : sessionExpectations.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, variant: getVariantSessionExpectations(), title: ' ', className: `pf-v6-u-mt-md kt-progress-bar`, id: "summary-progress-bar" })),
218
+ React.createElement(TextArea, { value: sessionExpectations, onChange: updateSessionExpectation, rows: 3, placeholder: "Please share anything that will help prepare for our meeting?", isRequired: true, "aria-label": "Preferred Time and Expectations for Remote Session" })),
224
219
  React.createElement("div", null,
225
220
  React.createElement("label", { className: "pf-v6-u-mt-md" },
226
221
  React.createElement(Trans, null, "Describe the impact to you or the business"),
227
222
  React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*")),
228
- React.createElement(TextArea, { value: impact, onChange: updateImpact, rows: 3, placeholder: "Describe the user or financial impact.", isRequired: true, maxLength: REMOTE_SESSION_FIELD_LENGTH_LIMIT, "aria-label": "Describe the impact to you or the business" }),
229
- React.createElement(Progress, { value: impact === null || impact === void 0 ? void 0 : impact.length, min: 0, max: REMOTE_SESSION_FIELD_LENGTH_LIMIT, size: ProgressSize.sm, label: `${impact === null || impact === void 0 ? void 0 : impact.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, valueText: `${impact === null || impact === void 0 ? void 0 : impact.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${impact === null || impact === void 0 ? void 0 : impact.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, variant: getVariantImpact(), title: ' ', className: `pf-v6-u-mt-md kt-progress-bar`, id: "summary-progress-bar" })),
223
+ React.createElement(TextArea, { value: impact, onChange: updateImpact, rows: 3, placeholder: "Describe the user or financial impact.", isRequired: true, "aria-label": "Describe the impact to you or the business" })),
230
224
  React.createElement("div", null,
231
225
  React.createElement("label", { className: "pf-v6-u-mt-md" },
232
226
  React.createElement(Trans, null, "Remote session link (optional)")),
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAiBnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBAmbxD"}
1
+ {"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAgBnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;CACrB;AA4BD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBA0XxD"}
@@ -7,30 +7,50 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useApolloClient } from '@apollo/client/react';
11
10
  import { publicApi } from '@cee-eng/hydrajs';
12
- import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, Progress, ProgressMeasureLocation, ProgressSize, ProgressVariant, TextArea, TextInput, } from '@patternfly/react-core';
11
+ import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
13
12
  import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
14
13
  import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
15
14
  import { SingleSelectDropdown, useFetch } from '@rh-support/components';
16
- import { resolveSalesforceUserIdByFederationId } from '@rh-support/utils';
17
15
  import isEqual from 'lodash/isEqual';
18
16
  import React, { useEffect, useState } from 'react';
19
17
  import { Trans, useTranslation } from 'react-i18next';
20
18
  import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
21
- import { GET_CASE_COMMENTS, useCreateCaseComment } from '../../../hooks/useCaseComments';
22
- import { checkForCaseStatusToggleOnAttachOrComment, setRemoteRiderFlag, updateCaseDetailsGraphQL, } from '../../../reducers/CaseReducer';
23
- import { buildRemoteSessionRequestCaseUpdate, formatSessionLinks, getLocaleNameFromLocalCode, REMOTE_SESSION_FIELD_LENGTH_LIMIT, } from './remoteSessionUtils';
19
+ import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
20
+ import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
21
+ import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
22
+ import { checkForCaseStatusToggleOnAttachOrComment, setRemoteRiderFlag, updateCaseDetails, } from '../../../reducers/CaseReducer';
23
+ const getLocaleNameFromLocalCode = (localeCode) => {
24
+ if ('Intl' in window && 'DisplayNames' in Intl) {
25
+ try {
26
+ const [lang, locale] = localeCode.includes('_') ? localeCode.split('_') : localeCode.split('-');
27
+ // https://github.com/microsoft/TypeScript/issues/41338
28
+ const langName = new Intl.DisplayNames([lang], { type: 'language' });
29
+ const regionNamesInLang = new Intl.DisplayNames([lang], { type: 'region' });
30
+ return `${regionNamesInLang.of(locale)} (${langName.of(lang)})`;
31
+ }
32
+ catch (e) {
33
+ return localeCode;
34
+ }
35
+ }
36
+ return localeCode;
37
+ };
38
+ const formatSessionLinks = (sessionLink) => {
39
+ const links = sessionLink
40
+ .split(/[;,| \n\r\t]+/)
41
+ .map((link) => link.trim())
42
+ .filter(Boolean);
43
+ const formattedLinks = links.map((link) => `[${link}](${link})`).join('\n');
44
+ return formattedLinks;
45
+ };
24
46
  export function RemoteSessionAgreementModal(props) {
25
47
  const { t } = useTranslation();
26
48
  const { remoteSessionTermsAcked } = useCaseSelector((state) => ({
27
49
  remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
28
- caseDetails: state.caseDetails,
29
50
  }), isEqual);
30
51
  const [isTermsChecked, setIsTermsChecked] = useState(false);
31
52
  const { request } = useFetch(publicApi.terms.getRequiredTerms);
32
53
  const caseDispatch = useCaseDispatch();
33
- const apolloClient = useApolloClient();
34
54
  const [selectedTranslation, setSelectedTranslation] = useState({
35
55
  id: '5001',
36
56
  isDefault: false,
@@ -73,32 +93,15 @@ export function RemoteSessionAgreementModal(props) {
73
93
  fetchTerms();
74
94
  // eslint-disable-next-line react-hooks/exhaustive-deps
75
95
  }, []);
76
- const client = useApolloClient();
77
- const { createComment, loading: isPostingComment } = useCreateCaseComment();
78
- const caseSalesforceId = useCaseSelector((state) => state.caseDetails.id, isEqual);
96
+ const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
97
+ propgateErrors: true,
98
+ });
99
+ const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
100
+ const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
101
+ const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
79
102
  const updateSessionExpectation = (event, value) => setSessionExpectations(value);
80
103
  const updateImpact = (event, value) => setImpact(value);
81
104
  const updateSessionLink = (event, value) => setSessionLink(value);
82
- const getVariantSessionExpectations = () => {
83
- if (!sessionExpectations)
84
- return ProgressVariant.success;
85
- if (sessionExpectations.length > REMOTE_SESSION_FIELD_LENGTH_LIMIT / 2) {
86
- return ProgressVariant.warning;
87
- }
88
- else {
89
- return ProgressVariant.success;
90
- }
91
- };
92
- const getVariantImpact = () => {
93
- if (!impact)
94
- return ProgressVariant.success;
95
- if (impact.length > REMOTE_SESSION_FIELD_LENGTH_LIMIT / 2) {
96
- return ProgressVariant.warning;
97
- }
98
- else {
99
- return ProgressVariant.success;
100
- }
101
- };
102
105
  // To handle modal cancel and close
103
106
  const onCancel = () => {
104
107
  if (agreeLoading || isPostingComment)
@@ -112,31 +115,23 @@ export function RemoteSessionAgreementModal(props) {
112
115
  props.onClose && props.onClose();
113
116
  };
114
117
  const toggleRemoteSessionForm = () => setIsRemoteSessionForm(true);
115
- const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
116
118
  // Function to ack remote session terms and post comment
117
119
  const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
118
- const requestComment = t(`<p><strong>Thank you for submitting the request for a remote session. A support manager will review the request, and updates will be provided in the support case. Please continue to provide any data requested by the support engineers in the case prior to the remote session (if applicable).</strong></p><p>Submitted a remote session request with following details:</p><p><strong>Preferred Time and Expectations of remote session</strong></p><p>${sessionExpectations}</p><p><strong>Describe the impact to you or the business</strong></p><p>${impact}</p>${sessionLink
119
- ? `<p><strong>Remote session link</strong></p><p>${formatSessionLinks(sessionLink)}</p>`
120
- : ''}<p>This action does not initiate a remote session. A Red Hat Associate will get back to you soon.</p>`);
120
+ const requestComment = t(`\n**Thank you for submitting the request for a remote session. A support manager will review the request, and updates will be provided in the support case. Please continue to provide any data requested by the support engineers in the case prior to the remote session (if applicable).**\n\nSubmitted a remote session request with following details:\n\n**Preferred Time and Expectations of remote session**\n${sessionExpectations}\n\n**Describe the impact to you or the business**\n${impact}\n\n${sessionLink ? `**Remote session link**\n${formatSessionLinks(sessionLink)}\n\n` : ''}This action does not initiate a remote session. A Red Hat Associate will get back to you soon.`);
121
121
  try {
122
- const ackedByUserId = yield resolveSalesforceUserIdByFederationId(apolloClient, props.loggedInUser);
123
- if (!ackedByUserId) {
124
- throw new Error('Salesforce user id is required to request a remote session');
125
- }
126
- yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, buildRemoteSessionRequestCaseUpdate(ackedByUserId), false, { existingCaseDetails });
122
+ yield updateCaseDetails(caseDispatch, props.caseNumber, {
123
+ remoteSessionTermsAcked: true,
124
+ waitingOnCallback: true,
125
+ });
127
126
  setRemoteRiderFlag(caseDispatch, true);
128
127
  try {
129
- yield createComment({
130
- caseId: caseSalesforceId,
131
- body: requestComment,
132
- isPublic: true,
133
- });
134
- client.refetchQueries({ include: [GET_CASE_COMMENTS] });
135
- yield checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus, {
136
- apolloClient: client,
128
+ yield postCommentRequest({
137
129
  caseNumber: props.caseNumber,
138
- existingCaseDetails,
130
+ commentBody: requestComment,
131
+ contentType: 'markdown',
139
132
  });
133
+ updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
134
+ checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
140
135
  setAgreeLoading(false);
141
136
  setHasSubmitted(true);
142
137
  // ToastNotification.addSuccessMessage(
@@ -203,14 +198,12 @@ export function RemoteSessionAgreementModal(props) {
203
198
  React.createElement("label", { className: "pf-v6-u-mt-md" },
204
199
  React.createElement(Trans, null, "Preferred Time and Expectations for Remote Session"),
205
200
  React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*")),
206
- React.createElement(TextArea, { value: sessionExpectations, onChange: updateSessionExpectation, rows: 3, placeholder: "Please share anything that will help prepare for our meeting?", isRequired: true, maxLength: REMOTE_SESSION_FIELD_LENGTH_LIMIT, "aria-label": "Preferred Time and Expectations for Remote Session" }),
207
- React.createElement(Progress, { value: sessionExpectations === null || sessionExpectations === void 0 ? void 0 : sessionExpectations.length, min: 0, max: REMOTE_SESSION_FIELD_LENGTH_LIMIT, size: ProgressSize.sm, label: `${sessionExpectations === null || sessionExpectations === void 0 ? void 0 : sessionExpectations.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, valueText: `${sessionExpectations === null || sessionExpectations === void 0 ? void 0 : sessionExpectations.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${sessionExpectations === null || sessionExpectations === void 0 ? void 0 : sessionExpectations.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, variant: getVariantSessionExpectations(), title: ' ', className: `pf-v6-u-mt-md kt-progress-bar`, id: "summary-progress-bar" })),
201
+ React.createElement(TextArea, { value: sessionExpectations, onChange: updateSessionExpectation, rows: 3, placeholder: "Please share anything that will help prepare for our meeting?", isRequired: true, "aria-label": "Preferred Time and Expectations for Remote Session" })),
208
202
  React.createElement("div", null,
209
203
  React.createElement("label", { className: "pf-v6-u-mt-md" },
210
204
  React.createElement(Trans, null, "Describe the impact to you or the business"),
211
205
  React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*")),
212
- React.createElement(TextArea, { value: impact, onChange: updateImpact, rows: 3, placeholder: "Describe the user or financial impact.", isRequired: true, maxLength: REMOTE_SESSION_FIELD_LENGTH_LIMIT, "aria-label": "Describe the impact to you or the business" }),
213
- React.createElement(Progress, { value: impact === null || impact === void 0 ? void 0 : impact.length, min: 0, max: REMOTE_SESSION_FIELD_LENGTH_LIMIT, size: ProgressSize.sm, label: `${impact === null || impact === void 0 ? void 0 : impact.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, valueText: `${impact === null || impact === void 0 ? void 0 : impact.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${impact === null || impact === void 0 ? void 0 : impact.length} / ${REMOTE_SESSION_FIELD_LENGTH_LIMIT}`, variant: getVariantImpact(), title: ' ', className: `pf-v6-u-mt-md kt-progress-bar`, id: "summary-progress-bar" })),
206
+ React.createElement(TextArea, { value: impact, onChange: updateImpact, rows: 3, placeholder: "Describe the user or financial impact.", isRequired: true, "aria-label": "Describe the impact to you or the business" })),
214
207
  React.createElement("div", null,
215
208
  React.createElement("label", { className: "pf-v6-u-mt-md" },
216
209
  React.createElement(Trans, null, "Remote session link (optional)")),
@@ -1 +1 @@
1
- {"version":3,"file":"CaseActionPlan.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,qBAgIpC;kBAhIQ,cAAc;;;AAmIvB,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"CaseActionPlan.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,qBA4HpC;kBA5HQ,cAAc;;;AA+HvB,eAAe,cAAc,CAAC"}
@@ -39,7 +39,8 @@ function CaseActionPlan(props) {
39
39
  }
40
40
  // eslint-disable-next-line react-hooks/exhaustive-deps
41
41
  }, [actionPlan]);
42
- const persistActionPlan = () => __awaiter(this, void 0, void 0, function* () {
42
+ const updateCase = (event) => __awaiter(this, void 0, void 0, function* () {
43
+ event.preventDefault();
43
44
  setIsUpdating(true);
44
45
  try {
45
46
  const caseDetails = { actionPlan: actionPlanState };
@@ -49,14 +50,10 @@ function CaseActionPlan(props) {
49
50
  setIsUpdating(false);
50
51
  }
51
52
  catch (e) {
52
- caseUpdateError.showFieldError(e, t('Action plan'), persistActionPlan);
53
+ caseUpdateError.showError(e, t('Action plan failed to update'));
53
54
  setIsUpdating(false);
54
55
  }
55
56
  });
56
- const updateCase = (event) => __awaiter(this, void 0, void 0, function* () {
57
- event.preventDefault();
58
- yield persistActionPlan();
59
- });
60
57
  const discardActionPlan = (event) => {
61
58
  event.preventDefault();
62
59
  setActionPlan(actionPlan);
@@ -1 +1 @@
1
- {"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuC/D,wBAAgB,sBAAsB,sBAgYrC"}
1
+ {"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AASA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAgB/D,wBAAgB,sBAAsB,sBAoYrC"}
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useApolloClient } from '@apollo/client/react';
11
10
  import { contacts } from '@cee-eng/hydrajs';
12
11
  import { InputGroupText, ValidatedOptions } from '@patternfly/react-core';
13
12
  import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
@@ -15,7 +14,6 @@ import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon
15
14
  import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
16
15
  import { getPhoneObj, PhoneInput, ToastNotification } from '@rh-support/components';
17
16
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
18
- import { GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
19
17
  import isEmpty from 'lodash/isEmpty';
20
18
  import isEqual from 'lodash/isEqual';
21
19
  import React, { useContext, useEffect, useState } from 'react';
@@ -24,43 +22,21 @@ import { PHONE_INSTRUCTION, PHONE_IS_NOT_VALID, PHONE_LINE_CANNOT_BE_EMPTY, PHON
24
22
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
25
23
  import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
26
24
  import { PHONE_LIMIT } from '../../../../reducers/CaseConstNTypes';
27
- import { setCaseState, updateCaseDetails, updateCaseDetailsGraphQL } from '../../../../reducers/CaseReducer';
25
+ import { setCaseState, updateCaseDetails } from '../../../../reducers/CaseReducer';
28
26
  import { ContactPhoneNumberPopOver } from '../../../CaseInformation/ContactPhoneNumberPopOver';
29
27
  import { removeAllChars, trimAndReplacePlus } from '../../../shared/utils';
30
28
  import { PDFContext } from '../../PDFContainer';
31
- function fetchContactBySSO(apolloClient, accountNumber, ssoUsername) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
34
- const { data } = yield apolloClient.query({
35
- query: GET_ACCOUNT_CONTACTS,
36
- variables: {
37
- accountNumber: { eq: accountNumber },
38
- contactsWhere: { SSOUserName__c: { eq: ssoUsername } },
39
- first: 1,
40
- },
41
- fetchPolicy: 'network-only',
42
- });
43
- const response = data;
44
- const contactNode = (_j = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Contacts) === null || _g === void 0 ? void 0 : _g.edges) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.node;
45
- return {
46
- phone: (_l = (_k = contactNode === null || contactNode === void 0 ? void 0 : contactNode.Phone) === null || _k === void 0 ? void 0 : _k.value) !== null && _l !== void 0 ? _l : '',
47
- };
48
- });
49
- }
50
29
  export function CaseContactPhoneNumber() {
51
30
  var _a;
52
- const apolloClient = useApolloClient();
53
- const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, accountNumberRef, suppliedPhoneNumberVerified, isCaseOwnerUpdating, hasLoggedInUserConfirmedPhoneNumber, isCasePhoneUpdating, existingCaseDetails, } = useCaseSelector((state) => ({
31
+ const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, suppliedPhoneNumberVerified, isCaseOwnerUpdating, hasLoggedInUserConfirmedPhoneNumber, isCasePhoneUpdating, } = useCaseSelector((state) => ({
54
32
  phoneCountryCode: state.caseDetails.phoneCountryCode || '',
55
33
  phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber || '',
56
34
  caseNumber: state.caseDetails.caseNumber,
57
35
  contactSSOName: state.caseDetails.contactSSOName,
58
- accountNumberRef: state.caseDetails.accountNumberRef,
59
36
  suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
60
37
  isCaseOwnerUpdating: state.isCaseOwnerUpdating,
61
38
  hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
62
39
  isCasePhoneUpdating: state.isCasePhoneUpdating,
63
- existingCaseDetails: state.caseDetails,
64
40
  }), isEqual);
65
41
  const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
66
42
  const canEditCase = useCanEditCase();
@@ -103,10 +79,8 @@ export function CaseContactPhoneNumber() {
103
79
  const phoneLine = (_a = getPhoneObj(localFullPhoneState)) === null || _a === void 0 ? void 0 : _a.phoneLine;
104
80
  const countryCode = (_b = getPhoneObj(localFullPhoneState)) === null || _b === void 0 ? void 0 : _b.countryCode;
105
81
  try {
106
- yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, caseNumber, {
107
- phoneCountryCode: countryCode,
108
- phoneAreaCodePrefixLineNumber: phoneLine,
109
- }, false, { existingCaseDetails });
82
+ // update case contact info
83
+ yield updateCaseDetails(caseDispatch, caseNumber, Object.assign(Object.assign({ phoneCountryCode: countryCode, phoneAreaCodePrefixLineNumber: phoneLine }, (contactSSOName === loggedInUser.data.ssoUsername && { suppliedPhoneNumberVerified: 'True' })), (!countryCode && !phoneLine && { clearPhoneNumber: true, suppliedPhoneNumberVerified: 'False' })));
110
84
  setIsSavedClicked(false);
111
85
  setCaseState(caseDispatch, { isCasePhoneUpdating: false });
112
86
  ToastNotification.addSuccessMessage(t(`Phone number has been successfully updated`));
@@ -128,7 +102,7 @@ export function CaseContactPhoneNumber() {
128
102
  catch (e) {
129
103
  setCaseState(caseDispatch, { isCasePhoneUpdating: false });
130
104
  setIsEditting(false);
131
- caseUpdateError.showFieldError(e, t('Phone number'), onSave);
105
+ caseUpdateError.showError(e, t(`Phone number failed to update`));
132
106
  }
133
107
  });
134
108
  const onClear = () => __awaiter(this, void 0, void 0, function* () {
@@ -193,10 +167,6 @@ export function CaseContactPhoneNumber() {
193
167
  // eslint-disable-next-line react-hooks/exhaustive-deps
194
168
  }, [suppliedPhoneNumberVerified]);
195
169
  useEffect(() => {
196
- if (!isEmpty(phoneCountryCode) || !isEmpty(phoneAreaCodePrefixLineNumber)) {
197
- setLocalFullPhoneState(phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber);
198
- return;
199
- }
200
170
  if (isEmpty(contactSSOName)) {
201
171
  setLocalFullPhoneState('');
202
172
  return;
@@ -210,17 +180,29 @@ export function CaseContactPhoneNumber() {
210
180
  if (contactSSOName === loggedInUser.data.ssoUsername) {
211
181
  try {
212
182
  setIsFetchingSSO(true);
213
- const loggedInUserContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
183
+ const loggedInUserContact = yield (contacts === null || contacts === void 0 ? void 0 : contacts.getSFDCContactBySso(contactSSOName));
214
184
  setIsFetchingSSO(false);
215
- const phoneLine = getPhoneObj(loggedInUserContact.phone).phoneLine || '';
216
- const countryCode = getPhoneObj(loggedInUserContact.phone).countryCode;
217
- _phoneAreaCodePrefixLineNumber = phoneLine;
218
- _phoneCountryCode = countryCode;
219
- _suppliedPhoneNumberVerified =
220
- isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
221
- isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
222
- ? hasLoggedInUserConfirmedPhoneNumber
223
- : 'False';
185
+ if (loggedInUserContact.supportPhoneAreaCodePrefixLineNumber) {
186
+ // User has opened a case before and has phone and area code in her/his contact on SF
187
+ _phoneAreaCodePrefixLineNumber = loggedInUserContact.supportPhoneAreaCodePrefixLineNumber;
188
+ _phoneCountryCode = loggedInUserContact.supportPhoneCountryCode;
189
+ _suppliedPhoneNumberVerified =
190
+ isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
191
+ isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
192
+ ? hasLoggedInUserConfirmedPhoneNumber
193
+ : 'False';
194
+ }
195
+ else {
196
+ const phoneLine = getPhoneObj(loggedInUserContact.phone).phoneLine || '';
197
+ const countryCode = getPhoneObj(loggedInUserContact.phone).countryCode;
198
+ _phoneAreaCodePrefixLineNumber = phoneLine;
199
+ _phoneCountryCode = countryCode;
200
+ _suppliedPhoneNumberVerified =
201
+ isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
202
+ isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
203
+ ? hasLoggedInUserConfirmedPhoneNumber
204
+ : 'False';
205
+ }
224
206
  }
225
207
  catch (_a) {
226
208
  _phoneAreaCodePrefixLineNumber = '';
@@ -234,11 +216,18 @@ export function CaseContactPhoneNumber() {
234
216
  // user is openning case for others (use is partner or red hatter)
235
217
  try {
236
218
  setIsFetchingSSO(true);
237
- const selectedContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
219
+ const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
238
220
  setIsFetchingSSO(false);
239
- _phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
240
- _phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
241
- _suppliedPhoneNumberVerified = 'Deferred';
221
+ if (selectedContact.supportPhoneAreaCodePrefixLineNumber) {
222
+ _phoneAreaCodePrefixLineNumber = selectedContact.supportPhoneAreaCodePrefixLineNumber;
223
+ _phoneCountryCode = selectedContact.supportPhoneCountryCode;
224
+ _suppliedPhoneNumberVerified = 'Deferred';
225
+ }
226
+ else {
227
+ _phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
228
+ _phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
229
+ _suppliedPhoneNumberVerified = 'Deferred';
230
+ }
242
231
  }
243
232
  catch (e) {
244
233
  _phoneAreaCodePrefixLineNumber = '';
@@ -263,9 +252,14 @@ export function CaseContactPhoneNumber() {
263
252
  setLocalFullPhoneState(checkingPlusInLocalFullPhone(_localFullPhone));
264
253
  setCaseState(caseDispatch, { isCasePhoneUpdating: false });
265
254
  });
266
- initContactPhoneNumber();
255
+ if (isEmpty(phoneCountryCode) && isEmpty(phoneAreaCodePrefixLineNumber)) {
256
+ initContactPhoneNumber();
257
+ }
258
+ else {
259
+ setLocalFullPhoneState(phoneCountryCode + ' ' + phoneAreaCodePrefixLineNumber);
260
+ }
267
261
  // eslint-disable-next-line react-hooks/exhaustive-deps
268
- }, [contactSSOName, phoneCountryCode, phoneAreaCodePrefixLineNumber]);
262
+ }, [contactSSOName]);
269
263
  return (React.createElement("div", { className: "form-group", style: { minWidth: '200px' } },
270
264
  React.createElement("h3", { className: `subheading subheading-sm ${isExportingPDF ? 'expand-input' : ''}` },
271
265
  React.createElement(Trans, null, "Case owner's phone number"),
@@ -281,7 +275,7 @@ export function CaseContactPhoneNumber() {
281
275
  isCasePhoneUpdating, style: { display: isExportingPDF ? 'none' : '' } },
282
276
  React.createElement(CheckIcon, null)),
283
277
  React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: onClear, "data-tracking-id": "case-details-page-supplied-phone-cancel", style: { display: isExportingPDF ? 'none' : '' }, disabled: isCaseOwnerUpdating || isCasePhoneUpdating, "aria-label": "Clear" },
284
- React.createElement(TimesIcon, { color: "#6A6E73" })))) : (React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: () => setIsEditting(true), "data-tracking-id": "case-details-page-supplied-phone-edit", style: { display: isExportingPDF ? 'none' : '' }, "aria-label": "Edit", disabled: isCaseOwnerUpdating || isCasePhoneUpdating || canEditCase.isCaseNotEditable },
278
+ React.createElement(TimesIcon, { color: "#6A6E73" })))) : (React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: () => setIsEditting(true), "data-tracking-id": "case-details-page-supplied-phone-edit", style: { display: isExportingPDF ? 'none' : '' }, "aria-label": "Edit", disabled: isCaseOwnerUpdating || isCasePhoneUpdating },
285
279
  React.createElement(PencilAltIcon, null)))),
286
280
  !invalid &&
287
281
  (localFullPhone === null || localFullPhone === void 0 ? void 0 : localFullPhone.length) <= PHONE_LIMIT &&
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAsBvD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBAgI1D"}
1
+ {"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAkBvD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBAgE1D"}