@rh-support/troubleshoot 2.6.299 → 2.6.300

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 (178) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +40 -28
  3. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +19 -46
  5. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/Case.js +17 -49
  7. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +8 -25
  9. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +17 -31
  11. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -1
  12. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +6 -8
  14. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseOverview/index.js +28 -39
  16. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +3 -1
  17. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +4 -3
  19. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +7 -4
  21. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +36 -13
  23. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +33 -11
  25. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +34 -38
  27. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  28. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -9
  29. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  30. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +59 -19
  31. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +9 -16
  33. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -4
  34. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  35. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +148 -110
  36. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +2 -6
  37. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  38. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +241 -147
  39. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +3 -5
  41. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +1 -3
  43. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  44. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -35
  45. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  46. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +224 -63
  47. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  48. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -7
  49. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  50. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +9 -7
  51. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  52. package/lib/esm/components/CaseInformation/CaseInformation.js +5 -7
  53. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  54. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +24 -37
  55. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  56. package/lib/esm/components/CaseInformation/SupportLevel.js +55 -32
  57. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  58. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  59. package/lib/esm/components/CaseManagement/CaseManagement.js +9 -4
  60. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  61. package/lib/esm/components/CaseManagement/Cep.js +7 -4
  62. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  63. package/lib/esm/components/IdeaInformation/IdeaInformation.js +12 -11
  64. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  65. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
  66. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
  67. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  68. package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
  69. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  70. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
  71. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  72. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -30
  73. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  74. package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
  75. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  76. package/lib/esm/components/Review/Review.js +18 -16
  77. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  78. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
  79. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  80. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +8 -5
  81. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  82. package/lib/esm/components/shared/useIsSectionValid.js +64 -50
  83. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  84. package/lib/esm/components/shared/usePostComment.js +10 -6
  85. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  86. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +24 -105
  87. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  88. package/lib/esm/components/wizardLayout/WizardLayout.js +7 -6
  89. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  90. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -10
  91. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  92. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  93. package/lib/esm/hooks/useResetCaseCreate.js +11 -18
  94. package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -86
  95. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  96. package/lib/esm/reducers/CaseConstNTypes.js +1 -5
  97. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +1 -3
  98. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  99. package/lib/esm/reducers/CaseDetailsPageReducer.js +5 -22
  100. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +2 -0
  101. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  102. package/lib/esm/reducers/CaseDiscussionTabReducer.js +28 -1
  103. package/lib/esm/reducers/CaseHelpers.d.ts +1 -2
  104. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  105. package/lib/esm/reducers/CaseHelpers.js +2 -34
  106. package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
  107. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  108. package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
  109. package/lib/esm/reducers/CaseReducer.d.ts +8 -27
  110. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  111. package/lib/esm/reducers/CaseReducer.js +33 -127
  112. package/package.json +6 -6
  113. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -3
  114. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
  115. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -22
  116. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -15
  117. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
  118. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -19
  119. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
  120. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
  121. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -49
  122. package/lib/esm/graphql/index.d.ts +0 -4
  123. package/lib/esm/graphql/index.d.ts.map +0 -1
  124. package/lib/esm/graphql/index.js +0 -3
  125. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
  126. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
  127. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
  128. package/lib/esm/graphql/mutations/index.d.ts +0 -2
  129. package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
  130. package/lib/esm/graphql/mutations/index.js +0 -1
  131. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
  132. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
  133. package/lib/esm/graphql/queries/getEscalationDetails.js +0 -24
  134. package/lib/esm/graphql/queries/getParentId.d.ts +0 -2
  135. package/lib/esm/graphql/queries/getParentId.d.ts.map +0 -1
  136. package/lib/esm/graphql/queries/getParentId.js +0 -16
  137. package/lib/esm/graphql/queries/index.d.ts +0 -3
  138. package/lib/esm/graphql/queries/index.d.ts.map +0 -1
  139. package/lib/esm/graphql/queries/index.js +0 -2
  140. package/lib/esm/graphql/schemas/escalation.d.ts +0 -84
  141. package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
  142. package/lib/esm/graphql/schemas/escalation.js +0 -1
  143. package/lib/esm/graphql/schemas/index.d.ts +0 -2
  144. package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
  145. package/lib/esm/graphql/schemas/index.js +0 -1
  146. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +0 -4
  147. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +0 -1
  148. package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +0 -12
  149. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
  150. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
  151. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -55
  152. package/lib/esm/hooks/useCaseComments/index.d.ts +0 -7
  153. package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
  154. package/lib/esm/hooks/useCaseComments/index.js +0 -5
  155. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
  156. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
  157. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -66
  158. package/lib/esm/hooks/useCaseComments/types.d.ts +0 -80
  159. package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
  160. package/lib/esm/hooks/useCaseComments/types.js +0 -1
  161. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -16
  162. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
  163. package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -25
  164. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
  165. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
  166. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
  167. package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
  168. package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
  169. package/lib/esm/hooks/useCaseHistory.js +0 -98
  170. package/lib/esm/models/caseHistory.d.ts +0 -80
  171. package/lib/esm/models/caseHistory.d.ts.map +0 -1
  172. package/lib/esm/models/caseHistory.js +0 -1
  173. package/lib/esm/utils/TimelineUtils.d.ts +0 -41
  174. package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
  175. package/lib/esm/utils/TimelineUtils.js +0 -134
  176. package/lib/esm/utils/caseHistoryUtils.d.ts +0 -66
  177. package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
  178. package/lib/esm/utils/caseHistoryUtils.js +0 -165
