@rh-support/troubleshoot 2.6.270 → 2.6.273

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 (166) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +28 -40
  3. package/lib/esm/components/AccountInfo/css/accountSelector.css +3 -2
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
  5. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +5 -2
  6. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  7. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +3 -1
  8. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  9. package/lib/esm/components/CaseEditView/Case.js +9 -5
  10. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
  11. package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +1 -1
  12. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +2 -4
  14. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseOverview/index.js +8 -6
  16. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  17. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +38 -34
  18. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +2 -4
  20. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover.js +1 -1
  21. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +21 -59
  23. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +1 -0
  25. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +2 -1
  27. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  28. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +6 -5
  29. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts +0 -1
  30. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  31. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +0 -1
  32. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +13 -33
  33. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  34. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +1 -1
  35. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  36. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +5 -4
  37. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.js +1 -1
  38. package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.js +1 -1
  39. package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
  40. package/lib/esm/components/CaseInformation/CaseGroup.js +11 -1
  41. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  42. package/lib/esm/components/CaseInformation/CaseInformation.js +11 -9
  43. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  44. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
  45. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  46. package/lib/esm/components/CaseInformation/Description.js +17 -1
  47. package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
  48. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  49. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  50. package/lib/esm/components/CaseInformation/SupportLevel.js +33 -56
  51. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  52. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  53. package/lib/esm/components/CaseManagement/CaseManagement.js +4 -7
  54. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  55. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +5 -4
  56. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +1 -1
  57. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  58. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +12 -6
  59. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
  60. package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +2 -1
  61. package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -1
  62. package/lib/esm/components/Cve/CvePanel.js +16 -8
  63. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  64. package/lib/esm/components/IdeaInformation/IdeaInformation.js +14 -14
  65. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  66. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  67. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  68. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  69. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -14
  70. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  71. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +14 -42
  72. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  73. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +19 -53
  74. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  75. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  76. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts +2 -0
  77. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
  78. package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +16 -13
  79. package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
  80. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
  81. package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
  82. package/lib/esm/components/Recommendations/EARules/EARule.js +3 -1
  83. package/lib/esm/components/Recommendations/InsightsResults.d.ts.map +1 -1
  84. package/lib/esm/components/Recommendations/InsightsResults.js +4 -0
  85. package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
  86. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  87. package/lib/esm/components/Review/Review.js +18 -11
  88. package/lib/esm/components/SessionRestore/SessionRestore.d.ts +2 -0
  89. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  90. package/lib/esm/components/SessionRestore/SessionRestore.js +23 -4
  91. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +3 -1
  92. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -1
  93. package/lib/esm/components/TroubleshootSection/AskRedHat.js +8 -10
  94. package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts.map +1 -1
  95. package/lib/esm/components/TroubleshootSection/ResponseActions.js +5 -3
  96. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +1 -1
  97. package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts.map +1 -1
  98. package/lib/esm/components/TroubleshootSection/UserFeedback.js +10 -8
  99. package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts.map +1 -1
  100. package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.js +5 -1
  101. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  102. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +2 -1
  103. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  104. package/lib/esm/components/shared/useIsSectionValid.js +55 -69
  105. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  106. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +34 -9
  107. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  108. package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
  109. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  110. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
  111. package/lib/esm/constants/caseDetailsConstants.d.ts +10 -10
  112. package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
  113. package/lib/esm/constants/caseDetailsConstants.js +27 -11
  114. package/lib/esm/hooks/useARHResponse.d.ts.map +1 -1
  115. package/lib/esm/hooks/useARHResponse.js +4 -1
  116. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  117. package/lib/esm/hooks/useResetCaseCreate.js +13 -11
  118. package/lib/esm/i18n/template-de.d.ts +6 -0
  119. package/lib/esm/i18n/template-de.d.ts.map +1 -1
  120. package/lib/esm/i18n/template-de.js +6 -0
  121. package/lib/esm/i18n/template-es.d.ts +6 -0
  122. package/lib/esm/i18n/template-es.d.ts.map +1 -1
  123. package/lib/esm/i18n/template-es.js +6 -0
  124. package/lib/esm/i18n/template-fr.d.ts +6 -0
  125. package/lib/esm/i18n/template-fr.d.ts.map +1 -1
  126. package/lib/esm/i18n/template-fr.js +6 -0
  127. package/lib/esm/i18n/template-it.d.ts +6 -0
  128. package/lib/esm/i18n/template-it.d.ts.map +1 -1
  129. package/lib/esm/i18n/template-it.js +6 -0
  130. package/lib/esm/i18n/template-jp.d.ts +6 -0
  131. package/lib/esm/i18n/template-jp.d.ts.map +1 -1
  132. package/lib/esm/i18n/template-jp.js +6 -0
  133. package/lib/esm/i18n/template-ko.d.ts +6 -0
  134. package/lib/esm/i18n/template-ko.d.ts.map +1 -1
  135. package/lib/esm/i18n/template-ko.js +6 -0
  136. package/lib/esm/i18n/template-pt.d.ts +6 -0
  137. package/lib/esm/i18n/template-pt.d.ts.map +1 -1
  138. package/lib/esm/i18n/template-pt.js +6 -0
  139. package/lib/esm/i18n/template-ru.d.ts +6 -0
  140. package/lib/esm/i18n/template-ru.d.ts.map +1 -1
  141. package/lib/esm/i18n/template-ru.js +6 -0
  142. package/lib/esm/i18n/template-zh.d.ts +6 -0
  143. package/lib/esm/i18n/template-zh.d.ts.map +1 -1
  144. package/lib/esm/i18n/template-zh.js +6 -0
  145. package/lib/esm/reducers/CaseConstNTypes.d.ts +23 -0
  146. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  147. package/lib/esm/reducers/CaseConstNTypes.js +9 -4
  148. package/lib/esm/reducers/CaseDiscussionTabReducer.js +1 -1
  149. package/lib/esm/reducers/CaseHelpers.d.ts +10 -7
  150. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  151. package/lib/esm/reducers/CaseHelpers.js +58 -11
  152. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  153. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  154. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  155. package/lib/esm/reducers/CaseReducer.d.ts +16 -5
  156. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  157. package/lib/esm/reducers/CaseReducer.js +96 -24
  158. package/lib/esm/reducers/RulesReducer.d.ts +11 -4
  159. package/lib/esm/reducers/RulesReducer.d.ts.map +1 -1
  160. package/lib/esm/reducers/RulesReducer.js +6 -1
  161. package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
  162. package/lib/esm/reducers/SessionRestoreReducer.js +7 -4
  163. package/lib/esm/reducers/TopContentReducer.js +1 -1
  164. package/lib/esm/scss/_pf-overrides.scss +28 -2
  165. package/package.json +8 -10
  166. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.css +0 -0
