@rh-support/troubleshoot 2.6.287 → 2.6.292

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 (101) 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/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +43 -12
  5. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/Case.js +7 -5
  7. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +25 -8
  9. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +14 -10
  11. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/CaseOverview/index.js +24 -18
  13. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +38 -34
  15. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -9
  17. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +19 -59
  19. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
  21. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +5 -3
  23. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +3 -2
  25. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  26. package/lib/esm/components/CaseInformation/CaseInformation.js +7 -5
  27. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  28. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
  29. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  30. package/lib/esm/components/CaseInformation/SupportLevel.js +32 -55
  31. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  32. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  33. package/lib/esm/components/CaseManagement/CaseManagement.js +4 -7
  34. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  35. package/lib/esm/components/IdeaInformation/IdeaInformation.js +10 -10
  36. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  37. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  38. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  39. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  40. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
  41. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  42. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
  43. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  44. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +19 -53
  45. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  46. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  47. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  48. package/lib/esm/components/Review/Review.js +16 -18
  49. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  50. package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
  51. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +1 -1
  52. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  53. package/lib/esm/components/shared/useIsSectionValid.js +50 -64
  54. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  55. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +34 -9
  56. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  57. package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
  58. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  59. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
  60. package/lib/esm/graphql/index.d.ts +4 -0
  61. package/lib/esm/graphql/index.d.ts.map +1 -0
  62. package/lib/esm/graphql/index.js +3 -0
  63. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
  64. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
  65. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
  66. package/lib/esm/graphql/mutations/index.d.ts +2 -0
  67. package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
  68. package/lib/esm/graphql/mutations/index.js +1 -0
  69. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
  70. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
  71. package/lib/esm/graphql/queries/getEscalationDetails.js +24 -0
  72. package/lib/esm/graphql/queries/getParentId.d.ts +2 -0
  73. package/lib/esm/graphql/queries/getParentId.d.ts.map +1 -0
  74. package/lib/esm/graphql/queries/getParentId.js +16 -0
  75. package/lib/esm/graphql/queries/index.d.ts +3 -0
  76. package/lib/esm/graphql/queries/index.d.ts.map +1 -0
  77. package/lib/esm/graphql/queries/index.js +2 -0
  78. package/lib/esm/graphql/schemas/escalation.d.ts +85 -0
  79. package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
  80. package/lib/esm/graphql/schemas/escalation.js +1 -0
  81. package/lib/esm/graphql/schemas/index.d.ts +2 -0
  82. package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
  83. package/lib/esm/graphql/schemas/index.js +1 -0
  84. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  85. package/lib/esm/hooks/useResetCaseCreate.js +18 -11
  86. package/lib/esm/reducers/CaseConstNTypes.d.ts +86 -2
  87. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  88. package/lib/esm/reducers/CaseConstNTypes.js +5 -0
  89. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +3 -1
  90. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  91. package/lib/esm/reducers/CaseDetailsPageReducer.js +22 -5
  92. package/lib/esm/reducers/CaseHelpers.d.ts +2 -1
  93. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  94. package/lib/esm/reducers/CaseHelpers.js +39 -2
  95. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  96. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  97. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  98. package/lib/esm/reducers/CaseReducer.d.ts +27 -8
  99. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  100. package/lib/esm/reducers/CaseReducer.js +100 -23
  101. package/package.json +5 -5
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { useApolloClient } from '@apollo/client/react';
10
11
  import { escalations, publicApi } from '@cee-eng/hydrajs';
11
12
  import { Button, ButtonVariant, Flex, FlexItem } from '@patternfly/react-core';
12
13
  import { LoadingIndicator, PFTable, TableComponent, ToastNotification, useFetch, } from '@rh-support/components';
@@ -30,6 +31,7 @@ const REOPEN_ESCALATION_MSG = 'Escalation reopened. A manager will review your r
30
31
  const CLOSURE_ESCALATION_MSG = 'Escalation closed.';
31
32
  export default function RMEEscalationList(props) {
32
33
  const { t } = useTranslation();
34
+ const apolloClient = useApolloClient();
33
35
  const { request: updateEscalationRequest, isFetching: isUpdatingEscalation } = useFetch(escalations.updateEscalations, { propgateErrors: true });
34
36
  const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
35
37
  propgateErrors: true,
@@ -61,8 +63,7 @@ export default function RMEEscalationList(props) {
61
63
  });
