@rh-support/troubleshoot 2.6.14 → 2.6.16

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 (194) 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 +21 -18
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +45 -34
  7. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +13 -19
  9. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +1 -1
  10. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  11. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +8 -8
  12. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +1 -1
  13. package/lib/esm/components/CaseEditView/CaseOverview/DateTime.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/CaseOverview/DateTime.js +1 -1
  15. package/lib/esm/components/CaseEditView/CaseOverview/index.js +8 -8
  16. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  17. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +20 -19
  18. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +5 -5
  20. package/lib/esm/components/CaseEditView/CaseSolutions/HandpicketItem.js +3 -3
  21. package/lib/esm/components/CaseEditView/CaseSubscriptionAbuseAlert.js +1 -1
  22. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  23. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +33 -23
  24. package/lib/esm/components/CaseEditView/PDFContainer.js +19 -15
  25. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.js +9 -8
  27. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  28. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +13 -16
  29. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  30. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +51 -94
  31. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.js +9 -8
  33. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  34. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +36 -31
  35. package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.d.ts.map +1 -1
  36. package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.js +3 -3
  37. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +2 -2
  38. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.d.ts.map +1 -1
  39. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +9 -7
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover.js +1 -1
  41. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftV3Popover.js +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +1 -1
  43. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +2 -2
  44. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
  45. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +3 -3
  46. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  47. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +2 -2
  48. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/SFDCUrl.d.ts.map +1 -1
  49. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/SFDCUrl.js +3 -4
  50. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +2 -2
  51. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +2 -2
  52. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseChat.js +1 -1
  53. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +1 -1
  54. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +2 -2
  55. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseExternalTrackerUpdate.js +1 -1
  56. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
  57. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +2 -3
  58. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +5 -5
  59. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  60. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +23 -17
  61. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +19 -4
  62. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  63. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +5 -8
  64. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
  65. package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +5 -4
  66. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  67. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +4 -6
  68. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.d.ts.map +1 -1
  69. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.js +4 -6
  70. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +1 -1
  71. package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.d.ts.map +1 -1
  72. package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.js +2 -3
  73. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  74. package/lib/esm/components/CaseInformation/CaseGroup.js +1 -2
  75. package/lib/esm/components/CaseInformation/CaseInformation.js +3 -3
  76. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.d.ts.map +1 -1
  77. package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +1 -1
  78. package/lib/esm/components/CaseInformation/Description.js +4 -4
  79. package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
  80. package/lib/esm/components/CaseInformation/Fts.js +13 -9
  81. package/lib/esm/components/CaseInformation/OpenCaseIssue.js +2 -2
  82. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  83. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  84. package/lib/esm/components/CaseInformation/SupportLevel.js +16 -10
  85. package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
  86. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +14 -11
  87. package/lib/esm/components/CaseManagement/CaseManagement.js +4 -4
  88. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  89. package/lib/esm/components/CaseManagement/Cep.js +44 -41
  90. package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.d.ts.map +1 -1
  91. package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.js +50 -42
  92. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  93. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +39 -63
  94. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +1 -1
  95. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  96. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +62 -36
  97. package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +1 -1
  98. package/lib/esm/components/CaseManagement/SendNotifications/AddContactToGroupModal.d.ts.map +1 -1
  99. package/lib/esm/components/CaseManagement/SendNotifications/AddContactToGroupModal.js +8 -8
  100. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.d.ts.map +1 -1
  101. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.js +10 -10
  102. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +2 -2
  103. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  104. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +57 -16
  105. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.d.ts.map +1 -1
  106. package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +12 -27
  107. package/lib/esm/components/ConfirmationModals/PreferredSecureSupportModal.d.ts.map +1 -1
  108. package/lib/esm/components/ConfirmationModals/PreferredSecureSupportModal.js +1 -1
  109. package/lib/esm/components/Cve/CveItem.d.ts.map +1 -1
  110. package/lib/esm/components/Cve/CveItem.js +10 -11
  111. package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
  112. package/lib/esm/components/Cve/CveModal.js +10 -11
  113. package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -1
  114. package/lib/esm/components/Cve/CvePanel.js +3 -3
  115. package/lib/esm/components/Cve/CveSidebar.js +2 -2
  116. package/lib/esm/components/IdeaInformation/IdeaInformation.js +7 -7
  117. package/lib/esm/components/ImproveCase/KtQuestions.js +6 -6
  118. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  119. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +6 -13
  120. package/lib/esm/components/ProductSelector/AllProductsSelector.js +8 -7
  121. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -1
  122. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  123. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +80 -53
  124. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  125. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +14 -10
  126. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -1
  127. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +4 -4
  128. package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
  129. package/lib/esm/components/Recommendations/AsideResults.js +5 -3
  130. package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +1 -1
  131. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -1
  132. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
  133. package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +7 -11
  134. package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.d.ts.map +1 -1
  135. package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.js +4 -4
  136. package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +7 -7
  137. package/lib/esm/components/Recommendations/InsightsResults.js +1 -1
  138. package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
  139. package/lib/esm/components/Recommendations/InsightsRuleInfo.js +16 -16
  140. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.js +6 -6
  141. package/lib/esm/components/Recommendations/RecommendationInfoBox.d.ts.map +1 -1
  142. package/lib/esm/components/Recommendations/RecommendationInfoBox.js +7 -7
  143. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  144. package/lib/esm/components/Recommendations/Recommendations.js +23 -20
  145. package/lib/esm/components/Recommendations/RecommendationsLoader.js +1 -1
  146. package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
  147. package/lib/esm/components/Recommendations/RulesModal.js +7 -9
  148. package/lib/esm/components/Recommendations/WatsonxAiIcon.d.ts.map +1 -1
  149. package/lib/esm/components/Recommendations/WatsonxAiIcon.js +9 -10
  150. package/lib/esm/components/RemoteRider/RemoteRiderBanner.js +1 -1
  151. package/lib/esm/components/Review/Review.js +4 -4
  152. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +5 -5
  153. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
  154. package/lib/esm/components/SessionRestore/SessionRestoreCard.js +1 -1
  155. package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
  156. package/lib/esm/components/SubmitCase/SubmitCase.js +21 -21
  157. package/lib/esm/components/Suggestions/Suggestions.js +2 -2
  158. package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
  159. package/lib/esm/components/Suggestions/TopContent.js +8 -8
  160. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  161. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +13 -14
  162. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  163. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +20 -16
  164. package/lib/esm/components/shared/Rule.js +6 -6
  165. package/lib/esm/components/shared/fileUpload/FileLister.js +6 -6
  166. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  167. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +7 -6
  168. package/lib/esm/components/shared/fileUpload/common/FileUploaderInfoIcon.js +1 -1
  169. package/lib/esm/components/shared/fileUpload/css/fileSelector.css +1 -0
  170. package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.js +1 -1
  171. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts.map +1 -1
  172. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +4 -4
  173. package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelectorImage.js +2 -2
  174. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts +15 -6
  175. package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts.map +1 -1
  176. package/lib/esm/components/shared/input/ContactSelectorInternal.js +128 -23
  177. package/lib/esm/components/wizardLayout/MainSection.js +2 -2
  178. package/lib/esm/components/wizardLayout/NewFeatureModal.d.ts.map +1 -1
  179. package/lib/esm/components/wizardLayout/NewFeatureModal.js +6 -6
  180. package/lib/esm/components/wizardLayout/WizardAside.js +3 -3
  181. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  182. package/lib/esm/components/wizardLayout/WizardMain.js +61 -19
  183. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  184. package/lib/esm/components/wizardLayout/WizardNavigation.js +7 -13
  185. package/lib/esm/css/app.css +13 -13
  186. package/lib/esm/css/case.css +23 -16
  187. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  188. package/lib/esm/hooks/useWizard.js +1 -3
  189. package/lib/esm/reducers/RouteConstNTypes.d.ts +1 -2
  190. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  191. package/lib/esm/reducers/RulesReducer.d.ts.map +1 -1
  192. package/lib/esm/scss/_main.scss +183 -88
  193. package/lib/esm/scss/_pf-overrides.scss +150 -140
  194. package/package.json +11 -11
