@rh-support/troubleshoot 2.1.11 → 2.1.13-beta-0
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/AccountSelector.js +1 -1
- package/lib/esm/components/AccountInfo/ManagedAccountsDropdown.js +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/OwnerSelector.js +91 -26
- package/lib/esm/components/AccountInfo/css/accountSelector.css +4 -0
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +8 -16
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +2 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +4 -2
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +4 -2
- package/lib/esm/components/CaseEditView/CaseOverview/DateTime.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/DateTime.js +4 -2
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +3 -1
- package/lib/esm/components/CaseEditView/PDFContainer.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/PDFContainer.js +3 -10
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.js +3 -3
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/index.d.ts +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/index.js +0 -1
- package/lib/esm/components/CaseEditView/ShareCase/PartnerCaseHelper.js +2 -2
- package/lib/esm/components/CaseEditView/ShareCase/TnC.d.ts +0 -2
- package/lib/esm/components/CaseEditView/ShareCase/TnC.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ShareCase/TnC.js +2 -20
- package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseActionPlan/CaseActionPlan.js +5 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +119 -42
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +2 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +5 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +8 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberSev1ConfirmAlert.d.ts +9 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberSev1ConfirmAlert.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberSev1ConfirmAlert.js +69 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseReferenceNumber.js +5 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +3 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +4 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +5 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +3 -1
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +3 -3
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +92 -29
- package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.d.ts +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumberPopOver.js +5 -8
- package/lib/esm/components/CaseInformation/FileDiag.d.ts +5 -1
- package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/FileDiag.js +2 -2
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +5 -3
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +3 -1
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +2 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +4 -15
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +7 -5
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +8 -4
- package/lib/esm/components/CaseManagement/OpenShiftV3Inputbox.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftV3Inputbox.js +5 -3
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +7 -5
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +1 -1
- package/lib/esm/components/EditDescription/EditDescription.d.ts.map +1 -1
- package/lib/esm/components/EditDescription/EditDescription.js +4 -2
- package/lib/esm/components/IdeaInformation/IdeaInformtion.js +5 -5
- package/lib/esm/components/OpenCase/OpenCase.js +2 -2
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +9 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +2 -2
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +2 -2
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +6 -8
- package/lib/esm/components/Recommendations/AsideResults.js +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -1
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.js +6 -3
- package/lib/esm/components/Recommendations/InsightsResults.js +1 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.js +1 -1
- package/lib/esm/components/Recommendations/RecommendationFeedbackModal.js +1 -1
- package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +25 -9
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.js +2 -2
- package/lib/esm/components/Review/Review.js +3 -3
- package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +9 -8
- package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/Suggestions.js +2 -2
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +30 -18
- package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/FileLister.js +17 -7
- package/lib/esm/components/shared/fileUpload/UploadButton.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/UploadButton.js +2 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +17 -3
- package/lib/esm/components/shared/fileUpload/css/fileSelector.css +1 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/FileSelectorButton.js +1 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts +2 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +28 -10
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +26 -15
- package/lib/esm/components/shared/utils.d.ts +1 -0
- package/lib/esm/components/shared/utils.d.ts.map +1 -1
- package/lib/esm/components/shared/utils.js +12 -0
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +4 -0
- package/lib/esm/components/wizardLayout/WizardAside.js +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +2 -2
- package/lib/esm/components/wizardLayout/WizardMain.js +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +50 -4
- package/lib/esm/constants/caseDetailsConstants.d.ts +3 -0
- package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
- package/lib/esm/constants/caseDetailsConstants.js +3 -0
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +3 -1
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +3 -2
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -2
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +7 -4
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +16 -8
- package/lib/esm/reducers/CaseReducer.d.ts +1 -1
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +9 -1
- package/lib/esm/scss/_main.scss +27 -221
- package/lib/esm/scss/_pf4-overrides.scss +90 -13
- package/lib/esm/utils/remoteRiderUtils.d.ts.map +1 -1
- package/lib/esm/utils/remoteRiderUtils.js +2 -2
- package/package.json +8 -8
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts +0 -11
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.js +0 -38
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts +0 -15
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +0 -106
- package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.d.ts +0 -3
- package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.d.ts.map +0 -1
- package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.js +0 -41
- package/lib/esm/constants/tncConstants.d.ts +0 -13
- package/lib/esm/constants/tncConstants.d.ts.map +0 -1
- package/lib/esm/constants/tncConstants.js +0 -12
|
@@ -8,12 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { pcm } from '@cee-eng/hydrajs';
|
|
11
|
-
import { Accordion, Button, Modal } from '@patternfly/react-core';
|
|
11
|
+
import { Accordion, Button, Card, CardBody, CardExpandableContent, CardHeader, CardTitle, Modal, } from '@patternfly/react-core';
|
|
12
12
|
import { useFetch } from '@rh-support/components';
|
|
13
13
|
import { getResTypeFromUrl } from '@rh-support/utils';
|
|
14
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
15
15
|
import { Trans, useTranslation } from 'react-i18next';
|
|
16
|
+
import { useCaseDispatch } from '../../context/CaseContext';
|
|
16
17
|
import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
|
|
18
|
+
import { setCaseState } from '../../reducers/CaseReducer';
|
|
17
19
|
import { createOrUpdateSessionResources, getSessResFromRecs } from '../../reducers/SessionRestoreReducer';
|
|
18
20
|
import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
19
21
|
import { EARuleInfoAccordion } from './EARules/EARuleInfoAccordion';
|
|
@@ -40,6 +42,9 @@ export function InsightResultModal(props) {
|
|
|
40
42
|
const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
|
|
41
43
|
const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
|
|
42
44
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
45
|
+
const caseDispatch = useCaseDispatch();
|
|
46
|
+
const [isExpanded, setIsExpanded] = React.useState(true);
|
|
47
|
+
// To handle self solving of issues
|
|
43
48
|
const handleSolvedIssue = () => __awaiter(this, void 0, void 0, function* () {
|
|
44
49
|
var _a, _b, _c, _d;
|
|
45
50
|
try {
|
|
@@ -59,6 +64,9 @@ export function InsightResultModal(props) {
|
|
|
59
64
|
const onModalToggle = () => {
|
|
60
65
|
setIsModalVisible((visible) => !visible);
|
|
61
66
|
};
|
|
67
|
+
const onExpand = (event, id) => {
|
|
68
|
+
setIsExpanded(!isExpanded);
|
|
69
|
+
};
|
|
62
70
|
useEffect(() => {
|
|
63
71
|
props.isOpen &&
|
|
64
72
|
createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.INSIGHTS, getSessResFromRecs(props.insightResults, SessionResourceVisibility.PRESENTED));
|
|
@@ -86,14 +94,22 @@ export function InsightResultModal(props) {
|
|
|
86
94
|
setCanShowNewTag(!(total === trueValues));
|
|
87
95
|
}, [selectedLocalFiles, props.EARule]);
|
|
88
96
|
if (props.isRenderedMain) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
setCaseState(caseDispatch, { isFileRecommendationsTriggered: true });
|
|
98
|
+
return (React.createElement(Card, { id: "expandable-card", className: "card-support top-recommendations", isExpanded: isExpanded, isCompact: true },
|
|
99
|
+
React.createElement(CardHeader, { onExpand: onExpand, toggleButtonProps: {
|
|
100
|
+
id: 'toggle-button1',
|
|
101
|
+
'aria-label': t('File recommendations'),
|
|
102
|
+
'aria-labelledby': 'expandable-card-title toggle-button1',
|
|
103
|
+
'aria-expanded': isExpanded,
|
|
104
|
+
}, className: "popular-solutions" },
|
|
105
|
+
React.createElement(CardTitle, { id: "expandable-card-title", className: "card-title" },
|
|
106
|
+
React.createElement(Trans, null, "File recommendations"))),
|
|
107
|
+
React.createElement(CardExpandableContent, null,
|
|
108
|
+
React.createElement(CardBody, { className: "file-recommendation" },
|
|
109
|
+
React.createElement(Accordion, { headingLevel: "h5", asDefinitionList: false, isBordered: true },
|
|
110
|
+
props.insightResults.map((doc) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc }))),
|
|
111
|
+
props.EARule.length > 0 &&
|
|
112
|
+
props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule }))))))));
|
|
97
113
|
}
|
|
98
114
|
return (React.createElement(React.Fragment, null,
|
|
99
115
|
React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteRiderAcceptanceModal.d.ts","sourceRoot":"","sources":["../../../../src/components/RemoteRider/RemoteRiderAcceptanceModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RemoteRiderAcceptanceModal.d.ts","sourceRoot":"","sources":["../../../../src/components/RemoteRider/RemoteRiderAcceptanceModal.tsx"],"names":[],"mappings":"AAMA,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,KAAK,EAAE,MAAM,eA2B/D"}
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
11
11
|
import { AcceptTermsModal, useFetch } from '@rh-support/components';
|
|
12
12
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
|
+
import { TncConstants } from '@rh-support/utils';
|
|
13
14
|
import React, { useContext } from 'react';
|
|
14
|
-
import { TnC } from '../../constants/tncConstants';
|
|
15
15
|
export default function RemoteRiderAcceptanceModal(props) {
|
|
16
16
|
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
17
17
|
const { request, isFetching } = useFetch(publicApi.kase.acknowledgeRemoteSessionTerms, { propgateErrors: true });
|
|
@@ -24,5 +24,5 @@ export default function RemoteRiderAcceptanceModal(props) {
|
|
|
24
24
|
props.onFailure && props.onFailure();
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
return (React.createElement(AcceptTermsModal, { isSubmitting: isFetching, siteCode:
|
|
27
|
+
return (React.createElement(AcceptTermsModal, { isSubmitting: isFetching, siteCode: TncConstants.REMOTE_RIDER_SITE_CODE, eventCode: TncConstants.REMOTER_RIDER_EVENT_CODE, loggedInUser: loggedInUser.data.ssoUsername, isModalOpen: props.isModalOpen, onModalClose: props.onModalClose, dataTrackingId: props.isCaseDetailsPage ? 'rar-case-details' : 'rar-case-submit', onConfirm: onConfirm }));
|
|
28
28
|
}
|
|
@@ -48,13 +48,13 @@ export default function Review(props) {
|
|
|
48
48
|
React.createElement(CaseType, { hideIdea: true }),
|
|
49
49
|
React.createElement(SupportLevel, null),
|
|
50
50
|
React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
|
|
51
|
-
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
51
|
+
React.createElement(FlexItem, { flex: { default: 'flex_1' }, className: "pf-u-mb-xl" },
|
|
52
52
|
React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange })),
|
|
53
|
-
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
53
|
+
React.createElement(FlexItem, { flex: { default: 'flex_1' }, className: "pf-u-mb-xl" },
|
|
54
54
|
React.createElement(ContactPhoneNumber, null))),
|
|
55
55
|
React.createElement(ContactPhoneNumberAlert, null),
|
|
56
56
|
React.createElement(Fts, { inlineEditable: true, initialIsEditing: isEmpty(contactInfo24x7), hideSaveCancel: true }),
|
|
57
|
-
React.createElement(CaseLanguageSelector,
|
|
57
|
+
React.createElement(CaseLanguageSelector, { "data-tracking-id": "review-preferred-language" }),
|
|
58
58
|
React.createElement(CaseGroup, null),
|
|
59
59
|
canSeeEmailNotifications && React.createElement(CaseContactSelector, null),
|
|
60
60
|
React.createElement(RHAssociatesSelector, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AA4BA,MAAM,CAAC,OAAO,UAAU,UAAU,
|
|
1
|
+
{"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AA4BA,MAAM,CAAC,OAAO,UAAU,UAAU,gBA6SjC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Env, publicApi } from '@cee-eng/hydrajs';
|
|
2
|
-
import { ActionList, ActionListItem, Button, Text, TextVariants } from '@patternfly/react-core';
|
|
2
|
+
import { ActionList, ActionListItem, Button, Text, TextVariants, Tooltip } from '@patternfly/react-core';
|
|
3
3
|
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
4
4
|
import { AlertMessage, AlertType, useFetch } from '@rh-support/components';
|
|
5
5
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
@@ -83,8 +83,8 @@ export default function SubmitCase() {
|
|
|
83
83
|
: attachmentState.caseFiles.selectedLocalFiles.every((localFile) => !isUploadedAndAnalyzed(localFile));
|
|
84
84
|
const isNotAnIdea = caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
85
85
|
return (React.createElement("article", { className: "gird-main" },
|
|
86
|
-
React.createElement(AlertMessage, { className: "
|
|
87
|
-
React.createElement(AlertMessage, { className: "
|
|
86
|
+
React.createElement(AlertMessage, { className: "pf-u-mt-lg", title: t('Failed to add user.'), variant: AlertType.DANGER, show: addNotifiedUserError }),
|
|
87
|
+
React.createElement(AlertMessage, { className: "pf-u-mt-lg", variant: AlertType.DANGER, show: caseCreationError, title: t("Sorry, we're experiencing an error"), isInline: true },
|
|
88
88
|
React.createElement(React.Fragment, null, caseCreationErrorMessage)),
|
|
89
89
|
!isCreatingCase && !caseCreationError && (React.createElement(React.Fragment, null,
|
|
90
90
|
showRemoteRiderBanner && !loggedInUser.data.isInternal && (React.createElement(RemoteRiderBanner, { onConfirm: onRemoteRiderConfirm, onClose: onRemoteRiderClose, caseNumber: caseNumber, isSecureSupport: loggedInUsersAccount.data.secureSupport })),
|
|
@@ -92,7 +92,7 @@ export default function SubmitCase() {
|
|
|
92
92
|
React.createElement("p", { className: "kicker kicker-sm pf-u-mb-sm" }, !isEmpty(RouteUtils.seBasePath) &&
|
|
93
93
|
!isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles) ? (React.createElement(React.Fragment, null,
|
|
94
94
|
React.createElement("div", { className: "submit-page-title pf-u-mb-lg" },
|
|
95
|
-
React.createElement(CheckCircleIcon, { size: "lg" }),
|
|
95
|
+
React.createElement(CheckCircleIcon, { className: "submit-case-check-icon", size: "lg" }),
|
|
96
96
|
' ',
|
|
97
97
|
React.createElement(Text, { className: "pf-u-ml-md pf-u-mb-0", component: TextVariants.h1 },
|
|
98
98
|
React.createElement(Trans, null, "We've added your case to our queue"))),
|
|
@@ -101,7 +101,7 @@ export default function SubmitCase() {
|
|
|
101
101
|
"\u00A0",
|
|
102
102
|
React.createElement(Link, { to: `/case/${caseNumber}`, "data-tracking-id": "get-support-queued-case-number", className: viewDisabled ? 'case-link-disabled' : '' }, caseNumber)))) : (React.createElement(React.Fragment, null,
|
|
103
103
|
React.createElement("div", { className: "submit-page-title" },
|
|
104
|
-
React.createElement(CheckCircleIcon, { size: "lg" }),
|
|
104
|
+
React.createElement(CheckCircleIcon, { className: "submit-case-check-icon", size: "lg" }),
|
|
105
105
|
' ',
|
|
106
106
|
React.createElement(Text, { component: TextVariants.h1 },
|
|
107
107
|
React.createElement(Trans, null, "We\u2019ve added your case to our queue"))),
|
|
@@ -132,9 +132,10 @@ export default function SubmitCase() {
|
|
|
132
132
|
React.createElement("div", null,
|
|
133
133
|
React.createElement(ActionList, null,
|
|
134
134
|
React.createElement(ActionListItem, null,
|
|
135
|
-
React.createElement(Button, { component: "a", href: `${getRedhatDotComHost(Env.getEnvName())}/wapps/ugc/protected/${'personalInfo.html'}`, target: "_blank", variant: "secondary", "data-tracking-id": "get-support-update-info" }, "Update info")),
|
|
136
|
-
React.createElement(ActionListItem, null,
|
|
137
|
-
React.createElement(
|
|
135
|
+
React.createElement(Button, { component: "a", href: `${getRedhatDotComHost(Env.getEnvName())}/wapps/ugc/protected/${'personalInfo.html'}`, target: "_blank", variant: "secondary", "data-tracking-id": "get-support-update-info", className: "update-info-button" }, "Update info")),
|
|
136
|
+
React.createElement(ActionListItem, null, viewDisabled ? (React.createElement(React.Fragment, null,
|
|
137
|
+
React.createElement(Tooltip, { content: t('File upload in progress.'), position: "bottom" },
|
|
138
|
+
React.createElement(Button, { className: "pf-u-ml-md", component: "a", href: getCaseURL(), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case'), isAriaDisabled: viewDisabled }, "View case")))) : (React.createElement(Button, { className: "pf-u-ml-md", component: (props) => React.createElement(Link, Object.assign({}, props, { to: `/case/${caseNumber}` })), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case') }, "View case")))))),
|
|
138
139
|
!isEmpty(attachmentState.caseFiles.selectedLocalFiles) && (React.createElement(FileUploader, { idToUploadTo: caseNumber, isSessionId: false, isSecureSupport: loggedInUsersAccount.data.secureSupport })),
|
|
139
140
|
React.createElement("div", null,
|
|
140
141
|
(!isEmpty(topContent.data) || !rulesState.EARules.rules || !clusterRecommendations) &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Suggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/Suggestions.tsx"],"names":[],"mappings":"AAgBA,UAAU,MAAM;IACZ,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Suggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/Suggestions/Suggestions.tsx"],"names":[],"mappings":"AAgBA,UAAU,MAAM;IACZ,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,eAsGhD"}
|
|
@@ -45,7 +45,7 @@ export default function Suggestions(props) {
|
|
|
45
45
|
return (React.createElement("div", null,
|
|
46
46
|
showTitleDescription && (React.createElement("div", { className: "card card-support" },
|
|
47
47
|
!isTCSearchEnabled && (React.createElement(Trans, null,
|
|
48
|
-
React.createElement("h3", { className: "card-heading popular-solutions" }, props.title ? props.title : t('i18nKeyPopularSolutions', 'Popular solutions and docs')))),
|
|
48
|
+
React.createElement("h3", { className: "card-heading popular-solutions green-card-heading" }, props.title ? props.title : t('i18nKeyPopularSolutions', 'Popular solutions and docs')))),
|
|
49
49
|
isTCSearchEnabled && (React.createElement("div", { className: "card-body" },
|
|
50
50
|
React.createElement(TopContentSearch, { topContentData: topContent.data, topContentResultsWrapperRef: accordionRef, onSearch: onSearchChange, dataTrackingId: "top-content-filter-troubleshoot", enableEventTracking: true }))))),
|
|
51
51
|
React.createElement("pfe-accordion", { ref: accordionRef }, map(filteredTC.slice(0, maxTC), (sug, index) => {
|
|
@@ -53,5 +53,5 @@ export default function Suggestions(props) {
|
|
|
53
53
|
return (React.createElement(TopContent, { seSessionId: activeSessionId, seResourceOriginID: (_b = (_a = sessionResourceTracking[SessionResourceSource.TOP_CONTENT]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '', topContentIndex: index, onResourceClick: onResourceClick, name: sug.categoryName, key: sug.categoryName, items: sug.content, helperText: (sug === null || sug === void 0 ? void 0 : sug.helperText) || '' }));
|
|
54
54
|
})),
|
|
55
55
|
showMax && filteredTC.length > maxTC && (React.createElement("div", { className: "text-right" },
|
|
56
|
-
React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: showAllCategories }, "More
|
|
56
|
+
React.createElement("button", { className: "btn btn-app btn-link", type: "button", onClick: showAllCategories, "data-tracking-id": "suggestions-more-categories" }, "More categories")))));
|
|
57
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAmBA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA0HzC;kBA1HQ,mBAAmB;;;AA6H5B,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core';
|
|
1
2
|
import { ErrorBoundary, LoadingDots } from '@rh-support/components';
|
|
2
3
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
4
|
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
@@ -8,6 +9,7 @@ import React, { useContext } from 'react';
|
|
|
8
9
|
import { Trans, useTranslation } from 'react-i18next';
|
|
9
10
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
10
11
|
import { TCStateContext } from '../../context/TopContentContext';
|
|
12
|
+
// import { isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
|
|
11
13
|
import { FileDiag } from '../CaseInformation/FileDiag';
|
|
12
14
|
import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
|
|
13
15
|
import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
|
|
@@ -31,37 +33,47 @@ function TroubleshootSection(props) {
|
|
|
31
33
|
isCreatingCase: state.isCreatingCase,
|
|
32
34
|
caseType: state.caseDetails.caseType,
|
|
33
35
|
}), isEqual);
|
|
34
|
-
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
35
36
|
const canShowTopProducts = isEmpty(product);
|
|
36
37
|
const canShowTopContent = !canShowTopProducts && ((_a = topContent === null || topContent === void 0 ? void 0 : topContent.data) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
37
38
|
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
38
39
|
const isNotAnIdea = caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
40
|
+
const ParentSection = ({ children }) => {
|
|
41
|
+
if (!children) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return React.createElement("section", { className: "parent-section" }, children);
|
|
45
|
+
};
|
|
39
46
|
return (React.createElement(React.Fragment, null,
|
|
40
|
-
!isCreatingCase && (React.createElement(
|
|
41
|
-
React.createElement(OpenShiftClusterId, { className: "push-bottom" }))),
|
|
47
|
+
!isCreatingCase && (React.createElement(ParentSection, null,
|
|
48
|
+
React.createElement(OpenShiftClusterId, { className: "push-bottom", "data-tracking-id": "troubleshoot-section-openshift-cluster-id" }))),
|
|
42
49
|
React.createElement("section", null,
|
|
43
50
|
React.createElement("header", null,
|
|
44
51
|
React.createElement("h3", null,
|
|
45
|
-
React.createElement(
|
|
52
|
+
React.createElement("p", { className: "selected-product-suggestion" },
|
|
46
53
|
t('Because you selected'),
|
|
47
|
-
|
|
48
|
-
React.createElement("
|
|
54
|
+
" ",
|
|
55
|
+
React.createElement("b", null, product))),
|
|
49
56
|
React.createElement(LoadingDots, { show: topContent.isFetching }),
|
|
50
|
-
topContent.data.length === 0 && (React.createElement(
|
|
51
|
-
React.createElement("
|
|
52
|
-
React.createElement(
|
|
53
|
-
|
|
57
|
+
topContent.data.length === 0 && (React.createElement(Card, { id: "card", className: "card-support top-recommendations pf-u-mb-md", isCompact: true },
|
|
58
|
+
React.createElement(CardHeader, { "aria-label": t('Popular solutions and docs'), className: "popular-solutions" },
|
|
59
|
+
React.createElement(CardTitle, { id: "card-title", className: "card-title" },
|
|
60
|
+
React.createElement(Trans, { i18nKey: 'i18nKeyPopularSolutions' }, "Popular solutions and docs"))),
|
|
61
|
+
React.createElement(CardBody, { "aria-label": t('No recommendations for this product'), className: "file-recs-no-recommendation pf-u-mt-md" },
|
|
54
62
|
React.createElement(Trans, null, "No recommendations for this product")))),
|
|
55
63
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading suggestions') } }, canShowTopContent && !isEmpty(version) && React.createElement(Suggestions, null)),
|
|
56
|
-
!isCreatingCase && React.createElement(ClusterRecommendations, { className: "
|
|
64
|
+
!isCreatingCase && React.createElement(ClusterRecommendations, { className: "pf-u-mt-lg" }))),
|
|
57
65
|
React.createElement("section", { className: "pf-u-mt-lg" },
|
|
58
|
-
isNotAnIdea && React.createElement(InsightsResults, { isDisplayOnMain: true }),
|
|
59
|
-
React.createElement("div", { className: "
|
|
60
|
-
React.createElement(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"."))))))
|
|
66
|
+
isNotAnIdea && (React.createElement(InsightsResults, { isDisplayOnMain: true, "data-tracking-id": "troubleshoot-section-file-recs" })),
|
|
67
|
+
React.createElement("div", { className: "pf-u-mt-lg" }, canAddAttachments ? (React.createElement(FileDiag, null)) : (React.createElement(React.Fragment, null,
|
|
68
|
+
React.createElement(Card, { id: "card", className: "card-support card-white file-diag", isCompact: true },
|
|
69
|
+
React.createElement(CardHeader, { "aria-label": !isNotAnIdea || loggedInUsersAccount.data.secureSupport
|
|
70
|
+
? t('File uploader')
|
|
71
|
+
: t('Upload file to analyze'), className: "card-heading" },
|
|
72
|
+
React.createElement(CardTitle, { id: "card-title", className: "card-title" }, !isNotAnIdea || loggedInUsersAccount.data.secureSupport ? (React.createElement(Trans, null, "File uploader")) : (React.createElement(Trans, null, "Upload file to analyze")))),
|
|
73
|
+
React.createElement(CardBody, { "aria-label": t('No recommendations for this product'), className: "no-access-file-diag" },
|
|
74
|
+
React.createElement("div", { className: "display-dashed pf-u-font-weight-bold pf-u-text-align-center pf-u-mt-md" },
|
|
75
|
+
React.createElement(Trans, null, "You do not have access to upload files"),
|
|
76
|
+
".")))))))));
|
|
65
77
|
}
|
|
66
78
|
TroubleshootSection.defaultProps = defaultProps;
|
|
67
79
|
export default TroubleshootSection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileLister.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/FileLister.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileLister.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/FileLister.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAiB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGxE,eAAO,MAAM,qBAAqB,2FAAyC,CAAC;AAiB5E,UAAU,MAAM;IACZ,kBAAkB,EAAE,UAAU,EAAE,CAAC;IACjC,UAAU,EAAE,CAAC,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACtG,YAAY,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,eA2S/C"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { pcm } from '@cee-eng/hydrajs';
|
|
2
2
|
import { Button, ButtonVariant, Label, Progress, ProgressMeasureLocation } from '@patternfly/react-core';
|
|
3
|
+
import HistoryIcon from '@patternfly/react-icons/dist/js/icons/history-icon';
|
|
3
4
|
import { CircularProgressbar } from '@rh-support/components';
|
|
4
|
-
import { humanizeSize } from '@rh-support/utils';
|
|
5
|
+
import { humanizeSize, PreviousCaseTypes } from '@rh-support/utils';
|
|
5
6
|
import capitalize from 'lodash/capitalize';
|
|
6
7
|
import isEmpty from 'lodash/isEmpty';
|
|
8
|
+
import isEqual from 'lodash/isEqual';
|
|
7
9
|
import map from 'lodash/map';
|
|
8
|
-
import React from 'react';
|
|
10
|
+
import React, { useEffect, useState } from 'react';
|
|
9
11
|
import { Trans, useTranslation } from 'react-i18next';
|
|
12
|
+
import { useCaseSelector } from '../../../context/CaseContext';
|
|
10
13
|
import { ATTACHMENT_DESCRIPTION_LENGTH_LIMIT } from '../../../reducers/CaseConstNTypes';
|
|
11
14
|
import { isAnalysingFile, isAnalysisFailed, isFileDeleted, isUploadAborted, isUploadedAndAnalysisFailed, isUploadedAndAnalysisSkipped, isUploadedAndAnalyzed, isUploadFailed, isUploading, isUploadingAttachment, isUploadingOnCase, isUploadingOnSession, isUploadOnTrack, isVerifyingUpload, shouldHideDescription, } from './reducer/AttachmentHelper';
|
|
12
15
|
import { FileStatusHelper } from './reducer/FileStatusHelper';
|
|
@@ -34,6 +37,13 @@ export default function FileLister(props) {
|
|
|
34
37
|
props.onFileEdit &&
|
|
35
38
|
props.onFileEdit(editedLocalFile, indexToEdit, { description: editedLocalFile.description.trim() });
|
|
36
39
|
};
|
|
40
|
+
const { caseType } = useCaseSelector((state) => ({
|
|
41
|
+
caseType: state.caseDetails.caseType,
|
|
42
|
+
}), isEqual);
|
|
43
|
+
const [isIdea, setIsIdea] = useState(false);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
setIsIdea(caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT);
|
|
46
|
+
}, [caseType]);
|
|
37
47
|
// To retry file upload
|
|
38
48
|
const onRetry = (index) => () => {
|
|
39
49
|
props.onRetry && props.onRetry(index);
|
|
@@ -94,7 +104,7 @@ export default function FileLister(props) {
|
|
|
94
104
|
React.createElement("span", { className: "sr-only" }, "Selected files"),
|
|
95
105
|
React.createElement("ul", { className: "file-diag-list" }, map(props.selectedLocalFiles, (localFile, index) => {
|
|
96
106
|
var _a;
|
|
97
|
-
return isFileDeleted(localFile.uploadProgress.uploadStatus) ? (React.createElement(React.Fragment, { key: index })) : (React.createElement("li", { key: index, className:
|
|
107
|
+
return isFileDeleted(localFile.uploadProgress.uploadStatus) ? (React.createElement(React.Fragment, { key: index })) : (React.createElement("li", { key: index, className: `file-upload-group ${localFile.uploadability.ableToUpload
|
|
98
108
|
? `file-${index + 1}`
|
|
99
109
|
: `file-${index + 1} text-error`}` },
|
|
100
110
|
React.createElement("div", { className: "file-name" },
|
|
@@ -113,7 +123,7 @@ export default function FileLister(props) {
|
|
|
113
123
|
((_a = localFile === null || localFile === void 0 ? void 0 : localFile.description) === null || _a === void 0 ? void 0 : _a.length) > 1 && (React.createElement("span", { className: "character-counter text-muted" }, 255 - localFile.description.length)),
|
|
114
124
|
(isUploadFailed(localFile.uploadProgress.uploadStatus) ||
|
|
115
125
|
isUploadAborted(localFile.uploadProgress.uploadStatus)) && (React.createElement("button", { type: "button", "aria-label": "Failed to upload, Retry", title: "Failed to upload, Retry", className: "btn btn-link btn-xs", "data-tracking-id": "file-lister-retry", onClick: onRetry(index) },
|
|
116
|
-
React.createElement(
|
|
126
|
+
React.createElement(HistoryIcon, null))),
|
|
117
127
|
!isVerifyingUpload(localFile.uploadProgress.uploadStatus) &&
|
|
118
128
|
!isAnalysingFile(localFile.analysisMetadata.analysisStatus) && (React.createElement(React.Fragment, null,
|
|
119
129
|
canShowAbortBtn(localFile.uploadProgress.uploadStatus) && (React.createElement(Button, { variant: ButtonVariant.link, isDanger: true, "aria-label": t('Cancel Upload'), title: t('Cancel Upload'), className: "btn btn-link btn-app remove-file", "data-tracking-id": "file-lister-abort", onClick: onAbortClick(localFile, index), hidden: !localFile.uploadability.ableToUpload, isDisabled: !(localFile.uploadProgress.percentUploaded > 0) },
|
|
@@ -124,12 +134,12 @@ export default function FileLister(props) {
|
|
|
124
134
|
React.createElement("input", { id: `file-${index + 1}-description`, "data-tracking-id": `case-${props.isSessionId ? 'create' : 'details'}-file-${index + 1}-description`, className: "file-description form-control pf-u-my-sm", type: "text", value: localFile.description, onChange: onDescriptionChange(localFile, index), maxLength: 255, placeholder: t(`${shouldHideDescription(localFile, props.isSessionId)
|
|
125
135
|
? ''
|
|
126
136
|
: t('Enter a description')}`), hidden: shouldHideDescription(localFile, props.isSessionId) }),
|
|
127
|
-
isUploadedAndAnalysisSkipped(localFile) && (React.createElement("span", { className: "text-muted" }, localFile.analysisMetadata.analysisErrorMesssage)),
|
|
137
|
+
isUploadedAndAnalysisSkipped(localFile) && !isIdea && (React.createElement("span", { className: "text-muted" }, localFile.analysisMetadata.analysisErrorMesssage)),
|
|
128
138
|
localFile.description.length === ATTACHMENT_DESCRIPTION_LENGTH_LIMIT ? (React.createElement("p", { className: "form-instructions" },
|
|
129
139
|
React.createElement(Trans, null, maxCaseAttachmentDescription))) : null,
|
|
130
140
|
isUploadedAndAnalysisFailed(localFile) && (React.createElement("span", { className: "text-danger" },
|
|
131
141
|
React.createElement(Trans, null, "Something went wrong during file analysis."),
|
|
132
|
-
React.createElement(Button, { onClick: onRetryAnalysis(index), isInline: true, variant: ButtonVariant.link },
|
|
142
|
+
React.createElement(Button, { onClick: onRetryAnalysis(index), isInline: true, variant: ButtonVariant.link, "data-tracking-id": "something-wrong-try-again" },
|
|
133
143
|
React.createElement(Trans, null, "Try analyzing again.")))),
|
|
134
144
|
isUploadFailed(localFile.uploadProgress.uploadStatus) && (React.createElement("span", { className: "text-danger" },
|
|
135
145
|
React.createElement(Trans, null,
|
|
@@ -138,7 +148,7 @@ export default function FileLister(props) {
|
|
|
138
148
|
sosReportErrorText(localFile.uploadProgress.uploadErrorMessage),
|
|
139
149
|
".",
|
|
140
150
|
' '),
|
|
141
|
-
React.createElement(Button, { onClick: onRetry(index), isInline: true, variant: ButtonVariant.link },
|
|
151
|
+
React.createElement(Button, { onClick: onRetry(index), isInline: true, variant: ButtonVariant.link, "data-tracking-id": "upload-fail-try-again" },
|
|
142
152
|
React.createElement(Trans, null, "Try again"))))));
|
|
143
153
|
})),
|
|
144
154
|
props.showSlowUploadMsg && isUploadingAttachment(props.selectedLocalFiles) && (React.createElement("span", { className: "text-muted" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/UploadButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/UploadButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,QAAA,MAAM,YAAY;;;;;CAKjB,CAAC;AAEF,aAAK,YAAY,GAAG,OAAO,YAAY,CAAC;AAExC,MAAM,WAAW,MAAO,SAAQ,YAAY;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC9E,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAyCtC;kBAzCQ,gBAAgB;;;;;;;;AA4CzB,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Button } from '@patternfly/react-core';
|
|
1
2
|
import { ability, resourceActions, resources } from '@rh-support/user-permissions';
|
|
2
3
|
import React, { useContext } from 'react';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
@@ -24,7 +25,7 @@ function FileUploadButton(props) {
|
|
|
24
25
|
if (props.isSessionId && !canUseSessionManagement) {
|
|
25
26
|
return React.createElement(React.Fragment, null);
|
|
26
27
|
}
|
|
27
|
-
return (React.createElement(React.Fragment, null, hasSomeSelectedFiles(selectedLocalFiles) && (React.createElement("div", { className: props.className }, hasSomeUnUploadedAttachments(selectedLocalFiles) ? (React.createElement(
|
|
28
|
+
return (React.createElement(React.Fragment, null, hasSomeSelectedFiles(selectedLocalFiles) && (React.createElement("div", { className: props.className }, hasSomeUnUploadedAttachments(selectedLocalFiles) ? (React.createElement(Button, { type: "button", className: "btn btn-app", "data-tracking-id": "file-upload-all", onClick: onUploadAll }, t(props.uploadBtnLabel))) : props.uploadAnotherBtn ? (React.createElement(FileSelectorButton, { isSessionId: props.isSessionId, isPrivate: props.isPrivate, "data-tracking-id": "file-selector-button", className: `pf-m-secondary ${hasSomeUnUploadedAttachments(selectedLocalFiles) && 'm-l-1'}`, buttonLabel: t('Upload new file') })) : null))));
|
|
28
29
|
}
|
|
29
30
|
FileUploadButton.defaultProps = defaultProps;
|
|
30
31
|
export { FileUploadButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/WidgetFileUploader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAA0C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WidgetFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/WidgetFileUploader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AA0B/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAInD,UAAU,MAAO,SAAQ,wBAAwB,EAAE,gBAAgB;IAC/D,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAYD,iBAAS,kBAAkB,CAAC,KAAK,EAAE,MAAM,eA+MxC;kBA/MQ,kBAAkB;;;AAmN3B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -7,7 +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 { Button } from '@patternfly/react-core';
|
|
10
|
+
import { Alert, Button } from '@patternfly/react-core';
|
|
11
11
|
import { ToastNotification } from '@rh-support/components';
|
|
12
12
|
import { getText } from '@rh-support/utils';
|
|
13
13
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -16,7 +16,6 @@ import { RulesDispatchContext, RulesStateContext } from '../../../context/RulesC
|
|
|
16
16
|
import { RulesReducerConstants } from '../../../reducers/RulesReducer';
|
|
17
17
|
import FileLister from './FileLister';
|
|
18
18
|
import WidgetFileSelector from './fileSelectors/WidgetFileSelector';
|
|
19
|
-
import WidgetFileSelectorImage from './fileSelectors/WidgetFileSelectorImage';
|
|
20
19
|
import { doSosReportAnalysisForFile, hasAnalysedSomeAttachments, hasSomeSelectedFiles, hasUploadedSomeAttachments, isAnalysingAnyAttachment, isAnalysisNotStarted, isRestoredFromSession, } from './reducer/AttachmentHelper';
|
|
21
20
|
import { defaultAnalysisMetadata, defaultUploadMetadata, onFilesSelect, UploadStatusConstants, } from './reducer/AttachmentReducer';
|
|
22
21
|
import { AttachmentDispatchContext, AttachmentStateContext } from './reducer/AttachmentReducerContext';
|
|
@@ -40,12 +39,26 @@ function WidgetFileUploader(props) {
|
|
|
40
39
|
const { rulesState } = useContext(RulesStateContext);
|
|
41
40
|
const [showViewRecBtn, setShowViewRecBtn] = useState(false);
|
|
42
41
|
const { editFile, removeFile, retryUpload, uploadAll, retryAnalysis } = useFileUploader(props);
|
|
42
|
+
const [unallowedLocalFileExists, setUnallowedLocalFileExists] = useState(false);
|
|
43
43
|
useEffect(() => {
|
|
44
44
|
if (rulesState.triggerRuleNotification) {
|
|
45
45
|
!showViewRecBtn && setShowViewRecBtn(true);
|
|
46
46
|
}
|
|
47
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
48
|
}, [rulesState.triggerRuleNotification]);
|
|
49
|
+
const allowedTypesIdea = ['image/jpeg', 'image/png', 'image/jpg', 'image/gif'];
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const checkUnallowedFiles = (selectedLocalFiles, isIdea) => {
|
|
52
|
+
let unallowedFiles = [];
|
|
53
|
+
if (isIdea) {
|
|
54
|
+
unallowedFiles = selectedLocalFiles.filter((file) => !allowedTypesIdea.includes(file.type));
|
|
55
|
+
}
|
|
56
|
+
let hasUnallowedFiles = unallowedFiles.length > 0;
|
|
57
|
+
setUnallowedLocalFileExists(hasUnallowedFiles);
|
|
58
|
+
};
|
|
59
|
+
checkUnallowedFiles(selectedLocalFiles, props.isIdea);
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
+
}, [selectedLocalFiles]);
|
|
49
62
|
const onViewRecBtnClick = () => {
|
|
50
63
|
rulesDispatch({
|
|
51
64
|
type: RulesReducerConstants.triggerEARulesModalVisibiltyChange,
|
|
@@ -125,7 +138,7 @@ function WidgetFileUploader(props) {
|
|
|
125
138
|
return (React.createElement("div", { className: `card card-white card-support file-diag ${props.className || ''}`, onPaste: handlePaste },
|
|
126
139
|
React.createElement("h3", { className: "card-heading" }, props.isIdea || props.isSecureSupport ? (React.createElement(Trans, null, "File uploader")) : (React.createElement(Trans, null, "Upload file to analyze"))),
|
|
127
140
|
React.createElement("div", { className: "card-body" },
|
|
128
|
-
|
|
141
|
+
React.createElement(WidgetFileSelector, { isSessionId: props.isSessionId, isPrivate: props.isPrivate, isIdea: props.isIdea }),
|
|
129
142
|
!hasSomeSelectedFiles(selectedLocalFiles) ? ((!props.isIdea && props.helperText) || (React.createElement("p", { className: "pf-u-mt-sm" },
|
|
130
143
|
!props.isIdea ? (React.createElement(Trans, { i18nKey: "i18nUploadSosReport" },
|
|
131
144
|
"Upload a",
|
|
@@ -134,6 +147,7 @@ function WidgetFileUploader(props) {
|
|
|
134
147
|
"to help us provide the best solutions for your system.")) : (React.createElement("span", { className: "pf-u-font-family-redhatVF-heading-sans-serif pf-u-color-300" },
|
|
135
148
|
React.createElement(Trans, null, "Allowed file types: png, gif, jpg, jpeg."))),
|
|
136
149
|
' '))) : (React.createElement(React.Fragment, null,
|
|
150
|
+
unallowedLocalFileExists && (React.createElement(Alert, { variant: "danger", title: "File type is not allowed on this case type. Please remove file to proceed." })),
|
|
137
151
|
React.createElement(FileLister, { selectedLocalFiles: attachmentState.caseFiles.selectedLocalFiles, onFileEdit: editFile, onFileRemove: removeFile, onRetry: retryUpload, onRetryAnalysis: retryAnalysis, isSessionId: props.isSessionId, showSlowUploadMsg: attachmentState.showUploadingOnSlowConnectionMsg }),
|
|
138
152
|
hasUploadedSomeAttachments(selectedLocalFiles) && !props.isIdea && (React.createElement("p", null,
|
|
139
153
|
React.createElement(Trans, null, "If you can't find a solution, all files are moved to your case."))))),
|
|
@@ -25,6 +25,6 @@ function FileSelectorButton(_a) {
|
|
|
25
25
|
React.createElement("label", { className: "sr-only", htmlFor: "upload-btn" },
|
|
26
26
|
React.createElement(Trans, null, "Upload new file")),
|
|
27
27
|
React.createElement("input", Object.assign({ value: "", style: { display: 'none !important' }, id: `${id !== null && id !== void 0 ? id : 'upload-btn'}` }, getInputProps())),
|
|
28
|
-
React.createElement("button", Object.assign({}, btnProps, { type: "button", className: `pf-c-button ${className}
|
|
28
|
+
React.createElement("button", Object.assign({}, btnProps, { type: "button", className: `pf-c-button ${className}`, "data-tracking-id": "upload-a-file" }), buttonLabel)));
|
|
29
29
|
}
|
|
30
30
|
export default FileSelectorButton;
|
|
@@ -2,7 +2,8 @@ import { IDClassNameProps } from '@rh-support/types/shared';
|
|
|
2
2
|
interface IProps extends IDClassNameProps {
|
|
3
3
|
isSessionId: boolean;
|
|
4
4
|
isPrivate: boolean;
|
|
5
|
+
isIdea?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare function WidgetFileSelector({ id, className, isSessionId, isPrivate }: IProps): JSX.Element;
|
|
7
|
+
declare function WidgetFileSelector({ id, className, isSessionId, isPrivate, isIdea }: IProps): JSX.Element;
|
|
7
8
|
export default WidgetFileSelector;
|
|
8
9
|
//# sourceMappingURL=WidgetFileSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetFileSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/fileSelectors/WidgetFileSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"WidgetFileSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/fileSelectors/WidgetFileSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAS5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,iBAAS,kBAAkB,CAAC,EAAE,EAAO,EAAE,SAAc,EAAE,WAAW,EAAE,SAAiB,EAAE,MAAc,EAAE,EAAE,MAAM,eAiE9G;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,28 +1,46 @@
|
|
|
1
|
+
import { humanizeSize } from '@rh-support/utils';
|
|
1
2
|
import React, { useContext } from 'react';
|
|
2
3
|
import { useDropzone } from 'react-dropzone';
|
|
3
4
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
5
|
import { onDrop } from '../reducer/AttachmentHelper';
|
|
5
6
|
import { AttachmentDispatchContext } from '../reducer/AttachmentReducerContext';
|
|
6
|
-
function WidgetFileSelector({ id = '', className = '', isSessionId, isPrivate = false }) {
|
|
7
|
+
function WidgetFileSelector({ id = '', className = '', isSessionId, isPrivate = false, isIdea = false }) {
|
|
7
8
|
const { t } = useTranslation();
|
|
9
|
+
const MAX_SIZE = isIdea ? 5242880 : undefined;
|
|
8
10
|
// Attachment Reducer Related
|
|
9
11
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
10
|
-
const
|
|
12
|
+
const dropzoneProps = {
|
|
11
13
|
onDrop: onDrop(dispatchToAttachmentReducer, isSessionId, isPrivate),
|
|
12
|
-
|
|
14
|
+
accept: isIdea ? ['.jpeg', '.png', '.jpg', '.gif'] : undefined,
|
|
15
|
+
maxSize: MAX_SIZE,
|
|
16
|
+
};
|
|
17
|
+
const { getRootProps, getInputProps, isDragActive, inputRef, rejectedFiles } = useDropzone(dropzoneProps);
|
|
13
18
|
const onLabelClick = (evt) => {
|
|
14
19
|
// so that file selector doesn't open twice
|
|
15
20
|
// https://github.com/react-dropzone/react-dropzone/issues/182
|
|
16
21
|
evt.stopPropagation();
|
|
17
|
-
// since we are stopping the
|
|
22
|
+
// since we are stopping the propagation the click event handler inside the
|
|
18
23
|
// react-dropzone doesn't get triggered. So we need to manually clear the input value
|
|
19
|
-
// so that user can attach same file twice
|
|
24
|
+
// so that user can attach the same file twice
|
|
20
25
|
inputRef.current.value = null;
|
|
21
26
|
};
|
|
22
|
-
return (React.createElement(
|
|
23
|
-
React.createElement("
|
|
24
|
-
|
|
25
|
-
React.createElement(
|
|
26
|
-
|
|
27
|
+
return (React.createElement(React.Fragment, null,
|
|
28
|
+
React.createElement("label", Object.assign({ className: "file-diag-dragndrop", htmlFor: "file-diag-selector" }, getRootProps({ onClick: onLabelClick }), { "data-tracking-id": "file-selector-widget-main" }),
|
|
29
|
+
React.createElement("input", Object.assign({ id: "file-diag-selector" }, getInputProps())),
|
|
30
|
+
isDragActive ? (t(`Drop your file here...`)) : (React.createElement(Trans, null, "Drag and drop, paste, or browse to upload a file")),
|
|
31
|
+
isIdea && (React.createElement("div", { className: "pf-u-text-align-center pf-u-color-300 pf-u-font-weight-normal" },
|
|
32
|
+
React.createElement(Trans, null, "Files must be less than 5 MB.")))),
|
|
33
|
+
isIdea && (React.createElement("p", { className: "pf-u-danger-color-200" }, rejectedFiles.map((rejectedFile) => {
|
|
34
|
+
const isImage = /image\/(png|gif|jpe?g)/.test(rejectedFile.type);
|
|
35
|
+
return !isImage ? (React.createElement("div", null,
|
|
36
|
+
rejectedFile.name,
|
|
37
|
+
" ",
|
|
38
|
+
React.createElement(Trans, null, "is not an allowed file type or an image "))) : rejectedFile.size > MAX_SIZE ? (React.createElement("div", null,
|
|
39
|
+
rejectedFile.name,
|
|
40
|
+
" ",
|
|
41
|
+
React.createElement(Trans, null, "exceeded max size limit of"),
|
|
42
|
+
" ",
|
|
43
|
+
humanizeSize(MAX_SIZE))) : ('');
|
|
44
|
+
})))));
|
|
27
45
|
}
|
|
28
46
|
export default WidgetFileSelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAyL9D"}
|