@@ -7,11 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useApolloClient } from '@apollo/client/react';
10
+ import { contacts } from '@cee-eng/hydrajs';
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';
15
14
  import isEmpty from 'lodash/isEmpty';
16
15
  import isEqual from 'lodash/isEqual';
17
16
  import isUndefined from 'lodash/isUndefined';
@@ -25,33 +24,13 @@ import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
25
24
  import { PDFContext } from '../CaseEditView/PDFContainer';
26
25
  import { removeAllChars, trimAndReplacePlus } from '../shared/utils';
27
26
  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
- }
46
27
  export function ContactPhoneNumber() {
47
- const apolloClient = useApolloClient();
48
- const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, accountNumberRef, shouldNotSetPhoneCountryCode, isCasePhoneUpdating, } = useCaseSelector((state) => ({
28
+ const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, shouldNotSetPhoneCountryCode, isCasePhoneUpdating, } = useCaseSelector((state) => ({
49
29
  suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
50
30
  phoneCountryCode: state.caseDetails.phoneCountryCode,
51
31
  phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber,
52
32
  hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
53
33
  contactSSOName: state.caseDetails.contactSSOName,
54
- accountNumberRef: state.caseDetails.accountNumberRef,
55
34
  shouldNotSetPhoneCountryCode: state.shouldNotSetPhoneCountryCode,
56
35
  isCasePhoneUpdating: state.isCasePhoneUpdating,
57
36
  }), isEqual);
@@ -177,25 +156,32 @@ export function ContactPhoneNumber() {
177
156
  }
178
157
  }
179
158
  else {
180
- // user is opening case for others (user is partner or red hatter)
159
+ // user is openning case for others (use is partner or red hatter)
181
160
  try {
182
161
  if (!contactSSOName)
183
162
  return;
184
163
  setIsFetchingSso(true);
185
- const selectedContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
164
+ const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
186
165
  setIsFetchingSso(false);
187
- const phoneLength = trimAndReplacePlus(removeAllChars(selectedContact.phone)).length;
188
- if (phoneLength > 10) {
189
- _phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
190
- _phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
166
+ if (selectedContact.supportPhoneAreaCodePrefixLineNumber) {
167
+ _phoneAreaCodePrefixLineNumber = selectedContact.supportPhoneAreaCodePrefixLineNumber;
168
+ _phoneCountryCode = selectedContact.supportPhoneCountryCode;
169
+ _suppliedPhoneNumberVerified = 'Deferred';
191
170
  }
192
171
  else {
193
- _phoneAreaCodePrefixLineNumber = selectedContact.phone;
194
- _phoneCountryCode = '';
195
- setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: true });
196
- setPortalPhone(selectedContact.phone);
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';
197
184
  }
198
- _suppliedPhoneNumberVerified = 'Deferred';
199
185
  }
200
186
  catch (e) {
201
187
  _phoneAreaCodePrefixLineNumber = '';
@@ -227,11 +213,12 @@ export function ContactPhoneNumber() {
227
213
  try {
228
214
  if (!contactSSOName)
229
215
  return;
230
- const selectedContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
231
- if (!isEmpty(selectedContact.phone)) {
216
+ const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
217
+ if (isEmpty(selectedContact.supportPhoneAreaCodePrefixLineNumber) &&
218
+ !isEmpty(selectedContact.phone)) {
232
219
  portalPhone = selectedContact.phone;
233
220
  phoneLength = trimAndReplacePlus(removeAllChars(portalPhone)).length;
234
- supportPhone = '';
221
+ supportPhone = selectedContact.supportPhoneAreaCodePrefixLineNumber;
235
222
  }
236
223
  }
237
224
  catch (e) {
@@ -1 +1 @@
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
+ {"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,qBAoJlC;kBApJQ,YAAY;;;AAsJrB,eAAe,YAAY,CAAC"}
@@ -1,82 +1,105 @@
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';
4
5
  import { PreviousCaseTypes, showFtsOnCaseViewEditPage, showFtsOnCreateCasePage } from '@rh-support/utils';
5
6
  import isEmpty from 'lodash/isEmpty';
6
7
  import isEqual from 'lodash/isEqual';
7
- import React, { useEffect, useState } from 'react';
8
+ import React, { useContext, useEffect, useState } from 'react';
8
9
  import { Trans, useTranslation } from 'react-i18next';
9
10
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
10
- import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
11
+ import { setCaseDetails } from '../../reducers/CaseReducer';
11
12
  const defaultProps = {
12
13
  id: '',
13
14
  className: '',
14
15
  };
15
16
  function SupportLevel(props) {
16
- const { caseNumber, severity, entitlementSla, caseType, productServiceLevel, otherServiceLevels, selectedEntitlementId, } = useCaseSelector((state) => ({
17
+ const { product, caseNumber, severity, entitlementSla, ownersEntitlements, caseType, openShiftClusterSupportLevel, } = useCaseSelector((state) => ({
18
+ product: state.caseDetails.product,
17
19
  caseNumber: state.caseDetails.caseNumber,
18
20
  severity: state.caseDetails.severity,
19
21
  entitlementSla: state.caseDetails.entitlementSla,
22
+ ownersEntitlements: state.ownersEntitlements,
20
23
  caseType: state.caseDetails.caseType,
21
- productServiceLevel: state.productServiceLevel,
22
- otherServiceLevels: state.otherServiceLevels,
23
- selectedEntitlementId: state.selectedEntitlementId,
24
+ openShiftClusterSupportLevel: state.openShiftClusterSupportLevel,
24
25
  }), isEqual);
25
26
  const caseDispatch = useCaseDispatch();
27
+ const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
26
28
  const { t } = useTranslation();
27
29
  const [isSupportLevelInValid, setIsSupportLevelInValid] = useState(false);
28
30
  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 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 };
35
+ const selected = selectedOption.value;
36
+ const casePayload = { entitlementSla: selected };
39
37
  casePayload.fts = caseNumber
40
- ? showFtsOnCaseViewEditPage(slaLabel, severity)
41
- : showFtsOnCreateCasePage(slaLabel, severity);
38
+ ? showFtsOnCaseViewEditPage(selected, severity)
39
+ : showFtsOnCreateCasePage(selected, severity);
42
40
  casePayload.fts = casePayload.fts && !isIdea;
43
- setIsSupportLevelInValid(isEmpty(entitlementId));
41
+ setIsSupportLevelInValid(isEmpty(selected));
44
42
  onCaseDetailsChange(casePayload);
45
- setCaseState(caseDispatch, { selectedEntitlementId: entitlementId });
46
43
  };
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) || '';
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();
49
72
  useEffect(() => {
50
- if (!productServiceLevel || entitlementSla)
73
+ if (!selectedSla || entitlementSla)
51
74
  return;
52
- if (entitlementSla !== productServiceLevel.serviceLevelLabel) {
53
- onCaseDetailsChange({ entitlementSla: productServiceLevel.serviceLevelLabel });
54
- setCaseState(caseDispatch, { selectedEntitlementId: productServiceLevel.entitlementId });
75
+ if (entitlementSla !== selectedSla) {
76
+ onCaseDetailsChange({ entitlementSla: selectedSla });
55
77
  }
56
78
  // eslint-disable-next-line react-hooks/exhaustive-deps
57
- }, [productServiceLevel, entitlementSla]);
79
+ }, [selectedSla, entitlementSla]);
80
+ // Create selected option for SingleSelectDropdown
58
81
  const getSelectedOption = () => ({
59
- label: selectedSla,
60
- value: currentEntitlementId,
82
+ label: selectedSla || '',
83
+ value: selectedSla || '',
61
84
  });
62
- const getDropdownOptions = () => allSlaOptions.map((sla) => ({
63
- label: sla.serviceLevelLabel,
64
- value: sla.entitlementId || sla.serviceLevelLabel,
85
+ // Create options array for SingleSelectDropdown
86
+ const getDropdownOptions = () => getSlaList().map((sla) => ({
87
+ label: sla,
88
+ value: sla,
65
89
  }));
66
- if (!hasMultipleSlas)
67
- return null;
68
90
  return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
69
91
  React.createElement("label", { htmlFor: "get-support-supportLevel" },
70
92
  React.createElement(Trans, null, "Support level"),
71
93
  ' ',
72
- React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
94
+ !isEmpty(ownersEntitlements.data) && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
73
95
  React.createElement(Popover, { "aria-label": "Support Level info", position: PopoverPosition.top, bodyContent: React.createElement("p", null,
74
96
  React.createElement(Trans, { i18nKey: "i18ProductionSupportServiceLevelAgreement" },
75
97
  "Learn more about our",
76
98
  ' ',
77
99
  React.createElement("a", { href: "/support/offerings/production/sla", target: "_blank" }, "production support service level agreement"))), closeBtnAriaLabel: "Close" },
78
100
  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') })));
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')))));
80
103
  }
81
104
  SupportLevel.defaultProps = defaultProps;
82
105
  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] || language,
56
+ label: Constants.languagesMap[language],
57
57
  value: language,
58
58
  }));
59
59
  const getSelectedLanguageOption = {
60
- label: caseLanguage ? Constants.languagesMap[caseLanguage] || caseLanguage : '',
60
+ label: caseLanguage ? Constants.languagesMap[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,qBAuCnD"}
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"}
@@ -2,16 +2,17 @@ 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
+ import CaseContactSelector from './SendNotifications/CaseContactSelector';
15
16
  export default function CaseManagement(props) {
16
17
  const caseDispatch = useCaseDispatch();
17
18
  const onSeverityChange = (payload) => {
@@ -28,7 +29,11 @@ export default function CaseManagement(props) {
28
29
  React.createElement(Fts, { inlineEditable: false }),
29
30
  React.createElement(Grid, { hasGutter: true },
30
31
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
31
- React.createElement(CaseLanguageSelector, { isManageStep: true }))),
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 }))),
35
+ React.createElement(CaseContactSelector, null),
32
36
  React.createElement(RHAssociatesSelector, null),
33
- React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true })));
37
+ React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
38
+ React.createElement(Cep, null)));
34
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAe/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,qBAkThC"}
1
+ {"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAoB/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,qBA8ThC"}
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { useApolloClient } from '@apollo/client/react';
11
10
  import { Button, Checkbox, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, Popover, PopoverPosition, TextArea, TextInput, ValidatedOptions, } from '@patternfly/react-core';