62
64
  const submitEscalationComment = (escalationNum, comment, message) => __awaiter(this, void 0, void 0, function* () {
63
65
  try {
64
- escalationNum &&
65
- fetchCaseEscalations(caseDetailsPageDispatch, props.caseNumber, props.accountNumber, false);
66
+ escalationNum && fetchCaseEscalations(caseDetailsPageDispatch, props.caseNumber, apolloClient, false);
66
67
  yield postCommentRequest({
67
68
  caseNumber: props.caseNumber,
68
69
  commentBody: comment,
@@ -1 +1 @@
1
- {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAkHpD"}
1
+ {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAoHpD"}
@@ -1,3 +1,4 @@
1
+ import { useApolloClient } from '@apollo/client/react';
1
2
  import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
2
3
  import { fetchCaseSeverities, fetchCaseTypes, fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
3
4
  import { haventLoadedMetadata } from '@rh-support/utils';
@@ -7,13 +8,14 @@ import React, { useContext, useEffect } from 'react';
7
8
  import { Trans, useTranslation } from 'react-i18next';
8
9
  import { useCaseSelector } from '../../context/CaseContext';
9
10
  import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
10
- import { Hostname } from '../ImproveCase/Hostname';
11
+ // import { Hostname } from '../ImproveCase/Hostname';
11
12
  import KtQuestions from '../ImproveCase/KtQuestions';
12
13
  import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
13
14
  export default function CaseInformation(props) {
14
15
  const { t } = useTranslation();
15
16
  const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
16
17
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
18
+ const apolloClient = useApolloClient();
17
19
  const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
18
20
  contactSSOName: state.caseDetails.contactSSOName,
19
21
  ownersCaseGroups: state.ownersCaseGroups,
@@ -38,13 +40,13 @@ export default function CaseInformation(props) {
38
40
  }
39
41
  const allPromisses = [];
40
42
  if (haventLoadedMetadata(allCaseTypes)) {
41
- allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
43
+ allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, apolloClient));
42
44
  }
43
45
  if (haventLoadedMetadata(allCaseSeverities)) {
44
- allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
46
+ allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, apolloClient));
45
47
  }
46
48
  if (haventLoadedMetadata(caseLanguages)) {
47
- allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer));
49
+ allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer, apolloClient));
48
50
  }
49
51
  Promise.all(allPromisses);
50
52
  }, [
@@ -56,6 +58,7 @@ export default function CaseInformation(props) {
56
58
  loggedInUserJwtToken,
57
59
  selectedAccountDetails,
58
60
  loggedInUsersAccount.data.secureSupport,
61
+ apolloClient,
59
62
  ]);
60
63
  return (React.createElement(React.Fragment, null,
61
64
  React.createElement(LoadingIndicator, { show: isMetadataLoading(), size: "lg" }),
@@ -77,7 +80,6 @@ export default function CaseInformation(props) {
77
80
  !isMetadataLoadingError() &&
78
81
  loggedInUserRights.data.canManageCases() && (React.createElement(React.Fragment, null,
79
82
  React.createElement("form", null,
80
- React.createElement(Hostname, null),
81
83
  React.createElement(OpenShiftClusterId, null),
82
84
  React.createElement(ClusterRecommendations, { className: "push-bottom" }),
83
85
  React.createElement(KtQuestions, null))))));
@@ -1 +1 @@
1
- {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAiB/D,wBAAgB,kBAAkB,sBAsVjC"}
1
+ {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuC/D,wBAAgB,kBAAkB,sBAwVjC"}
@@ -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":"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
+ {"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
78
  React.createElement(QuestionCircleIcon, { color: "#5e40be", className: "pf-v6-u-ml-xs icon-size cursor-pointer", "aria-label": "Support Level Info" })),
101
- React.createElement(SingleSelectDropdown, { ariaLabel: t('Select Support Level'), onSelect: onEntitlementChange, selected: getSelectedOption(), options: getDropdownOptions(), isDisabled: ownersEntitlements.isError || isEmpty(ownersEntitlements.data), isInvalid: isSupportLevelInValid, dataTrackingId: "get-support-supportLevel", placeholder: t('Select Support Level') }),
102
- isEmpty(ownersEntitlements.data) && (React.createElement("p", { className: "form-instructions" }, ownersEntitlements.isError ? t('Error loading support levels') : t('No active subscriptions')))));
79
+ React.createElement(SingleSelectDropdown, { ariaLabel: t('Select Support Level'), onSelect: onEntitlementChange, selected: getSelectedOption(), options: getDropdownOptions(), isInvalid: isSupportLevelInValid, dataTrackingId: "get-support-supportLevel", placeholder: t('Select Support Level') })));
103
80
  }
104
81
  SupportLevel.defaultProps = defaultProps;
105
82
  export default SupportLevel;
@@ -53,11 +53,11 @@ export default function CaseLanguageSelector(props) {
53
53
  props.isManageStep,
54
54
  ]);
