@rh-support/troubleshoot 2.6.354 → 2.6.357

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (345) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +19 -29
  3. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  4. package/lib/esm/components/AccountInfo/OwnerSelector.js +91 -16
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +6 -2
  7. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +61 -32
  9. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts +8 -0
  10. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.d.ts.map +1 -0
  11. package/lib/esm/components/CaseEditView/ArchivedCaseBanner.js +18 -0
  12. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/Case.js +60 -33
  14. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +19 -9
  16. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
  17. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +15 -4
  18. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +82 -55
  20. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +2 -0
  21. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
  23. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +1 -2
  24. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  25. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +8 -6
  26. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  27. package/lib/esm/components/CaseEditView/CaseOverview/index.js +76 -45
  28. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +203 -109
  30. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +0 -1
  31. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
  33. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +1 -3
  34. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  35. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +5 -9
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +18 -17
  38. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  39. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +51 -47
  40. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  41. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +49 -44
  42. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +4 -0
  43. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -0
  44. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +23 -0
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +51 -45
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +23 -10
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +0 -2
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.d.ts.map +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +3 -2
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +132 -57
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +10 -5
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +110 -65
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +40 -26
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts +2 -4
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +122 -148
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +4 -2
  68. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  69. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +76 -145
  70. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  71. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +22 -9
  72. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  73. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +9 -2
  74. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
  75. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +8 -1
  76. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +29 -0
  77. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +1 -0
  78. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +29 -0
  79. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +17 -0
  80. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -0
  81. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +60 -0
  82. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts +2 -2
  83. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.d.ts.map +1 -1
  84. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useMarkdownFileUploader.js +18 -7
  85. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +9 -3
  86. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  87. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +217 -267
  88. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  89. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +6 -4
  90. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  91. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +3 -1
  92. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  93. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +35 -3
  94. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  95. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +63 -224
  96. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +4 -5
  97. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  98. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +18 -5
  99. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  100. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +7 -2
  101. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  102. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +38 -52
  103. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  104. package/lib/esm/components/CaseInformation/CaseGroup.js +168 -61
  105. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  106. package/lib/esm/components/CaseInformation/CaseInformation.js +10 -9
  107. package/lib/esm/components/CaseInformation/CaseLabels.d.ts +3 -0
  108. package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +1 -0
  109. package/lib/esm/components/CaseInformation/CaseLabels.js +103 -0
  110. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  111. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +108 -31
  112. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +2 -2
  113. package/lib/esm/components/CaseInformation/Description.js +1 -1
  114. package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
  115. package/lib/esm/components/CaseInformation/FileDiag.js +2 -5
  116. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  117. package/lib/esm/components/CaseInformation/Fts.js +31 -17
  118. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  119. package/lib/esm/components/CaseInformation/Severity.js +21 -13
  120. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  121. package/lib/esm/components/CaseInformation/SupportLevel.js +36 -55
  122. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts +4 -0
  123. package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +1 -0
  124. package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +110 -0
  125. package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
  126. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -8
  127. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  128. package/lib/esm/components/CaseManagement/CaseManagement.js +13 -10
  129. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  130. package/lib/esm/components/CaseManagement/Cep.js +11 -9
  131. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +2 -1
  132. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  133. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +22 -3
  134. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +6 -6
  135. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  136. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +15 -22
  137. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  138. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +34 -40
  139. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  140. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +8 -4
  141. package/lib/esm/components/EditDescription/EditDescription.js +1 -1
  142. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  143. package/lib/esm/components/IdeaInformation/IdeaInformation.js +16 -18
  144. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  145. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  146. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  147. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  148. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
  149. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  150. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
  151. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  152. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +37 -50
  153. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +3 -0
  154. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +1 -0
  155. package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +9 -0
  156. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  157. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  158. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
  159. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +9 -1
  160. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  161. package/lib/esm/components/Recommendations/AsideResults.js +4 -3
  162. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  163. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -4
  164. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  165. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  166. package/lib/esm/components/Recommendations/InsightsResults.js +3 -3
  167. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  168. package/lib/esm/components/Recommendations/Recommendations.js +3 -9
  169. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  170. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +10 -8
  171. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  172. package/lib/esm/components/Review/Review.js +25 -19
  173. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  174. package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
  175. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  176. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  177. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  178. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  179. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +104 -62
  180. package/lib/esm/components/shared/Constants.d.ts +5 -0
  181. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  182. package/lib/esm/components/shared/Constants.js +5 -0
  183. package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
  184. package/lib/esm/components/shared/fileUpload/FileLister.js +3 -3
  185. package/lib/esm/components/shared/fileUpload/FileUpload.js +2 -3
  186. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  187. package/lib/esm/components/shared/fileUpload/FileUploader.js +3 -1
  188. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +1 -0
  189. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  190. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +4 -3
  191. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts +1 -1
  192. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.d.ts.map +1 -1
  193. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +21 -5
  194. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  195. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +210 -34
  196. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +5 -1
  197. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
  198. package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +36 -1
  199. package/lib/esm/components/shared/fileUpload/types/index.d.ts +5 -1
  200. package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
  201. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +2 -2
  202. package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
  203. package/lib/esm/components/shared/fileUpload/useFileUploader.js +116 -47
  204. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  205. package/lib/esm/components/shared/useIsSectionValid.js +22 -57
  206. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  207. package/lib/esm/components/shared/usePostComment.js +16 -28
  208. package/lib/esm/components/shared/utils.d.ts +1 -0
  209. package/lib/esm/components/shared/utils.d.ts.map +1 -1
  210. package/lib/esm/components/shared/utils.js +9 -3
  211. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  212. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +178 -38
  213. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  214. package/lib/esm/components/wizardLayout/WizardAside.js +2 -4
  215. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  216. package/lib/esm/components/wizardLayout/WizardLayout.js +12 -13
  217. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  218. package/lib/esm/components/wizardLayout/WizardMain.js +7 -0
  219. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  220. package/lib/esm/components/wizardLayout/WizardNavigation.js +14 -11
  221. package/lib/esm/constants/caseDetailsConstants.d.ts +5 -0
  222. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  223. package/lib/esm/constants/caseDetailsConstants.js +5 -0
  224. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  225. package/lib/esm/css/app.css +28 -0
  226. package/lib/esm/css/case.css +60 -209
  227. package/lib/esm/graphql/index.d.ts +4 -0
  228. package/lib/esm/graphql/index.d.ts.map +1 -0
  229. package/lib/esm/graphql/index.js +3 -0
  230. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
  231. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
  232. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
  233. package/lib/esm/graphql/mutations/index.d.ts +2 -0
  234. package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
  235. package/lib/esm/graphql/mutations/index.js +1 -0
  236. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
  237. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
  238. package/lib/esm/graphql/queries/getEscalationDetails.js +31 -0
  239. package/lib/esm/graphql/queries/index.d.ts +2 -0
  240. package/lib/esm/graphql/queries/index.d.ts.map +1 -0
  241. package/lib/esm/graphql/queries/index.js +1 -0
  242. package/lib/esm/graphql/schemas/escalation.d.ts +66 -0
  243. package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
  244. package/lib/esm/graphql/schemas/escalation.js +1 -0
  245. package/lib/esm/graphql/schemas/index.d.ts +2 -0
  246. package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
  247. package/lib/esm/graphql/schemas/index.js +1 -0
  248. package/lib/esm/hooks/useAB.d.ts.map +1 -1
  249. package/lib/esm/hooks/useAB.js +45 -23
  250. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +4 -0
  251. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -0
  252. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +52 -0
  253. package/lib/esm/hooks/useCaseComments/index.d.ts +7 -0
  254. package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -0
  255. package/lib/esm/hooks/useCaseComments/index.js +5 -0
  256. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +25 -0
  257. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -0
  258. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +75 -0
  259. package/lib/esm/hooks/useCaseComments/types.d.ts +85 -0
  260. package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -0
  261. package/lib/esm/hooks/useCaseComments/types.js +1 -0
  262. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +17 -0
  263. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -0
  264. package/lib/esm/hooks/useCaseComments/useCaseComments.js +38 -0
  265. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +19 -0
  266. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -0
  267. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +33 -0
  268. package/lib/esm/hooks/useCaseGroupUiState.d.ts +3 -0
  269. package/lib/esm/hooks/useCaseGroupUiState.d.ts.map +1 -0
  270. package/lib/esm/hooks/useCaseGroupUiState.js +10 -0
  271. package/lib/esm/hooks/useCaseHistory.d.ts +26 -0
  272. package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -0
  273. package/lib/esm/hooks/useCaseHistory.js +98 -0
  274. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +21 -0
  275. package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -0
  276. package/lib/esm/hooks/useCaseLabelLinkMutations.js +91 -0
  277. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +1 -1
  278. package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
  279. package/lib/esm/hooks/useCaseUpdateErrorMessage.js +21 -11
  280. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  281. package/lib/esm/hooks/useResetCaseCreate.js +18 -11
  282. package/lib/esm/hooks/useS3Upload.d.ts +5 -4
  283. package/lib/esm/hooks/useS3Upload.d.ts.map +1 -1
  284. package/lib/esm/hooks/useS3Upload.js +28 -30
  285. package/lib/esm/i18n/template-de.d.ts +2 -2
  286. package/lib/esm/i18n/template-de.js +2 -2
  287. package/lib/esm/i18n/template-es.d.ts +2 -2
  288. package/lib/esm/i18n/template-es.js +2 -2
  289. package/lib/esm/i18n/template-fr.d.ts +2 -2
  290. package/lib/esm/i18n/template-fr.js +2 -2
  291. package/lib/esm/i18n/template-it.d.ts +2 -2
  292. package/lib/esm/i18n/template-it.js +2 -2
  293. package/lib/esm/i18n/template-jp.d.ts +2 -2
  294. package/lib/esm/i18n/template-jp.js +2 -2
  295. package/lib/esm/i18n/template-ko.d.ts +2 -2
  296. package/lib/esm/i18n/template-ko.js +2 -2
  297. package/lib/esm/i18n/template-pt.d.ts +2 -2
  298. package/lib/esm/i18n/template-pt.js +2 -2
  299. package/lib/esm/i18n/template-ru.d.ts +2 -2
  300. package/lib/esm/i18n/template-ru.js +2 -2
  301. package/lib/esm/i18n/template-zh.d.ts +2 -2
  302. package/lib/esm/i18n/template-zh.js +2 -2
  303. package/lib/esm/index.js +1 -0
  304. package/lib/esm/models/cache.d.ts +0 -2
  305. package/lib/esm/models/cache.d.ts.map +1 -1
  306. package/lib/esm/models/caseHistory.d.ts +80 -0
  307. package/lib/esm/models/caseHistory.d.ts.map +1 -0
  308. package/lib/esm/models/caseHistory.js +1 -0
  309. package/lib/esm/reducers/CaseConstNTypes.d.ts +123 -9
  310. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  311. package/lib/esm/reducers/CaseConstNTypes.js +31 -7
  312. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +7 -5
  313. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  314. package/lib/esm/reducers/CaseDetailsPageReducer.js +58 -26
  315. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +11 -12
  316. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  317. package/lib/esm/reducers/CaseDiscussionTabReducer.js +63 -70
  318. package/lib/esm/reducers/CaseHelpers.d.ts +11 -1
  319. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  320. package/lib/esm/reducers/CaseHelpers.js +117 -17
  321. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  322. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  323. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  324. package/lib/esm/reducers/CaseReducer.d.ts +56 -11
  325. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  326. package/lib/esm/reducers/CaseReducer.js +279 -99
  327. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  328. package/lib/esm/reducers/RecommendationsReducer.js +15 -18
  329. package/lib/esm/scss/_main.scss +9 -0
  330. package/lib/esm/utils/TimelineUtils.d.ts +41 -0
  331. package/lib/esm/utils/TimelineUtils.d.ts.map +1 -0
  332. package/lib/esm/utils/TimelineUtils.js +135 -0
  333. package/lib/esm/utils/caseHistoryUtils.d.ts +66 -0
  334. package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -0
  335. package/lib/esm/utils/caseHistoryUtils.js +165 -0
  336. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +1 -2
  337. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  338. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  339. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts +6 -0
  340. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.d.ts.map +1 -0
  341. package/lib/esm/utils/caseSeverityFtsGraphQLUtils.js +26 -0
  342. package/package.json +9 -8
  343. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts +0 -25
  344. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.d.ts.map +0 -1
  345. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/AsaCommentFeedbackModal.js +0 -88