12
11
  import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
13
12
  import { LoadingIndicator, ToastNotification, useConfirmation } from '@rh-support/components';
@@ -18,8 +17,10 @@ import isEqual from 'lodash/isEqual';
18
17
  import React, { useContext, useEffect, useState } from 'react';
19
18
  import { Trans, useTranslation } from 'react-i18next';
20
19
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
21
- import { GET_CASE_COMMENTS } from '../../hooks/useCaseComments';
20
+ import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
21
+ import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../context/CaseDiscussionTabContext';
22
22
  import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
23
+ import { updateDiscussionStateComments } from '../../reducers/CaseDiscussionTabReducer';
23
24
  import { checkForCaseStatusToggleOnAttachOrComment, postCepDetails, setCaseDetails, setCaseState, updateCaseDetails, } from '../../reducers/CaseReducer';
24
25
  import { PDFContext } from '../CaseEditView/PDFContainer';
25
26
  export function Cep(props) {
@@ -41,7 +42,9 @@ export function Cep(props) {
41
42
  const ability = useContext(AbilityContext);
42
43
  const canUseCep = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.CEP);
43
44
  const confirm = useConfirmation();
44
- const client = useApolloClient();
45
+ const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
46
+ const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
47
+ const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
45
48
  const canEditCase = useCanEditCase();
46
49
  const [saveButtonIsClicked, setSaveButtonIsClicked] = useState(false);
47
50
  const { isExportingPDF } = useContext(PDFContext);
@@ -89,7 +92,7 @@ export function Cep(props) {
89
92
  checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status);
90
93
  if (caseDetails.cep) {
91
94
  yield postCepDetails(caseDispatch, caseNumber, cepDetailsLocal);
92
- client.refetchQueries({ include: [GET_CASE_COMMENTS] });
95
+ updateDiscussionStateComments(dispatchDiscussion, caseDispatch, caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
93
96
  }
94
97
  ToastNotification.addSuccessMessage(t(`Consultant Engagement in Progress has been updated successfully`));
95
98
  }
@@ -1 +1 @@
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,sBAoJtC"}
1
+ {"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBA8ItC"}
@@ -1,4 +1,3 @@
1
- import { useApolloClient } from '@apollo/client/react';
2
1
  import { Grid, GridItem } from '@patternfly/react-core';
3
2
  import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
4
3
  import { fetchCaseSeverities, fetchCaseTypes, fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
@@ -9,22 +8,21 @@ import React, { useContext, useEffect } from 'react';
9
8
  import { Trans, useTranslation } from 'react-i18next';
10
9
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
11
10
  import { setCaseDetails } from '../../reducers/CaseReducer';
12
- // import CaseGroup from '../CaseInformation/CaseGroup';
11
+ import CaseGroup from '../CaseInformation/CaseGroup';
13
12
  import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
14
13
  import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
15
14
  import Severity from '../CaseInformation/Severity';
16
15
  import SupportLevel from '../CaseInformation/SupportLevel';
17
16
  import CaseLanguageSelector from '../CaseManagement/CaseLanguageSelector';
18
- // import { Cep } from '../CaseManagement/Cep';
17
+ import { Cep } from '../CaseManagement/Cep';
19
18
  import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
20
19
  import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
21
- // import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
20
+ import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
22
21
  import KtQuestions from '../ImproveCase/KtQuestions';
23
22
  export default function IdeaInformation() {
24
23
  const { t } = useTranslation();
25
24
  const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
26
25
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
27
- const apolloClient = useApolloClient();
28
26
  const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
29
27
  contactSSOName: state.caseDetails.contactSSOName,
30
28
  ownersCaseGroups: state.ownersCaseGroups,
@@ -50,13 +48,13 @@ export default function IdeaInformation() {
50
48
  }
51
49
  const allPromisses = [];
52
50
  if (haventLoadedMetadata(allCaseTypes)) {
53
- allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, apolloClient));
51
+ allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
54
52
  }
55
53
  if (haventLoadedMetadata(allCaseSeverities)) {
56
- allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, apolloClient));
54
+ allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
57
55
  }