55
55
  const getLanguageDropdownOptions = map(caseLanguages.data, (language) => ({
56
- label: Constants.languagesMap[language],
56
+ label: Constants.languagesMap[language] || language,
57
57
  value: language,
58
58
  }));
59
59
  const getSelectedLanguageOption = {
60
- label: caseLanguage ? Constants.languagesMap[caseLanguage] : '',
60
+ label: caseLanguage ? Constants.languagesMap[caseLanguage] || caseLanguage : '',
61
61
  value: caseLanguage || '',
62
62
  };
63
63
  return (React.createElement("div", { className: "form-group" },
@@ -1 +1 @@
1
- {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBAiCnD"}
1
+ {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;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":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBA8ItC"}
1
+ {"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBAkJtC"}
@@ -1,3 +1,4 @@
1
+ import { useApolloClient } from '@apollo/client/react';
1
2
  import { Grid, GridItem } from '@patternfly/react-core';
2
3
  import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
3
4
  import { fetchCaseSeverities, fetchCaseTypes, fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
@@ -8,13 +9,13 @@ import React, { useContext, useEffect } from 'react';
8
9
  import { Trans, useTranslation } from 'react-i18next';
9
10
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
10
11
  import { setCaseDetails } from '../../reducers/CaseReducer';
11
- import CaseGroup from '../CaseInformation/CaseGroup';
12
+ // import CaseGroup from '../CaseInformation/CaseGroup';
12
13
  import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
13
14
  import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
14
15
  import Severity from '../CaseInformation/Severity';
15
16
  import SupportLevel from '../CaseInformation/SupportLevel';
16
17
  import CaseLanguageSelector from '../CaseManagement/CaseLanguageSelector';
17
- import { Cep } from '../CaseManagement/Cep';
18
+ // import { Cep } from '../CaseManagement/Cep';
18
19
  import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
19
20
  import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
20
21
  import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
@@ -23,6 +24,7 @@ export default function IdeaInformation() {
23
24
  const { t } = useTranslation();
24
25
  const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
25
26
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
27
+ const apolloClient = useApolloClient();
26
28
  const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
27
29
  contactSSOName: state.caseDetails.contactSSOName,
28
30
  ownersCaseGroups: state.ownersCaseGroups,
@@ -48,13 +50,13 @@ export default function IdeaInformation() {
48
50
  }
49
51
  const allPromisses = [];
50
52
  if (haventLoadedMetadata(allCaseTypes)) {
51
- allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
53
+ allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, apolloClient));
52
54
  }
53
55
  if (haventLoadedMetadata(allCaseSeverities)) {
54
- allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
56
+ allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, apolloClient));
55
57
  }
56
58
  if (haventLoadedMetadata(caseLanguages)) {
57
- allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer));
59
+ allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer, apolloClient));
58
60
  }
59
61
  Promise.all(allPromisses);
60
62
  }, [
@@ -66,6 +68,7 @@ export default function IdeaInformation() {
66
68
  loggedInUserJwtToken,
67
69
  selectedAccountDetails,
68
70
  loggedInUsersAccount.data.secureSupport,
71
+ apolloClient,
69
72
  ]);
70
73
  const onSeverityChange = (payload) => {
71
74
  setCaseDetails(caseDispatch, payload);
@@ -100,11 +103,8 @@ export default function IdeaInformation() {
100
103
  React.createElement(ContactPhoneNumberAlert, null),
101
104
  React.createElement(Grid, { hasGutter: true },
102
105
  React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
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(CaseLanguageSelector, { isManageStep: true }))),
106
107
  React.createElement(CaseContactSelector, null),
107
108
  React.createElement(RHAssociatesSelector, null),
108
- React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
109
- React.createElement(Cep, null))))));
109
+ React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }))))));
110
110
  }
