@rh-support/troubleshoot 2.6.300 → 2.6.302

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 (221) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +28 -40
  3. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  4. package/lib/esm/components/AccountInfo/OwnerSelector.js +52 -14
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +51 -31
  7. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/Case.js +50 -18
  9. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +25 -8
  11. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +57 -34
  13. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts +2 -0
  14. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +3 -3
  16. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +1 -2
  17. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +8 -6
  19. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/CaseOverview/index.js +43 -30
  21. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +76 -30
  23. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +0 -1
  24. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  25. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +3 -3
  26. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +1 -3
  27. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  28. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +3 -4
  29. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  30. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +13 -17
  31. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +19 -43
  33. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  34. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +17 -40
  35. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +3 -0
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -0
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +22 -0
  38. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  39. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +44 -41
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  41. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +8 -7
  42. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  43. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +0 -2
  44. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +38 -18
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +19 -59
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +4 -2
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +110 -148
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +5 -5
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +2 -1
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +15 -0
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +1 -0
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +19 -0
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +17 -0
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -0
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +49 -0
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +6 -2
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +147 -241
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +5 -3
  68. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  69. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +3 -1
  70. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  71. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +35 -3
  72. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  73. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +63 -224
  74. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts +4 -5
  75. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  76. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +18 -5
  77. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  78. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +7 -2
  79. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  80. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +30 -52
  81. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  82. package/lib/esm/components/CaseInformation/CaseGroup.js +68 -46
  83. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  84. package/lib/esm/components/CaseInformation/CaseInformation.js +7 -5
  85. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  86. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
  87. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  88. package/lib/esm/components/CaseInformation/SupportLevel.js +32 -55
  89. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  90. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  91. package/lib/esm/components/CaseManagement/CaseManagement.js +4 -7
  92. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  93. package/lib/esm/components/CaseManagement/Cep.js +4 -7
  94. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  95. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +19 -9
  96. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  97. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +60 -34
  98. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  99. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +34 -40
  100. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  101. package/lib/esm/components/IdeaInformation/IdeaInformation.js +13 -14
  102. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  103. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  104. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  105. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  106. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
  107. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  108. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
  109. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  110. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +30 -50
  111. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  112. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  113. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  114. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -4
  115. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  116. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  117. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  118. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +9 -7
  119. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  120. package/lib/esm/components/Review/Review.js +16 -16
  121. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  122. package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
  123. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  124. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +5 -8
  125. package/lib/esm/components/shared/fileUpload/FileUploader.d.ts.map +1 -1
  126. package/lib/esm/components/shared/fileUpload/FileUploader.js +3 -1
  127. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +3 -1
  128. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
  129. package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +76 -4
  130. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  131. package/lib/esm/components/shared/useIsSectionValid.js +50 -64
  132. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  133. package/lib/esm/components/shared/usePostComment.js +16 -28
  134. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  135. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +120 -24
  136. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  137. package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
  138. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  139. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
  140. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  141. package/lib/esm/graphql/index.d.ts +4 -0
  142. package/lib/esm/graphql/index.d.ts.map +1 -0
  143. package/lib/esm/graphql/index.js +3 -0
  144. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
  145. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
  146. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
  147. package/lib/esm/graphql/mutations/index.d.ts +2 -0
  148. package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
  149. package/lib/esm/graphql/mutations/index.js +1 -0
  150. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
  151. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
  152. package/lib/esm/graphql/queries/getEscalationDetails.js +24 -0
  153. package/lib/esm/graphql/queries/getParentId.d.ts +2 -0
  154. package/lib/esm/graphql/queries/getParentId.d.ts.map +1 -0
  155. package/lib/esm/graphql/queries/getParentId.js +16 -0
  156. package/lib/esm/graphql/queries/index.d.ts +3 -0
  157. package/lib/esm/graphql/queries/index.d.ts.map +1 -0
  158. package/lib/esm/graphql/queries/index.js +2 -0
  159. package/lib/esm/graphql/schemas/escalation.d.ts +84 -0
  160. package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
  161. package/lib/esm/graphql/schemas/escalation.js +1 -0
  162. package/lib/esm/graphql/schemas/index.d.ts +2 -0
  163. package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
  164. package/lib/esm/graphql/schemas/index.js +1 -0
  165. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +4 -0
  166. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +1 -0
  167. package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +12 -0
  168. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +4 -0
  169. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -0
  170. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +55 -0
  171. package/lib/esm/hooks/useCaseComments/index.d.ts +7 -0
  172. package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -0
  173. package/lib/esm/hooks/useCaseComments/index.js +5 -0
  174. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +25 -0
  175. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -0
  176. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +66 -0
  177. package/lib/esm/hooks/useCaseComments/types.d.ts +80 -0
  178. package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -0
  179. package/lib/esm/hooks/useCaseComments/types.js +1 -0
  180. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +16 -0
  181. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -0
  182. package/lib/esm/hooks/useCaseComments/useCaseComments.js +25 -0
  183. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +19 -0
  184. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +1 -0
  185. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +33 -0
  186. package/lib/esm/hooks/useCaseHistory.d.ts +26 -0
  187. package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -0
  188. package/lib/esm/hooks/useCaseHistory.js +98 -0
  189. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  190. package/lib/esm/hooks/useResetCaseCreate.js +18 -11
  191. package/lib/esm/models/caseHistory.d.ts +80 -0
  192. package/lib/esm/models/caseHistory.d.ts.map +1 -0
  193. package/lib/esm/models/caseHistory.js +1 -0
  194. package/lib/esm/reducers/CaseConstNTypes.d.ts +91 -3
  195. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  196. package/lib/esm/reducers/CaseConstNTypes.js +20 -2
  197. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +5 -4
  198. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  199. package/lib/esm/reducers/CaseDetailsPageReducer.js +39 -23
  200. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +3 -5
  201. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  202. package/lib/esm/reducers/CaseDiscussionTabReducer.js +33 -46
  203. package/lib/esm/reducers/CaseHelpers.d.ts +3 -2
  204. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  205. package/lib/esm/reducers/CaseHelpers.js +108 -41
  206. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  207. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  208. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  209. package/lib/esm/reducers/CaseReducer.d.ts +30 -8
  210. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  211. package/lib/esm/reducers/CaseReducer.js +192 -55
  212. package/lib/esm/utils/TimelineUtils.d.ts +41 -0
  213. package/lib/esm/utils/TimelineUtils.d.ts.map +1 -0
  214. package/lib/esm/utils/TimelineUtils.js +134 -0
  215. package/lib/esm/utils/caseHistoryUtils.d.ts +66 -0
  216. package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -0
  217. package/lib/esm/utils/caseHistoryUtils.js +165 -0
  218. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts +1 -2
  219. package/lib/esm/utils/caseOpenshiftClusterIdUtils.d.ts.map +1 -1
  220. package/lib/esm/utils/caseOpenshiftClusterIdUtils.js +4 -4
  221. package/package.json +7 -8
