@rh-support/troubleshoot 2.6.287 → 2.6.295

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 (105) 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 +42 -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/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +9 -6
  15. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  16. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +7 -3
  17. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +38 -34
  19. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -9
  21. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +19 -59
  23. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
  25. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +5 -3
  27. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  28. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +3 -2
  29. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  30. package/lib/esm/components/CaseInformation/CaseInformation.js +7 -5
  31. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  32. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
  33. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  34. package/lib/esm/components/CaseInformation/SupportLevel.js +32 -55
  35. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  36. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  37. package/lib/esm/components/CaseManagement/CaseManagement.js +4 -9
  38. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  39. package/lib/esm/components/IdeaInformation/IdeaInformation.js +11 -12
  40. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  41. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
  42. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
  43. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  44. package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -15
  45. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  46. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
  47. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  48. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +19 -53
  49. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  50. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
  51. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  52. package/lib/esm/components/Review/Review.js +16 -18
  53. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  54. package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
  55. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +1 -1
  56. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  57. package/lib/esm/components/shared/useIsSectionValid.js +50 -64
  58. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  59. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +106 -23
  60. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  61. package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
  62. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  63. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
  64. package/lib/esm/graphql/index.d.ts +4 -0
  65. package/lib/esm/graphql/index.d.ts.map +1 -0
  66. package/lib/esm/graphql/index.js +3 -0
  67. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
  68. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
  69. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
  70. package/lib/esm/graphql/mutations/index.d.ts +2 -0
  71. package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
  72. package/lib/esm/graphql/mutations/index.js +1 -0
  73. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
  74. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
  75. package/lib/esm/graphql/queries/getEscalationDetails.js +24 -0
  76. package/lib/esm/graphql/queries/getParentId.d.ts +2 -0
  77. package/lib/esm/graphql/queries/getParentId.d.ts.map +1 -0
  78. package/lib/esm/graphql/queries/getParentId.js +16 -0
  79. package/lib/esm/graphql/queries/index.d.ts +3 -0
  80. package/lib/esm/graphql/queries/index.d.ts.map +1 -0
  81. package/lib/esm/graphql/queries/index.js +2 -0
  82. package/lib/esm/graphql/schemas/escalation.d.ts +84 -0
  83. package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
  84. package/lib/esm/graphql/schemas/escalation.js +1 -0
  85. package/lib/esm/graphql/schemas/index.d.ts +2 -0
  86. package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
  87. package/lib/esm/graphql/schemas/index.js +1 -0
  88. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  89. package/lib/esm/hooks/useResetCaseCreate.js +18 -11
  90. package/lib/esm/reducers/CaseConstNTypes.d.ts +86 -2
  91. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  92. package/lib/esm/reducers/CaseConstNTypes.js +5 -0
  93. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +3 -1
  94. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  95. package/lib/esm/reducers/CaseDetailsPageReducer.js +22 -5
  96. package/lib/esm/reducers/CaseHelpers.d.ts +2 -1
  97. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  98. package/lib/esm/reducers/CaseHelpers.js +34 -2
  99. package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
  100. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  101. package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
  102. package/lib/esm/reducers/CaseReducer.d.ts +27 -8
  103. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  104. package/lib/esm/reducers/CaseReducer.js +113 -29
  105. 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 { InputGroupText, Spinner, TextInput, ValidatedOptions } from '@patternfly/react-core';
11
12
  import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
12
13
  import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
@@ -19,7 +20,7 @@ import { Trans, useTranslation } from 'react-i18next';
19
20
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
20
21
  import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
21
22
  import { SUMMARY_LENGTH_LIMIT } from '../../../../reducers/CaseConstNTypes';
22
- import { setCaseDetails, updateCaseDetails } from '../../../../reducers/CaseReducer';
23
+ import { setCaseDetails, updateCaseDetailsGraphQL } from '../../../../reducers/CaseReducer';
23
24
  import { PDFContext } from '../../PDFContainer';