@@ -37,6 +37,18 @@ function OpenshiftDropdownV4(props) {
37
37
  const { t } = useTranslation();
38
38
  const PER_PAGE = 200;
39
39
  const LOAD_MORE_VALUE = 'loader';
40
+ const getDisplayName = (id, noClusterIdReasonExplanation, display_name) => {
41
+ if (isEmpty(id))
42
+ return '';
43
+ if (id === 'dont-have-id') {
44
+ return noClusterIdReasonExplanation === 'v3-cluster'
45
+ ? t('The case is for a v3 cluster')
46
+ : t("I don't have my Cluster ID");
47
+ }
48
+ if (id === 'v3-cluster')
49
+ return t('The case is for a v3 cluster');
50
+ return display_name || id;
51
+ };
40
52
  const [clustersRawResponse, setClustersRawResponse] = useState([]);
41
53
  const clustersRawResponseRef = useRef(clustersRawResponse);
42
54
  clustersRawResponseRef.current = clustersRawResponse;
@@ -44,7 +56,7 @@ function OpenshiftDropdownV4(props) {
44
56
  const loadMoreInProgressRef = useRef(false);
45
57
  const [clustersSelectOptions, setClustersSelectOptions] = useState([]);
46
58
  const [isOpen, setIsOpen] = useState(false);
47
- const [inputVal, setInputVal] = useState(props.openshiftDisplayName);
59
+ const [inputVal, setInputVal] = useState(() => getDisplayName(props.openshiftClusterIDState, props.noClusterIdReasonExplanation || '', props.openshiftDisplayName || props.openshiftClusterIDState));
48
60
  const inputValRef = useRef(inputVal);
49
61
  inputValRef.current = inputVal;
50
62
  const [showArchivedClusters, setShowArchivedClusters] = useState(false);
@@ -53,19 +65,6 @@ function OpenshiftDropdownV4(props) {
53
65
  const { getFromCache, setInCache } = useLRUCache(50);
54
66
  const textInputRef = useRef();
55
67
  const { isExportingPDF } = useContext(PDFContext);
56
- // gets a cluster id and returns display name
57
- const getDisplayName = (id, noClusterIdReasonExplanation, display_name) => {
58
- if (isEmpty(id))
59
- return '';
60
- if (id === 'dont-have-id') {
61
- return noClusterIdReasonExplanation === 'v3-cluster'
62
- ? t('The case is for a v3 cluster')
63
- : t("I don't have my Cluster ID");
64
- }
65
- if (id === 'v3-cluster')
66
- return t('The case is for a v3 cluster');
67
- return display_name || id;
68
- };
69
68
  const onDropdownClear = () => __awaiter(this, void 0, void 0, function* () {
70
69
  setIsOpen(false);
71
70
  setInputVal('');
@@ -149,12 +148,10 @@ function OpenshiftDropdownV4(props) {
149
148
  React.createElement(SelectOption, { key: 'dont-have-id', value: createState('dont-have-id', t("I don't have my Cluster ID")), "data-tracking-id": "dont-have-cluster-id", isFocused: focusedItemIndex === 1 }, "I don't have my Cluster ID"),
150
149
  ...(props.isV3
151
150
  ? [
152
- React.createElement(SelectOption, { key: 'v3-cluster', value: createState('v3-cluster', t('The case is for a v3 cluster')), isFocused: focusedItemIndex === 2 }),
151
+ React.createElement(SelectOption, { key: 'v3-cluster', value: createState('v3-cluster', t('The case is for a v3 cluster')), "data-tracking-id": "v3-cluster-case", isFocused: focusedItemIndex === 2 }, t('The case is for a v3 cluster')),
153
152
  ]
154
153
  : []),
155
- ],
156
- // eslint-disable-next-line react-hooks/exhaustive-deps
157
- [showArchivedClusters, focusedItemIndex]);
154
+ ], [showArchivedClusters, focusedItemIndex, props.isV3, t]);
158
155
  const getClusterOptions = (clusters, total = totalResultsNo) => {
159
156
  const clustersResponseGrouped = groupBy(clusters, 'console_url') || [];
160
157
  const domainNames = Object.keys(clustersResponseGrouped) || [];
@@ -224,17 +221,14 @@ function OpenshiftDropdownV4(props) {
224
221
  }
225
222
  else {
226
223
  if (abortControllerRef.current !== undefined) {
227
- // Cancel the previous request
228
224
  abortControllerRef.current.abort();
229
225
  }
230
- // recreate a new AbortController for each call
231
226
  let controller = new AbortController();
232
227
  abortControllerRef.current = controller;
233
228
  const clusterStatus = ` AND status not in ('Deprovisioned'${!showArchivedClusters ? ",'Archived'" : ''})`;
234
229
  const searchPhrase = search
235
230
  ? ` AND (external_cluster_id ILIKE '%${search}%' OR display_name ILIKE '%${search}%' OR console_url ILIKE '%${search}%')`
236
231
  : '';
237
- // query language: https://github.com/yaacov/tree-search-language
238
232
  clustersResponse = yield cloud.getAccountClustersSubscription({
239
233
  order: 'display_name asc',
240
234
  page,
@@ -265,7 +259,6 @@ function OpenshiftDropdownV4(props) {
265
259
  };
266
260
  }
267
261
  catch (e) {
268
- // silently fails
269
262
  setIsFetchingClusters(false);
270
263
  return { items: [], totalResult: 0, page: 1, total: 0 };
271
264
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NonOrgCaseNotifyeesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAwB,oBAAoB,EAAY,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AA+BD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBA+NxD"}
1
+ {"version":3,"file":"NonOrgCaseNotifyeesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAwB,oBAAoB,EAAY,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AA+BD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBA2NxD"}
@@ -69,58 +69,52 @@ export function NonOrgCaseNotifyeesSelector(props) {
69
69
  const onRemoveItem = (optionToRemove) => {
70
70
  props.onChange && props.onChange([optionToRemove]);
71
71
  };
72
+ const mapContactsToNotifyees = (rawContacts) => rawContacts
73
+ .filter((c) => !!c.ssoName)
74
+ .map((c) => {
75
+ const { ssoName } = c, rest = __rest(c, ["ssoName"]);
76
+ return Object.assign({ ssoUsername: ssoName }, rest);
77
+ });
78
+ const hasSelectedUsername = (mappedContacts) => mappedContacts.some((contact) => props.selectedItems.some((item) => isContact(item) && item.ssoUsername === contact.ssoUsername));
72
79
  const onAddClick = () => __awaiter(this, void 0, void 0, function* () {
73
80
  var _a, _b, _c, _d;
74
81
  clearErrors();
75
- const searchResults = yield request(props.accountNumber, inputVal,
76
- // eslint-disable-next-line eqeqeq
77
- props.groupNumber == '-1' ? null : props.groupNumber);
82
+ const searchResults = yield request(props.accountNumber, inputVal, props.groupNumber || null);
78
83
  const { notificationAddress = { email: '' }, contacts = [] } = (_a = searchResults === null || searchResults === void 0 ? void 0 : searchResults[0]) !== null && _a !== void 0 ? _a : {};
79
84
  if ((notificationAddress === null || notificationAddress === void 0 ? void 0 : notificationAddress.email) && (contacts === null || contacts === void 0 ? void 0 : contacts.length)) {
80
- const mappedContacts = contacts
81
- .filter((c) => !!c.ssoName)
82
- .map((c) => {
83
- const { ssoName } = c, rest = __rest(c, ["ssoName"]);
84
- return Object.assign({ ssoUsername: ssoName }, rest);
85
- });
86
- const isUsernameAlreadySelected = mappedContacts.some((contact) => props.selectedItems.some((item) => isContact(item) && item.ssoUsername === contact.ssoUsername));
87
- if (!isUsernameAlreadySelected) {
85
+ const mappedContacts = mapContactsToNotifyees(contacts);
86
+ if (!hasSelectedUsername(mappedContacts)) {
88
87
  (_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, [...mappedContacts]);
89
88
  }
90
89
  setInputVal('');
91
90
  setNotifyeesList([...mappedContacts, { emailAddress: notificationAddress.email }]);
91
+ return;
92
92
  }
93
- else {
94
- if (notificationAddress === null || notificationAddress === void 0 ? void 0 : notificationAddress.email) {
95
- const isEmailAlreadySelected = props.selectedItems.some((item) => {
96
- var _a, _b;
97
- return isCustomEmailAddress(item) &&
98
- ((_a = item.emailAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = notificationAddress.email) === null || _b === void 0 ? void 0 : _b.toLowerCase());
99
- });
100
- if (!isEmailAlreadySelected) {
101
- const updatedSelection = [{ emailAddress: notificationAddress.email, caseNumber: '' }];
102
- (_c = props.onChange) === null || _c === void 0 ? void 0 : _c.call(props, updatedSelection);
103
- }
104
- setInputVal('');
105
- }
106
- else if (contacts === null || contacts === void 0 ? void 0 : contacts.length) {
107
- const mappedContacts = contacts
108
- .filter((c) => !!c.ssoName)
109
- .map((c) => {
110
- const { ssoName } = c, rest = __rest(c, ["ssoName"]);
111
- return Object.assign({ ssoUsername: ssoName }, rest);
112
- });
113
- const isUsernameAlreadySelected = mappedContacts.some((contact) => props.selectedItems.some((item) => isContact(item) && item.ssoUsername === contact.ssoUsername));
114
- if (!isUsernameAlreadySelected) {
115
- (_d = props.onChange) === null || _d === void 0 ? void 0 : _d.call(props, [...mappedContacts]);
116
- }
117
- setInputVal('');
93
+ if (notificationAddress === null || notificationAddress === void 0 ? void 0 : notificationAddress.email) {
94
+ const isEmailAlreadySelected = props.selectedItems.some((item) => {
95
+ var _a, _b;
96
+ return isCustomEmailAddress(item) &&
97
+ ((_a = item.emailAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = notificationAddress.email) === null || _b === void 0 ? void 0 : _b.toLowerCase());
98
+ });
99
+ if (!isEmailAlreadySelected) {
100
+ (_c = props.onChange) === null || _c === void 0 ? void 0 : _c.call(props, [{ emailAddress: notificationAddress.email, caseNumber: '' }]);
118
101
  }
119
- else {
120
- loggedInUsersAccount.data.hasGroupACLs && props.groupNumber && props.groupNumber !== '-1'
121
- ? setShowGroupPermissionError(true)
122
- : setShowAccountPermissionError(true);
102
+ setInputVal('');
103
+ return;
104
+ }
105
+ if (contacts === null || contacts === void 0 ? void 0 : contacts.length) {
106
+ const mappedContacts = mapContactsToNotifyees(contacts);
107
+ if (!hasSelectedUsername(mappedContacts)) {
108
+ (_d = props.onChange) === null || _d === void 0 ? void 0 : _d.call(props, [...mappedContacts]);
123
109
  }
110
+ setInputVal('');
111
+ return;
112
+ }
113
+ if (loggedInUsersAccount.data.hasGroupACLs && props.groupNumber) {
114
+ setShowGroupPermissionError(true);
115
+ }
116
+ else {
117
+ setShowAccountPermissionError(true);
124
118
  }
125
119
  });
126
120
  const clearErrors = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"NoAttachmentSelectedModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ConfirmationModals/NoAttachmentSelectedModal.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,UAAU,MAAM;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;CACzB;AAID,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,qBAgJtD"}
1
+ {"version":3,"file":"NoAttachmentSelectedModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ConfirmationModals/NoAttachmentSelectedModal.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAiBvE,UAAU,MAAM;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;CACzB;AAID,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,qBAkJtD"}
@@ -1,12 +1,14 @@
1
1
  import { Button, ButtonVariant, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, } from '@patternfly/react-core';
2
2
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
3
3
  import { ability, resourceActions, resources } from '@rh-support/user-permissions';
4
+ import { pendoTrackEvent } from '@rh-support/utils';
4
5
  import React, { useContext, useEffect, useRef, useState } from 'react';
5
6
  import { Trans, useTranslation } from 'react-i18next';
6
7
  import { RulesDispatchContext, RulesStateContext } from '../../context/RulesContext';
7
8
  import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
8
9
  import { RulesReducerConstants } from '../../reducers/RulesReducer';
9
10
  import FileEARule from '../ImproveCase/FileEARule';
11
+ import { recsViewedFromNoAttachmentModalEvent } from '../shared/Constants';
10
12
  import { AttachmentStateContext, isAnyFileAttached, isAnyFileDiagnosticsAttachment, isUploadingAttachment, } from '../shared/fileUpload';
11
13
  import FileSelectorButton from '../shared/fileUpload/fileSelectors/FileSelectorButton';
12
14
  import FileUpload from '../shared/fileUpload/FileUpload';
@@ -14,26 +16,28 @@ const TIMEOUT_DURATION = 9000;
14
16
  export function NoAttachmentSelectedModal(props) {
15
17
  const { t } = useTranslation();
16
18
  const { sessionRestore: { activeSessionId }, } = useContext(SessionRestoreStateContext);
17
- const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
18
19
  const { attachmentState: { caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
19
20
  const [isUploading, setIsUploading] = useState(false);
20
21
  const isAnyFileAttachedLocal = isAnyFileAttached(selectedLocalFiles);
21
22
  const skipAndCreateCaseBtntimeoutRef = useRef(null);
22
23
  const rulesDispatch = useContext(RulesDispatchContext);
23
24
  const { rulesState } = useContext(RulesStateContext);
25
+ const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
26
+ const isSecureSupport = Boolean(loggedInUsersAccount.data.secureSupport);
24
27
  const isFirstMounRef = useRef(true);
25
28
  const canUseSessionManagement = ability.can(resourceActions.CREATE, resources.SESSION_TRACKING);
26
29
  useEffect(() => {
27
- if (rulesState.triggerRuleNotification && !isFirstMounRef.current) {
30
+ if (rulesState.triggerRuleNotification && !isFirstMounRef.current && !isSecureSupport) {
28
31
  rulesDispatch({
29
32
  type: RulesReducerConstants.triggerEARulesModalVisibiltyChange,
30
33
  payload: { isRuleModalVisible: true },
31
34
  });
35
+ pendoTrackEvent(recsViewedFromNoAttachmentModalEvent);
32
36
  props.onClose();
33
37
  }
34
38
  isFirstMounRef.current = false;
35
39
  // eslint-disable-next-line react-hooks/exhaustive-deps
36
- }, [rulesState.triggerRuleNotification, rulesDispatch]);
40
+ }, [rulesState.triggerRuleNotification, rulesDispatch, isSecureSupport]);
37
41
  /** Clearing timeout on component unmount */
38
42
  useEffect(() => {
39
43
  return () => {
@@ -75,7 +79,7 @@ export function NoAttachmentSelectedModal(props) {
75
79
  React.createElement("p", { className: "pf-v6-u-mb-md" },
76
80
  React.createElement(Trans, null, "Uploading an attachment will speed up your case's resolution time")),
77
81
  React.createElement(FileEARule, { isInline: true })))),
78
- React.createElement(FileUpload, { idToUploadTo: activeSessionId, onUploadClick: onFileUploadClick, isSessionId: true, needsAnalyzing: true, autoUploadOnSelect: loggedInUsersAccount.data.secureSupport ? false : true, isSecureSupport: loggedInUsersAccount.data.secureSupport, isPrivate: false }),
82
+ React.createElement(FileUpload, { idToUploadTo: activeSessionId, onUploadClick: onFileUploadClick, isSessionId: true, needsAnalyzing: !isSecureSupport, autoUploadOnSelect: isSecureSupport ? false : true, isSecureSupport: isSecureSupport, isPrivate: false }),
79
83
  React.createElement(ModalFooter, null, isUploading ? (React.createElement(Button, { key: "create-case", variant: ButtonVariant.primary, onClick: props.onConfirm, "data-tracking-id": "skip-upload-or-analysis-and-submit" },
80
84
  React.createElement(Trans, null, "Skip analyze and create my case"))) : isAnyFileAttachedLocal ? (!canUseSessionManagement && (React.createElement(Button, { className: "pf-v6-u-mt-sm", variant: ButtonVariant.primary, onClick: props.onConfirm, "data-tracking-id": "no-attachment-modal-create-case" },
81
85
  React.createElement(Trans, null, "Create Case")))) : (React.createElement(React.Fragment, null,
@@ -41,7 +41,7 @@ export default function EditDescription(props) {
41
41
  try {
42
42
  setIsUpdating(true);
43
43
  const caseDetails = { description: localDescription };
44
- // Only GS4 internal can edit description
44
+ //Only GS4 internal can edit description
45
45
  yield kase.updateCase(caseNumber, caseDetails, true);
46
46
  setIsUpdating(false);
47
47
  setCaseDetails(caseDispatch, caseDetails);
@@ -1 +1 @@
1
- {"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBA8ItC"}
1
+ {"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAkBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBAoJtC"}
@@ -1,3 +1,4 @@
1
+ import { useApolloClient } from '@apollo/client/react';
1
2
  import { Grid, GridItem } from '@patternfly/react-core';
2
3
  import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
3
4
  import { fetchCaseSeverities, fetchCaseTypes, fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
@@ -8,26 +9,27 @@ import React, { useContext, useEffect } from 'react';
8
9
  import { Trans, useTranslation } from 'react-i18next';
9
10
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
10
11
  import { setCaseDetails } from '../../reducers/CaseReducer';
11
- import CaseGroup from '../CaseInformation/CaseGroup';
12
+ // import CaseGroup from '../CaseInformation/CaseGroup';
12
13
  import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
13
- import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
14
+ // TODO: Re-enable once phone number verification flow is fully supported with GraphQL
15
+ // import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
14
16
  import Severity from '../CaseInformation/Severity';
15
17
  import SupportLevel from '../CaseInformation/SupportLevel';
16
18
  import CaseLanguageSelector from '../CaseManagement/CaseLanguageSelector';
17
- import { Cep } from '../CaseManagement/Cep';
19
+ // import { Cep } from '../CaseManagement/Cep';
18
20
  import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
19
21
  import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
20
- import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
22
+ // import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
21
23
  import KtQuestions from '../ImproveCase/KtQuestions';
22
24
  export default function IdeaInformation() {
23
25
  const { t } = useTranslation();
24
26
  const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
25
27
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
26
- const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
28
+ const apolloClient = useApolloClient();
29
+ const { contactSSOName, selectedAccountDetails, ownersCaseGroups } = useCaseSelector((state) => ({
27
30
  contactSSOName: state.caseDetails.contactSSOName,
28
31
  ownersCaseGroups: state.ownersCaseGroups,
29
32
  selectedAccountDetails: state.selectedAccountDetails,
30
- hasInvalidEntitlements: state.hasInvalidEntitlements,
31
33
  }), isEqual);
32
34
  const caseDispatch = useCaseDispatch();
33
35
  const isMetadataLoading = () => {
@@ -48,13 +50,13 @@ export default function IdeaInformation() {
48
50
  }
49
51
  const allPromisses = [];
50
52
  if (haventLoadedMetadata(allCaseTypes)) {
51
- allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
53
+ allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, apolloClient));
52
54
  }
53
55
  if (haventLoadedMetadata(allCaseSeverities)) {
54
- allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
56
+ allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, apolloClient));
55
57
  }
56
58
  if (haventLoadedMetadata(caseLanguages)) {
57
- allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer));
59
+ allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer, apolloClient));
58
60
  }
59
61
  Promise.all(allPromisses);
60
62
  }, [
@@ -66,6 +68,7 @@ export default function IdeaInformation() {
66
68
  loggedInUserJwtToken,
67
69
  selectedAccountDetails,
68
70
  loggedInUsersAccount.data.secureSupport,
71
+ apolloClient,
69
72
  ]);
70
73
  const onSeverityChange = (payload) => {
71
74
  setCaseDetails(caseDispatch, payload);
@@ -79,13 +82,13 @@ export default function IdeaInformation() {
79
82
  ' ',
80
83
  React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
81
84
  " for assistance.")),
82
- React.createElement(AlertMessage, { show: hasInvalidEntitlements, variant: AlertType.DANGER, className: "pf-v6-u-mb-md", isInline: true },
85
+ React.createElement(AlertMessage, { show: !loggedInUserRights.data.isEntitled(), variant: AlertType.DANGER, className: "pf-v6-u-mb-md", isInline: true },
83
86
  React.createElement(Trans, { i18nKey: "i18ValidEntitlementContactCustomerService" },
84
87
  "You need a valid entitlement to create a case.\u00A0 Please contact",
85
88
  ' ',
86
89
  React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
87
90
  " for assistance.")),
88
- !hasInvalidEntitlements &&
91
+ loggedInUserRights.data.isEntitled() &&
89
92
  !isMetadataLoading() &&
90
93
  !isMetadataLoadingError() &&
91
94
  loggedInUserRights.data.canManageCases() && (React.createElement(React.Fragment, null,
@@ -97,14 +100,9 @@ export default function IdeaInformation() {
97
100
  React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange })),
98
101
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xl" },
99
102
  React.createElement(ContactPhoneNumber, null))),
100
- React.createElement(ContactPhoneNumberAlert, null),
101
103
  React.createElement(Grid, { hasGutter: true },
102
104
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
103
- React.createElement(CaseLanguageSelector, { isManageStep: true })),
104
- React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
105
- React.createElement(CaseGroup, { init: true }))),
106
- React.createElement(CaseContactSelector, null),
105
+ React.createElement(CaseLanguageSelector, { isManageStep: true }))),
107
106
  React.createElement(RHAssociatesSelector, null),
108
- React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
109
- React.createElement(Cep, null))))));
107
+ React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }))))));
110
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SupportTypeSelectorPage.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/SupportTypeSelectorPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAiB/D,MAAM,CAAC,OAAO,UAAU,uBAAuB,sBAiM9C"}
1
+ {"version":3,"file":"SupportTypeSelectorPage.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/SupportTypeSelectorPage.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAiB/D,MAAM,CAAC,OAAO,UAAU,uBAAuB,sBAkM9C"}
@@ -1,3 +1,4 @@
1
+ import { useApolloClient } from '@apollo/client/react';
1
2
  import { Bullseye, Card, CardBody, Gallery, GalleryItem, Split, SplitItem } from '@patternfly/react-core';