@@ -1,10 +1,10 @@
1
- import { ValidatedOptions } from '@patternfly/react-core';
2
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
1
+ import { SingleSelectDropdown } from '@rh-support/components';
3
2
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
3
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
5
4
  import isEmpty from 'lodash/isEmpty';
6
5
  import isEqual from 'lodash/isEqual';
7
- import React, { useContext, useEffect, useState } from 'react';
6
+ import map from 'lodash/map';
7
+ import React, { useContext, useEffect } from 'react';
8
8
  import { Trans, useTranslation } from 'react-i18next';
9
9
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
10
10
  import { getDescriptionWOQues } from '../../reducers/CaseHelpers';
@@ -21,19 +21,14 @@ export default function CaseLanguageSelector(props) {
21
21
  caseLanguage: state.caseDetails.caseLanguage,
22
22
  isLoadingLang: state.isLoadingLang,
23
23
  }), isEqual);
24
- const [isOpen, setIsOpen] = useState(false);
25
- const onToggle = (isOpen) => {
26
- setIsOpen(isOpen);
27
- };
28
24
  const canUseLanguageDetection = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseDetailsFields.CASE_LANGUAGE_DETECTION);
29
25
  const caseDispatch = useCaseDispatch();
30
26
  const { globalMetadataState: { caseLanguages }, } = useContext(GlobalMetadataStateContext);