@@ -1,105 +1,82 @@
1
1
  import { Popover, PopoverPosition } from '@patternfly/react-core';
2
2
  import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
3
3
  import { SingleSelectDropdown } from '@rh-support/components';
4
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
5
4
  import { PreviousCaseTypes, showFtsOnCaseViewEditPage, showFtsOnCreateCasePage } from '@rh-support/utils';
6
5
  import isEmpty from 'lodash/isEmpty';
7
6
  import isEqual from 'lodash/isEqual';
8
- import React, { useContext, useEffect, useState } from 'react';
7
+ import React, { useEffect, useState } from 'react';
9
8
  import { Trans, useTranslation } from 'react-i18next';
10
9
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
11
- import { setCaseDetails } from '../../reducers/CaseReducer';
10
+ import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
12
11
  const defaultProps = {
13
12
  id: '',
14
13
  className: '',
15
14
  };
16
15
  function SupportLevel(props) {
17
- const { product, caseNumber, severity, entitlementSla, ownersEntitlements, caseType, openShiftClusterSupportLevel, } = useCaseSelector((state) => ({
18
- product: state.caseDetails.product,
16
+ const { caseNumber, severity, entitlementSla, caseType, productServiceLevel, otherServiceLevels, selectedEntitlementId, } = useCaseSelector((state) => ({
19
17
  caseNumber: state.caseDetails.caseNumber,
20
18
  severity: state.caseDetails.severity,
21
19
  entitlementSla: state.caseDetails.entitlementSla,
22
- ownersEntitlements: state.ownersEntitlements,
23
20
  caseType: state.caseDetails.caseType,
24
- openShiftClusterSupportLevel: state.openShiftClusterSupportLevel,
21
+ productServiceLevel: state.productServiceLevel,
22
+ otherServiceLevels: state.otherServiceLevels,
23
+ selectedEntitlementId: state.selectedEntitlementId,
25
24
  }), isEqual);
26
25
  const caseDispatch = useCaseDispatch();
27
- const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
28
26
  const { t } = useTranslation();
29
27
  const [isSupportLevelInValid, setIsSupportLevelInValid] = useState(false);
30
28
  const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
29
+ const allSlaOptions = [...(productServiceLevel ? [productServiceLevel] : []), ...(otherServiceLevels !== null && otherServiceLevels !== void 0 ? otherServiceLevels : [])].sort((a, b) => b.priority - a.priority);
30
+ const hasMultipleSlas = allSlaOptions.length > 1;
31
31
  const onCaseDetailsChange = (caseDetails) => {
32
32
  setCaseDetails(caseDispatch, caseDetails);
33
33
  };
34
34
  const onEntitlementChange = (selectedOption) => {
35
- const selected = selectedOption.value;
36
- const casePayload = { entitlementSla: selected };
35
+ const entitlementId = selectedOption.value;
36
+ const matchedSla = allSlaOptions.find((sla) => sla.entitlementId === entitlementId);
37
+ const slaLabel = (matchedSla === null || matchedSla === void 0 ? void 0 : matchedSla.serviceLevelLabel) || '';
38
+ const casePayload = { entitlementSla: slaLabel };
37
39
  casePayload.fts = caseNumber
38
- ? showFtsOnCaseViewEditPage(selected, severity)
39
- : showFtsOnCreateCasePage(selected, severity);
40
+ ? showFtsOnCaseViewEditPage(slaLabel, severity)
41
+ : showFtsOnCreateCasePage(slaLabel, severity);
40
42
  casePayload.fts = casePayload.fts && !isIdea;
41
- setIsSupportLevelInValid(isEmpty(selected));
43
+ setIsSupportLevelInValid(isEmpty(entitlementId));
42
44
  onCaseDetailsChange(casePayload);
45
+ setCaseState(caseDispatch, { selectedEntitlementId: entitlementId });
43
46
  };
44
- const getSlaList = () => {
45
- var _a, _b;
46
- if (openShiftClusterSupportLevel)
47
- return [openShiftClusterSupportLevel];
48
- const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
49
- if (entitledProduct && entitledProduct.serviceLevels) {
50
- return entitledProduct.serviceLevels.split(';') || [];
51
- }
52
- else {
53
- return ownersEntitlements.data ? ownersEntitlements.data.map((sla) => sla.slaProcessId) : [];
54
- }
55
- };
56
- const getSelectedSla = () => {
57
- var _a, _b;
58
- if (openShiftClusterSupportLevel)
59
- return openShiftClusterSupportLevel;
60
- const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
61
- // if sla is empty then it means either first time this component is rendered or product has changed.
62
- if (isEmpty(entitlementSla) && entitledProduct && entitledProduct.preferredServiceLevel) {
63
- return entitledProduct.preferredServiceLevel;
64
- }
65
- else {
66
- return isEmpty(entitlementSla) && !isEmpty(ownersEntitlements.data)
67
- ? ownersEntitlements.data[0].slaProcessId
68
- : entitlementSla;
69
- }
70
- };
71
- const selectedSla = getSelectedSla();
47
+ const selectedSla = entitlementSla || (productServiceLevel === null || productServiceLevel === void 0 ? void 0 : productServiceLevel.serviceLevelLabel) || '';
48
+ const currentEntitlementId = selectedEntitlementId || (productServiceLevel === null || productServiceLevel === void 0 ? void 0 : productServiceLevel.entitlementId) || '';
72
49
  useEffect(() => {
73
- if (!selectedSla || entitlementSla)
50
+ if (!productServiceLevel || entitlementSla)
74
51
  return;
75
- if (entitlementSla !== selectedSla) {
76
- onCaseDetailsChange({ entitlementSla: selectedSla });
52
+ if (entitlementSla !== productServiceLevel.serviceLevelLabel) {
53
+ onCaseDetailsChange({ entitlementSla: productServiceLevel.serviceLevelLabel });
54
+ setCaseState(caseDispatch, { selectedEntitlementId: productServiceLevel.entitlementId });
77
55
  }
78
56
  // eslint-disable-next-line react-hooks/exhaustive-deps
79
- }, [selectedSla, entitlementSla]);
80
- // Create selected option for SingleSelectDropdown
57
+ }, [productServiceLevel, entitlementSla]);
81
58
  const getSelectedOption = () => ({
82
- label: selectedSla || '',
83
- value: selectedSla || '',
59
+ label: selectedSla,
60
+ value: currentEntitlementId,
84
61
  });
85
- // Create options array for SingleSelectDropdown
86
- const getDropdownOptions = () => getSlaList().map((sla) => ({
87
- label: sla,
88
- value: sla,
62
+ const getDropdownOptions = () => allSlaOptions.map((sla) => ({
63
+ label: sla.serviceLevelLabel,
64
+ value: sla.entitlementId || sla.serviceLevelLabel,
89
65
  }));
66
+ if (!hasMultipleSlas)
67
+ return null;
90
68
  return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
91
69
  React.createElement("label", { htmlFor: "get-support-supportLevel" },
92
70
  React.createElement(Trans, null, "Support level"),
93
71
  ' ',
94
- !isEmpty(ownersEntitlements.data) && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
72
+ React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
95
73
  React.createElement(Popover, { "aria-label": "Support Level info", position: PopoverPosition.top, bodyContent: React.createElement("p", null,
96
74
  React.createElement(Trans, { i18nKey: "i18ProductionSupportServiceLevelAgreement" },
97
75
  "Learn more about our",
98
76
  ' ',
99
77
  React.createElement("a", { href: "/support/offerings/production/sla", target: "_blank" }, "production support service level agreement"))), closeBtnAriaLabel: "Close" },
100
78
  React.createElement(QuestionCircleIcon, { color: "#5e40be", className: "pf-v6-u-ml-xs icon-size cursor-pointer", "aria-label": "Support Level Info" })),
101
- React.createElement(SingleSelectDropdown, { ariaLabel: t('Select Support Level'), onSelect: onEntitlementChange, selected: getSelectedOption(), options: getDropdownOptions(), isDisabled: ownersEntitlements.isError || isEmpty(ownersEntitlements.data), isInvalid: isSupportLevelInValid, dataTrackingId: "get-support-supportLevel", placeholder: t('Select Support Level') }),
102
- isEmpty(ownersEntitlements.data) && (React.createElement("p", { className: "form-instructions" }, ownersEntitlements.isError ? t('Error loading support levels') : t('No active subscriptions')))));
79
+ React.createElement(SingleSelectDropdown, { ariaLabel: t('Select Support Level'), onSelect: onEntitlementChange, selected: getSelectedOption(), options: getDropdownOptions(), isInvalid: isSupportLevelInValid, dataTrackingId: "get-support-supportLevel", placeholder: t('Select Support Level') })));
103
80
  }
104
81
  SupportLevel.defaultProps = defaultProps;
105
82
  export default SupportLevel;
@@ -53,11 +53,11 @@ export default function CaseLanguageSelector(props) {
53
53
  props.isManageStep,
54
54
  ]);
55
55
  const getLanguageDropdownOptions = map(caseLanguages.data, (language) => ({
56
- label: Constants.languagesMap[language],
56
+ label: Constants.languagesMap[language] || language,
57
57
  value: language,
58
58
  }));
59
59
  const getSelectedLanguageOption = {
60
- label: caseLanguage ? Constants.languagesMap[caseLanguage] : '',
60
+ label: caseLanguage ? Constants.languagesMap[caseLanguage] || caseLanguage : '',
61
61
  value: caseLanguage || '',
62
62
  };
63
63
  return (React.createElement("div", { className: "form-group" },
@@ -1 +1 @@
1
- {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBAiCnD"}
1
+ {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiB1B,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBAsCnD"}
@@ -4,15 +4,15 @@ import { useCaseDispatch } from '../../context/CaseContext';
4
4
  import { setCaseDetails } from '../../reducers/CaseReducer';
5
5
  import CaseGroup from '../CaseInformation/CaseGroup';
6
6
  import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
7
- import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
7
+ // TODO: Re-enable once phone number verification flow is fully supported with GraphQL
8
+ // import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
8
9
  import Fts from '../CaseInformation/Fts';
9
10
  import Severity from '../CaseInformation/Severity';
10
11
  import SupportLevel from '../CaseInformation/SupportLevel';
11
12
  import CaseLanguageSelector from './CaseLanguageSelector';
12
- import { Cep } from './Cep';
13
+ // import { Cep } from './Cep';
13
14
  import OpenReferenceNumber from './OpenReferenceNumber';
14
15
  import { RHAssociatesSelector } from './RHAssociatesSelector';
15
- import CaseContactSelector from './SendNotifications/CaseContactSelector';
16
16
  export default function CaseManagement(props) {
17
17
  const caseDispatch = useCaseDispatch();
18
18
  const onSeverityChange = (payload) => {
@@ -25,15 +25,12 @@ export default function CaseManagement(props) {
25
25
  React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange })),
26
26
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
27
27
  React.createElement(ContactPhoneNumber, null))),
28
- React.createElement(ContactPhoneNumberAlert, null),
29
28
  React.createElement(Fts, { inlineEditable: false }),
30
29
  React.createElement(Grid, { hasGutter: true },
31
30
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
32
31
  React.createElement(CaseLanguageSelector, { isManageStep: true })),
33
32
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
34
33
  React.createElement(CaseGroup, { init: true }))),
35
- React.createElement(CaseContactSelector, null),
36
34
  React.createElement(RHAssociatesSelector, null),
37
- React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
38
- React.createElement(Cep, null)));
35
+ React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true })));
39
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAoB/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,qBA8ThC"}
1
+ {"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAe/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,qBAkThC"}
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { useApolloClient } from '@apollo/client/react';
10
11
  import { Button, Checkbox, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, Popover, PopoverPosition, TextArea, TextInput, ValidatedOptions, } from '@patternfly/react-core';