@@ -1 +1 @@
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
+ {"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,3 +1,4 @@
1
+ import { useApolloClient } from '@apollo/client/react';
1
2
  import { Bullseye, Card, CardBody, Gallery, GalleryItem, Split, SplitItem } from '@patternfly/react-core';
2
3
  import { LoadingIndicator } from '@rh-support/components';
3
4
  import { fetchCaseTypes, useGlobalDispatchContext, useGlobalStateContext } from '@rh-support/react-context';
@@ -11,8 +12,9 @@ import { getUpdatedDescription } from '../../reducers/CaseHelpers';
11
12
  import { setCaseDetails } from '../../reducers/CaseReducer';
12
13
  import { BugIcon, CertificationIcon, CustomerServiceIcon, DocumentationIcon, GearIcon, IdeaIcon, RcaIcon, } from './SupportTypeIcons';
13
14
  export default function SupportTypeSelectorPage() {
14
- const { globalMetadataState: { allCaseTypes, loggedInUsersAccount }, } = useGlobalStateContext();
15
+ const { globalMetadataState: { allCaseTypes }, } = useGlobalStateContext();
15
16
  const globalDispatch = useGlobalDispatchContext();
17
+ const apolloClient = useApolloClient();
16
18
  const [selectedSupportType, setSelectedSupportType] = useState('');
17
19
  const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
18
20
  const { caseType, isFetchingSelectedAccountDetails, issue, timeFramesAndUrgency, v3ClusterName } = useCaseSelector((state) => ({
@@ -27,7 +29,7 @@ export default function SupportTypeSelectorPage() {
27
29
  useEffect(() => {
28
30
  if (haventLoadedMetadata(allCaseTypes)) {
29
31
  // Load support types.
30
- fetchCaseTypes(globalDispatch, loggedInUsersAccount.data.secureSupport);
32
+ fetchCaseTypes(globalDispatch, apolloClient);
31
33
  }
32
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
33
35
  }, []);
@@ -6,7 +6,6 @@ interface IProps {
6
6
  routeProps: RouteComponentProps<IRouteUrlParams>;
7
7
  loadTCOnChange?: boolean;
8
8
  showTCAfterButtonClicked?: boolean;
9
- checkEntitledProduct?: boolean;
10
9
  isOnSummaryPage?: boolean;
11
10
  isOnGetSupportPage?: boolean;
12
11
  isOnReviewPage?: boolean;
@@ -1 +1 @@
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
+ {"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,8 +1,5 @@
1
1
  import { Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant } from '@patternfly/react-core';
2
- import { AlertMessage, AlertType } from '@rh-support/components';
3
2
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
- import filter from 'lodash/filter';
5
- import find from 'lodash/find';
6
3
  import isEmpty from 'lodash/isEmpty';
7
4
  import isEqual from 'lodash/isEqual';
8
5
  import React, { forwardRef, useContext, useEffect, useState } from 'react';
@@ -19,7 +16,6 @@ import { ProductVersionDropdownSelector } from './ProductVersionDropdownSelector
19
16
  const defaultProps = {
20
17
  loadTCOnChange: false,
21
18
  showTCAfterButtonClicked: false,
22
- checkEntitledProduct: false,
23
19
  };
24
20
  /**
25
21
  * Renders a dropdown list to select all products.
@@ -30,15 +26,12 @@ const defaultProps = {
30
26
  * @param props
31
27
  */
32
28
  const AllProductsSelector = forwardRef((props, ref) => {
33
- var _a, _b;
34
- const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
29
+ const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
35
30
  const caseDispatch = useCaseDispatch();
36
- const { product, version, contactSSOName } = useCaseSelector((state) => ({
31
+ const { product, version } = useCaseSelector((state) => ({
37
32
  product: state.caseDetails.product,
38
33
  version: state.caseDetails.version,
39
- contactSSOName: state.caseDetails.contactSSOName,
40
34
  }), isEqual);
41
- //test
42
35
  const { topContentState: { topContent }, } = useContext(TCStateContext);
43
36
  const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
44
37
  const [isModalOpen, setIsModalOpen] = useState(false);
@@ -46,7 +39,6 @@ const AllProductsSelector = forwardRef((props, ref) => {
46
39
  const [showModalButton, setShowModalButton] = useState(false);
47
40
  const [isProductChanged, setProductChanged] = useState(false);
48
41
  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;
50
42
  useEffect(() => {
51
43
  // after TC data is loaded we open the modal
52
44
  const showTCPopUpModalOnProductChange = props.loadTCOnChange && !props.showTCAfterButtonClicked && showModal;
@@ -79,7 +71,6 @@ const AllProductsSelector = forwardRef((props, ref) => {
79
71
  };
80
72
  RouteUtils.updateQueryParams(props.routeProps, newParams);
81
73
  }
82
- const entitledProducts = filter(allProducts.data.productsResult, (p) => p.isEntitledProduct);
83
74
  const renderProductVersionDropdownSelector = (activeSection === (isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT) &&
84
75
  !props.caseCreateExperience) ||
85
76
  activeSection === AppRouteSections.GET_SUPPORT ||
@@ -91,12 +82,9 @@ const AllProductsSelector = forwardRef((props, ref) => {
91
82
  return (React.createElement(React.Fragment, null,
92
83
  renderProductVersionDropdownSelector && (React.createElement("div", { className: "form-group product-selector-wrapper" },
93
84
  React.createElement("div", { className: "all-product-selector-dropdown" },
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 })))),
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 })))),
95
86
  renderOpenCaseIssue && (React.createElement("div", { className: "case-details-summary" },
96
87
  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) }),
100
88
  showModalButton &&
101
89
  !isEmpty(product) &&
102
90
  !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;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"}
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"}