58
56
  if (haventLoadedMetadata(caseLanguages)) {
59
- allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer, apolloClient));
57
+ allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer));
60
58
  }
61
59
  Promise.all(allPromisses);
62
60
  }, [
@@ -68,7 +66,6 @@ export default function IdeaInformation() {
68
66
  loggedInUserJwtToken,
69
67
  selectedAccountDetails,
70
68
  loggedInUsersAccount.data.secureSupport,
71
- apolloClient,
72
69
  ]);
73
70
  const onSeverityChange = (payload) => {
74
71
  setCaseDetails(caseDispatch, payload);
@@ -103,7 +100,11 @@ export default function IdeaInformation() {
103
100
  React.createElement(ContactPhoneNumberAlert, null),
104
101
  React.createElement(Grid, { hasGutter: true },
105
102
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
106
- React.createElement(CaseLanguageSelector, { isManageStep: true }))),
103
+ React.createElement(CaseLanguageSelector, { isManageStep: true })),
104
+ React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
105
+ React.createElement(CaseGroup, { init: true }))),
106
+ React.createElement(CaseContactSelector, null),
107
107
  React.createElement(RHAssociatesSelector, null),
108
- React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }))))));
108
+ React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
109
+ React.createElement(Cep, null))))));
109
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SupportTypeSelectorPage.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/SupportTypeSelectorPage.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAiB/D,MAAM,CAAC,OAAO,UAAU,uBAAuB,sBAkM9C"}
1
+ {"version":3,"file":"SupportTypeSelectorPage.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/SupportTypeSelectorPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAiB/D,MAAM,CAAC,OAAO,UAAU,uBAAuB,sBAiM9C"}
@@ -1,4 +1,3 @@
1
- import { useApolloClient } from '@apollo/client/react';
2
1
  import { Bullseye, Card, CardBody, Gallery, GalleryItem, Split, SplitItem } from '@patternfly/react-core';