11
12
  import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
12
13
  import { LoadingIndicator, ToastNotification, useConfirmation } from '@rh-support/components';
@@ -17,10 +18,8 @@ import isEqual from 'lodash/isEqual';
17
18
  import React, { useContext, useEffect, useState } from 'react';
18
19
  import { Trans, useTranslation } from 'react-i18next';
19
20
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
20
- import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
21
- import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../context/CaseDiscussionTabContext';
21
+ import { GET_CASE_COMMENTS } from '../../hooks/useCaseComments';
22
22
  import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
23
- import { updateDiscussionStateComments } from '../../reducers/CaseDiscussionTabReducer';
24
23
  import { checkForCaseStatusToggleOnAttachOrComment, postCepDetails, setCaseDetails, setCaseState, updateCaseDetails, } from '../../reducers/CaseReducer';
25
24
  import { PDFContext } from '../CaseEditView/PDFContainer';
26
25
  export function Cep(props) {
@@ -42,9 +41,7 @@ export function Cep(props) {
42
41
  const ability = useContext(AbilityContext);
43
42
  const canUseCep = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.CEP);
44
43
  const confirm = useConfirmation();
45
- const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
46
- const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
47
- const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
44
+ const client = useApolloClient();
48
45
  const canEditCase = useCanEditCase();
49
46
  const [saveButtonIsClicked, setSaveButtonIsClicked] = useState(false);
50
47
  const { isExportingPDF } = useContext(PDFContext);
@@ -92,7 +89,7 @@ export function Cep(props) {
92
89
  checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status);
93
90
  if (caseDetails.cep) {
94
91
  yield postCepDetails(caseDispatch, caseNumber, cepDetailsLocal);
95
- updateDiscussionStateComments(dispatchDiscussion, caseDispatch, caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
92
+ client.refetchQueries({ include: [GET_CASE_COMMENTS] });
96
93
  }
97
94
  ToastNotification.addSuccessMessage(t(`Consultant Engagement in Progress has been updated successfully`));
98
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuB/D,eAAO,MAAM,oBAAoB,yBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yBAYxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBAmT/C"}
1
+ {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuB/D,eAAO,MAAM,oBAAoB,yBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yBAYxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBA8T/C"}
@@ -90,8 +90,8 @@ export function OpenShiftClusterId(props) {
90
90
  if (isEmpty(product))
91
91
  return;
92
92
  const isClusterVisible = () => __awaiter(this, void 0, void 0, function* () {
93
- var _a, _b;
94
- const hasCluster = yield isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
93
+ var _a;
94
+ const hasCluster = yield isClusterIdEnabledForProduct(product);
95
95
  setShowClusterId(hasCluster);
96
96
  if (!hasCluster) {
97
97
  resetClusterData();
@@ -117,7 +117,7 @@ export function OpenShiftClusterId(props) {
117
117
  setIsClusterIdInValid(false);
118
118
  }
119
119
  }
120
- const majorVersion = (_b = getVersion(version)) === null || _b === void 0 ? void 0 : _b.major;
120
+ const majorVersion = (_a = getVersion(version)) === null || _a === void 0 ? void 0 : _a.major;
121
121
  const isOpenShiftV3 = product === 'OpenShift Container Platform' && majorVersion === '3';
122
122
  setShowV3TextBox(isOpenShiftV3);
123
123
  if (isOpenShiftV3 || noClusterIdReasonExplanation === 'v3-cluster') {
@@ -199,11 +199,19 @@ export function OpenShiftClusterId(props) {
199
199
  fetchClusterRecommendations(clusterRecommendationsDispatch, selectedId, clusterRecommendationsCache);
200
200
  };
201
201
  const clusterIdDropdownFormInstructions = () => {
202
- const errorMessage = isClusterIdInvalid
203
- ? isInvalidErrorMessage()
204
- : isEmpty(openshiftClusterID) && isEmpty(selectedReason)
205
- ? discoverV4ClusterIdLinkError()
206
- : null;
202
+ // TODO: Re-enable empty cluster ID check when cluster ID is made mandatory again
203
+ // const errorMessage = isClusterIdInvalid
204
+ // ? isInvalidErrorMessage()
205
+ // : isEmpty(openshiftClusterID) && isEmpty(selectedReason)
206
+ // ? discoverV4ClusterIdLinkError()
207
+ // : null;
208
+ // TODO: Re-enable empty cluster ID check when cluster ID is made mandatory again
209
+ // const errorMessage = isClusterIdInvalid
210
+ // ? isInvalidErrorMessage()
211
+ // : isEmpty(openshiftClusterID) && isEmpty(selectedReason)
212
+ // ? discoverV4ClusterIdLinkError()
213
+ // : null;
214
+ const errorMessage = isClusterIdInvalid ? isInvalidErrorMessage() : null;
207
215
  const infoMessage = v3Selected ? v3Tov4TransitionLink() : discoverV4ClusterIdLink();
208
216
  return isNextBtnClickedToShowValidationError && errorMessage ? errorMessage : infoMessage;
209
217
  };
@@ -232,7 +240,9 @@ export function OpenShiftClusterId(props) {
232
240
  return null;
233
241
  return (React.createElement("div", { className: `${props.className ? props.className : ''}` },
234
242
  !showV3TextBox && (React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: openshiftDisplayName, openshiftClusterIDState: openshiftClusterID || selectedReason, onClusterIdStateUpdate: onClusterIdStateUpdate, isClusterIdInvalid: isNextBtnClickedToShowValidationError &&
235
- ((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3: product !== 'OpenShift Container Platform' })),
243
+ // TODO: Re-enable empty check when cluster ID is made mandatory again
244
+ // ((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) ||
245
+ isClusterIdInvalid, clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3: product !== 'OpenShift Container Platform' })),
236
246
  noClusterIdReasonExplanation !== 'v3-cluster' && dontKnowSelected && !showV3TextBox && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer })),
237
247
  (v3Selected || showV3TextBox) && (React.createElement(OpenShiftV3Inputbox, { v3ClusterName: v3ClusterName, onReasonInputBoxChanged: v3ClusterNameInputBoxChanged, isInValid: isEmpty(v3ClusterName.trim()) && isNextBtnClickedToShowValidationError, v3Selected: v3Selected }))));
238
248
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CAC3C;AAsBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA+dzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CAC3C;AAsBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAwfzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -36,11 +36,17 @@ const createState = (external_cluster_id, display_name, openshift_version, suppo
36
36
  function OpenshiftDropdownV4(props) {
37
37
  const { t } = useTranslation();
38
38
  const PER_PAGE = 200;
39
+ const LOAD_MORE_VALUE = 'loader';
39
40
  const [clustersRawResponse, setClustersRawResponse] = useState([]);
41
+ const clustersRawResponseRef = useRef(clustersRawResponse);
42
+ clustersRawResponseRef.current = clustersRawResponse;
40
43
  const abortControllerRef = useRef();
44
+ const loadMoreInProgressRef = useRef(false);
41
45
  const [clustersSelectOptions, setClustersSelectOptions] = useState([]);
42
46
  const [isOpen, setIsOpen] = useState(false);
43
47
  const [inputVal, setInputVal] = useState(props.openshiftDisplayName);
48
+ const inputValRef = useRef(inputVal);
49
+ inputValRef.current = inputVal;
44
50
  const [showArchivedClusters, setShowArchivedClusters] = useState(false);
45
51
  const [isFetchingClusters, setIsFetchingClusters] = useState(false);
46
52
  const [totalResultsNo, setTotalResultsNo] = useState(0);
@@ -67,31 +73,41 @@ function OpenshiftDropdownV4(props) {
67
73
  const fetchedClusters = yield fetchAccountClusters();
68
74
  setClustersRawResponse(fetchedClusters.items);
69
75
  setTotalResultsNo(fetchedClusters.total);
70
- setClustersSelectOptions(getClusterOptions(fetchedClusters.items));
76
+ setClustersSelectOptions(getClusterOptions(fetchedClusters.items, fetchedClusters.total));
71
77
  });
72
78
  const onToggle = () => setIsOpen(!isOpen);
73
- const onViewMoreClick = () => __awaiter(this, void 0, void 0, function* () {
74
- setClustersRawResponse((prev) => {
75
- const page = Math.floor(prev.length / PER_PAGE) + 1;
76
- fetchAccountClusters(inputVal, page).then((fetchedClusters) => {
77
- setClustersRawResponse((latest) => {
78
- const clusterResponse = [...latest, ...((fetchedClusters === null || fetchedClusters === void 0 ? void 0 : fetchedClusters.items) || [])];
79
- setTotalResultsNo(fetchedClusters.total);
80
- setClustersSelectOptions(getClusterOptions(clusterResponse));
81
- return clusterResponse;
82
- });
83
- });
84
- return prev;
85
- });
79
+ const onViewMoreClick = (event) => __awaiter(this, void 0, void 0, function* () {
80
+ var _a;
81
+ (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event);
82
+ if (loadMoreInProgressRef.current)
83
+ return;
84
+ loadMoreInProgressRef.current = true;
85
+ try {
86
+ const currentClusters = clustersRawResponseRef.current;
87
+ const page = Math.floor(currentClusters.length / PER_PAGE) + 1;
88
+ const fetchedClusters = yield fetchAccountClusters(inputValRef.current, page);
89
+ const clusterResponse = [...clustersRawResponseRef.current, ...((fetchedClusters === null || fetchedClusters === void 0 ? void 0 : fetchedClusters.items) || [])];
90
+ setClustersRawResponse(clusterResponse);
91
+ setTotalResultsNo(fetchedClusters.total);
92
+ setClustersSelectOptions(getClusterOptions(clusterResponse, fetchedClusters.total));
93
+ setIsOpen(true);
94
+ }
95
+ finally {
96
+ loadMoreInProgressRef.current = false;
97
+ }
86
98
  });
87
99
  const onSelect = (event, selectedCluster) => __awaiter(this, void 0, void 0, function* () {
88
- if (selectedCluster.type === 'checkbox') {
100
+ if (selectedCluster === LOAD_MORE_VALUE) {
101
+ onViewMoreClick(event);
102
+ return;
103
+ }
104
+ if ((selectedCluster === null || selectedCluster === void 0 ? void 0 : selectedCluster.type) === 'checkbox') {
89
105
  setShowArchivedClusters(!showArchivedClusters);
90
106
  props.onClusterClear();
91
107
  setClustersRawResponse([]);
92
108
  setInputVal('');
93
109
  }
94
- else if (selectedCluster !== 'loader') {
110
+ else {
95
111
  props.onClusterIdStateUpdate(selectedCluster);
96
112
  const displayName = selectedCluster.display_name || selectedCluster.toString();
97
113
  setInputVal(displayName);
@@ -101,7 +117,8 @@ function OpenshiftDropdownV4(props) {
101
117
  // Define dropdown options for keyboard navigation
102
118
  const dropdownOptions = useMemo(() => [
103
119
  { type: 'checkbox', key: 'show-hide-archived-clusters', label: t('Show archived clusters') },
104
- { type: 'option', key: 'dont-have-id', label: t("I don't have my Cluster ID") },
120
+ // TODO: Re-enable "I don't have my Cluster ID" option when needed
121
+ // { type: 'option', key: 'dont-have-id', label: t("I don't have my Cluster ID") },
105
122
  ...(props.isV3 ? [{ type: 'option', key: 'v3-cluster', label: t('The case is for a v3 cluster') }] : []),
106
123
  ], [props.isV3, t]);
107
124
  // Use the keyboard navigation hook
@@ -116,10 +133,10 @@ function OpenshiftDropdownV4(props) {
116
133
  setShowArchivedClusters(!showArchivedClusters);
117
134
  props.onClusterClear();
118
135
  setClustersRawResponse([]);
119
- }
120
- else if (item.key === 'dont-have-id') {
121
- props.onClusterIdStateUpdate(createState('dont-have-id', t("I don't have my Cluster ID")));
122
- setIsOpen(false);
136
+ // TODO: Re-enable "I don't have my Cluster ID" keyboard handler when needed
137
+ // } else if (item.key === 'dont-have-id') {
138
+ // props.onClusterIdStateUpdate(createState('dont-have-id', t("I don't have my Cluster ID")));
139
+ // setIsOpen(false);
123
140
  }
124
141
  else if (item.key === 'v3-cluster') {
125
142
  props.onClusterIdStateUpdate(createState('v3-cluster', t('The case is for a v3 cluster')));
@@ -130,7 +147,16 @@ function OpenshiftDropdownV4(props) {
130
147
  const dropdownHeaderOptions = useMemo(() => [
131
148
  React.createElement(SelectOption, { hasCheckbox: true, key: "show-archived-clusters", "aria-label": t('Show archived clusters'), id: "show-archived-clusters", className: "archived-clusters-checkbox", "data-tracking-id": "show-hide-archived-clusters", value: { type: 'checkbox' }, isSelected: showArchivedClusters }, t('Show archived clusters')),
132
149
  React.createElement(Divider, { component: "div", key: 'cluster-id-options-divider-e' }),
133
- 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
+ /* TODO: Re-enable "I don't have my Cluster ID" dropdown option when needed
151
+ <SelectOption
152
+ key={'dont-have-id'}
153
+ value={createState('dont-have-id', t("I don't have my Cluster ID"))}
154
+ data-tracking-id="dont-have-cluster-id"
155
+ isFocused={focusedItemIndex === 1}
156
+ >
157
+ {"I don't have my Cluster ID"}
158
+ </SelectOption>,
159
+ */
134
160
  ...(props.isV3
135
161
  ? [
136
162
  React.createElement(SelectOption, { key: 'v3-cluster', value: createState('v3-cluster', t('The case is for a v3 cluster')), isFocused: focusedItemIndex === 2 }),
@@ -139,7 +165,7 @@ function OpenshiftDropdownV4(props) {
139
165
  ],
140
166
  // eslint-disable-next-line react-hooks/exhaustive-deps
141
167
  [showArchivedClusters, focusedItemIndex]);
142
- const getClusterOptions = (clusters) => {
168
+ const getClusterOptions = (clusters, total = totalResultsNo) => {
143
169
  const clustersResponseGrouped = groupBy(clusters, 'console_url') || [];
144
170
  const domainNames = Object.keys(clustersResponseGrouped) || [];
145
171
  // move clusters with empty console_urls to the end of domains array
@@ -161,11 +187,11 @@ function OpenshiftDropdownV4(props) {
161
187
  clusterOptions.push(React.createElement(Divider, { component: "div", key: index + domain }));
162
188
  });
163
189
  if (isFetchingClusters) {
164
- clusterOptions.push(React.createElement(SelectOption, { isLoading: true, disabled: true },
190
+ clusterOptions.push(React.createElement(SelectOption, { isLoading: true, disabled: true, key: "clusters-loading" },
165
191
  React.createElement(Spinner, { size: "lg" })));
166
192
  }
167
- else if (!isFetchingClusters && clustersRawResponse.length < totalResultsNo) {
168
- clusterOptions.push(React.createElement(SelectOption, { isLoadButton: true, onClick: onViewMoreClick, value: "loader" }, "Display additional results"));
193
+ else if (!isFetchingClusters && clusters.length < total) {
194
+ clusterOptions.push(React.createElement(SelectOption, { isLoadButton: true, key: "display-additional-results", onClick: onViewMoreClick, value: LOAD_MORE_VALUE }, "Display additional results"));
169
195
  }
170
196
  return [
171
197
  ...dropdownHeaderOptions,
@@ -208,17 +234,14 @@ function OpenshiftDropdownV4(props) {
208
234
  }
209
235
  else {
210
236
  if (abortControllerRef.current !== undefined) {
211
- // Cancel the previous request
212
237
  abortControllerRef.current.abort();
213
238
  }
214
- // recreate a new AbortController for each call
215
239
  let controller = new AbortController();
216
240
  abortControllerRef.current = controller;
217
241
  const clusterStatus = ` AND status not in ('Deprovisioned'${!showArchivedClusters ? ",'Archived'" : ''})`;
218
242
  const searchPhrase = search
219
243
  ? ` AND (external_cluster_id ILIKE '%${search}%' OR display_name ILIKE '%${search}%' OR console_url ILIKE '%${search}%')`
220
244
  : '';
221
- // query language: https://github.com/yaacov/tree-search-language
222
245
  clustersResponse = yield cloud.getAccountClustersSubscription({
223
246
  order: 'display_name asc',
224
247
  page,
@@ -249,7 +272,6 @@ function OpenshiftDropdownV4(props) {
249
272
  };
250
273
  }
251
274
  catch (e) {
252
- // silently fails
253
275
  setIsFetchingClusters(false);
254
276
  return { items: [], totalResult: 0, page: 1, total: 0 };
255
277
  }
@@ -297,7 +319,7 @@ function OpenshiftDropdownV4(props) {
297
319
  if (!isUnmounted) {
298
320
  setClustersRawResponse(fetchedClusters.items);
299
321
  setTotalResultsNo(fetchedClusters.total);
300
- setClustersSelectOptions(getClusterOptions(fetchedClusters.items) || []);
322
+ setClustersSelectOptions(getClusterOptions(fetchedClusters.items, fetchedClusters.total) || []);
301
323
  }
302
324
  });
303
325
  fetchClusters();
@@ -315,7 +337,7 @@ function OpenshiftDropdownV4(props) {
315
337
  const fetchedClusters = yield fetchAccountClusters(value);
316
338
  setClustersRawResponse(fetchedClusters.items);
317
339
  setTotalResultsNo(fetchedClusters.total);
318
- setClustersSelectOptions(getClusterOptions(fetchedClusters.items));
340
+ setClustersSelectOptions(getClusterOptions(fetchedClusters.items, fetchedClusters.total));
319
341
  }), 500);
320
342
  const getSelectedItem = () => {
321
343
  if (!isEmpty(inputVal)) {
@@ -336,10 +358,14 @@ function OpenshiftDropdownV4(props) {
336
358
  React.createElement("div", { className: `${props.className} form-group` },
337
359
  React.createElement("label", { htmlFor: "case-details-cluster-nickname-selector" },
338
360
  React.createElement(Trans, null, "OpenShift Cluster ID"),
339
- React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*"),
340
361
  !isExportingPDF ? React.createElement(CaseOpenShiftPopover, null) : ''),
341
362
  React.createElement("span", { id: titleId, hidden: true }, "Select a state"),
342
- React.createElement(Select, { id: "openshift-cluster-selector", isOpen: isOpen, selected: getSelectedItem(), onSelect: onSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, shouldFocusFirstItemOnOpen: true, isScrollable: true, "aria-invalid": props.isClusterIdInvalid, "aria-describedby": "clusterID-validate-helper", "data-tracking-id": "openshift-cluster-id", className: "openshift-cluster-id" },
363
+ React.createElement(Select, { id: "openshift-cluster-selector", isOpen: isOpen, selected: getSelectedItem(), onSelect: onSelect, onOpenChange: (nextOpen) => {
364
+ if (!nextOpen && loadMoreInProgressRef.current) {
365
+ return;
366
+ }
367
+ setIsOpen(nextOpen);
368
+ }, toggle: toggle, shouldFocusFirstItemOnOpen: true, isScrollable: true, "aria-invalid": props.isClusterIdInvalid, "aria-describedby": "clusterID-validate-helper", "data-tracking-id": "openshift-cluster-id", className: "openshift-cluster-id" },
343
369
  React.createElement(SelectList, { id: "openshift-cluster-selector-listbox" }, clustersSelectOptions)),
344
370
  React.createElement("div", { id: "clusterID-validate-helper", className: `form-instructions ${props.isClusterIdInvalid ? 'form-invalid' : ''}` }, props.clusterIdDropdownFormInstructions))));
345
371
  }
@@ -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":"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,sBAqJtC"}