@rh-support/troubleshoot 2.6.357 → 2.6.361
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.
- package/lib/esm/components/AccountInfo/OwnerSelector.js +5 -5
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +16 -6
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +11 -7
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -0
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +19 -8
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +23 -19
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +2 -2
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +7 -5
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +7 -5
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +6 -0
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +8 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.js +6 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +41 -8
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInternalStatus.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +11 -11
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseSbrGroups.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseSbrGroups.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +1 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +4 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +5 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +33 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +6 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +210 -35
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +11 -17
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +5 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +2 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +4 -11
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CasePrivateNotes/CasePrivateNotes.js +6 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +1 -0
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +6 -2
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseLabels.js +21 -16
- package/lib/esm/components/CaseInformation/Fts.js +2 -2
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +16 -15
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +52 -21
- package/lib/esm/components/CaseManagement/Cep.js +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +1 -3
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +0 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +6 -12
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +4 -2
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +4 -2
- package/lib/esm/components/EditDescription/EditDescription.d.ts.map +1 -1
- package/lib/esm/components/EditDescription/EditDescription.js +3 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +11 -3
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +52 -46
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +1 -0
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +126 -54
- package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.js +6 -3
- package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/MainSection.js +2 -1
- package/lib/esm/css/case.css +154 -8
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -1
- package/lib/esm/graphql/queries/getEscalationDetails.js +5 -0
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +6 -1
- package/lib/esm/hooks/useCaseComments/index.d.ts +2 -1
- package/lib/esm/hooks/useCaseComments/index.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseComments/types.d.ts +8 -0
- package/lib/esm/hooks/useCaseComments/types.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +12 -3
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.js +84 -9
- package/lib/esm/hooks/useCaseHistory.d.ts +2 -2
- package/lib/esm/hooks/useCaseHistory.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseHistory.js +16 -7
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +2 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseLabelLinkMutations.js +21 -28
- package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts +9 -1
- package/lib/esm/hooks/useCaseUpdateErrorMessage.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseUpdateErrorMessage.js +103 -16
- package/lib/esm/models/caseHistory.d.ts +6 -0
- package/lib/esm/models/caseHistory.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +2 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +26 -4
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +5 -3
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +6 -2
- package/lib/esm/utils/caseHistoryUtils.d.ts +19 -0
- package/lib/esm/utils/caseHistoryUtils.d.ts.map +1 -1
- package/lib/esm/utils/caseHistoryUtils.js +31 -0
- package/lib/esm/utils/linkifyHtmlTextNodes.d.ts +8 -0
- package/lib/esm/utils/linkifyHtmlTextNodes.d.ts.map +1 -0
- package/lib/esm/utils/linkifyHtmlTextNodes.js +37 -0
- package/package.json +7 -6
|
@@ -8,13 +8,15 @@ import isEqual from 'lodash/isEqual';
|
|
|
8
8
|
import React, { useContext, useEffect } from 'react';
|
|
9
9
|
import { Trans, useTranslation } from 'react-i18next';
|
|
10
10
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
|
+
import { useShowCaseGroupField } from '../../hooks/useCaseGroupUiState';
|
|
11
12
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
12
|
-
|
|
13
|
+
import CaseGroup from '../CaseInformation/CaseGroup';
|
|
13
14
|
import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
|
|
14
15
|
// TODO: Re-enable once phone number verification flow is fully supported with GraphQL
|
|
15
16
|
// import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
|
|
16
17
|
import Severity from '../CaseInformation/Severity';
|
|
17
18
|
import SupportLevel from '../CaseInformation/SupportLevel';
|
|
19
|
+
import CaseLabelsCreate from '../CaseManagement/CaseLabelsCreate';
|
|
18
20
|
import CaseLanguageSelector from '../CaseManagement/CaseLanguageSelector';
|
|
19
21
|
// import { Cep } from '../CaseManagement/Cep';
|
|
20
22
|
import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
|
|
@@ -32,6 +34,7 @@ export default function IdeaInformation() {
|
|
|
32
34
|
selectedAccountDetails: state.selectedAccountDetails,
|
|
33
35
|
}), isEqual);
|
|
34
36
|
const caseDispatch = useCaseDispatch();
|
|
37
|
+
const showCaseGroupField = useShowCaseGroupField();
|
|
35
38
|
const isMetadataLoading = () => {
|
|
36
39
|
return !isMetadataLoadingError() && (loggedInUser.isFetching || selectedAccountDetails.isFetching);
|
|
37
40
|
};
|
|
@@ -101,8 +104,13 @@ export default function IdeaInformation() {
|
|
|
101
104
|
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xl" },
|
|
102
105
|
React.createElement(ContactPhoneNumber, null))),
|
|
103
106
|
React.createElement(Grid, { hasGutter: true },
|
|
104
|
-
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
105
|
-
React.createElement(CaseLanguageSelector, { isManageStep: true }))
|
|
107
|
+
React.createElement(GridItem, { span: 12, xl2: showCaseGroupField ? 6 : 12, className: "pf-v6-u-mb-xs" },
|
|
108
|
+
React.createElement(CaseLanguageSelector, { isManageStep: true })),
|
|
109
|
+
showCaseGroupField && (React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
110
|
+
React.createElement(CaseGroup, { init: true })))),
|
|
111
|
+
React.createElement(Grid, { hasGutter: true },
|
|
112
|
+
React.createElement(GridItem, { span: 12, xl2: 12, className: "pf-v6-u-mb-xs" },
|
|
113
|
+
React.createElement(CaseLabelsCreate, null))),
|
|
106
114
|
React.createElement(RHAssociatesSelector, null),
|
|
107
115
|
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }))))));
|
|
108
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAexF,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA+oBxD"}
|
|
@@ -11,7 +11,7 @@ import { useApolloClient } from '@apollo/client/react';
|
|
|
11
11
|
import { Button, Dropdown, DropdownItem, DropdownList, Flex, FlexItem, MenuToggle, Modal, ModalBody, ModalFooter, ModalHeader, Spinner, TextArea, } from '@patternfly/react-core';
|
|
12
12
|
import { ToastNotification } from '@rh-support/components';
|
|
13
13
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
14
|
-
import {
|
|
14
|
+
import { getFtsForSeverityChange, isPremiumEntitlement, isSev1, PreviousCaseTypes, severitySort, } from '@rh-support/utils';
|
|
15
15
|
import { isUndefined } from 'lodash';
|
|
16
16
|
import find from 'lodash/find';
|
|
17
17
|
import includes from 'lodash/includes';
|
|
@@ -118,12 +118,9 @@ export default function UpdateSeverityModal(props) {
|
|
|
118
118
|
// To update the state when severity changes
|
|
119
119
|
const updateState = (value) => {
|
|
120
120
|
const casePayload = { severity: value };
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
!isEmpty(caseDetails.caseNumber) &&
|
|
125
|
-
autoEnableFtsOnCaseViewEditPage(caseDetails.entitlementSla, value) &&
|
|
126
|
-
(casePayload.fts = true);
|
|
121
|
+
casePayload.fts = getFtsForSeverityChange(caseDetails.entitlementSla, value, {
|
|
122
|
+
isCaseEdit: !isEmpty(caseDetails.caseNumber),
|
|
123
|
+
});
|
|
127
124
|
};
|
|
128
125
|
// Modal cancel function which resets the field
|
|
129
126
|
const onCancel = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -169,27 +166,30 @@ export default function UpdateSeverityModal(props) {
|
|
|
169
166
|
return '<h4>Contact Support Update</h4><p>User updated 24x7 contact information</p>';
|
|
170
167
|
};
|
|
171
168
|
const updateCaseFtsInfo = () => __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
const ftsUpdateComment = `${getFtsUpdateComment()}<h4>Description</h4><p>${descriptionValue.trim()}</p>`;
|
|
172
170
|
try {
|
|
173
|
-
const ftsUpdateComment = `${getFtsUpdateComment()}<h4>Description</h4><p>${descriptionValue.trim()}</p>`;
|
|
174
171
|
yield updateSeverityViaGraphQL({
|
|
175
172
|
severity: currentSeverity || caseDetails.caseSeverity,
|
|
176
173
|
fts: localFts,
|
|
177
174
|
contactInfo24x7: localFtsContact,
|
|
178
175
|
});
|
|
179
|
-
|
|
176
|
+
ToastNotification.addSuccessMessage(t(`Case has been successfully updated`));
|
|
177
|
+
void postComment({
|
|
180
178
|
commentBody: ftsUpdateComment === null || ftsUpdateComment === void 0 ? void 0 : ftsUpdateComment.trim(),
|
|
181
179
|
contentType: 'markdown',
|
|
182
180
|
updateDiscussionState: true,
|
|
181
|
+
}).catch((err) => {
|
|
182
|
+
caseUpdateError.showError(err, t(`Couldn't post severity update comment. Please try again`));
|
|
183
183
|
});
|
|
184
|
-
ToastNotification.addSuccessMessage(t(`Case has been successfully updated`));
|
|
185
184
|
}
|
|
186
185
|
catch (err) {
|
|
187
|
-
caseUpdateError.
|
|
186
|
+
caseUpdateError.showFieldError(err, t('24x7 Support'), updateCaseFtsInfo);
|
|
188
187
|
}
|
|
189
188
|
finally {
|
|
190
189
|
onClose();
|
|
191
190
|
setDescriptionValue('');
|
|
192
191
|
setIsUpdateClickedToShowError(false);
|
|
192
|
+
setSeverityUpdating(caseOverviewDispatch, false);
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
const onSubmit = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -216,50 +216,53 @@ export default function UpdateSeverityModal(props) {
|
|
|
216
216
|
try {
|
|
217
217
|
setSeverityUpdating(caseOverviewDispatch, true);
|
|
218
218
|
yield updateSeverityViaGraphQL(updatedCaseDetails);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
setSeverityUpdating(caseOverviewDispatch, false);
|
|
220
|
+
const newSeverity = updatedCaseDetails['severity'];
|
|
221
|
+
setCurrentSeverity(newSeverity);
|
|
222
|
+
onSuccessfulSubmit();
|
|
223
|
+
ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
|
|
224
|
+
void (() => __awaiter(this, void 0, void 0, function* () {
|
|
225
225
|
try {
|
|
226
|
-
yield checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), caseDetails.caseStatus, {
|
|
227
|
-
apolloClient: client,
|
|
228
|
-
caseNumber: caseDetails.caseNumber,
|
|
229
|
-
existingCaseDetails,
|
|
230
|
-
});
|
|
231
|
-
setCurrentSeverity(updatedCaseDetails['severity']);
|
|
232
|
-
onSuccessfulSubmit();
|
|
233
|
-
ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
|
|
234
|
-
}
|
|
235
|
-
catch (e) {
|
|
236
226
|
yield postComment({
|
|
237
|
-
commentBody:
|
|
227
|
+
commentBody: severityUpdateComment === null || severityUpdateComment === void 0 ? void 0 : severityUpdateComment.trim(),
|
|
238
228
|
contentType: 'markdown',
|
|
239
229
|
updateDiscussionState: true,
|
|
240
230
|
});
|
|
241
|
-
|
|
242
|
-
|
|
231
|
+
try {
|
|
232
|
+
yield checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), caseDetails.caseStatus, {
|
|
233
|
+
apolloClient: client,
|
|
234
|
+
caseNumber: caseDetails.caseNumber,
|
|
235
|
+
existingCaseDetails,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
catch (e) {
|
|
239
|
+
yield postComment({
|
|
240
|
+
commentBody: severityUpdateFailedComment === null || severityUpdateFailedComment === void 0 ? void 0 : severityUpdateFailedComment.trim(),
|
|
241
|
+
contentType: 'markdown',
|
|
242
|
+
updateDiscussionState: true,
|
|
243
|
+
});
|
|
244
|
+
caseUpdateError.showFieldError(e, t('Status'));
|
|
245
|
+
yield updateSeverityViaGraphQL({
|
|
246
|
+
status: 'Waiting on Customer Action Required',
|
|
247
|
+
severity: updatedCaseDetails['severity'],
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
catch (e) {
|
|
252
|
+
caseUpdateError.showFieldError(e, t('Severity'), onSubmit);
|
|
243
253
|
yield updateSeverityViaGraphQL({
|
|
244
|
-
|
|
245
|
-
severity: updatedCaseDetails['severity'],
|
|
254
|
+
severity: caseDetails.caseSeverity,
|
|
246
255
|
});
|
|
256
|
+
setCurrentSeverity(caseDetails.caseSeverity);
|
|
257
|
+
reUpdateSeverity(caseDetails.caseSeverity);
|
|
258
|
+
setSeverityUpdating(caseOverviewDispatch, false);
|
|
247
259
|
}
|
|
248
|
-
}
|
|
249
|
-
catch (e) {
|
|
250
|
-
onClose();
|
|
251
|
-
caseUpdateError.showError(e, t(`Couldn't post severity update comment. Please try again`));
|
|
252
|
-
yield updateSeverityViaGraphQL({
|
|
253
|
-
severity: caseDetails.caseSeverity,
|
|
254
|
-
});
|
|
255
|
-
setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
|
|
256
|
-
reUpdateSeverity(caseDetails.caseSeverity);
|
|
257
|
-
setSeverityUpdating(caseOverviewDispatch, false);
|
|
258
|
-
}
|
|
260
|
+
}))();
|
|
259
261
|
}
|
|
260
262
|
catch (e) {
|
|
263
|
+
setSeverityUpdating(caseOverviewDispatch, false);
|
|
261
264
|
onClose();
|
|
262
|
-
caseUpdateError.
|
|
265
|
+
caseUpdateError.showFieldError(e, t('Severity'));
|
|
263
266
|
yield updateSeverityViaGraphQL({
|
|
264
267
|
severity: caseDetails.caseSeverity,
|
|
265
268
|
});
|
|
@@ -353,8 +356,11 @@ export default function UpdateSeverityModal(props) {
|
|
|
353
356
|
});
|
|
354
357
|
}
|
|
355
358
|
else {
|
|
356
|
-
|
|
357
|
-
|
|
359
|
+
const ftsForSeverity = isIdea
|
|
360
|
+
? false
|
|
361
|
+
: getFtsForSeverityChange(caseDetails.entitlementSla, option.name, { isCaseEdit: true });
|
|
362
|
+
setLocalFts(ftsForSeverity);
|
|
363
|
+
setUpdatedCaseDetails({ severity: option.name, fts: ftsForSeverity });
|
|
358
364
|
}
|
|
359
365
|
setCurrentSeverity(option.name);
|
|
360
366
|
updateState(option.name);
|
|
@@ -37,6 +37,7 @@ export declare const hasQueuedAttachmentUploads: (selectedLocalFiles: IFileLocal
|
|
|
37
37
|
export declare const hasAbortedOrFailedAttachments: (selectedLocalFiles: IFileLocal[]) => boolean;
|
|
38
38
|
/** True when at least one non-deleted file remains in the upload queue (UI visibility). */
|
|
39
39
|
export declare const hasSomeSelectedFiles: (selectedLocalFiles: IFileLocal[]) => boolean;
|
|
40
|
+
export declare const clearUploadRuntimeState: () => void;
|
|
40
41
|
export declare const isUploadingAttachment: (selectedLocalFiles: IFileLocal[]) => boolean;
|
|
41
42
|
export declare const isAnalysingAnyAttachment: (selectedLocalFiles: IFileLocal[]) => boolean;
|
|
42
43
|
export declare const canShowProgressBar: (file: IFileLocal) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAEvF,OAAO,EACH,iBAAiB,EAWpB,MAAM,mBAAmB,CAAC;
|
|
1
|
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E,CAAC;AAKF,eAAO,MAAM,2BAA2B,UAOvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,oBAAoB,UAAU,EAAE,YAE9E,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,aAAQ,SAUvC,CAAC"}
|
|
@@ -11,41 +11,54 @@ import { Config, pcm, sessionAttachments } from '@cee-eng/hydrajs';
|
|
|
11
11
|
import { ToastNotification } from '@rh-support/components';
|
|
12
12
|
import { CaseAttachmentUploadError, deleteCaseAttachment, fetchCaseDetailsByCaseNumber, GET_CONTENT_DOCUMENT_IDS, getText, MultipartUploadError, pendoTrackEvent, pollAttachmentUploadStatus, pollContentVersionStatus, uploadCaseAttachment, } from '@rh-support/utils';
|
|
13
13
|
import find from 'lodash/find';
|
|
14
|
-
import forEach from 'lodash/forEach';
|
|
15
14
|
import includes from 'lodash/includes';
|
|
16
15
|
import isEmpty from 'lodash/isEmpty';
|
|
17
16
|
import isUndefined from 'lodash/isUndefined';
|
|
18
17
|
import { AnalysisStatusConstants, AttachmentReducerConstants, defaultAnalysisMetadata, defaultUploadMetadata, onFilesSelect, resetAttachment, udpateFileUploadMetadata, updateAnalysisMetadata, updateAttachmentIdForFile, UploadStatusConstants, } from './AttachmentReducer';
|
|
19
18
|
import { FileStatusHelper } from './FileStatusHelper';
|
|
20
19
|
export const onDrop = (dispatchToAttachmentReducer, isSessionId, isPrivate = false) => (acceptedFiles) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
catch (e) {
|
|
44
|
-
if (!e.ableToUpload) {
|
|
45
|
-
ToastNotification.addDangerMessage(e.ableToUploadMessage);
|
|
20
|
+
if (!acceptedFiles.length) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
const results = yield Promise.all(acceptedFiles.map((file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
try {
|
|
26
|
+
const fileAccessDetails = yield getFileAccessDetails(file);
|
|
27
|
+
const localFile = {
|
|
28
|
+
name: file.name,
|
|
29
|
+
size: file.size,
|
|
30
|
+
lastModified: file.lastModified,
|
|
31
|
+
type: file.type,
|
|
32
|
+
description: '',
|
|
33
|
+
isPrivate: isPrivate,
|
|
34
|
+
uploadProgress: Object.assign(Object.assign({}, defaultUploadMetadata), { uploadStatus: isSessionId
|
|
35
|
+
? UploadStatusConstants.attachedOnSession
|
|
36
|
+
: UploadStatusConstants.attachedOnCase }),
|
|
37
|
+
analysisMetadata: Object.assign({}, defaultAnalysisMetadata),
|
|
38
|
+
uploadability: Object.assign({}, fileAccessDetails),
|
|
39
|
+
includeResults: true,
|
|
40
|
+
};
|
|
41
|
+
return { localFile, file };
|
|
46
42
|
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
if (!e.ableToUpload) {
|
|
45
|
+
ToastNotification.addDangerMessage(e.ableToUploadMessage);
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
})));
|
|
50
|
+
const selectedLocalFiles = [];
|
|
51
|
+
const selectedOriginalFiles = [];
|
|
52
|
+
results.forEach((result) => {
|
|
53
|
+
if (result) {
|
|
54
|
+
selectedLocalFiles.push(result.localFile);
|
|
55
|
+
selectedOriginalFiles.push(result.file);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
if (selectedLocalFiles.length > 0) {
|
|
59
|
+
onFilesSelect(dispatchToAttachmentReducer, { selectedLocalFiles, selectedOriginalFiles });
|
|
47
60
|
}
|
|
48
|
-
}));
|
|
61
|
+
}))();
|
|
49
62
|
};
|
|
50
63
|
const getFileAccessDetails = (file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
64
|
const fileName = (file === null || file === void 0 ? void 0 : file.name) || '';
|
|
@@ -101,6 +114,40 @@ export const hasAbortedOrFailedAttachments = (selectedLocalFiles) => !isEmpty(fi
|
|
|
101
114
|
isUploadFailed(localFile.uploadProgress.uploadStatus)));
|
|
102
115
|
/** True when at least one non-deleted file remains in the upload queue (UI visibility). */
|
|
103
116
|
export const hasSomeSelectedFiles = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => !isFileDeleted(localFile.uploadProgress.uploadStatus)));
|
|
117
|
+
const MAX_CONCURRENT_SESSION_UPLOADS = 3;
|
|
118
|
+
const SESSION_UPLOAD_MAX_ATTEMPTS = 2;
|
|
119
|
+
const SESSION_UPLOAD_RETRY_DELAY_MS = 500;
|
|
120
|
+
const activeUploadLockKeys = new Set();
|
|
121
|
+
const sessionUploadQueues = new Map();
|
|
122
|
+
const buildUploadLockKey = (idToUploadTo, localFile) => `${idToUploadTo}:${localFile.name}:${localFile.size}:${localFile.lastModified}`;
|
|
123
|
+
export const clearUploadRuntimeState = () => {
|
|
124
|
+
activeUploadLockKeys.clear();
|
|
125
|
+
sessionUploadQueues.clear();
|
|
126
|
+
};
|
|
127
|
+
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
128
|
+
const acquireSessionUploadSlot = (sessionId) => new Promise((resolve) => {
|
|
129
|
+
const tryAcquire = () => {
|
|
130
|
+
var _a;
|
|
131
|
+
const queue = (_a = sessionUploadQueues.get(sessionId)) !== null && _a !== void 0 ? _a : { activeCount: 0, waiting: [] };
|
|
132
|
+
sessionUploadQueues.set(sessionId, queue);
|
|
133
|
+
if (queue.activeCount < MAX_CONCURRENT_SESSION_UPLOADS) {
|
|
134
|
+
queue.activeCount++;
|
|
135
|
+
resolve(() => {
|
|
136
|
+
queue.activeCount--;
|
|
137
|
+
const next = queue.waiting.shift();
|
|
138
|
+
if (next) {
|
|
139
|
+
next();
|
|
140
|
+
}
|
|
141
|
+
else if (queue.activeCount === 0) {
|
|
142
|
+
sessionUploadQueues.delete(sessionId);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
queue.waiting.push(tryAcquire);
|
|
148
|
+
};
|
|
149
|
+
tryAcquire();
|
|
150
|
+
});
|
|
104
151
|
export const isUploadingAttachment = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => isUploading(localFile.uploadProgress.uploadStatus)));
|
|
105
152
|
export const isAnalysingAnyAttachment = (selectedLocalFiles) => !isEmpty(find(selectedLocalFiles, (localFile) => isAnalysingFile(localFile.analysisMetadata.analysisStatus)));
|
|
106
153
|
export const canShowProgressBar = (file) => isUploading(file.uploadProgress.uploadStatus) || isAnalysingFile(file.analysisMetadata.analysisStatus);
|
|
@@ -150,29 +197,25 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
|
|
|
150
197
|
if (eligibleCount === 0) {
|
|
151
198
|
return;
|
|
152
199
|
}
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
onCaseFileUploaded,
|
|
168
|
-
});
|
|
200
|
+
const startEligibleUpload = (index) => {
|
|
201
|
+
const localFile = caseFiles.selectedLocalFiles[index];
|
|
202
|
+
return uploadFile({
|
|
203
|
+
dispatch,
|
|
204
|
+
idToUploadTo,
|
|
205
|
+
localFile,
|
|
206
|
+
originalFile: caseFiles.selectedOriginalFiles[index],
|
|
207
|
+
index,
|
|
208
|
+
needsAnalyzing,
|
|
209
|
+
isSessionId,
|
|
210
|
+
slowUploadConfig,
|
|
211
|
+
apolloClient,
|
|
212
|
+
caseSalesforceId,
|
|
213
|
+
onCaseFileUploaded,
|
|
169
214
|
});
|
|
170
215
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
startEligibleUploads();
|
|
216
|
+
eligibleIndices.forEach((index) => {
|
|
217
|
+
void startEligibleUpload(index);
|
|
218
|
+
});
|
|
176
219
|
});
|
|
177
220
|
export const uploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ dispatch, idToUploadTo, localFile, originalFile, index,
|
|
178
221
|
// isSecureSupport = false, // TODO: Re-enable when Hydra/GraphQL attachment APIs support secure support again
|
|
@@ -186,6 +229,12 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
|
|
|
186
229
|
if (isUploading(uploadStatus) || isUploadComplete(uploadStatus)) {
|
|
187
230
|
return;
|
|
188
231
|
}
|
|
232
|
+
const uploadLockKey = buildUploadLockKey(idToUploadTo, localFile);
|
|
233
|
+
if (activeUploadLockKeys.has(uploadLockKey)) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
activeUploadLockKeys.add(uploadLockKey);
|
|
237
|
+
let releaseSessionUploadSlot;
|
|
189
238
|
// For Metadata you must add x-amz-meta
|
|
190
239
|
// only add x-amz-meta if the value is present else the aws throws signature invalid errors
|
|
191
240
|
const putObjectRequest = {
|
|
@@ -241,12 +290,31 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
|
|
|
241
290
|
updateUploadMetadata(dispatch, index, initialUploadPayload);
|
|
242
291
|
let attachmentId = '';
|
|
243
292
|
if (isSessionId) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
293
|
+
releaseSessionUploadSlot = yield acquireSessionUploadSlot(idToUploadTo);
|
|
294
|
+
for (let attempt = 1; attempt <= SESSION_UPLOAD_MAX_ATTEMPTS; attempt++) {
|
|
295
|
+
try {
|
|
296
|
+
attachmentId = yield sessionAttachments.uploadSessionAttachmentS3(idToUploadTo, {
|
|
297
|
+
description: localFile.description,
|
|
298
|
+
fileName: localFile.name,
|
|
299
|
+
sessionId: idToUploadTo,
|
|
300
|
+
size: localFile.size,
|
|
301
|
+
}, putObjectRequest, listener, true, { partSize: 5 * 1024 * 1024, queueSize: 5 }, Object.assign(Object.assign({}, slowUploadConfig), { preferSlowS3Upload: Config.userConfig.preferSlowS3Upload }));
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
const isUserAbort = (error === null || error === void 0 ? void 0 : error.message) === 'Request aborted by user';
|
|
306
|
+
if (isUserAbort || attempt >= SESSION_UPLOAD_MAX_ATTEMPTS) {
|
|
307
|
+
throw error;
|
|
308
|
+
}
|
|
309
|
+
updateUploadMetadata(dispatch, index, {
|
|
310
|
+
uploadStatus: UploadStatusConstants.uploadingOnSession,
|
|
311
|
+
uploadErrorMessage: '',
|
|
312
|
+
percentUploaded: 0,
|
|
313
|
+
onAbort: undefined,
|
|
314
|
+
});
|
|
315
|
+
yield delay(SESSION_UPLOAD_RETRY_DELAY_MS * attempt);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
250
318
|
}
|
|
251
319
|
else {
|
|
252
320
|
// Mirror master Hydra listener behavior for circular progress + abort button.
|
|
@@ -372,6 +440,10 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
|
|
|
372
440
|
updateUploadMetadata(dispatch, index, uploadErrorPayload);
|
|
373
441
|
}
|
|
374
442
|
}
|
|
443
|
+
finally {
|
|
444
|
+
releaseSessionUploadSlot === null || releaseSessionUploadSlot === void 0 ? void 0 : releaseSessionUploadSlot();
|
|
445
|
+
activeUploadLockKeys.delete(uploadLockKey);
|
|
446
|
+
}
|
|
375
447
|
});
|
|
376
448
|
export function doSosReportAnalysisForAllFiles(dispatch, idToUploadTo, localFiles, isSessionId) {
|
|
377
449
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/useFileUploader.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAgBnF,OAAO,EACH,UAAU,EAKb,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAKnD,wBAAgB,eAAe,CAAC,KAAK,EAAE,wBAAwB;
|
|
1
|
+
{"version":3,"file":"useFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/useFileUploader.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAgBnF,OAAO,EACH,UAAU,EAKb,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAKnD,wBAAgB,eAAe,CAAC,KAAK,EAAE,wBAAwB;gCA8JjB,MAAM;gCAYA,UAAU,mBAAmB,MAAM,WAAW,UAAU;oCAOpD,MAAM,QAAQ,UAAU;wBAxGzD,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC;4BAwJ3B,MAAM;kCA9DN,MAAM;EAwFhD"}
|
|
@@ -47,6 +47,8 @@ export function useFileUploader(props) {
|
|
|
47
47
|
useBrowserAPIForDetection,
|
|
48
48
|
}), [checkForS3SlowUploads, useBrowserAPIForDetection]);
|
|
49
49
|
const isInitialMountRef = useRef(true);
|
|
50
|
+
const caseFilesRef = useRef(caseFiles);
|
|
51
|
+
caseFilesRef.current = caseFiles;
|
|
50
52
|
const selectedLocalFiles = attachmentState.caseFiles.selectedLocalFiles;
|
|
51
53
|
const prevSelectedFiles = usePrevious(selectedLocalFiles);
|
|
52
54
|
const resolveCaseSalesforceId = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -82,7 +84,7 @@ export function useFileUploader(props) {
|
|
|
82
84
|
uploadAllFiles({
|
|
83
85
|
dispatch,
|
|
84
86
|
idToUploadTo: idToUploadTo || sessionId,
|
|
85
|
-
caseFiles,
|
|
87
|
+
caseFiles: caseFilesRef.current,
|
|
86
88
|
needsAnalyzing,
|
|
87
89
|
isSessionId,
|
|
88
90
|
slowUploadConfig,
|
|
@@ -92,7 +94,6 @@ export function useFileUploader(props) {
|
|
|
92
94
|
});
|
|
93
95
|
}), [
|
|
94
96
|
apolloClient,
|
|
95
|
-
caseFiles,
|
|
96
97
|
dispatch,
|
|
97
98
|
idToUploadTo,
|
|
98
99
|
isSessionId,
|
|
@@ -107,7 +108,9 @@ export function useFileUploader(props) {
|
|
|
107
108
|
sessionRestoreDispatch,
|
|
108
109
|
slowUploadConfig,
|
|
109
110
|
]);
|
|
110
|
-
const
|
|
111
|
+
const onUploadAllRef = useRef(onUploadAll);
|
|
112
|
+
onUploadAllRef.current = onUploadAll;
|
|
113
|
+
const debouncedAutoUploadOnSelect = useMemo(() => debounce(() => void onUploadAllRef.current(), AUTO_UPLOAD_ON_SELECT_DEBOUNCE_MS), []);
|
|
111
114
|
useEffect(() => () => debouncedAutoUploadOnSelect.cancel(), [debouncedAutoUploadOnSelect]);
|
|
112
115
|
useEffect(() => {
|
|
113
116
|
if (isInitialMountRef.current) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainSection.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/MainSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MainSection.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/MainSection.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,UAAU,MAAM;IACZ,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAC5C,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAKD,QAAA,MAAM,WAAW;;;CAkFhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Alert } from '@patternfly/react-core';
|
|
2
2
|
import { ErrorBoundary, LoadingIndicator } from '@rh-support/components';
|
|
3
3
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
4
|
+
import { getCssPortalUrl } from '@rh-support/utils';
|
|
4
5
|
import isEqual from 'lodash/isEqual';
|
|
5
6
|
import React, { useContext } from 'react';
|
|
6
7
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
@@ -26,7 +27,7 @@ const MainSection = (props) => {
|
|
|
26
27
|
"To adhere to data regulations, open this case through",
|
|
27
28
|
' ',
|
|
28
29
|
React.createElement("b", null,
|
|
29
|
-
React.createElement("a", { href:
|
|
30
|
+
React.createElement("a", { href: getCssPortalUrl(), target: "_blank", rel: "noopener noreferrer", "data-tracking-id": "stateside-support-link" }, "Confirmed Sovereign Support")),
|
|
30
31
|
' ',
|
|
31
32
|
"instead of traditional support."))),
|
|
32
33
|
React.createElement(LoadingIndicator, { show: props.isLoading, size: "lg" }),
|