@@ -7,10 +7,11 @@ 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 { contacts } from '@cee-eng/hydrajs';
10
+ import { useApolloClient } from '@apollo/client/react';
11
11
  import { ValidatedOptions } from '@patternfly/react-core';
12
12
  import { getPhoneObj, PhoneInput } from '@rh-support/components';
13
13
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
14
+ import { GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
14
15
  import isEmpty from 'lodash/isEmpty';
15
16
  import isEqual from 'lodash/isEqual';
16
17
  import isUndefined from 'lodash/isUndefined';
@@ -24,13 +25,33 @@ import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
24
25
  import { PDFContext } from '../CaseEditView/PDFContainer';
25
26
  import { removeAllChars, trimAndReplacePlus } from '../shared/utils';
26
27
  import { ContactPhoneNumberPopOver } from './ContactPhoneNumberPopOver';
28
+ function fetchContactBySSO(apolloClient, accountNumber, ssoUsername) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
31
+ const { data } = yield apolloClient.query({
32
+ query: GET_ACCOUNT_CONTACTS,
33
+ variables: {
34
+ accountNumber: { eq: accountNumber },
35
+ contactsWhere: { SSOUserName__c: { eq: ssoUsername } },
36
+ first: 1,
37
+ },
38
+ });
39
+ const response = data;
40
+ const contactNode = (_j = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Contacts) === null || _g === void 0 ? void 0 : _g.edges) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.node;
41
+ return {
42
+ phone: (_l = (_k = contactNode === null || contactNode === void 0 ? void 0 : contactNode.Phone) === null || _k === void 0 ? void 0 : _k.value) !== null && _l !== void 0 ? _l : '',
43
+ };
44
+ });
45
+ }
27
46
  export function ContactPhoneNumber() {
28
- const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, shouldNotSetPhoneCountryCode, isCasePhoneUpdating, } = useCaseSelector((state) => ({
47
+ const apolloClient = useApolloClient();
48
+ const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, accountNumberRef, shouldNotSetPhoneCountryCode, isCasePhoneUpdating, } = useCaseSelector((state) => ({
29
49
  suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
30
50
  phoneCountryCode: state.caseDetails.phoneCountryCode,
31
51
  phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber,
32
52
  hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
33
53
  contactSSOName: state.caseDetails.contactSSOName,
54
+ accountNumberRef: state.caseDetails.accountNumberRef,
34
55
  shouldNotSetPhoneCountryCode: state.shouldNotSetPhoneCountryCode,
35
56
  isCasePhoneUpdating: state.isCasePhoneUpdating,
36
57
  }), isEqual);
@@ -156,32 +177,25 @@ export function ContactPhoneNumber() {
156
177
  }
157
178
  }
158
179
  else {
159
- // user is openning case for others (use is partner or red hatter)
180
+ // user is opening case for others (user is partner or red hatter)
160
181
  try {
161
182
  if (!contactSSOName)
162
183
  return;
163
184
  setIsFetchingSso(true);
164
- const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
185
+ const selectedContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
165
186
  setIsFetchingSso(false);
166
- if (selectedContact.supportPhoneAreaCodePrefixLineNumber) {
167
- _phoneAreaCodePrefixLineNumber = selectedContact.supportPhoneAreaCodePrefixLineNumber;
168
- _phoneCountryCode = selectedContact.supportPhoneCountryCode;
169
- _suppliedPhoneNumberVerified = 'Deferred';
187
+ const phoneLength = trimAndReplacePlus(removeAllChars(selectedContact.phone)).length;
188
+ if (phoneLength > 10) {
189
+ _phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
190
+ _phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
170
191
  }
171
192
  else {
172
- const phoneLength = trimAndReplacePlus(removeAllChars(selectedContact.phone)).length;
173
- if (phoneLength > 10) {
174
- _phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
175
- _phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
176
- }
177
- else {
178
- _phoneAreaCodePrefixLineNumber = selectedContact.phone;
179
- _phoneCountryCode = '';
180
- setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: true });
181
- setPortalPhone(selectedContact.phone);
182
- }
183
- _suppliedPhoneNumberVerified = 'Deferred';
193
+ _phoneAreaCodePrefixLineNumber = selectedContact.phone;
194
+ _phoneCountryCode = '';
195
+ setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: true });
196
+ setPortalPhone(selectedContact.phone);
184
197
  }