3
2
  import { LoadingIndicator } from '@rh-support/components';
4
3
  import { fetchCaseTypes, useGlobalDispatchContext, useGlobalStateContext } from '@rh-support/react-context';
@@ -12,9 +11,8 @@ import { getUpdatedDescription } from '../../reducers/CaseHelpers';
12
11
  import { setCaseDetails } from '../../reducers/CaseReducer';
13
12
  import { BugIcon, CertificationIcon, CustomerServiceIcon, DocumentationIcon, GearIcon, IdeaIcon, RcaIcon, } from './SupportTypeIcons';
14
13
  export default function SupportTypeSelectorPage() {
15
- const { globalMetadataState: { allCaseTypes }, } = useGlobalStateContext();
14
+ const { globalMetadataState: { allCaseTypes, loggedInUsersAccount }, } = useGlobalStateContext();
16
15
  const globalDispatch = useGlobalDispatchContext();
17
- const apolloClient = useApolloClient();
18
16
  const [selectedSupportType, setSelectedSupportType] = useState('');
19
17
  const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
20
18
  const { caseType, isFetchingSelectedAccountDetails, issue, timeFramesAndUrgency, v3ClusterName } = useCaseSelector((state) => ({
@@ -29,7 +27,7 @@ export default function SupportTypeSelectorPage() {
29
27
  useEffect(() => {
30
28
  if (haventLoadedMetadata(allCaseTypes)) {
31
29
  // Load support types.
32
- fetchCaseTypes(globalDispatch, apolloClient);
30
+ fetchCaseTypes(globalDispatch, loggedInUsersAccount.data.secureSupport);
33
31
  }
34
32
  // eslint-disable-next-line react-hooks/exhaustive-deps
35
33
  }, []);
@@ -6,6 +6,7 @@ interface IProps {
6
6
  routeProps: RouteComponentProps<IRouteUrlParams>;
7
7
  loadTCOnChange?: boolean;
8
8
  showTCAfterButtonClicked?: boolean;
9
+ checkEntitledProduct?: boolean;
9
10
  isOnSummaryPage?: boolean;
10
11
  isOnGetSupportPage?: boolean;
11
12
  isOnReviewPage?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvG,UAAU,MAAM;IACZ,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAOD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAoJvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvG,UAAU,MAAM;IACZ,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAQD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAuKvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import { Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant } from '@patternfly/react-core';
2
+ import { AlertMessage, AlertType } from '@rh-support/components';
2
3
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
+ import filter from 'lodash/filter';
5
+ import find from 'lodash/find';
3
6
  import isEmpty from 'lodash/isEmpty';
4
7
  import isEqual from 'lodash/isEqual';
5
8
  import React, { forwardRef, useContext, useEffect, useState } from 'react';
@@ -16,6 +19,7 @@ import { ProductVersionDropdownSelector } from './ProductVersionDropdownSelector
16
19
  const defaultProps = {
17
20
  loadTCOnChange: false,
18
21
  showTCAfterButtonClicked: false,
22
+ checkEntitledProduct: false,
19
23
  };
20
24
  /**
21
25
  * Renders a dropdown list to select all products.
@@ -26,12 +30,15 @@ const defaultProps = {
26
30
  * @param props
27
31
  */
28
32
  const AllProductsSelector = forwardRef((props, ref) => {
29
- const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
33
+ var _a, _b;
34
+ const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
30
35
  const caseDispatch = useCaseDispatch();
31
- const { product, version } = useCaseSelector((state) => ({
36
+ const { product, version, contactSSOName } = useCaseSelector((state) => ({
32
37
  product: state.caseDetails.product,
33
38
  version: state.caseDetails.version,
39
+ contactSSOName: state.caseDetails.contactSSOName,
34
40
  }), isEqual);
41
+ //test
35
42
  const { topContentState: { topContent }, } = useContext(TCStateContext);
36
43
  const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
37
44
  const [isModalOpen, setIsModalOpen] = useState(false);
@@ -39,6 +46,7 @@ const AllProductsSelector = forwardRef((props, ref) => {
39
46
  const [showModalButton, setShowModalButton] = useState(false);
40
47
  const [isProductChanged, setProductChanged] = useState(false);
41
48
  const { t } = useTranslation();
49
+ const isEntitledProduct = (_b = find((_a = allProducts === null || allProducts === void 0 ? void 0 : allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, (p) => p.product === product)) === null || _b === void 0 ? void 0 : _b.isEntitledProduct;
42
50
  useEffect(() => {
43
51
  // after TC data is loaded we open the modal
44
52
  const showTCPopUpModalOnProductChange = props.loadTCOnChange && !props.showTCAfterButtonClicked && showModal;
@@ -71,6 +79,7 @@ const AllProductsSelector = forwardRef((props, ref) => {
71
79
  };
72
80
  RouteUtils.updateQueryParams(props.routeProps, newParams);
73
81
  }
82
+ const entitledProducts = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
74
83
  const renderProductVersionDropdownSelector = (activeSection === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT) &&
75
84
  !props.caseCreateExperience) ||
76
85
  activeSection === AppRouteSections.GET_SUPPORT ||
@@ -82,9 +91,12 @@ const AllProductsSelector = forwardRef((props, ref) => {
82
91
  return (React.createElement(React.Fragment, null,
83
92
  renderProductVersionDropdownSelector && (React.createElement("div", { className: "form-group product-selector-wrapper" },
84
93
  React.createElement("div", { className: "all-product-selector-dropdown" },
85
- React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching })))),
94
+ React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage, loadTCOnChange: props.loadTCOnChange, isFetching: topContent.isFetching })))),
86
95
  renderOpenCaseIssue && (React.createElement("div", { className: "case-details-summary" },
87
96
  React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage, isOnGetSupportPage: props.isOnGetSupportPage }))),
97
+ React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v6-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
98
+ ? 'You are'
99
+ : 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
88
100
  showModalButton &&
89
101
  !isEmpty(product) &&
90
102
  !isEmpty(version) &&
@@ -1 +1 @@
1
- {"version":3,"file":"NewProductDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAiBpE,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,0BAA0B,GAAI,OAAO,MAAM,sBA+JvD,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"NewProductDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAoBpE,OAAO,KAAkD,MAAM,OAAO,CAAC;AAUvE,UAAU,MAAM;IACZ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,0BAA0B,GAAI,OAAO,MAAM,sBA2MvD,CAAC;AAEF,eAAe,0BAA0B,CAAC"}