24
25
  const defaultProps = {
25
26
  inlineEditable: true,
@@ -29,11 +30,13 @@ const defaultProps = {
29
30
  function Summary(props) {
30
31
  const { t } = useTranslation();
31
32
  const caseUpdateError = useCaseUpdateErrorMessage();
32
- const { summary, caseNumber } = useCaseSelector((state) => ({
33
+ const { summary, caseNumber, existingCaseDetails } = useCaseSelector((state) => ({
33
34
  summary: state.caseDetails.summary,
34
35
  caseNumber: state.caseDetails.caseNumber,
36
+ existingCaseDetails: state.caseDetails,
35
37
  }), isEqual);
36
38
  const caseDispatch = useCaseDispatch();
39
+ const apolloClient = useApolloClient();
37
40
  const { isExportingPDF } = useContext(PDFContext);
38
41
  const [summaryState, setSummaryState] = useState(summary);
39
42
  const [isSummaryUpdating, setIsSummaryUpdating] = useState(false);
@@ -41,9 +44,11 @@ function Summary(props) {
41
44
  // value changed logic to show a none local severity change
42
45
  const [localSummaryChange, setLocalSummaryChange] = useState(false);
43
46
  // To keep track of Cancel button state to close InlineEdit input mode
44
- const [isCancelClicked, setIsCancelClicked] = useState(false);
47
+ const [cancelToggleKey, setCancelToggleKey] = useState(0);
45
48
  // To keep track of Save button state to close InlineEdit input mode
46
- const [isSaveClicked, setIsSaveClicked] = useState(false);
49
+ const [saveToggleKey, setSaveToggleKey] = useState(0);
50
+ const closeInlineEdit = () => setSaveToggleKey((key) => key + 1);
51
+ const cancelInlineEdit = () => setCancelToggleKey((key) => key + 1);
47
52
  const afterLocalChange = () => setLocalSummaryChange(false);
48
53
  const getSummaryChangedTT = () => React.createElement(Trans, null, "Summary has been updated");
49
54
  // Function to handle when summary changes
@@ -55,7 +60,9 @@ function Summary(props) {
55
60
  const onSummaryUpdate = (caseDetails) => __awaiter(this, void 0, void 0, function* () {
56
61
  setIsSummaryUpdating(true);
57
62
  try {
58
- yield updateCaseDetails(caseDispatch, caseNumber, caseDetails);
63
+ yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, caseNumber, caseDetails, false, {
64
+ existingCaseDetails,
65
+ });
59
66
  setIsSummaryUpdating(false);
60
67
  ToastNotification.addSuccessMessage(t(`Title has been successfully updated`));
61
68
  }
@@ -81,11 +88,11 @@ function Summary(props) {
81
88
  setCaseDetails(caseDispatch, caseDetails);
82
89
  }
83
90
  setLocalSummaryChange(true);
84
- setIsSaveClicked(!isSaveClicked);
91
+ closeInlineEdit();
85
92
  });
86
93
  const onCancel = () => {
87
94
  setSummaryState(summary);
88
- setIsCancelClicked(!isCancelClicked);
95
+ cancelInlineEdit();
89
96
  };
90
97
  useEffect(() => {
91
98
  setSummaryState(summary);
@@ -119,14 +126,14 @@ function Summary(props) {
119
126
  setCaseDetails(caseDispatch, caseDetails);
120
127
  }
121
128
  setLocalSummaryChange(true);
122
- setIsSaveClicked(!isSaveClicked);
129
+ closeInlineEdit();
123
130
  }
124
131
  });
125
132
  return (React.createElement(React.Fragment, null,
126
133
  React.createElement(NewInlineEdit, { labelProps: { htmlFor: 'case-details-summary' }, labelContent: React.createElement(React.Fragment, null,
127
134
  React.createElement(Trans, null, "Title"),
128
135
  React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localSummaryChange, value: summary, getTooltipContent: getSummaryChangedTT }),
129
- React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")), allowInlineEdit: props.inlineEditable, content: summary ? summary : t('No summary to display.'), saveDisabled: saveDisabled, hideLabel: props.hideLabel, hideSaveCancel: props.hideSaveCancel, charCount: (summaryState === null || summaryState === void 0 ? void 0 : summaryState.length) || 0, charTotal: SUMMARY_LENGTH_LIMIT, cancelToggleState: isCancelClicked, saveToggleState: isSaveClicked, isExportingPDF: isExportingPDF },
136
+ React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")), allowInlineEdit: props.inlineEditable, content: summary ? summary : t('No summary to display.'), saveDisabled: saveDisabled, hideLabel: props.hideLabel, hideSaveCancel: props.hideSaveCancel, charCount: (summaryState === null || summaryState === void 0 ? void 0 : summaryState.length) || 0, charTotal: SUMMARY_LENGTH_LIMIT, cancelToggleState: cancelToggleKey % 2 === 1, saveToggleState: saveToggleKey % 2 === 1, isExportingPDF: isExportingPDF },
130
137
  React.createElement("div", { className: "pf-v6-u-display-flex pf-v6-u-flex-direction-row pf-v6-u-align-items-center" },
131
138
  React.createElement(TextInput, { type: "text", id: "case-details-summary", "aria-required": true, required: true, name: "case-details-summary", value: summaryState, onChange: (_event, value) => onSummaryChange(value), isDisabled: isSummaryUpdating, "data-tracking-id": "case-details-summary", onKeyDown: handleKeyDown, validated: (summaryState === null || summaryState === void 0 ? void 0 : summaryState.length) > SUMMARY_LENGTH_LIMIT || isSummaryEmpty
132
139
  ? ValidatedOptions.error
@@ -1 +1 @@
1
- {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA6IlD"}
1
+ {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA8IlD"}
@@ -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 { Button, ButtonVariant, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, } from '@patternfly/react-core';
11
12
  import { SingleSelectDropdown, ToastNotification } from '@rh-support/components';
12
13
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
@@ -43,11 +44,12 @@ export function VerifyCaseStatusModal(props) {
43
44
  selectedAccountDetails: state.selectedAccountDetails,
44
45
  }), isEqual);
45
46
  const { status } = caseState.caseDetails;
46
- const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
47
+ const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
48
+ const apolloClient = useApolloClient();
47
49
  const canManageCase = loggedInUserRights.data.canManageCases();
48
50
  useEffect(() => {
49
- fetchAllStatuses(caseOverviewDispatch, loggedInUsersAccount.data.secureSupport);
50
- }, [caseOverviewDispatch, loggedInUsersAccount.data.secureSupport]);
51
+ fetchAllStatuses(caseOverviewDispatch, apolloClient);
52
+ }, [caseOverviewDispatch, apolloClient]);
51
53
  const { isCaseUpdating } = caseState;
52
54
  const canEditCase = useCanEditCase();
53
55
  const caseDispatch = useCaseDispatch();
@@ -1 +1 @@
1
- {"version":3,"file":"RMEEscalationList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAqB,MAAM,2CAA2C,CAAC;AAe/F,OAAO,KAAsC,MAAM,OAAO,CAAC;AAiB3D,UAAU,MAAM;IACZ,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,MAAM,qBA8MtD"}
1
+ {"version":3,"file":"RMEEscalationList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAqB,MAAM,2CAA2C,CAAC;AAe/F,OAAO,KAAsC,MAAM,OAAO,CAAC;AAiB3D,UAAU,MAAM;IACZ,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,MAAM,qBA8MtD"}
@@ -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,qBAuCnD"}
@@ -2,17 +2,16 @@ 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';
16
15
  export default function CaseManagement(props) {
17
16
  const caseDispatch = useCaseDispatch();
18
17
  const onSeverityChange = (payload) => {
@@ -29,11 +28,7 @@ export default function CaseManagement(props) {
29
28
  React.createElement(Fts, { inlineEditable: false }),
30
29
  React.createElement(Grid, { hasGutter: true },
31
30
  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 }))),
35
- React.createElement(CaseContactSelector, null),
31
+ React.createElement(CaseLanguageSelector, { isManageStep: true }))),
36
32
  React.createElement(RHAssociatesSelector, null),
37
- React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
38
- React.createElement(Cep, null)));
33
+ React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true })));
39
34
  }
@@ -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,sBAoJtC"}
@@ -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,21 +9,22 @@ 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
- import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
21
+ // import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
21
22
  import KtQuestions from '../ImproveCase/KtQuestions';
22
23
  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,7 @@ 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(CaseContactSelector, null),
106
+ React.createElement(CaseLanguageSelector, { isManageStep: true }))),
107
107
  React.createElement(RHAssociatesSelector, null),
108
- React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
109
- React.createElement(Cep, null))))));
108
+ React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }))))));
110
109
  }
@@ -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"}