198
+ _suppliedPhoneNumberVerified = 'Deferred';
185
199
  }
186
200
  catch (e) {
187
201
  _phoneAreaCodePrefixLineNumber = '';
@@ -213,12 +227,11 @@ export function ContactPhoneNumber() {
213
227
  try {
214
228
  if (!contactSSOName)
215
229
  return;
216
- const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
217
- if (isEmpty(selectedContact.supportPhoneAreaCodePrefixLineNumber) &&
218
- !isEmpty(selectedContact.phone)) {
230
+ const selectedContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
231
+ if (!isEmpty(selectedContact.phone)) {
219
232
  portalPhone = selectedContact.phone;
220
233
  phoneLength = trimAndReplacePlus(removeAllChars(portalPhone)).length;
221
- supportPhone = selectedContact.supportPhoneAreaCodePrefixLineNumber;
234
+ supportPhone = '';
222
235
  }
223
236
  }
224
237
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAS3D,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBAsKhD"}
1
+ {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAUvE,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBA+LhD"}
@@ -4,9 +4,10 @@ import OutlinedQuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/ou
4
4
  import { InlineEdit, useBreakpoint } from '@rh-support/components';
5
5
  import isEmpty from 'lodash/isEmpty';
6
6
  import isEqual from 'lodash/isEqual';
7
- import React, { useEffect, useRef, useState } from 'react';
7
+ import React, { useContext, useEffect, useRef, useState } from 'react';
8
8
  import { Trans, useTranslation } from 'react-i18next';
9
9
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
10
+ import { RouteContext } from '../../context/RouteContext';
10
11
  import { useAB } from '../../hooks/useAB';
11
12
  import { CASE_DETAILS_ISSUE_LIMIT } from '../../reducers/CaseConstNTypes';
12
13
  import { getUpdatedDescription } from '../../reducers/CaseHelpers';
@@ -27,6 +28,7 @@ export default function Description(props) {
27
28
  summary: state.caseDetails.summary,
28
29
  }), isEqual);
29
30
  const caseDispatch = useCaseDispatch();
31
+ const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
30
32
  const breakPoint = useBreakpoint();
31
33
  const isLgScreenHeight = breakPoint.lgh; // min-height: 1100px
32
34
  const [isOpen, setIsOpen] = useState(false);
@@ -44,6 +46,20 @@ export default function Description(props) {
44
46
  const newDescription = getUpdatedDescription(ktQ1Local, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName);
45
47
  onCaseDetailsChange({ issue: ktQ1Local, description: newDescription });
46
48
  };
49
+ useEffect(() => {
50
+ if (isNextBtnClickedToShowValidationError && issue) {
51
+ const newDescription = getUpdatedDescription(issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName);
52
+ setCaseDetails(caseDispatch, { description: newDescription });
53
+ }
54
+ }, [
55
+ isNextBtnClickedToShowValidationError,
56
+ issue,
57
+ environment,
58
+ periodicityOfIssue,
59
+ timeFramesAndUrgency,
60
+ v3ClusterName,
61
+ caseDispatch,
62
+ ]);
47
63
  const handleTextAreaClick = () => {
48
64
  if (!hasShownPopover) {
49
65
  setIsOpen(true);
@@ -1 +1 @@
1
- {"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAa5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAW/D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAChE,oBAAoB,EAAE,OAAO,CAAC;CACjC;AASD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxD;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,qBAyQ9B;kBAzQQ,QAAQ;;;AA2QjB,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAa5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAW/D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAChE,oBAAoB,EAAE,OAAO,CAAC;CACjC;AASD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxD;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,qBA0Q9B;kBA1QQ,QAAQ;;;AA4QjB,eAAe,QAAQ,CAAC"}
@@ -160,7 +160,7 @@ function Severity(props) {
160
160
  ' ',
161
161
  React.createElement("a", { href: "/support/policy/severity", target: "_blank" },
162
162
  React.createElement(Trans, null, "Red Hat Support Severity Level Definitions"))), closeBtnAriaLabel: "Close" },
163
- React.createElement(QuestionCircleIcon, { className: "pf-v6-u-ml-xs icon-size cursor-pointer pf-v6-u-text-color-status-custom", "aria-label": t(`Support Severity Level info`) }))),
163
+ React.createElement(QuestionCircleIcon, { color: "#5e40be", className: "pf-v6-u-ml-xs icon-size cursor-pointer", "aria-label": t(`Support Severity Level info`) }))),
164
164
  "\u00A0",