2
3
  import { LoadingIndicator } from '@rh-support/components';
3
4
  import { fetchCaseTypes, useGlobalDispatchContext, useGlobalStateContext } from '@rh-support/react-context';
@@ -11,8 +12,9 @@ import { getUpdatedDescription } from '../../reducers/CaseHelpers';
11
12
  import { setCaseDetails } from '../../reducers/CaseReducer';
12
13
  import { BugIcon, CertificationIcon, CustomerServiceIcon, DocumentationIcon, GearIcon, IdeaIcon, RcaIcon, } from './SupportTypeIcons';
13
14
  export default function SupportTypeSelectorPage() {
14
- const { globalMetadataState: { allCaseTypes, loggedInUsersAccount }, } = useGlobalStateContext();
15
+ const { globalMetadataState: { allCaseTypes }, } = useGlobalStateContext();
15
16
  const globalDispatch = useGlobalDispatchContext();
17
+ const apolloClient = useApolloClient();
16
18
  const [selectedSupportType, setSelectedSupportType] = useState('');
17
19
  const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
18
20
  const { caseType, isFetchingSelectedAccountDetails, issue, timeFramesAndUrgency, v3ClusterName } = useCaseSelector((state) => ({
@@ -27,7 +29,7 @@ export default function SupportTypeSelectorPage() {
27
29
  useEffect(() => {
28
30
  if (haventLoadedMetadata(allCaseTypes)) {
29
31
  // Load support types.
30
- fetchCaseTypes(globalDispatch, loggedInUsersAccount.data.secureSupport);
32
+ fetchCaseTypes(globalDispatch, apolloClient);
31
33
  }
32
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
33
35
  }, []);
@@ -6,7 +6,6 @@ interface IProps {
6
6
  routeProps: RouteComponentProps<IRouteUrlParams>;
7
7
  loadTCOnChange?: boolean;
8
8
  showTCAfterButtonClicked?: boolean;
9
- checkEntitledProduct?: boolean;
10
9
  isOnSummaryPage?: boolean;
11
10
  isOnGetSupportPage?: boolean;
12
11
  isOnReviewPage?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvG,UAAU,MAAM;IACZ,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAQD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAuKvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvG,UAAU,MAAM;IACZ,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAOD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAoJvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,8 +1,5 @@
1
1
  import { Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant } from '@patternfly/react-core';
2
- import { AlertMessage, AlertType } from '@rh-support/components';
3
2
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
- import filter from 'lodash/filter';
5
- import find from 'lodash/find';
6
3
  import isEmpty from 'lodash/isEmpty';
7
4
  import isEqual from 'lodash/isEqual';
8
5
  import React, { forwardRef, useContext, useEffect, useState } from 'react';
@@ -19,7 +16,6 @@ import { ProductVersionDropdownSelector } from './ProductVersionDropdownSelector
19
16
  const defaultProps = {
20
17
  loadTCOnChange: false,
21
18
  showTCAfterButtonClicked: false,
22
- checkEntitledProduct: false,
23
19
  };
24
20
  /**
25
21
  * Renders a dropdown list to select all products.
@@ -30,15 +26,12 @@ const defaultProps = {
30
26
  * @param props
31
27
  */
32
28
  const AllProductsSelector = forwardRef((props, ref) => {
33
- var _a, _b;
34
- const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
29
+ const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
35
30
  const caseDispatch = useCaseDispatch();
36
- const { product, version, contactSSOName } = useCaseSelector((state) => ({
31
+ const { product, version } = useCaseSelector((state) => ({
37
32
  product: state.caseDetails.product,
38
33
  version: state.caseDetails.version,
39
- contactSSOName: state.caseDetails.contactSSOName,
40
34
  }), isEqual);
41
- //test
42
35
  const { topContentState: { topContent }, } = useContext(TCStateContext);
43
36
  const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
44
37
  const [isModalOpen, setIsModalOpen] = useState(false);
@@ -46,7 +39,6 @@ const AllProductsSelector = forwardRef((props, ref) => {
46
39
  const [showModalButton, setShowModalButton] = useState(false);
47
40
  const [isProductChanged, setProductChanged] = useState(false);
48
41
  const { t } = useTranslation();
49
- const isEntitledProduct = (_b = find((_a = allProducts === null || allProducts === void 0 ? void 0 : allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, (p) => p.product === product)) === null || _b === void 0 ? void 0 : _b.isEntitledProduct;
50
42
  useEffect(() => {
51
43
  // after TC data is loaded we open the modal
52
44
  const showTCPopUpModalOnProductChange = props.loadTCOnChange && !props.showTCAfterButtonClicked && showModal;
@@ -79,7 +71,6 @@ const AllProductsSelector = forwardRef((props, ref) => {
79
71
  };
80
72
  RouteUtils.updateQueryParams(props.routeProps, newParams);
81
73
  }
82
- const entitledProducts = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
83
74
  const renderProductVersionDropdownSelector = (activeSection === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT) &&
84
75
  !props.caseCreateExperience) ||
85
76
  activeSection === AppRouteSections.GET_SUPPORT ||
@@ -91,12 +82,9 @@ const AllProductsSelector = forwardRef((props, ref) => {
91
82
  return (React.createElement(React.Fragment, null,
92
83
  renderProductVersionDropdownSelector && (React.createElement("div", { className: "form-group product-selector-wrapper" },
93
84
  React.createElement("div", { className: "all-product-selector-dropdown" },
94
- React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching })))),
85
+ React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching })))),
95
86
  renderOpenCaseIssue && (React.createElement("div", { className: "case-details-summary" },
96
87
  React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage, isOnGetSupportPage: props.isOnGetSupportPage }))),
97
- React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v6-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
98
- ? 'You are'
99
- : 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
100
88
  showModalButton &&
101
89
  !isEmpty(product) &&
102
90
  !isEmpty(version) &&
@@ -1 +1 @@
1
- {"version":3,"file":"NewProductDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAoBpE,OAAO,KAAkD,MAAM,OAAO,CAAC;AAUvE,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,0BAA0B,GAAI,OAAO,MAAM,sBA2MvD,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"NewProductDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAiBpE,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,0BAA0B,GAAI,OAAO,MAAM,sBA+JvD,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -1,21 +1,15 @@
1
- import { Button, Divider, MenuToggle, Select, SelectGroup, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
1
+ import { Button, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
2
2
  import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
3
3
  import { useSelectKeyboardNavigator } from '@rh-support/components';
4
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
5
4
  import isEmpty from 'lodash/isEmpty';
6
5
  import isEqual from 'lodash/isEqual';
7
- import React, { useContext, useEffect, useRef, useState } from 'react';
8
- import { Trans, useTranslation } from 'react-i18next';
6
+ import React, { useEffect, useRef, useState } from 'react';
7
+ import { useTranslation } from 'react-i18next';
9
8
  import { useCaseSelector } from '../../context/CaseContext';
10
- const isProductSupportedForCustomer = (productName, productResults) => {
11
- const foundItem = productResults.filter((item) => item.name === productName)[0];
12
- return foundItem ? foundItem.supportedForCustomer : false;
13
- };
14
9
  export const NewProductDropdownSelector = (props) => {
15
10
  const { t } = useTranslation();
16
11
  const [isOpen, setIsOpen] = useState(false);
17
12
  const [showValidationLocal, setShowValidationLocal] = useState(props.isNextBtnClickedToShowValidationError);
18
- const [isSelectedProductSupportedForCustomer, setIsSelectedProductSupportedForCustomer] = useState(true);
19
13
  const [filteredProducts, setFilteredProducts] = useState(props.products);
20
14
  const [shouldFilter, setShouldFilter] = useState(false);
21
15
  const textInputRef = useRef();
@@ -23,7 +17,6 @@ export const NewProductDropdownSelector = (props) => {
23
17
  product: state.caseDetails.product,
24
18
  }), isEqual);
25
19
  const [inputValue, setInputValue] = useState('');
26
- const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
27
20
  useEffect(() => {
28
21
  setShowValidationLocal(props.isNextBtnClickedToShowValidationError);
29
22
  }, [props.isNextBtnClickedToShowValidationError]);
@@ -33,22 +26,15 @@ export const NewProductDropdownSelector = (props) => {
33
26
  }
34
27
  // eslint-disable-next-line react-hooks/exhaustive-deps
35
28
  }, [product]);
36
- // Update filtered products whenever input changes
37
29
  useEffect(() => {
38
- const productsToFilter = props.isCaseCreate ? props.products : allProducts.data.productsResult;
39
30
  if (!isEmpty(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim())) {
40
- const filtered = productsToFilter.filter((p) => { var _a; return (_a = p.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(inputValue.toLowerCase()); });
31
+ const filtered = props.products.filter((p) => { var _a; return (_a = p.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(inputValue.toLowerCase()); });
41
32
  setFilteredProducts(filtered);
42
33
  }
43
34
  else {
44
- setFilteredProducts(productsToFilter);
35
+ setFilteredProducts(props.products);
45
36
  }
46
- }, [inputValue, props.products, props.isCaseCreate, allProducts.data.productsResult]);
47
- useEffect(() => {
48
- product &&
49
- props.isOnSummaryPage &&
50
- setIsSelectedProductSupportedForCustomer(isProductSupportedForCustomer(product, allProducts.data.productsResult));
51
- }, [allProducts.data.productsResult, product, props.isOnSummaryPage]);
37
+ }, [inputValue, props.products]);
52
38
  const onToggleClick = () => {
53
39
  var _a;
54
40
  setIsOpen(!isOpen);
@@ -83,14 +69,12 @@ export const NewProductDropdownSelector = (props) => {
83
69
  setIsOpen(false);
84
70
  },
85
71
  });
86
- const createProductGroup = (products, label, type, shouldFilter = false) => {
87
- const productsToShow = shouldFilter ? filteredProducts : products;
88
- return productsToShow.length > 0 ? (React.createElement(React.Fragment, null,
89
- !shouldFilter && (React.createElement(SelectGroup, { label: label, key: type, value: '', className: "product-selector-group", children: '' })),
90
- productsToShow.map((prod, index) => {
91
- var _a;
92
- return (React.createElement(SelectOption, { key: `${type}-${index}`, value: prod, isFocused: focusedItemIndex === index, className: "pf-v6-c-select__menu-wrapper", "data-tracking-id": `${(_a = prod.name) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, '')}-${type}-dropdown`, isSelected: prod.name === product }, prod.name));
93
- }))) : (React.createElement(SelectOption, { key: '', value: '', className: "pf-v6-c-select__menu-wrapper", isDisabled: true }, "No Results Found"));
72
+ const renderProductOptions = () => {
73
+ const productsToShow = shouldFilter ? filteredProducts : props.products;
74
+ return productsToShow.length > 0 ? (React.createElement(React.Fragment, null, productsToShow.map((prod, index) => {
75
+ var _a;
76
+ return (React.createElement(SelectOption, { key: `product-${index}`, value: prod, isFocused: focusedItemIndex === index, className: "pf-v6-c-select__menu-wrapper", "data-tracking-id": `${(_a = prod.name) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, '')}-product-dropdown`, isSelected: prod.name === product }, prod.name));
77
+ }))) : (React.createElement(SelectOption, { key: '', value: '', className: "pf-v6-c-select__menu-wrapper", isDisabled: true }, "No Results Found"));
94
78
  };
95
79
  const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, variant: "typeahead", onClick: onToggleClick, isExpanded: isOpen, isFullWidth: true, isDisabled: props.isLoading, status: isEmpty(inputValue) && showValidationLocal ? 'danger' : undefined },
96
80
  React.createElement(TextInputGroup, { isPlain: true },
@@ -98,16 +82,8 @@ export const NewProductDropdownSelector = (props) => {
98
82
  props.isLoading ? (React.createElement(TextInputGroupUtilities, null,
99
83
  React.createElement(Spinner, { size: "md" }))) : (React.createElement(TextInputGroupUtilities, Object.assign({}, (!inputValue ? { style: { display: 'none' } } : {})),
100
84
  React.createElement(Button, { icon: React.createElement(TimesIcon, { "aria-hidden": true }), variant: "plain", onClick: onClear, "aria-label": "Clear input value" }))))));
101
- const topProducts = allProducts.data.topProducts.filter((p) => p.isEntitledProduct).slice(0, 3);
102
85
  return (React.createElement("div", null,
103
86
  React.createElement(Select, { id: "product-selector", isOpen: isOpen, onSelect: (e, selection) => onSelect(selection), onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, selected: product, shouldFocusFirstItemOnOpen: false, isScrollable: true, "data-tracking-id": "get-support-product-dropdown-selector" },
104
- React.createElement(SelectList, { id: "product-selector-listbox" },
105
- !shouldFilter && createProductGroup(topProducts, t('Top products'), 'topProduct'),
106
- !shouldFilter && React.createElement(Divider, null),
107
- createProductGroup(props.isCaseCreate ? props.products : allProducts.data.productsResult, t('All products'), 'product', shouldFilter))),
108
- !props.isLoading && !isSelectedProductSupportedForCustomer && (React.createElement("div", { className: "pf-v6-u-ml-xs pf-v6-u-mt-sm form-instructions" },
109
- React.createElement(Trans, null, "Red Hat must confirm your subscription status before providing support."),
110
- React.createElement("br", null),
111
- React.createElement(Trans, null, "We'll contact you if we have any questions.")))));
87
+ React.createElement(SelectList, { id: "product-selector-listbox" }, renderProductOptions()))));
112
88
  };
113
89
  export default NewProductDropdownSelector;
@@ -1 +1 @@
1
- {"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;CAClD;AAED,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,sBAmItD,CAAC"}
1
+ {"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,UAAU,MAAM;IACZ,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;CAClD;AAED,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,sBAwGtD,CAAC"}