@rh-support/troubleshoot 2.7.1 → 2.32.2-prodBackup

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 (219) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.js +4 -4
  2. package/lib/esm/components/AccountInfo/ManagedAccountsDropdown.js +1 -1
  3. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +38 -33
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +70 -58
  7. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/Case.js +50 -14
  9. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +45 -30
  11. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +1 -1
  12. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +7 -16
  14. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +1 -1
  15. package/lib/esm/components/CaseEditView/CaseOverview/DateTime.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/CaseOverview/DateTime.js +1 -1
  17. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/CaseOverview/index.js +10 -9
  19. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +28 -23
  21. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
  23. package/lib/esm/components/CaseEditView/CaseSolutions/HandpicketItem.js +3 -3
  24. package/lib/esm/components/CaseEditView/CaseSubscriptionAbuseAlert.js +1 -1
  25. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +51 -35
  27. package/lib/esm/components/CaseEditView/PDFContainer.js +19 -15
  28. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts.map +1 -1
  29. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.js +33 -16
  30. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  31. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +13 -16
  32. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  33. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +50 -42
  34. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.d.ts.map +1 -1
  35. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.js +33 -16
  36. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  37. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +53 -48
  38. package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.d.ts.map +1 -1
  39. package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.js +3 -3
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +2 -2
  41. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.d.ts.map +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +7 -7
  43. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover.js +1 -1
  44. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftV3Popover.js +1 -1
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +1 -1
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.d.ts.map +1 -1
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +5 -8
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +3 -3
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +2 -2
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/SFDCUrl.d.ts.map +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/SFDCUrl.js +3 -4
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +2 -2
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.d.ts +1 -2
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.d.ts.map +1 -1
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +2 -3
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +2 -2
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseChat.js +1 -1
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
  61. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +19 -2
  62. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +2 -2
  63. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseExternalTrackerUpdate.js +1 -1
  64. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  65. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +2 -3
  66. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  67. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +6 -6
  68. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  69. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +26 -18
  70. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +27 -4
  71. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  72. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +5 -8
  73. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  74. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +5 -4
  75. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  76. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +4 -6
  77. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.d.ts.map +1 -1
  78. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.js +4 -6
  79. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +1 -1
  80. package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.d.ts.map +1 -1
  81. package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.js +2 -3
  82. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  83. package/lib/esm/components/CaseInformation/CaseGroup.js +1 -2
  84. package/lib/esm/components/CaseInformation/CaseInformation.js +3 -3
  85. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.d.ts.map +1 -1
  86. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +1 -1
  87. package/lib/esm/components/CaseInformation/Description.js +4 -4
  88. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  89. package/lib/esm/components/CaseInformation/Fts.js +8 -8
  90. package/lib/esm/components/CaseInformation/OpenCaseIssue.js +2 -2
  91. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  92. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  93. package/lib/esm/components/CaseInformation/SupportLevel.js +16 -10
  94. package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
  95. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +14 -11
  96. package/lib/esm/components/CaseManagement/CaseManagement.js +4 -4
  97. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  98. package/lib/esm/components/CaseManagement/Cep.js +44 -41
  99. package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.d.ts.map +1 -1
  100. package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.js +50 -42
  101. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  102. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +39 -63
  103. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +1 -1
  104. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +0 -3
  105. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  106. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +80 -46
  107. package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
  108. package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +8 -6
  109. package/lib/esm/components/CaseManagement/SendNotifications/AddContactToGroupModal.d.ts.map +1 -1
  110. package/lib/esm/components/CaseManagement/SendNotifications/AddContactToGroupModal.js +8 -8
  111. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.d.ts.map +1 -1
  112. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.js +19 -21
  113. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  114. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +11 -8
  115. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  116. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +55 -21
  117. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  118. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +12 -27
  119. package/lib/esm/components/ConfirmationModals/PreferredSecureSupportModal.d.ts.map +1 -1
  120. package/lib/esm/components/ConfirmationModals/PreferredSecureSupportModal.js +1 -1
  121. package/lib/esm/components/Cve/CveItem.d.ts.map +1 -1
  122. package/lib/esm/components/Cve/CveItem.js +10 -11
  123. package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
  124. package/lib/esm/components/Cve/CveModal.js +11 -11
  125. package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -1
  126. package/lib/esm/components/Cve/CvePanel.js +3 -3
  127. package/lib/esm/components/Cve/CveSidebar.js +2 -2
  128. package/lib/esm/components/IdeaInformation/IdeaInformation.js +7 -7
  129. package/lib/esm/components/ImproveCase/KtQuestions.js +6 -6
  130. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  131. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +6 -13
  132. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  133. package/lib/esm/components/ProductSelector/AllProductsSelector.js +12 -8
  134. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -1
  135. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  136. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +83 -47
  137. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  138. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +14 -10
  139. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -1
  140. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +4 -4
  141. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  142. package/lib/esm/components/Recommendations/AsideResults.js +6 -4
  143. package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +1 -1
  144. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -1
  145. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
  146. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +10 -11
  147. package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.d.ts.map +1 -1
  148. package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.js +6 -4
  149. package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +7 -7
  150. package/lib/esm/components/Recommendations/InsightsResults.js +2 -2
  151. package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
  152. package/lib/esm/components/Recommendations/InsightsRuleInfo.js +23 -16
  153. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.d.ts.map +1 -1
  154. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.js +7 -7
  155. package/lib/esm/components/Recommendations/RecommendationInfoBox.d.ts.map +1 -1
  156. package/lib/esm/components/Recommendations/RecommendationInfoBox.js +7 -7
  157. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  158. package/lib/esm/components/Recommendations/Recommendations.js +23 -20
  159. package/lib/esm/components/Recommendations/RecommendationsLoader.js +1 -1
  160. package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
  161. package/lib/esm/components/Recommendations/RulesModal.js +10 -12
  162. package/lib/esm/components/Recommendations/WatsonxAiIcon.d.ts.map +1 -1
  163. package/lib/esm/components/Recommendations/WatsonxAiIcon.js +9 -10
  164. package/lib/esm/components/RemoteRider/RemoteRiderBanner.js +1 -1
  165. package/lib/esm/components/Review/Review.js +4 -4
  166. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.d.ts.map +1 -1
  167. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +7 -5
  168. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
  169. package/lib/esm/components/SessionRestore/SessionRestoreCard.js +1 -1
  170. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  171. package/lib/esm/components/SubmitCase/SubmitCase.js +21 -21
  172. package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
  173. package/lib/esm/components/Suggestions/Suggestions.js +19 -14
  174. package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
  175. package/lib/esm/components/Suggestions/TopContent.js +16 -16
  176. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  177. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +13 -14
  178. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  179. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +20 -16
  180. package/lib/esm/components/shared/Rule.js +6 -6
  181. package/lib/esm/components/shared/fileUpload/FileLister.js +6 -6
  182. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  183. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +7 -6
  184. package/lib/esm/components/shared/fileUpload/common/FileUploaderInfoIcon.js +1 -1
  185. package/lib/esm/components/shared/fileUpload/css/fileSelector.css +2 -0
  186. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.js +1 -1
  187. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts.map +1 -1
  188. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +4 -4
  189. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelectorImage.js +2 -2
  190. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts +16 -6
  191. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts.map +1 -1
  192. package/lib/esm/components/shared/input/ContactSelectorInternal.js +133 -23
  193. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  194. package/lib/esm/components/shared/useIsSectionValid.js +60 -4
  195. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  196. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +8 -2
  197. package/lib/esm/components/wizardLayout/MainSection.js +2 -2
  198. package/lib/esm/components/wizardLayout/NewFeatureModal.d.ts.map +1 -1
  199. package/lib/esm/components/wizardLayout/NewFeatureModal.js +6 -6
  200. package/lib/esm/components/wizardLayout/WizardAside.js +3 -3
  201. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  202. package/lib/esm/components/wizardLayout/WizardMain.js +62 -19
  203. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +2 -2
  204. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  205. package/lib/esm/components/wizardLayout/WizardNavigation.js +21 -22
  206. package/lib/esm/css/app.css +18 -17
  207. package/lib/esm/css/case.css +62 -22
  208. package/lib/esm/css/results.css +2 -2
  209. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  210. package/lib/esm/hooks/useWizard.js +1 -3
  211. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  212. package/lib/esm/reducers/CaseReducer.js +2 -2
  213. package/lib/esm/reducers/RouteConstNTypes.d.ts +1 -2
  214. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  215. package/lib/esm/reducers/RouteConstNTypes.js +2 -0
  216. package/lib/esm/reducers/RulesReducer.d.ts.map +1 -1
  217. package/lib/esm/scss/_main.scss +251 -94
  218. package/lib/esm/scss/_pf-overrides.scss +186 -149
  219. package/package.json +11 -11