165
165
  filteredSeverities.filter((s) => s.disabled).length !== 0 && (React.createElement(Tooltip, { position: TooltipPosition.top, content: React.createElement(Trans, null, "Only the enabled severity levels are supported for selected product and version.") },
166
166
  React.createElement(Icon, { size: "sm" },
@@ -1 +1 @@
1
- {"version":3,"file":"SupportLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/SupportLevel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAO5C,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,qBAmJlC;kBAnJQ,YAAY;;;AAqJrB,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SupportLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/SupportLevel.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA8B,MAAM,OAAO,CAAC;AAMnD,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAO5C,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,qBAqHlC;kBArHQ,YAAY;;;AAuHrB,eAAe,YAAY,CAAC"}
@@ -1,105 +1,82 @@
1
1
  import { Popover, PopoverPosition } from '@patternfly/react-core';
2
2
  import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
3
3
  import { SingleSelectDropdown } from '@rh-support/components';
4
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
5
4
  import { PreviousCaseTypes, showFtsOnCaseViewEditPage, showFtsOnCreateCasePage } from '@rh-support/utils';
6
5
  import isEmpty from 'lodash/isEmpty';
7
6
  import isEqual from 'lodash/isEqual';
8
- import React, { useContext, useEffect, useState } from 'react';
7
+ import React, { useEffect, useState } from 'react';
9
8
  import { Trans, useTranslation } from 'react-i18next';
10
9
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
11
- import { setCaseDetails } from '../../reducers/CaseReducer';
10
+ import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
12
11
  const defaultProps = {
13
12
  id: '',
14
13
  className: '',
15
14
  };
16
15
  function SupportLevel(props) {
17
- const { product, caseNumber, severity, entitlementSla, ownersEntitlements, caseType, openShiftClusterSupportLevel, } = useCaseSelector((state) => ({
18
- product: state.caseDetails.product,
16
+ const { caseNumber, severity, entitlementSla, caseType, productServiceLevel, otherServiceLevels, selectedEntitlementId, } = useCaseSelector((state) => ({
19
17
  caseNumber: state.caseDetails.caseNumber,
20
18
  severity: state.caseDetails.severity,
21
19
  entitlementSla: state.caseDetails.entitlementSla,
22
- ownersEntitlements: state.ownersEntitlements,
23
20
  caseType: state.caseDetails.caseType,
24
- openShiftClusterSupportLevel: state.openShiftClusterSupportLevel,
21
+ productServiceLevel: state.productServiceLevel,
22
+ otherServiceLevels: state.otherServiceLevels,
23
+ selectedEntitlementId: state.selectedEntitlementId,
25
24
  }), isEqual);
26
25
  const caseDispatch = useCaseDispatch();
27
- const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
28
26
  const { t } = useTranslation();
29
27
  const [isSupportLevelInValid, setIsSupportLevelInValid] = useState(false);
30
28
  const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
29
+ const allSlaOptions = [...(productServiceLevel ? [productServiceLevel] : []), ...(otherServiceLevels !== null && otherServiceLevels !== void 0 ? otherServiceLevels : [])].sort((a, b) => b.priority - a.priority);
30
+ const hasMultipleSlas = allSlaOptions.length > 1;
31
31
  const onCaseDetailsChange = (caseDetails) => {
32
32
  setCaseDetails(caseDispatch, caseDetails);
33
33
  };
34
34
  const onEntitlementChange = (selectedOption) => {
35
- const selected = selectedOption.value;
36
- const casePayload = { entitlementSla: selected };
35
+ const entitlementId = selectedOption.value;
36
+ const matchedSla = allSlaOptions.find((sla) => sla.entitlementId === entitlementId);
37
+ const slaLabel = (matchedSla === null || matchedSla === void 0 ? void 0 : matchedSla.serviceLevelLabel) || '';
38
+ const casePayload = { entitlementSla: slaLabel };
37
39
  casePayload.fts = caseNumber
38
- ? showFtsOnCaseViewEditPage(selected, severity)
39
- : showFtsOnCreateCasePage(selected, severity);
40
+ ? showFtsOnCaseViewEditPage(slaLabel, severity)
41
+ : showFtsOnCreateCasePage(slaLabel, severity);
40
42
  casePayload.fts = casePayload.fts && !isIdea;
41
- setIsSupportLevelInValid(isEmpty(selected));
43
+ setIsSupportLevelInValid(isEmpty(entitlementId));
42
44
  onCaseDetailsChange(casePayload);
45
+ setCaseState(caseDispatch, { selectedEntitlementId: entitlementId });
43
46
  };
44
- const getSlaList = () => {
45
- var _a, _b;
46
- if (openShiftClusterSupportLevel)
47
- return [openShiftClusterSupportLevel];
48
- const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
49
- if (entitledProduct && entitledProduct.serviceLevels) {
50
- return entitledProduct.serviceLevels.split(';') || [];
51
- }
52
- else {
53
- return ownersEntitlements.data ? ownersEntitlements.data.map((sla) => sla.slaProcessId) : [];
54
- }
55
- };
56
- const getSelectedSla = () => {
57
- var _a, _b;
58
- if (openShiftClusterSupportLevel)
59
- return openShiftClusterSupportLevel;
60
- const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
61
- // if sla is empty then it means either first time this component is rendered or product has changed.
62
- if (isEmpty(entitlementSla) && entitledProduct && entitledProduct.preferredServiceLevel) {
63
- return entitledProduct.preferredServiceLevel;
64
- }
65
- else {
66
- return isEmpty(entitlementSla) && !isEmpty(ownersEntitlements.data)
67
- ? ownersEntitlements.data[0].slaProcessId
68
- : entitlementSla;
69
- }
70
- };
71
- const selectedSla = getSelectedSla();
47
+ const selectedSla = entitlementSla || (productServiceLevel === null || productServiceLevel === void 0 ? void 0 : productServiceLevel.serviceLevelLabel) || '';
48
+ const currentEntitlementId = selectedEntitlementId || (productServiceLevel === null || productServiceLevel === void 0 ? void 0 : productServiceLevel.entitlementId) || '';
72
49
  useEffect(() => {
73
- if (!selectedSla || entitlementSla)
50
+ if (!productServiceLevel || entitlementSla)
74
51
  return;
75
- if (entitlementSla !== selectedSla) {
76
- onCaseDetailsChange({ entitlementSla: selectedSla });
52
+ if (entitlementSla !== productServiceLevel.serviceLevelLabel) {
53
+ onCaseDetailsChange({ entitlementSla: productServiceLevel.serviceLevelLabel });
54
+ setCaseState(caseDispatch, { selectedEntitlementId: productServiceLevel.entitlementId });
77
55
  }
78
56
  // eslint-disable-next-line react-hooks/exhaustive-deps
79
- }, [selectedSla, entitlementSla]);
80
- // Create selected option for SingleSelectDropdown
57
+ }, [productServiceLevel, entitlementSla]);
81
58
  const getSelectedOption = () => ({
82
- label: selectedSla || '',
83
- value: selectedSla || '',
59
+ label: selectedSla,
60
+ value: currentEntitlementId,
84
61
  });
85
- // Create options array for SingleSelectDropdown
86
- const getDropdownOptions = () => getSlaList().map((sla) => ({
87
- label: sla,
88
- value: sla,
62
+ const getDropdownOptions = () => allSlaOptions.map((sla) => ({
63
+ label: sla.serviceLevelLabel,
64
+ value: sla.entitlementId || sla.serviceLevelLabel,
89
65
  }));
66
+ if (!hasMultipleSlas)
67
+ return null;
90
68
  return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
91
69
  React.createElement("label", { htmlFor: "get-support-supportLevel" },
92
70
  React.createElement(Trans, null, "Support level"),
93
71
  ' ',
94
- !isEmpty(ownersEntitlements.data) && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
72
+ React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
95
73
  React.createElement(Popover, { "aria-label": "Support Level info", position: PopoverPosition.top, bodyContent: React.createElement("p", null,
96
74
  React.createElement(Trans, { i18nKey: "i18ProductionSupportServiceLevelAgreement" },
97
75
  "Learn more about our",
98
76
  ' ',
99
77
  React.createElement("a", { href: "/support/offerings/production/sla", target: "_blank" }, "production support service level agreement"))), closeBtnAriaLabel: "Close" },
100
- React.createElement(QuestionCircleIcon, { className: "pf-v6-u-ml-xs icon-size cursor-pointer pf-v6-u-text-color-status-custom", "aria-label": "Support Level Info" })),
101
- React.createElement(SingleSelectDropdown, { ariaLabel: t('Select Support Level'), onSelect: onEntitlementChange, selected: getSelectedOption(), options: getDropdownOptions(), isDisabled: ownersEntitlements.isError || isEmpty(ownersEntitlements.data), isInvalid: isSupportLevelInValid, dataTrackingId: "get-support-supportLevel", placeholder: t('Select Support Level') }),
102
- isEmpty(ownersEntitlements.data) && (React.createElement("p", { className: "form-instructions" }, ownersEntitlements.isError ? t('Error loading support levels') : t('No active subscriptions')))));
78
+ React.createElement(QuestionCircleIcon, { color: "#5e40be", className: "pf-v6-u-ml-xs icon-size cursor-pointer", "aria-label": "Support Level Info" })),
79
+ React.createElement(SingleSelectDropdown, { ariaLabel: t('Select Support Level'), onSelect: onEntitlementChange, selected: getSelectedOption(), options: getDropdownOptions(), isInvalid: isSupportLevelInValid, dataTrackingId: "get-support-supportLevel", placeholder: t('Select Support Level') })));
103
80
  }
104
81
  SupportLevel.defaultProps = defaultProps;
105
82
  export default SupportLevel;
@@ -53,11 +53,11 @@ export default function CaseLanguageSelector(props) {
53
53
  props.isManageStep,
54
54
  ]);
55
55
  const getLanguageDropdownOptions = map(caseLanguages.data, (language) => ({
56
- label: Constants.languagesMap[language],
56
+ label: Constants.languagesMap[language] || language,
57
57
  value: language,
58
58
  }));
59
59
  const getSelectedLanguageOption = {
60
- label: caseLanguage ? Constants.languagesMap[caseLanguage] : '',
60
+ label: caseLanguage ? Constants.languagesMap[caseLanguage] || caseLanguage : '',
61
61
  value: caseLanguage || '',
62
62
  };
63
63
  return (React.createElement("div", { className: "form-group" },
@@ -1 +1 @@
1
- {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBAiCnD"}
1
+ {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBAqCnD"}
@@ -2,14 +2,14 @@ import { Grid, GridItem } from '@patternfly/react-core';
2
2
  import React from 'react';
3
3
  import { useCaseDispatch } from '../../context/CaseContext';
4
4
  import { setCaseDetails } from '../../reducers/CaseReducer';
5
- import CaseGroup from '../CaseInformation/CaseGroup';
5
+ // import CaseGroup from '../CaseInformation/CaseGroup';
6
6
  import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
7
7
  import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
8
8
  import Fts from '../CaseInformation/Fts';
9
9
  import Severity from '../CaseInformation/Severity';
10
10
  import SupportLevel from '../CaseInformation/SupportLevel';
11
11
  import CaseLanguageSelector from './CaseLanguageSelector';
12
- import { Cep } from './Cep';
12
+ // import { Cep } from './Cep';
13
13
  import OpenReferenceNumber from './OpenReferenceNumber';
14
14
  import { RHAssociatesSelector } from './RHAssociatesSelector';
15
15
  import CaseContactSelector from './SendNotifications/CaseContactSelector';
@@ -29,11 +29,8 @@ export default function CaseManagement(props) {
29
29
  React.createElement(Fts, { inlineEditable: false }),
30
30
  React.createElement(Grid, { hasGutter: true },
31
31
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
32
- React.createElement(CaseLanguageSelector, { isManageStep: true })),
33
- React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
34
- React.createElement(CaseGroup, { init: true }))),
32
+ React.createElement(CaseLanguageSelector, { isManageStep: true }))),
35
33
  React.createElement(CaseContactSelector, null),
36
34
  React.createElement(RHAssociatesSelector, null),
37
- React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
38
- React.createElement(Cep, null)));
35
+ React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true })));
39
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/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,GAAI,OAAO,MAAM,sBA4J/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;AAM/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,GAAI,OAAO,MAAM,sBAkK/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -37,9 +37,10 @@ const NoClusterIDReasonSelector = (props) => {
37
37
  }