31
27
  const onCaseDetailsChange = (caseDetails) => {
32
28
  setCaseDetails(caseDispatch, caseDetails);
33
29
  };
34
- const onLanguageChange = (event, selection) => {
35
- setIsOpen(false);
36
- onCaseDetailsChange({ caseLanguage: selection });
30
+ const onLanguageChange = (option) => {
31
+ onCaseDetailsChange({ caseLanguage: option.value });
37
32
  };
38
33
  useEffect(() => {
39
34
  if (!caseLanguage) {
@@ -57,12 +52,20 @@ export default function CaseLanguageSelector(props) {
57
52
  canUseLanguageDetection,
58
53
  props.isManageStep,
59
54
  ]);
55
+ const getLanguageDropdownOptions = map(caseLanguages.data, (language) => ({
56
+ label: Constants.languagesMap[language],
57
+ value: language,
58
+ }));
59
+ const getSelectedLanguageOption = {
60
+ label: caseLanguage ? Constants.languagesMap[caseLanguage] : '',
61
+ value: caseLanguage || '',
62
+ };
60
63
  return (React.createElement("div", { className: "form-group" },
61
64
  React.createElement("label", { htmlFor: "get-support-language" },
62
65
  React.createElement(Trans, null, "Preferred language"),
63
66
  ' ',
64
67
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
65
- React.createElement(Select, { variant: SelectVariant.single, "aria-label": t(`Select a language`), onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onLanguageChange, selections: caseLanguage, isOpen: isOpen, "aria-labelledby": 'get-support-language', isDisabled: caseLanguages.isError, validated: caseLanguages.isError ? ValidatedOptions.error : ValidatedOptions.default, "data-tracking-id": "preferred-language-select" }, caseLanguages.data.map((sla, index) => (React.createElement(SelectOption, { value: sla, key: index }, Constants.languagesMap[sla])))),
68
+ React.createElement(SingleSelectDropdown, { placeholder: t('Select a language'), dataTrackingId: "preferred-language-select", options: getLanguageDropdownOptions, selected: getSelectedLanguageOption, isDisabled: caseLanguages.isError, isInvalid: caseLanguages.isError, onSelect: onLanguageChange }),
66
69
  React.createElement("p", { className: "form-instructions" },
67
70
  React.createElement(Trans, null, "Select a language for communicating with our support engineers."))));
68
71
  }
@@ -21,16 +21,16 @@ export default function CaseManagement(props) {
21
21
  return (React.createElement("form", null,
22
22
  React.createElement(SupportLevel, null),
23
23
  React.createElement(Grid, { hasGutter: true },
24
- React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v5-u-mb-xs" },
24
+ React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
25
25
  React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange })),
26
- React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v5-u-mb-xs" },
26
+ React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
27
27
  React.createElement(ContactPhoneNumber, null))),
28
28
  React.createElement(ContactPhoneNumberAlert, null),
29
29
  React.createElement(Fts, { inlineEditable: false }),
30
30
  React.createElement(Grid, { hasGutter: true },
31
- React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v5-u-mb-xs" },
31
+ React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
32
32
  React.createElement(CaseLanguageSelector, { isManageStep: true })),
33
- React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v5-u-mb-xs" },
33
+ React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
34
34
  React.createElement(CaseGroup, { init: true }))),
35
35
  React.createElement(CaseContactSelector, null),
36
36
  React.createElement(RHAssociatesSelector, null),
@@ -1 +1 @@
1
- {"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAoB/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,qBAuThC"}
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,qBA0ThC"}
@@ -7,7 +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 { Button, Checkbox, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalVariant, Popover, PopoverPosition, TextArea, TextInput, ValidatedOptions, } from '@patternfly/react-core';
10
+ import { Button, Checkbox, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, Popover, PopoverPosition, TextArea, TextInput, ValidatedOptions, } from '@patternfly/react-core';
11
11
  import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
12
12
  import { LoadingIndicator, ToastNotification, useConfirmation } from '@rh-support/components';