@@ -1,94 +1,65 @@
1
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
1
+ import { TextInputGroup, TextInputGroupMain } from '@patternfly/react-core';
2
2
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
3
- import { LoadingIndicator } from '@rh-support/components';
3
+ import { LoadingIndicator, SingleSelectDropdown } from '@rh-support/components';
4
4
  import { fetchNoClusterIdReasonsMetadata, GlobalMetadataStateContext, useGlobalDispatchContext, } from '@rh-support/react-context';
5
5
  import { haventLoadedMetadata } from '@rh-support/utils';
6
6
  import filter from 'lodash/filter';
7
- import React, { useContext, useEffect, useRef, useState } from 'react';
7
+ import map from 'lodash/map';
8
+ import React, { useContext, useEffect, useState } from 'react';
8
9
  import { Trans, useTranslation } from 'react-i18next';
9
10
  import { PDFContext } from '../CaseEditView/PDFContainer';
10
- const createState = (display_value, display_name) => {
11
- return {
12
- display_name,
13
- display_value,
14
- toString: () => display_name || '',
15
- compareTo: function (value) {
16
- const displayName = this.toString().toLowerCase();
17
- const val = (value || '').toString().toLowerCase();
18
- return displayName.includes(val);
19
- },
20
- };
21
- };
22
11
  const NoClusterIDReasonSelector = (props) => {
23
12
  const { t } = useTranslation();
24
- const [isOpen, setIsOpen] = useState(false);
25
- const [validated, setValidated] = useState('default');
26
- const [inputVal, setInputVal] = useState('');
27
13
  const [notRegistered, setNotRegistered] = useState(false);
14
+ const [inputValue, setInputValue] = useState(props.noClusterIdReasonExplanation || '');
28
15
  const globalDispatch = useGlobalDispatchContext();
29
16
  const { globalMetadataState: { caseNoClusterIdReasons }, } = useContext(GlobalMetadataStateContext);
30
17
  const { isExportingPDF } = useContext(PDFContext);
31
- const onToggle = (isOpen) => {
32
- setIsOpen(isOpen);
33
- };
34
18
  const caseNoClusterIdReasonsList = props.isCustomer
35
19
  ? filter(caseNoClusterIdReasons.data, (item) => item !==
36
20
  'I am opening a case on behalf of the customer and cannot provide their Cluster ID at this time')
37
21
  : caseNoClusterIdReasons.data;
38
- const selectRef = useRef(undefined);
39
- const onSelect = (event, selection) => {
22
+ const clearSelection = () => {
23
+ setNotRegistered(false);
24
+ setInputValue('');
25
+ props.onReasonInputBoxChanged('');
26
+ props.onReasonChange('');
27
+ };
28
+ const handleReasonChange = (option) => {
40
29
  clearSelection();
41
- const selected = selection.display_value;
30
+ const selected = option.value;
42
31
  props.onReasonChange(selected);
43
- if (selected === 'Other') {
44
- window.setTimeout(() => {
45
- var _a;
46
- (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.inputRef.current.focus();
47
- }, 100);
48
- }
49
32
  if (selected === 'My cluster is disconnected and / or has not been registered') {
50
33
  setNotRegistered(true);
51
34
  }
52
35
  };
53
- const clearSelection = () => {
54
- setIsOpen(false);
55
- setNotRegistered(false);
56
- setInputVal('');
57
- props.onReasonInputBoxChanged('');
58
- props.onReasonChange('');
36
+ const handleInputChange = (_event, value) => {
37
+ setInputValue(value);
38
+ props.onReasonInputBoxChanged(value);
59
39
  };
60
- const getSelectedItem = () => {
40
+ const getDropdownOptions = () => {
41
+ return map(caseNoClusterIdReasonsList || [], (option) => ({
42
+ label: t(option),
43
+ value: option,
44
+ }));
45
+ };
46
+ const getSelectedOption = () => {
61
47
  if (props.noClusterIdReason) {
62
- if (props.noClusterIdReason === 'Other' || props.noClusterIdReasonExplanation) {
63
- return createState(inputVal || props.noClusterIdReasonExplanation, inputVal || props.noClusterIdReasonExplanation);
64
- }
65
- else {
66
- return createState(props.noClusterIdReason, t(props.noClusterIdReason));
67
- }
68
- }
69
- else if (props.noClusterIdReasonExplanation) {
70
- return createState(props.noClusterIdReasonExplanation, props.noClusterIdReasonExplanation);
48
+ return {
49
+ label: t(props.noClusterIdReason),
50
+ value: props.noClusterIdReason,
51
+ };
71
52
  }
72
- };
73
- const onTypeaheadInputChanged = (input) => {
74
- setIsOpen(false);
75
- setInputVal(input);
76
- props.onReasonInputBoxChanged(input);
53
+ return {
54
+ label: '',
55
+ value: '',
56
+ };
77
57
  };
78
58
  useEffect(() => {
79
59
  if (haventLoadedMetadata(caseNoClusterIdReasons)) {
80
60
  fetchNoClusterIdReasonsMetadata(globalDispatch);
81
61
  }
82
- // eslint-disable-next-line react-hooks/exhaustive-deps
83
- }, [caseNoClusterIdReasons]);
84
- useEffect(() => {
85
- if (props.isInValid) {
86
- setValidated('error');
87
- }
88
- else {
89
- setValidated('default');
90
- }
91
- }, [props.isInValid]);
62
+ }, [caseNoClusterIdReasons, globalDispatch]);
92
63
  const titleId = 'Reason-name-select';
93
64
  const registerMyClusterID = () => (React.createElement("a", { className: `show-target ${isExportingPDF ? 'hide-in-pdf' : ''}`, href: "https://console.redhat.com/openshift/register ", target: "_blank", rel: "noopener noreferrer" },
94
65
  React.createElement(Trans, null, "Register my Cluster ID")));
@@ -98,11 +69,16 @@ const NoClusterIDReasonSelector = (props) => {
98
69
  React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true },
99
70
  ' ',
100
71
  "*")),
101
- React.createElement(Select, { variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Select an option or briefly describe your reason'), onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, selections: getSelectedItem(), isOpen: isOpen, placeholderText: t('Select an option or briefly describe your reason'), noValidate: props.isInValid, "aria-labelledby": titleId, "aria-invalid": props.isInValid, "aria-describedby": "validate-reason-helper", validated: validated, className: `${props.isInValid ? ' form-invalid' : ''}`, isDisabled: caseNoClusterIdReasons.isFetching || props.isDisabled, required: true, onFilter: () => null, ref: selectRef, onTypeaheadInputChanged: onTypeaheadInputChanged, "data-tracking-id": "no-openshift-cluster-id-reason" }, (caseNoClusterIdReasonsList || []).map((option, index) => (React.createElement(SelectOption, { key: index, value: createState(option, t(option)) })))),
72
+ React.createElement("div", { className: "no-cluster-id-reason-container" },
73
+ React.createElement("div", { className: props.noClusterIdReason === 'Other' ? 'd-none' : '' },
74
+ React.createElement(SingleSelectDropdown, { placeholder: t('Select an option or briefly describe your reason'), dataTrackingId: "no-openshift-cluster-id-reason", options: getDropdownOptions(), selected: getSelectedOption(), isDisabled: caseNoClusterIdReasons.isFetching || props.isDisabled, isLoading: caseNoClusterIdReasons.isFetching, isInvalid: props.isInValid, onSelect: handleReasonChange, "aria-labelledby": titleId, "aria-invalid": props.isInValid, "aria-describedby": "validate-reason-helper" })),
75
+ props.noClusterIdReason === 'Other' && (React.createElement("div", { className: "text-input-wrapper" },
76
+ React.createElement(TextInputGroup, null,
77
+ React.createElement(TextInputGroupMain, { value: inputValue, onChange: handleInputChange, placeholder: t('Briefly describe your reason'), "aria-label": t('Other reason description') }))))),
102
78
  React.createElement(LoadingIndicator, { show: caseNoClusterIdReasons.isFetching, size: "xs" }),
103
79
  React.createElement("p", { id: "validate-reason-helper", className: `form-instructions ${props.isInValid ? 'form-invalid' : ''}` },
104
80
  React.createElement(React.Fragment, null,
105
- props.isInValid && React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v5-u-mr-sm" }),
81
+ props.isInValid && React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v6-u-mr-sm" }),
106
82
  ' ',
107
83
  notRegistered ? (registerMyClusterID()) : (React.createElement(Trans, null, "Describing your reason can help us better understand and support your issue."))))));
108
84
  };