38
38
  };
39
39
  const handleInputChange = (_event, value) => {
40
- setInputValue(value);
41
- setHasLargeReasonExplanation(value.length > SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT);
42
- props.onReasonInputBoxChanged(value);
40
+ const cleaned = value.trim().length === 0 ? '' : value;
41
+ setInputValue(cleaned);
42
+ setHasLargeReasonExplanation(cleaned.length > SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT);
43
+ props.onReasonInputBoxChanged(cleaned);
43
44
  };
44
45
  const getDropdownOptions = () => {
45
46
  return map(caseNoClusterIdReasonsList || [], (option) => ({
@@ -78,7 +79,7 @@ const NoClusterIDReasonSelector = (props) => {
78
79
  React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true },
79
80
  ' ',
80
81
  "*")),
81
- React.createElement("div", { className: "cluster-ID-counter" }, `${(_a = inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) !== null && _a !== void 0 ? _a : 0} / ${SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT}`)),
82
+ props.noClusterIdReason === 'Other' && (React.createElement("div", { className: "cluster-ID-counter" }, `${(_a = inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) !== null && _a !== void 0 ? _a : 0} / ${SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT}`))),
82
83
  React.createElement("div", { className: "no-cluster-id-reason-container" },
83
84
  React.createElement("div", { className: props.noClusterIdReason === 'Other' ? 'd-none' : '' },
84
85
  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" })),
@@ -209,7 +209,7 @@ export function OpenShiftClusterId(props) {
209
209
  };
210
210
  const onReasonExplanationInputBoxChanged = (noClusterIdReasonExplanation) => {
211
211
  if (noClusterIdReason === 'Other') {
212
- setCaseDetails(caseDispatch, { noClusterIdReasonExplanation: noClusterIdReasonExplanation.trim() });
212
+ setCaseDetails(caseDispatch, { noClusterIdReasonExplanation: noClusterIdReasonExplanation });
213
213
  }
214
214
  };
215
215
  const v3ClusterNameInputBoxChanged = (v3Cluster) => {
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CAC3C;AAsBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAudzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CAC3C;AAsBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA+dzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -71,12 +71,18 @@ function OpenshiftDropdownV4(props) {
71
71
  });
72
72
  const onToggle = () => setIsOpen(!isOpen);
73
73
  const onViewMoreClick = () => __awaiter(this, void 0, void 0, function* () {
74
- const page = Math.floor(clustersRawResponse.length / PER_PAGE) + 1;
75
- const fetchedClusters = yield fetchAccountClusters(inputVal, page);
76
- const clusterResponse = [...clustersRawResponse, ...((fetchedClusters === null || fetchedClusters === void 0 ? void 0 : fetchedClusters.items) || [])];
77
- setClustersRawResponse(clusterResponse);
78
- setTotalResultsNo(fetchedClusters.total);
79
- setClustersSelectOptions(getClusterOptions(clusterResponse));
74
+ setClustersRawResponse((prev) => {
75
+ const page = Math.floor(prev.length / PER_PAGE) + 1;
76
+ fetchAccountClusters(inputVal, page).then((fetchedClusters) => {
77
+ setClustersRawResponse((latest) => {
78
+ const clusterResponse = [...latest, ...((fetchedClusters === null || fetchedClusters === void 0 ? void 0 : fetchedClusters.items) || [])];
79
+ setTotalResultsNo(fetchedClusters.total);
80
+ setClustersSelectOptions(getClusterOptions(clusterResponse));
81
+ return clusterResponse;
82
+ });
83
+ });
84
+ return prev;
85
+ });
80
86
  });
81
87
  const onSelect = (event, selectedCluster) => __awaiter(this, void 0, void 0, function* () {
82
88
  if (selectedCluster.type === 'checkbox') {
@@ -1 +1 @@
1
- {"version":3,"file":"NonOrgCaseNotifyeesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAwB,oBAAoB,EAAY,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AA+BD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBA8NxD"}
1
+ {"version":3,"file":"NonOrgCaseNotifyeesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAwB,oBAAoB,EAAY,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AA+BD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBA+NxD"}
@@ -22,6 +22,7 @@ import { accounts } from '@cee-eng/hydrajs';
22
22
  import { Button, Flex, FlexItem, Label, LabelGroup, Menu, MenuContent, MenuItem, MenuList, Popper, TextInputGroup, TextInputGroupMain, } from '@patternfly/react-core';
23
23
  import { getHydraContactLabel, useFetch } from '@rh-support/components';
24
24
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
25
+ import { haltEvent } from '@rh-support/utils';
25
26
  import React, { useContext, useEffect, useRef, useState } from 'react';
26
27
  import { Trans } from 'react-i18next';
27
28
  const isCustomEmailAddress = (user) => {
@@ -154,7 +155,7 @@ export function NonOrgCaseNotifyeesSelector(props) {
154
155
  const isContactOption = isContact(option);
155
156
  const isCurrentUserCaseContact = isContactOption && option.ssoUsername === props.contactSsoUsername;
156
157
  const isDisabled = (props.isChipDisabled && isContactOption) || isCurrentUserCaseContact;
157
- return (React.createElement(Label, { key: getKey(option) || index, onClose: () => onRemoveItem(option), isDisabled: isDisabled, closeBtnAriaLabel: `Remove ${getHydraContactLabel(option)}`, variant: "outline", color: "blue" }, getHydraContactLabel(option)));
158
+ return (React.createElement(Label, { key: getKey(option) || index, onClose: () => onRemoveItem(option), isDisabled: isDisabled, closeBtnAriaLabel: `Remove ${getHydraContactLabel(option)}`, variant: "outline", color: "blue", onClick: haltEvent }, getHydraContactLabel(option)));
158
159
  })));
159
160
  };
160
161
  const menu = (React.createElement(Menu, { ref: menuRef },
@@ -1 +1 @@
1
- {"version":3,"file":"CvePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CvePanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,sBAwCrC,CAAC"}
1
+ {"version":3,"file":"CvePanel.d.ts","sourceRoot":"","sources":["../../../../src/components/Cve/CvePanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,sBAkDrC,CAAC"}
@@ -2,22 +2,30 @@ import { Accordion, AccordionContent, AccordionItem, AccordionToggle } from '@pa
2
2
  import isEqual from 'lodash/isEqual';
3
3
  import map from 'lodash/map';
4
4
  import slice from 'lodash/slice';
5
- import React, { useState } from 'react';
5
+ import React, { useEffect, useRef, useState } from 'react';
6
6
  import { useCaseSelector } from '../../context/CaseContext';
7
7
  import { CveItem } from './CveItem';
8
8
  export const CvePanel = (props) => {
9
- var _a;
10
9
  const { cveWorkflowRecommendation } = useCaseSelector((state) => ({
11
10
  cveWorkflowRecommendation: state.cveWorkflowRecommendation,
12
11
  }), isEqual);
13
- const [expanded, setExpanded] = useState(((_a = cveWorkflowRecommendation === null || cveWorkflowRecommendation === void 0 ? void 0 : cveWorkflowRecommendation[0]) === null || _a === void 0 ? void 0 : _a.title) || '');
14
- const handleToggle = (id) => setExpanded(id === expanded ? '' : id);
12
+ const [expanded, setExpanded] = useState(true);
13
+ const prevCveIds = useRef([]);
14
+ // Auto-expand accordion whenever CVE data changes
15
+ useEffect(() => {
16
+ const currentCveIds = (cveWorkflowRecommendation === null || cveWorkflowRecommendation === void 0 ? void 0 : cveWorkflowRecommendation.map((cve) => cve.title || cve.nid)) || [];
17
+ const cveIdsChanged = !isEqual(prevCveIds.current, currentCveIds);
18
+ if (cveIdsChanged && currentCveIds.length > 0) {
19
+ setExpanded(true);
20
+ prevCveIds.current = currentCveIds;
21
+ }
22
+ }, [cveWorkflowRecommendation]);
23
+ const handleToggle = () => setExpanded(!expanded);
15
24
  const renderAccordionItem = (cve, index) => {
16
- const isExpanded = expanded === (cve === null || cve === void 0 ? void 0 : cve.title);
17
- return (React.createElement(AccordionItem, { isExpanded: isExpanded, key: `cve-item-${index}` },
18
- React.createElement(AccordionToggle, { onClick: () => handleToggle(cve.title), id: `cve-toggle-${index}`, "data-tracking-id": "cve-accordion-toggle" }, cve.title),
25
+ return (React.createElement(AccordionItem, { isExpanded: expanded, key: `cve-item-${index}` },
26
+ React.createElement(AccordionToggle, { onClick: handleToggle, id: `cve-toggle-${index}`, "data-tracking-id": "cve-accordion-toggle" }, cve.title),
19
27
  React.createElement(AccordionContent, { id: `cve-content-${index}` },
20
- React.createElement(CveItem, { cve: cve, isExpanded: isExpanded, index: index }))));
28
+ React.createElement(CveItem, { cve: cve, isExpanded: expanded, index: index }))));
21
29
  };
22
30
  return (React.createElement(Accordion, { isBordered: false, displaySize: 'default', asDefinitionList: false, className: `${props.className ? props.className : ''}` }, map(slice(cveWorkflowRecommendation, 0, 4), renderAccordionItem)));
23
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBA6ItC"}
1
+ {"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBAkJtC"}