13
13
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
@@ -138,51 +138,54 @@ export function Cep(props) {
138
138
  if (!canUseCep) {
139
139
  return React.createElement(React.Fragment, null);
140
140
  }
141
- return (React.createElement("div", { className: "form-group pf-v5-u-my-md" },
141
+ return (React.createElement("div", { className: "form-group pf-v6-u-my-md" },
142
142
  React.createElement("div", { id: "cep-checkbox" },
143
143
  React.createElement(Checkbox, { id: "get-support-cep", label: t('Consultant has been engaged'), isChecked: isEqual(cep, undefined) ? false : cep, onChange: onCepChange, "data-tracking-id": "get-support-cep", name: "get-support-cep" }),
144
144
  !isExportingPDF ? (React.createElement(Popover, { id: "cep-info-popover", "aria-label": "CEP info", position: PopoverPosition.top, bodyContent: React.createElement(Trans, null, "Used by consultants to indicate that a consulting engagement is in progress and the issue requires increased attention from support resources."), closeBtnAriaLabel: "Close" },
145
- React.createElement(QuestionCircleIcon, { className: "pf-v5-u-ml-xs icon-size", "aria-label": "CEP Info" }))) : ('')),
145
+ React.createElement(QuestionCircleIcon, { className: "pf-v6-u-ml-xs icon-size cursor-pointer", "aria-label": "CEP Info" }))) : ('')),
146
146
  React.createElement(LoadingIndicator, { show: isCaseUpdating && isPostingCep, isInline: true, size: "sm" }),
147
- React.createElement(Modal, { id: "cep-details-modal", title: t('Consultant engagement is in progress'), "aria-describedby": "cep-modal-description", isOpen: isCepModalOpen, showClose: true, variant: ModalVariant.large, onClose: onCancel, actions: [
147
+ React.createElement(Modal, { id: "cep-details-modal", "aria-describedby": "cep-modal-description", isOpen: isCepModalOpen, variant: ModalVariant.large, onClose: onCancel },
148
+ React.createElement(ModalHeader, null,
149
+ React.createElement("h2", null, t('Consultant engagement is in progress'))),
150
+ React.createElement(ModalBody, null,
151
+ React.createElement("p", null,
152
+ React.createElement(Trans, null, "Please provide the contact information of Consulting personnel troubleshooting the customer issue.")),
153
+ React.createElement("p", { className: "push-top-narrow", id: "cep-madal-description" },
154
+ React.createElement(Trans, null, "If requested, Red Hat Support will use this information to initiate direct contact (i.e. phone, chat) with listed contact(s) in order to provide faster assistance. The primary method of communication will continue to be this support ticket.")),
155
+ React.createElement(Form, { className: "push-top-narrow" },
156
+ React.createElement(FormGroup, { label: t('Contact name'), isRequired: true, fieldId: "cep-contact-name" },
157
+ React.createElement(TextInput, { type: "text", id: "cep-contact-name", isRequired: true, maxLength: 254, "aria-label": t('Contact name'), onChange: (_event, value) => onCepContactNameChange(value), validated: saveButtonIsClicked && isEmpty((_d = cepDetailsLocal.contactName) === null || _d === void 0 ? void 0 : _d.trim())
158
+ ? ValidatedOptions.error
159
+ : ValidatedOptions.default }),
160
+ React.createElement(FormHelperText, null,
161
+ React.createElement(HelperText, null,
162
+ React.createElement(HelperTextItem, null,
163
+ React.createElement(Trans, null, "Provide main contact(s) troubleshooting the issue."))))),
164
+ React.createElement(FormGroup, { label: t('Availability/Working hours'), isRequired: true, fieldId: "cep-workingHours" },
165
+ React.createElement(TextInput, { type: "text", id: "cep-workingHours", isRequired: true, maxLength: 254, "aria-label": t('Availability/Working hours'), onChange: (_event, value) => onCepWorkingHoursChange(value), validated: saveButtonIsClicked && isEmpty((_e = cepDetailsLocal.workingHours) === null || _e === void 0 ? void 0 : _e.trim())
166
+ ? ValidatedOptions.error
167
+ : ValidatedOptions.default }),
168
+ React.createElement(FormHelperText, null,
169
+ React.createElement(HelperText, null,
170
+ React.createElement(HelperTextItem, null,
171
+ React.createElement(Trans, null, "Indicate working hours, time zone; specify if not available on certain dates (i.e. weekends, holidays)."))))),
172
+ React.createElement(FormGroup, { label: t('Contact information'), isRequired: true, fieldId: "cep-contactInformation" },
173
+ React.createElement(TextArea, { id: "cep-contactInformation", "aria-required": true, isRequired: true, maxLength: 2000, name: "cep-contactInformation", value: cepDetailsLocal.contactInformation, onChange: (_event, value) => onCepContactInformationsChange(value), "aria-label": "auto resizing text area example", autoResize: true, validated: saveButtonIsClicked && isEmpty((_f = cepDetailsLocal.contactInformation) === null || _f === void 0 ? void 0 : _f.trim())
174
+ ? ValidatedOptions.error
175
+ : ValidatedOptions.default, resizeOrientation: "vertical" }),
176
+ React.createElement(FormHelperText, null,
177
+ React.createElement(HelperText, null,
178
+ React.createElement(HelperTextItem, null,
179
+ React.createElement(Trans, null, "Please provide phone number, chat ID or email."))))),
180
+ React.createElement(FormGroup, { label: t('Notes'), fieldId: "cep-notes" },
181
+ React.createElement(TextArea, { id: "cep-notes", "aria-required": false, isRequired: false, maxLength: 2000, name: "cep-notes", value: cepDetailsLocal.notes, onChange: (_event, value) => onCepNotesChange(value), autoResize: true, resizeOrientation: "vertical" }),
182
+ React.createElement(FormHelperText, null,
183
+ React.createElement(HelperText, null,
184
+ React.createElement(HelperTextItem, null,
185
+ React.createElement(Trans, null, "Provide any pertinent information that Red Hat Support should be aware of that's not already captured in the issue statement or comments."))))))),
186
+ React.createElement(ModalFooter, null,
148
187
  React.createElement(Button, { key: "confirm", variant: "primary", className: "btn btn-app btn-primary", onClick: onSubmit, isDisabled: saveButtonIsClicked && isFormInvalid, "data-tracking-id": "cep-details-save" },
149
188
  React.createElement(Trans, null, "Submit")),
150
189
  React.createElement(Button, { key: "link", className: "btn btn-app btn-link", variant: "link", onClick: onCancel, "data-tracking-id": "cep-details-cancel", isDisabled: isCaseUpdating || isPostingCep },
151
- React.createElement(Trans, null, "Cancel")),
152
- ] },
153
- React.createElement("p", null,
154
- React.createElement(Trans, null, "Please provide the contact information of Consulting personnel troubleshooting the customer issue.")),
155
- React.createElement("p", { className: "push-top-narrow", id: "cep-madal-description" },
156
- React.createElement(Trans, null, "If requested, Red Hat Support will use this information to initiate direct contact (i.e. phone, chat) with listed contact(s) in order to provide faster assistance. The primary method of communication will continue to be this support ticket.")),
157
- React.createElement(Form, { className: "push-top-narrow" },
158
- React.createElement(FormGroup, { label: t('Contact name'), isRequired: true, fieldId: "cep-contact-name" },
159
- React.createElement(TextInput, { type: "text", id: "cep-contact-name", isRequired: true, maxLength: 254, "aria-label": t('Contact name'), onChange: (_event, value) => onCepContactNameChange(value), validated: saveButtonIsClicked && isEmpty((_d = cepDetailsLocal.contactName) === null || _d === void 0 ? void 0 : _d.trim())
160
- ? ValidatedOptions.error
161
- : ValidatedOptions.default }),
162
- React.createElement(FormHelperText, null,
163
- React.createElement(HelperText, null,
164
- React.createElement(HelperTextItem, null,
165
- React.createElement(Trans, null, "Provide main contact(s) troubleshooting the issue."))))),
166
- React.createElement(FormGroup, { label: t('Availability/Working hours'), isRequired: true, fieldId: "cep-workingHours" },
167
- React.createElement(TextInput, { type: "text", id: "cep-workingHours", isRequired: true, maxLength: 254, "aria-label": t('Availability/Working hours'), onChange: (_event, value) => onCepWorkingHoursChange(value), validated: saveButtonIsClicked && isEmpty((_e = cepDetailsLocal.workingHours) === null || _e === void 0 ? void 0 : _e.trim())
168
- ? ValidatedOptions.error
169
- : ValidatedOptions.default }),
170
- React.createElement(FormHelperText, null,
171
- React.createElement(HelperText, null,
172
- React.createElement(HelperTextItem, null,
173
- React.createElement(Trans, null, "Indicate working hours, time zone; specify if not available on certain dates (i.e. weekends, holidays)."))))),
174
- React.createElement(FormGroup, { label: t('Contact information'), isRequired: true, fieldId: "cep-contactInformation" },
175
- React.createElement(TextArea, { id: "cep-contactInformation", "aria-required": true, isRequired: true, maxLength: 2000, name: "cep-contactInformation", value: cepDetailsLocal.contactInformation, onChange: (_event, value) => onCepContactInformationsChange(value), "aria-label": "auto resizing text area example", autoResize: true, validated: saveButtonIsClicked && isEmpty((_f = cepDetailsLocal.contactInformation) === null || _f === void 0 ? void 0 : _f.trim())
176
- ? ValidatedOptions.error
177
- : ValidatedOptions.default, resizeOrientation: "vertical" }),
178
- React.createElement(FormHelperText, null,
179
- React.createElement(HelperText, null,
180
- React.createElement(HelperTextItem, null,
181
- React.createElement(Trans, null, "Please provide phone number, chat ID or email."))))),
182
- React.createElement(FormGroup, { label: t('Notes'), fieldId: "cep-notes" },
183
- React.createElement(TextArea, { id: "cep-notes", "aria-required": false, isRequired: false, maxLength: 2000, name: "cep-notes", value: cepDetailsLocal.notes, onChange: (_event, value) => onCepNotesChange(value), autoResize: true, resizeOrientation: "vertical" }),
184
- React.createElement(FormHelperText, null,
185
- React.createElement(HelperText, null,
186
- React.createElement(HelperTextItem, null,
187
- React.createElement(Trans, null, "Provide any pertinent information that Red Hat Support should be aware of that's not already captured in the issue statement or comments.")))))))));
190
+ React.createElement(Trans, null, "Cancel"))))));
188
191
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ESSRemoteSessionCheckBox.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/ESSRemoteSessionCheckBox.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAqB/D,QAAA,MAAM,qBAAqB,yBAyO1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"ESSRemoteSessionCheckBox.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/ESSRemoteSessionCheckBox.tsx"],"names":[],"mappings":"AASA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAqB/D,QAAA,MAAM,qBAAqB,yBA8O1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -8,11 +8,10 @@ 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, ButtonVariant, Checkbox, Modal } from '@patternfly/react-core';
12
- import { Select, SelectOption } from '@patternfly/react-core/deprecated';
11
+ import { Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader } from '@patternfly/react-core';
13
12
  import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