@@ -29,7 +29,7 @@ export const v3Tov4TransitionLink = () => (React.createElement("a", { className:
29
29
  React.createElement(Trans, null, "How to transition from v3 to v4?")));
30
30
  export const discoverV4ClusterIdLink = () => (React.createElement("a", { className: "show-target", href: "/solutions/4505861", target: "_blank", rel: "noopener noreferrer" }, "How do I determine my OpenShift 4.x Cluster ID?"));
31
31
  export const discoverV4ClusterIdLinkError = () => (React.createElement(React.Fragment, null,
32
- React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v5-u-mr-sm" }),
32
+ React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v6-u-mr-sm" }),
33
33
  React.createElement(Trans, { i18nKey: 'v4ClusterRequiredField' },
34
34
  "Cluster ID is required.",
35
35
  React.createElement("div", null,
@@ -13,8 +13,5 @@ interface IProps extends IDClassNameProps {
13
13
  openshiftDisplayName?: string;
14
14
  }
15
15
  declare function OpenshiftDropdownV4(props: IProps): React.JSX.Element;
16
- declare namespace OpenshiftDropdownV4 {
17
- var defaultProps: {};
18
- }
19
16
  export { OpenshiftDropdownV4 };
20
17
  //# sourceMappingURL=OpenshiftDropdownV4.d.ts.map
@@ -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;AAI5E,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAIjF,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;CACjC;AAuBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAsXzC;kBAtXQ,mBAAmB;;;AAyX5B,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;CACjC;AAgBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAmdzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -8,9 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { cloud } from '@cee-eng/hydrajs';
11
- import { Checkbox, Divider } from '@patternfly/react-core';
12
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
13
- import { useLRUCache } from '@rh-support/components';
11
+ import { Button, Divider, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
12
+ import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
13
+ import { useLRUCache, useSelectKeyboardNavigator } from '@rh-support/components';
14
14
  import debounce from 'lodash/debounce';
15
15
  import groupBy from 'lodash/groupBy';
16
16
  import isEmpty from 'lodash/isEmpty';
@@ -19,12 +19,6 @@ import { Trans, useTranslation } from 'react-i18next';
19
19
  import { getDisplayNameForCluster } from '../../utils/caseOpenshiftClusterIdUtils';
20
20
  import { PDFContext } from '../CaseEditView/PDFContainer';
21
21
  import CaseOpenShiftPopover from '../CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover';
22
- const defaultProps = {
23
- className: '',
24
- id: '',
25
- isDisabled: false,
26
- openshiftDisplayName: '',
27
- };
28
22
  const createState = (external_cluster_id, display_name, openshift_version) => {
29
23
  return {
30
24
  display_name,
@@ -45,12 +39,12 @@ function OpenshiftDropdownV4(props) {
45
39
  const abortControllerRef = useRef();
46
40
  const [clustersSelectOptions, setClustersSelectOptions] = useState([]);
47
41
  const [isOpen, setIsOpen] = useState(false);
48
- const [validated, setValidated] = useState('default');
49
42
  const [inputVal, setInputVal] = useState('');
50
43
  const [showArchivedClusters, setShowArchivedClusters] = useState(false);
51
44
  const [isFetchingClusters, setIsFetchingClusters] = useState(false);
52
45
  const [totalResultsNo, setTotalResultsNo] = useState(0);
53
46
  const { getFromCache, setInCache } = useLRUCache(50);
47
+ const textInputRef = useRef();
54
48
  const { isExportingPDF } = useContext(PDFContext);
55
49
  // gets a cluster id and returns display name
56
50
  const getDisplayName = (id, noClusterIdReasonExplanation, display_name) => {
@@ -74,7 +68,7 @@ function OpenshiftDropdownV4(props) {
74
68
  setTotalResultsNo(fetchedClusters.total);
75
69
  setClustersSelectOptions(getClusterOptions(fetchedClusters.items));
76
70
  });
77
- const onToggle = (isOpen) => setIsOpen(isOpen);
71
+ const onToggle = () => setIsOpen(!isOpen);
78
72
  const onViewMoreClick = () => __awaiter(this, void 0, void 0, function* () {
79
73
  const page = Math.floor(clustersRawResponse.length / PER_PAGE) + 1;
80
74
  const fetchedClusters = yield fetchAccountClusters(inputVal, page);
@@ -84,32 +78,60 @@ function OpenshiftDropdownV4(props) {
84
78
  setClustersSelectOptions(getClusterOptions(clusterResponse));
85
79
  });
86
80
  const onSelect = (event, selectedCluster) => __awaiter(this, void 0, void 0, function* () {
87
- setInputVal('');
88
- if (event.target.tagName !== 'BUTTON') {
89
- // checkbox is clicked
81
+ if (selectedCluster.type === 'checkbox') {
90
82
  setShowArchivedClusters(!showArchivedClusters);
91
- // reset
92
83
  props.onClusterClear();
93
84
  setClustersRawResponse([]);
85
+ setInputVal('');
94
86
  }
95
- else {
87
+ else if (selectedCluster !== 'loader') {
96
88
  props.onClusterIdStateUpdate(selectedCluster);
89
+ const displayName = selectedCluster.display_name || selectedCluster.toString();
90
+ setInputVal(displayName);
97
91
  setIsOpen(false);
98
92
  }
99
93
  });
94
+ // Define dropdown options for keyboard navigation
95
+ const dropdownOptions = useMemo(() => [
96
+ { type: 'checkbox', key: 'show-hide-archived-clusters', label: t('Show archived clusters') },
97
+ { type: 'option', key: 'dont-have-id', label: t("I don't have my Cluster ID") },
98
+ ...(props.isV3 ? [{ type: 'option', key: 'v3-cluster', label: t('The case is for a v3 cluster') }] : []),
99
+ ], [props.isV3, t]);
100
+ // Use the keyboard navigation hook
101
+ const { focusedItemIndex, onInputKeyDown } = useSelectKeyboardNavigator({
102
+ list: dropdownOptions,
103
+ isOpen,
104
+ resetIndexOnClose: true,
105
+ isDisabled: props.isDisabled,
106
+ setIsOpen,
107
+ onSelect: (item) => {
108
+ if (item.type === 'checkbox') {
109
+ setShowArchivedClusters(!showArchivedClusters);
110
+ props.onClusterClear();
111
+ setClustersRawResponse([]);
112
+ }
113
+ else if (item.key === 'dont-have-id') {
114
+ props.onClusterIdStateUpdate(createState('dont-have-id', t("I don't have my Cluster ID")));
115
+ setIsOpen(false);
116
+ }
117
+ else if (item.key === 'v3-cluster') {
118
+ props.onClusterIdStateUpdate(createState('v3-cluster', t('The case is for a v3 cluster')));
119
+ setIsOpen(false);
120
+ }
121
+ },
122
+ });
100
123
  const dropdownHeaderOptions = useMemo(() => [
101
- React.createElement(SelectOption, { key: 'show-hide-archived-clusters', inputId: "check-box" },
102
- React.createElement(Checkbox, { label: t('Show archived clusters'), key: "show-archived-clusters", "aria-label": t('Show archived clusters'), id: "show-archived-clusters", "data-tracking-id": "show-hide-archived-clusters", isChecked: showArchivedClusters, className: "archived-clusters-checkbox" })),
124
+ 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')),
103
125
  React.createElement(Divider, { component: "div", key: 'cluster-id-options-divider-e' }),
104
- 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" }),
126
+ 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"),
105
127
  ...(props.isV3
106
128
  ? [
107
- React.createElement(SelectOption, { key: 'v3-cluster', value: createState('v3-cluster', t('The case is for a v3 cluster')) }),
129
+ React.createElement(SelectOption, { key: 'v3-cluster', value: createState('v3-cluster', t('The case is for a v3 cluster')), isFocused: focusedItemIndex === 2 }),
108
130
  ]
109
131
  : []),
110
132
  ],
111
133
  // eslint-disable-next-line react-hooks/exhaustive-deps
112
- [showArchivedClusters]);
134
+ [showArchivedClusters, focusedItemIndex]);
113
135
  const getClusterOptions = (clusters) => {
114
136
  const clustersResponseGrouped = groupBy(clusters, 'console_url') || [];
115
137
  const domainNames = Object.keys(clustersResponseGrouped) || [];
@@ -124,13 +146,20 @@ function OpenshiftDropdownV4(props) {
124
146
  const clusterOptions = [];
125
147
  domainNames.forEach((domain, index) => {
126
148
  domain !== '' &&
127
- clusterOptions.push(React.createElement(SelectOption, { isDisabled: true, className: "pf-v5-u-font-weight-bold pf-v5-u-color-400", value: createState(domain, domain), key: domain + index }));
149
+ clusterOptions.push(React.createElement(SelectOption, { isDisabled: true, className: "pf-v6-u-font-weight-bold pf-v6-u-color-400", value: createState(domain, domain), key: domain + index }, domain));
128
150
  clustersResponseGrouped[domain] &&
129
151
  clustersResponseGrouped[domain].forEach((cluster, i) => {
130
- clusterOptions.push(React.createElement(SelectOption, { key: cluster.external_cluster_id, value: createState(cluster.external_cluster_id, getDisplayNameForCluster(cluster) || cluster.external_cluster_id, cluster.openshift_version) }));
152
+ clusterOptions.push(React.createElement(SelectOption, { key: cluster.external_cluster_id, value: createState(cluster.external_cluster_id, getDisplayNameForCluster(cluster) || cluster.external_cluster_id, cluster.openshift_version) }, getDisplayNameForCluster(cluster) || cluster.external_cluster_id));
131
153
  });
132
154
  clusterOptions.push(React.createElement(Divider, { component: "div", key: index + domain }));
133
155
  });
156
+ if (isFetchingClusters) {
157
+ clusterOptions.push(React.createElement(SelectOption, { isLoading: true, disabled: true },
158
+ React.createElement(Spinner, { size: "lg" })));
159
+ }
160
+ else if (!isFetchingClusters && clustersRawResponse.length < totalResultsNo) {
161
+ clusterOptions.push(React.createElement(SelectOption, { isLoadButton: true, onClick: onViewMoreClick, value: "loader" }, "Display additional results"));
162
+ }
134
163
  return [
135
164
  ...dropdownHeaderOptions,
136
165
  ...(clusterOptions.length !== 0 ? [React.createElement(Divider, { component: "div", key: 'cluster-id-options-divider' })] : []),
@@ -232,6 +261,18 @@ function OpenshiftDropdownV4(props) {
232
261
  // no dependency here as we want to run this once on load
233
262
  // eslint-disable-next-line react-hooks/exhaustive-deps
234
263
  }, []);
264
+ useEffect(() => {
265
+ if (!isEmpty(props.openshiftClusterIDState)) {
266
+ const displayName = getDisplayName(props.openshiftClusterIDState, props.noClusterIdReasonExplanation || '', props.openshiftDisplayName || props.openshiftClusterIDState);
267
+ if (isEmpty(inputVal) || inputVal !== displayName) {
268
+ setInputVal(displayName);
269
+ }
270
+ }
271
+ else if (!isEmpty(inputVal)) {
272
+ setInputVal('');
273
+ }
274
+ // eslint-disable-next-line react-hooks/exhaustive-deps
275
+ }, [props.openshiftClusterIDState, props.openshiftDisplayName, props.noClusterIdReasonExplanation]);
235
276
  // need to get clusters when user opens the dropdown
236
277
  // as the api response is cached np extra call is made on open/close
237
278
  // added observing props.isV3 because re-render
@@ -255,24 +296,17 @@ function OpenshiftDropdownV4(props) {
255
296
  };
256
297
  // eslint-disable-next-line react-hooks/exhaustive-deps
257
298
  }, [props.isV3, showArchivedClusters, isOpen, inputVal]);
258
- useEffect(() => {
259
- if (props.isClusterIdInvalid) {
260
- setValidated('error');
261
- }
262
- else {
263
- setValidated('default');
264
- }
265
- }, [props.isClusterIdInvalid]);
266
- // when user type or paste a clusterId we land here
267
- const onTypeaheadInputChanged = (input) => __awaiter(this, void 0, void 0, function* () {
268
- setInputVal(input);
269
- const fetchedClusters = yield fetchAccountClusters(input);
299
+ const onTextInputChange = (_event, value) => {
300
+ setInputVal(value);
301
+ props.onClusterIdStateUpdate({ external_cluster_id: value });
302
+ debounceFn(value);
303
+ };
304
+ const debounceFn = debounce((value) => __awaiter(this, void 0, void 0, function* () {
305
+ const fetchedClusters = yield fetchAccountClusters(value);
270
306
  setClustersRawResponse(fetchedClusters.items);
271
307
  setTotalResultsNo(fetchedClusters.total);
272
308
  setClustersSelectOptions(getClusterOptions(fetchedClusters.items));
273
- props.onClusterIdStateUpdate({ external_cluster_id: input });
274
- });
275
- const debounceFn = debounce(onTypeaheadInputChanged, 500);
309
+ }), 500);
276
310
  const getSelectedItem = () => {
277
311
  if (!isEmpty(inputVal)) {
278
312
  return createState(props.openshiftClusterIDState, inputVal);
@@ -281,6 +315,12 @@ function OpenshiftDropdownV4(props) {
281
315
  return createState(props.openshiftClusterIDState, getDisplayName(props.openshiftClusterIDState, props.noClusterIdReasonExplanation || '', props.openshiftDisplayName || props.openshiftClusterIDState));
282
316
  }
283
317
  };
318
+ const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, variant: "typeahead", onClick: onToggle, onKeyDown: onInputKeyDown, isExpanded: isOpen, isFullWidth: true, isDisabled: props.isDisabled },
319
+ React.createElement(TextInputGroup, { isPlain: true },
320
+ React.createElement(TextInputGroupMain, { value: inputVal, onClick: onToggle, onChange: onTextInputChange, onKeyDown: onInputKeyDown, autoComplete: "off", innerRef: textInputRef, placeholder: t('Search by Cluster ID, alias, and domain or manually enter your Cluster ID'), role: "combobox", isExpanded: isOpen, "aria-controls": "openshift-cluster-selector-listbox" }),
321
+ isFetchingClusters ? (React.createElement(TextInputGroupUtilities, null,
322
+ React.createElement(Spinner, { size: "md" }))) : (inputVal && (React.createElement(TextInputGroupUtilities, null,
323
+ React.createElement(Button, { icon: React.createElement(TimesIcon, { "aria-hidden": true }), variant: "plain", onClick: onDropdownClear, "aria-label": t('Clear input value') })))))));
284
324
  const titleId = 'case-details-cluster-nickname-selector';
285
325
  return (React.createElement(React.Fragment, null,
286
326
  React.createElement("div", { className: `${props.className} form-group` },
@@ -289,14 +329,8 @@ function OpenshiftDropdownV4(props) {
289
329
  React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*"),
290
330
  !isExportingPDF ? React.createElement(CaseOpenShiftPopover, null) : ''),
291
331
  React.createElement("span", { id: titleId, hidden: true }, "Select a state"),
292
- React.createElement(Select, Object.assign({ variant: SelectVariant.typeahead, isDisabled: props.isDisabled, typeAheadAriaLabel: t('Search by Cluster ID, alias, and domain or manually enter your Cluster ID'), onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onSelect, onClear: !isExportingPDF ? onDropdownClear : undefined, selections: getSelectedItem(), isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Search by Cluster ID, alias, and domain or manually enter your Cluster ID'), hasInlineFilter: false, onTypeaheadInputChanged: debounceFn, onFilter: () => undefined, validated: validated, "aria-invalid": props.isClusterIdInvalid, "aria-describedby": "clusterID-validate-helper", required: true }, (isFetchingClusters && { loadingVariant: 'spinner' }), (!isFetchingClusters &&
293
- clustersRawResponse.length < totalResultsNo && {
294
- loadingVariant: {
295
- text: 'Display additional results',
296
- onClick: onViewMoreClick,
297
- },
298
- }), { "data-tracking-id": "openshift-cluster-id", className: "openshift-cluster-id" }), clustersSelectOptions),
332
+ 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" },
333
+ React.createElement(SelectList, { id: "openshift-cluster-selector-listbox" }, clustersSelectOptions)),
299
334
  React.createElement("div", { id: "clusterID-validate-helper", className: `form-instructions ${props.isClusterIdInvalid ? 'form-invalid' : ''}` }, props.clusterIdDropdownFormInstructions))));
300
335
  }
301
- OpenshiftDropdownV4.defaultProps = defaultProps;
302
336
  export { OpenshiftDropdownV4 };
@@ -1 +1 @@
1
- {"version":3,"file":"RHAssociatesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/RHAssociatesSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBA+M1C;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"RHAssociatesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/RHAssociatesSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAoN1C;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -110,21 +110,23 @@ function RHAssociatesSelector(props) {
110
110
  };
111
111
  const canNotifyRHAssociates = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.NOTIFY_RH_ASSOCIATES);
112
112
  const toolTipRef = useRef();
113
+ const contactsToExclude = !isEmpty(selectedOwner.data) ? [{ ssoUsername: selectedOwner.data.ssoUsername }] : [];
113
114
  if (!canNotifyRHAssociates)
114
115
  return React.createElement(React.Fragment, null);
115
116
  return (React.createElement(React.Fragment, null, canNotifyRHAssociates && (React.createElement("div", { className: "form-group" },
116
117
  React.createElement("label", { className: "react-typeahead-label-wrapper", htmlFor: "get-support-notifications" },
117
- React.createElement(Trans, null, "Red Hat associates"),
118
- React.createElement(ContactSelectorInternal, { className: "push-bottom-narrow", selectedContacts: filter(selectedNotificationContacts, (c) => c.isInternal), showSelectedContacts: true, contactsToExclude: !isEmpty(selectedOwner.data) ? [{ ssoUsername: selectedOwner.data.ssoUsername }] : [], id: "open-case-rh-notifications", name: "open-case-rh-notifications", multiple: true, contactListParams: {
118
+ React.createElement(Trans, null, "Internal Contacts"),
119
+ React.createElement(ContactSelectorInternal, { className: "push-bottom-narrow", selectedContacts: filter(selectedNotificationContacts, (c) => c.isInternal), showSelectedContacts: true, contactsToExclude: contactsToExclude, disableContactRemoval: contactsToExclude, id: "open-case-rh-notifications", name: "open-case-rh-notifications", multiple: true, contactListParams: {
119
120
  internal: false, // to get non-ldap contacts only
120
121
  isInternalContact: true,
121
122
  }, placeholder: t(`Add an internal associate to watch this case`), onSelect: onNotifiedUserChange, renderToken: renderToken, isUpdating: isRHAssociatesUpdating, "data-tracking-id": "case-contact-select-rh-watcher" })),
122
- caseNumber && showAddWatchButton() && !isExportingPDF && (React.createElement(Button, { variant: "secondary", onClick: addCurrentUser, type: "button", "data-tracking-id": "case-add-me-rh-watcher" },
123
+ caseNumber && showAddWatchButton() && !isExportingPDF && (React.createElement(Button, { className: "add-watcher-button", variant: "secondary", onClick: addCurrentUser, type: "button", "data-tracking-id": "case-add-me-rh-watcher", isDisabled: isRHAssociatesUpdating },
123
124
  React.createElement(Trans, null, "Add me as a watcher"))),
124
- caseNumber && showRemoveWatchButton() && !isExportingPDF && (React.createElement("div", { ref: toolTipRef, className: "remove-me-as-watcher pf-v5-u-display-inline-block" }, isCurrentUserCaseContact ? (React.createElement(React.Fragment, null,
125
+ caseNumber && showRemoveWatchButton() && !isExportingPDF && (React.createElement("div", { className: "remove-me-as-watcher pf-v6-u-display-inline-block" }, isCurrentUserCaseContact ? (React.createElement(React.Fragment, null,
125
126
  React.createElement(Tooltip, { trigger: 'mouseenter focus', triggerRef: toolTipRef, position: TooltipPosition.top, content: React.createElement(Trans, null, "You are case contact and therefore you cannot be removed as watcher") }),
126
- React.createElement(Button, { variant: "tertiary", onClick: removeCurrentUser, type: "button", isDisabled: true, "data-tracking-id": "case-remove-me-rh-watcher-case-contact" },
127
- React.createElement(Trans, null, "Remove me as a watcher")))) : (React.createElement(Button, { variant: "secondary", onClick: removeCurrentUser, type: "button", "data-tracking-id": "case-remove-me-rh-watcher" },
127
+ React.createElement("div", { ref: toolTipRef },
128
+ React.createElement(Button, { className: "remove-watcher-button", variant: "tertiary", onClick: removeCurrentUser, isDisabled: true, "data-tracking-id": "case-remove-me-rh-watcher-case-contact" },
129
+ React.createElement(Trans, null, "Remove me as a watcher"))))) : (React.createElement(Button, { className: "remove-watcher-button", variant: "secondary", onClick: removeCurrentUser, "data-tracking-id": "case-remove-me-rh-watcher", isDisabled: isRHAssociatesUpdating },
128
130
  React.createElement(Trans, null, "Remove me as a watcher")))))))));
129
131
  }
130
132
  export { RHAssociatesSelector };
@@ -1 +1 @@
1
- {"version":3,"file":"AddContactToGroupModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddContactToGroupModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGvF,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,MAAM;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,UAAU,CAAC;IAC9B,eAAe,EAAE,UAAU,CAAC;IAC5B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AACD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBAuDnD"}
1
+ {"version":3,"file":"AddContactToGroupModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddContactToGroupModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGvF,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,MAAM;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,UAAU,CAAC;IAC9B,eAAe,EAAE,UAAU,CAAC;IAC5B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AACD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBAkDnD"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { publicApi } from '@cee-eng/hydrajs';
11
- import { Button, Modal, ModalVariant, TextInput } from '@patternfly/react-core';
11
+ import { Button, Modal, ModalFooter, ModalVariant, TextInput } from '@patternfly/react-core';
12
12
  import { ToastNotification, useFetch } from '@rh-support/components';
13
13
  import React from 'react';
14
14
  import { Trans, useTranslation } from 'react-i18next';
@@ -30,16 +30,16 @@ export function AddContactToGroupModal(props) {
30
30
  const handleClose = () => {
31
31
  props.onClose && props.onClose();
32
32
  };
33
- return (React.createElement(Modal, { variant: ModalVariant.medium, title: t('Add to a group'), isOpen: true, onClose: handleClose, actions: [
34
- React.createElement(Button, { spinnerAriaValueText: isFetching ? t('Adding') : undefined, isLoading: isFetching, key: "confirm", variant: "primary", onClick: onAdd, isDisabled: isFetching },
35
- React.createElement(Trans, null, "Add")),
36
- React.createElement(Button, { key: "cancel", variant: "link", onClick: handleClose },
37
- React.createElement(Trans, null, " Cancel")),
38
- ] },
33
+ return (React.createElement(Modal, { variant: ModalVariant.medium, title: t('Add to a group'), isOpen: true, onClose: handleClose },
39
34
  React.createElement("label", { htmlFor: "group-member" },
40
35
  React.createElement(Trans, null, "New group member")),
41
36
  React.createElement(TextInput, { id: "group-member", isDisabled: true, value: props.selectedContact.ssoUsername }),
42
37
  React.createElement("label", { htmlFor: "group-selector" },
43
38
  React.createElement(Trans, null, "Group")),
44
- React.createElement(TextInput, { id: "group-selector", value: props.selectedCaseGroup.name, isDisabled: true })));
39
+ React.createElement(TextInput, { id: "group-selector", value: props.selectedCaseGroup.name, isDisabled: true }),
40
+ React.createElement(ModalFooter, null,
41
+ React.createElement(Button, { spinnerAriaValueText: isFetching ? t('Adding') : undefined, isLoading: isFetching, key: "confirm", variant: "primary", onClick: onAdd, isDisabled: isFetching },
42
+ React.createElement(Trans, null, "Add")),
43
+ React.createElement(Button, { key: "cancel", variant: "link", onClick: handleClose },
44
+ React.createElement(Trans, null, " Cancel")))));
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AddCustomEmailToAccountModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,MAAM;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AACD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,qBAsGpD"}
1
+ {"version":3,"file":"AddCustomEmailToAccountModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,MAAM;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AACD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,qBA+GpD"}
@@ -8,11 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { customEmail } from '@cee-eng/hydrajs';
11
- import { Button, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalVariant, TextInput, ValidatedOptions, } from '@patternfly/react-core';
11
+ import { Button, ButtonVariant, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, TextInput, ValidatedOptions, } from '@patternfly/react-core';
12
12
  import { ToastNotification, useFetch } from '@rh-support/components';
13
13
  import isEmpty from 'lodash/isEmpty';
14
14
  import React, { useState } from 'react';
15
- import { Trans, useTranslation } from 'react-i18next';
15
+ import { useTranslation } from 'react-i18next';
16
16
  export function AddCustomEmailToAccount(props) {
17
17
  const { t } = useTranslation();
18
18
  const { request, isFetching } = useFetch(customEmail.addCustomEmailToAccount, { propgateErrors: true });
@@ -45,23 +45,21 @@ export function AddCustomEmailToAccount(props) {
45
45
  : isEmpty(firstName.trim())
46
46
  ? ValidatedOptions.error
47
47
  : ValidatedOptions.default;
48
- return (React.createElement(Modal, { variant: ModalVariant.medium, title: t('Add a notification email to your account'), isOpen: true, onClose: handleClose, onEscapePress: handleClose, actions: [
49
- React.createElement(Button, { spinnerAriaValueText: isFetching ? t('Adding') : undefined, isLoading: isFetching, key: "confirm", variant: "primary", onClick: onAdd, isDisabled: isFetching || (isSaveButtonClicked && isEmpty(firstName.trim())) },
50
- React.createElement(Trans, null, "Add to account")),
51
- React.createElement(Button, { key: "cancel", variant: "link", onClick: handleClose, isDisabled: isFetching },
52
- React.createElement(Trans, null, "Cancel")),
53
- ] },
54
- React.createElement("p", { className: "pf-v5-u-mb-lg" },
55
- React.createElement(Trans, null, "Note: This email will be added at an account level, not a case level.")),
56
- React.createElement(Form, null,
57
- React.createElement(FormGroup, { label: t('New email address'), fieldId: "custom-email-address", isRequired: true },
58
- React.createElement(TextInput, { id: "custom-email", isDisabled: true, value: props.customEmailAddress, isRequired: true })),
59
- React.createElement(FormGroup, { label: t('First name'), fieldId: "custom-email-firstName", isRequired: true },
60
- firstNameValidated === 'error' && (React.createElement(FormHelperText, null,
61
- React.createElement(HelperText, null,
62
- React.createElement(HelperTextItem, { variant: "error" },
63
- React.createElement(Trans, null, "First name cannot be empty"))))),
64
- React.createElement(TextInput, { id: "custom-email-firstName", value: firstName, isRequired: true, type: "text", validated: firstNameValidated, onChange: (_event, firstName) => onFirstNameChange(firstName), "aria-label": t('First name'), placeholder: t('First name'), maxLength: 254 })),
65
- React.createElement(FormGroup, { label: t('Last name'), fieldId: "custom-email-lastName", className: "pf-v5-u-mb-md" },
66
- React.createElement(TextInput, { id: "custom-email-lastName", value: lastName, type: "text", onChange: (_event, lastName) => onLastNameChange(lastName), "aria-label": t('Last name'), placeholder: t('Last name'), maxLength: 254 })))));
48
+ return (React.createElement(Modal, { isOpen: true, onClose: handleClose, variant: ModalVariant.medium, "aria-labelledby": "add-email-modal-title", "aria-describedby": "add-email-modal-body" },
49
+ React.createElement(ModalHeader, { title: t('Add a notification email to your account'), labelId: "add-email-modal-title" }),
50
+ React.createElement(ModalBody, { id: "add-email-modal-body" },
51
+ React.createElement("p", { className: "pf-v6-u-mb-md" }, t('Note: This email will be added at an account level, not a case level.')),
52
+ React.createElement(Form, null,
53
+ React.createElement(FormGroup, { label: t('New email address'), fieldId: "custom-email-address", isRequired: true },
54
+ React.createElement(TextInput, { id: "custom-email", isDisabled: true, value: props.customEmailAddress, isRequired: true, "aria-label": t('New email address') })),
55
+ React.createElement(FormGroup, { label: t('First name'), fieldId: "custom-email-firstName", isRequired: true },
56
+ React.createElement(TextInput, { id: "custom-email-firstName", value: firstName, isRequired: true, type: "text", validated: firstNameValidated, onChange: (_event, firstName) => onFirstNameChange(firstName), "aria-label": t('First name'), placeholder: t('First name'), maxLength: 254 }),
57
+ firstNameValidated === ValidatedOptions.error && (React.createElement(FormHelperText, null,
58
+ React.createElement(HelperText, null,
59
+ React.createElement(HelperTextItem, { variant: ValidatedOptions.error }, t('First name cannot be empty')))))),
60
+ React.createElement(FormGroup, { label: t('Last name'), fieldId: "custom-email-lastName" },
61
+ React.createElement(TextInput, { id: "custom-email-lastName", value: lastName, type: "text", onChange: (_event, lastName) => onLastNameChange(lastName), "aria-label": t('Last name'), placeholder: t('Last name'), maxLength: 254 })))),
62
+ React.createElement(ModalFooter, null,
63
+ React.createElement(Button, { key: "confirm", variant: ButtonVariant.primary, onClick: onAdd, isDisabled: isFetching || (isSaveButtonClicked && isEmpty(firstName.trim())), spinnerAriaValueText: isFetching ? t('Loading') : undefined, isLoading: isFetching }, t('Add to account')),
64
+ React.createElement(Button, { key: "cancel", variant: ButtonVariant.link, onClick: handleClose, isDisabled: isFetching }, t('Cancel')))));
67
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA4czC;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAsdzC;AAED,eAAe,mBAAmB,CAAC"}