14
13
  import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
15
- import { useFetch } from '@rh-support/components';
14
+ import { SingleSelectDropdown, useFetch } from '@rh-support/components';
16
15
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
17
16
  import { TncConstants } from '@rh-support/utils';
18
17
  import isEqual from 'lodash/isEmpty';
@@ -48,9 +47,8 @@ const ESSRemoteSessionCheck = () => {
48
47
  translatedInstructions: 'Please read and accept the remote session terms below to allow Red Hat to access your network or systems.',
49
48
  translatedTermsName: 'Remote Access Agreement',
50
49
  });
51
- const [allTranslations, setAllTranslations] = useState({});
50
+ const [languageOptions, setLanguageOptions] = useState([]);
52
51
  const [agreeLoading, setAgreeLoading] = useState(false);
53
- const [isLangSelectorDropdownOpen, setisLangSelectorDropdownOpen] = useState(false);
54
52
  const [isTermsChecked, setIsTermsChecked] = useState(false);
55
53
  const [isRSAModalOpen, setIsRSAModalOpen] = useState(false);
56
54
  const { isCaseUpdating, screenSessionRequested } = useCaseSelector((state) => ({
@@ -69,15 +67,20 @@ const ESSRemoteSessionCheck = () => {
69
67
  try {
70
68
  const response = yield request(siteCode, eventCode, user);
71
69
  let defaultTranslation = response[0].translations[0];
72
- const translationLangInfoMap = response[0].translations.reduce((allTranslationsmap, translation) => {
70
+ // Transform translations into dropdown options
71
+ const options = response[0].translations.map((translation) => ({
72
+ value: translation,
73
+ label: getLocaleNameFromLocalCode(translation.localeCode),
74
+ disabled: false,
75
+ }));
76
+ // Find default translation
77
+ response[0].translations.forEach((translation) => {
73
78
  if (translation.isDefault) {
74
79
  defaultTranslation = translation;
75
80
  }
76
- allTranslationsmap[translation['localeCode']] = translation;
77
- return allTranslationsmap;
78
- }, {});
81
+ });
79
82
  setSelectedTranslation(defaultTranslation);
80
- setAllTranslations(translationLangInfoMap);
83
+ setLanguageOptions(options);
81
84
  }
82
85
  catch (e) {
83
86
  console.log(e);
@@ -112,12 +115,9 @@ const ESSRemoteSessionCheck = () => {
112
115
  setIsTermsChecked(value);
113
116
  };
114
117
  // Handle language change
115
- const onLangChange = (event, lang) => {
116
- setSelectedTranslation(allTranslations[lang]);
117
- setisLangSelectorDropdownOpen(false);
118
+ const onLanguageSelect = (option) => {
119
+ setSelectedTranslation(option.value);
118
120
  };
119
- // To handle dropdown toggle
120
- const onDropdownToggle = (toggle) => setisLangSelectorDropdownOpen(toggle);
121
121
  // To handle modal cancel and close
122
122
  const onCancel = () => {
123
123
  setIsRSAModalOpen(false);
@@ -128,41 +128,49 @@ const ESSRemoteSessionCheck = () => {
128
128
  setRemoteSessionChecked(false);
129
129
  setAgreeLoading(false);
130
130
  };
131
- const modalActions = [
132
- React.createElement(Button, { key: "submit", "aria-label": t('I agree'), variant: ButtonVariant.primary, onClick: submitRemoteSessionAgreement, "data-tracking-id": "ess-remote-session-agreement-check", isLoading: agreeLoading, isDisabled: !isTermsChecked || agreeLoading }, t('I agree')),
133
- ];
134
131
  // To check if terms have been accepted on account level
135
132
  const termsAcceptedOnAccountLevel = loggedInUsersAccount.data.remoteSessionTermsAcked;
133
+ const currentSelection = {
134
+ value: selectedTranslation,
135
+ label: getLocaleNameFromLocalCode(selectedTranslation.localeCode),
136
+ disabled: false,
137
+ };
136
138
  return (React.createElement(React.Fragment, null,
137
139
  React.createElement(Checkbox, { id: "case-management-remote-session", label: React.createElement(React.Fragment, null,
138
140
  React.createElement(Trans, null, "I want a"),
139
141
  ' ',
140
142
  React.createElement("a", { href: "https://access.redhat.com/articles/3566571", target: "_blank", rel: "noopener noreferrer" },
141
143
  React.createElement(Trans, null, "remote session"))), description: t('Red Hat will add a comment to your case to schedule your remote session.'), "data-tracking-id": "case-management-remote-session-check", isChecked: remoteSessionChecked, onChange: termsAcceptedOnAccountLevel ? handleCheckBoxChange : handleTermsCheckBoxChange, isDisabled: isCaseUpdating, className: "rsa-checkbox" }),
142
- React.createElement(Modal, { id: "remote-session-check-modal", "aria-label": t('Remote Session Agreement'), title: t('Remote Session Agreement'), isOpen: isRSAModalOpen, onClose: onCancel, actions: modalActions },
143
- React.createElement(React.Fragment, null,
144
- React.createElement("p", { className: "pf-v5-u-mt-xs" },
145
- React.createElement(Trans, null,
146
- "Your acceptance of this remote session agreement is required ",
147
- React.createElement("strong", null, "for each case"),
148
- ' ',
149
- "when you request Red Hat\u2019s support team to directly access your network or systems.")),
150
- React.createElement("p", { className: "pf-v5-u-mt-md" },
151
- React.createElement(Trans, null, "Remote access to your network or systems is not a standard Red Hat problem resolution process. Before Red Hat logs into your systems to analyze your support issue during a remote session, Red Hat needs your approval and authorization for such remote access.")),
152
- React.createElement("p", { className: "pf-v5-u-mt-md" },
153
- React.createElement(Trans, null, "Please read and accept the remote session terms below to allow Red Hat to access your network or systems.")),
154
- React.createElement("div", null,
155
- React.createElement(Select, { className: "pf-v5-u-mt-md", "aria-label": t('Select language'), id: "terms-language-selector", selections: selectedTranslation.localeCode, onSelect: onLangChange, isOpen: isLangSelectorDropdownOpen, menuAppendTo: document.body, placeholderText: t('Select an option that best fits'), onToggle: (_event, toggle) => onDropdownToggle(toggle), width: 350 }, Object.keys(allTranslations).map((option, index) => (React.createElement(SelectOption, { key: index, value: option }, getLocaleNameFromLocalCode(option))))),
156
- React.createElement("a", { "aria-label": t('Download'), "data-tracking-id": "ess-rsa-modal-terms-download", className: "pf-v5-u-ml-md", href: selectedTranslation.pdfDownloadUrl, rel: "noopener noreferrer", target: "_blank" },
157
- t('Download'),
158
- " ",
159
- React.createElement(DownloadIcon, { className: "pf-v5-u-ml-xs" }))),
160
- React.createElement("div", null,
161
- React.createElement(Checkbox, { className: "pf-v5-u-mt-md rsa-checkbox", id: "terms-accept-checkbox", label: React.createElement(React.Fragment, null,
162
- React.createElement(Trans, null, "I have read and agree to the"),
144
+ React.createElement(Modal, { id: "remote-session-check-modal", "aria-label": t('Remote Session Agreement'), isOpen: isRSAModalOpen, onClose: onCancel },
145
+ React.createElement(ModalHeader, null,
146
+ React.createElement("h2", null, t('Remote Session Agreement'))),
147
+ React.createElement(ModalBody, null,
148
+ React.createElement(React.Fragment, null,
149
+ React.createElement("p", { className: "pf-v6-u-mt-xs" },
150
+ React.createElement(Trans, null,
151
+ "Your acceptance of this remote session agreement is required",
163
152
  ' ',
164
- React.createElement("a", { className: "pf-v5-c-button pf-m-link pf-m-inline align-link-items", rel: "noopener noreferrer", target: "_blank", href: selectedTranslation.pdfDownloadUrl, "data-tracking-id": "ccase-management-ess-request-rsa" },
165
- React.createElement(Trans, null, "terms "),
166
- React.createElement(ExternalLinkAltIcon, null))), isChecked: isTermsChecked, "aria-label": t('I have read and agree to the terms'), onChange: onCheckBoxChange }))))));
153
+ React.createElement("strong", null, "for each case"),
154
+ " when you request Red Hat\u2019s support team to directly access your network or systems.")),
155
+ React.createElement("p", { className: "pf-v6-u-mt-md" },
156
+ React.createElement(Trans, null, "Remote access to your network or systems is not a standard Red Hat problem resolution process. Before Red Hat logs into your systems to analyze your support issue during a remote session, Red Hat needs your approval and authorization for such remote access.")),
157
+ React.createElement("p", { className: "pf-v6-u-mt-md" },
158
+ React.createElement(Trans, null, "Please read and accept the remote session terms below to allow Red Hat to access your network or systems.")),
159
+ React.createElement("div", { className: "remote-session-language-container" },
160
+ React.createElement("div", { className: "terms-language-selector" },
161
+ React.createElement(SingleSelectDropdown, { className: "pf-v6-u-mt-md", id: "terms-language-selector", selected: currentSelection, options: languageOptions, placeholder: t('Select an option that best fits'), onSelect: onLanguageSelect, ariaLabel: t('Select language') })),
162
+ React.createElement("a", { "aria-label": t('Download'), "data-tracking-id": "ess-rsa-modal-terms-download", className: "pf-v6-u-ml-md", href: selectedTranslation.pdfDownloadUrl, rel: "noopener noreferrer", target: "_blank" },
163
+ t('Download'),
164
+ " ",
165
+ React.createElement(DownloadIcon, { className: "pf-v6-u-ml-xs" }))),
166
+ React.createElement("div", null,
167
+ React.createElement(Checkbox, { className: "pf-v6-u-mt-md rsa-checkbox", id: "terms-accept-checkbox", label: React.createElement(React.Fragment, null,
168
+ React.createElement(Trans, null, "I have read and agree to the"),
169
+ ' ',
170
+ React.createElement("a", { className: "pf-v6-c-button pf-m-link pf-m-inline align-link-items", rel: "noopener noreferrer", target: "_blank", href: selectedTranslation.pdfDownloadUrl, "data-tracking-id": "ccase-management-ess-request-rsa" },
171
+ React.createElement(Trans, null, "terms "),
172
+ React.createElement(ExternalLinkAltIcon, null))), isChecked: isTermsChecked, "aria-label": t('I have read and agree to the terms'), onChange: onCheckBoxChange })))),
173
+ React.createElement(ModalFooter, null,
174
+ React.createElement(Button, { key: "submit", "aria-label": t('I agree'), variant: ButtonVariant.primary, onClick: submitRemoteSessionAgreement, "data-tracking-id": "ess-remote-session-agreement-check", isLoading: agreeLoading, isDisabled: !isTermsChecked || agreeLoading }, t('I agree'))))));
167
175
  };
168
176
  export default ESSRemoteSessionCheck;
@@ -1 +1 @@
1
- {"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAKvE,UAAU,MAAM;IACZ,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAeD,QAAA,MAAM,yBAAyB,UAAW,MAAM,sBAoJ/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
1
+ {"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,UAAU,MAAM;IACZ,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,yBAAyB,UAAW,MAAM,sBAqI/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -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,
@@ -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;AAiB5E,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;AAuBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA6bzC;kBA7bQ,mBAAmB;;;AAgc5B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}