@rh-support/troubleshoot 2.6.270 → 2.6.273
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.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/AccountSelector.js +28 -40
- package/lib/esm/components/AccountInfo/css/accountSelector.css +3 -2
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +5 -2
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +3 -1
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +9 -5
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +2 -4
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +8 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +38 -34
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +21 -59
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +2 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +6 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +13 -33
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +5 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.js +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +11 -1
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +11 -9
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +17 -1
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +33 -56
- 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 -7
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +5 -4
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +12 -6
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +2 -1
- package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -1
- package/lib/esm/components/Cve/CvePanel.js +16 -8
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +14 -14
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -14
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +14 -42
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +19 -53
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts +2 -0
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +16 -13
- package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARule.js +3 -1
- package/lib/esm/components/Recommendations/InsightsResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +4 -0
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +18 -11
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts +2 -0
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +23 -4
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +3 -1
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/AskRedHat.js +8 -10
- package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/ResponseActions.js +5 -3
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +1 -1
- package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/UserFeedback.js +10 -8
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.js +5 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +2 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +55 -69
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +34 -9
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
- package/lib/esm/constants/caseDetailsConstants.d.ts +10 -10
- package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
- package/lib/esm/constants/caseDetailsConstants.js +27 -11
- package/lib/esm/hooks/useARHResponse.d.ts.map +1 -1
- package/lib/esm/hooks/useARHResponse.js +4 -1
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +13 -11
- package/lib/esm/i18n/template-de.d.ts +6 -0
- package/lib/esm/i18n/template-de.d.ts.map +1 -1
- package/lib/esm/i18n/template-de.js +6 -0
- package/lib/esm/i18n/template-es.d.ts +6 -0
- package/lib/esm/i18n/template-es.d.ts.map +1 -1
- package/lib/esm/i18n/template-es.js +6 -0
- package/lib/esm/i18n/template-fr.d.ts +6 -0
- package/lib/esm/i18n/template-fr.d.ts.map +1 -1
- package/lib/esm/i18n/template-fr.js +6 -0
- package/lib/esm/i18n/template-it.d.ts +6 -0
- package/lib/esm/i18n/template-it.d.ts.map +1 -1
- package/lib/esm/i18n/template-it.js +6 -0
- package/lib/esm/i18n/template-jp.d.ts +6 -0
- package/lib/esm/i18n/template-jp.d.ts.map +1 -1
- package/lib/esm/i18n/template-jp.js +6 -0
- package/lib/esm/i18n/template-ko.d.ts +6 -0
- package/lib/esm/i18n/template-ko.d.ts.map +1 -1
- package/lib/esm/i18n/template-ko.js +6 -0
- package/lib/esm/i18n/template-pt.d.ts +6 -0
- package/lib/esm/i18n/template-pt.d.ts.map +1 -1
- package/lib/esm/i18n/template-pt.js +6 -0
- package/lib/esm/i18n/template-ru.d.ts +6 -0
- package/lib/esm/i18n/template-ru.d.ts.map +1 -1
- package/lib/esm/i18n/template-ru.js +6 -0
- package/lib/esm/i18n/template-zh.d.ts +6 -0
- package/lib/esm/i18n/template-zh.d.ts.map +1 -1
- package/lib/esm/i18n/template-zh.js +6 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +23 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +9 -4
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +1 -1
- package/lib/esm/reducers/CaseHelpers.d.ts +10 -7
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +58 -11
- package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
- package/lib/esm/reducers/CaseReducer.d.ts +16 -5
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +96 -24
- package/lib/esm/reducers/RulesReducer.d.ts +11 -4
- package/lib/esm/reducers/RulesReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RulesReducer.js +6 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +7 -4
- package/lib/esm/reducers/TopContentReducer.js +1 -1
- package/lib/esm/scss/_pf-overrides.scss +28 -2
- package/package.json +8 -10
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.css +0 -0
|
@@ -3,12 +3,12 @@ import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@
|
|
|
3
3
|
import { PreviousCaseTypes } from '@rh-support/utils';
|
|
4
4
|
import isEmpty from 'lodash/isEmpty';
|
|
5
5
|
import isEqual from 'lodash/isEqual';
|
|
6
|
-
import React, { useContext } from 'react';
|
|
6
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
7
7
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
8
8
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
9
9
|
import { AccountSelector } from '../AccountInfo/AccountSelector';
|
|
10
10
|
import { OwnerSelector } from '../AccountInfo/OwnerSelector';
|
|
11
|
-
import CaseGroup from '../CaseInformation/CaseGroup';
|
|
11
|
+
// import CaseGroup from '../CaseInformation/CaseGroup';
|
|
12
12
|
import CaseType from '../CaseInformation/CaseType';
|
|
13
13
|
import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
|
|
14
14
|
import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
|
|
@@ -16,12 +16,12 @@ import Fts from '../CaseInformation/Fts';
|
|
|
16
16
|
import Severity from '../CaseInformation/Severity';
|
|
17
17
|
import SupportLevel from '../CaseInformation/SupportLevel';
|
|
18
18
|
import CaseLanguageSelector from '../CaseManagement/CaseLanguageSelector';
|
|
19
|
-
import { Cep } from '../CaseManagement/Cep';
|
|
19
|
+
// import { Cep } from '../CaseManagement/Cep';
|
|
20
20
|
import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
|
|
21
21
|
import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
|
|
22
22
|
import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
|
|
23
23
|
import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
|
|
24
|
-
import { Hostname } from '../ImproveCase/Hostname';
|
|
24
|
+
// import { Hostname } from '../ImproveCase/Hostname';
|
|
25
25
|
import KtQuestions from '../ImproveCase/KtQuestions';
|
|
26
26
|
import { AllProductsSelector } from '../ProductSelector/AllProductsSelector';
|
|
27
27
|
export default function Review(props) {
|
|
@@ -30,6 +30,17 @@ export default function Review(props) {
|
|
|
30
30
|
contactInfo24x7: state.caseDetails.contactInfo24x7,
|
|
31
31
|
caseType: state.caseDetails.caseType,
|
|
32
32
|
}), isEqual);
|
|
33
|
+
const previousCaseTypeRef = useRef(caseType);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (previousCaseTypeRef.current !== caseType && caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT) {
|
|
36
|
+
setCaseDetails(caseDispatch, {
|
|
37
|
+
environment: '',
|
|
38
|
+
periodicityOfIssue: '',
|
|
39
|
+
description: '',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
previousCaseTypeRef.current = caseType;
|
|
43
|
+
}, [caseType, caseDispatch]);
|
|
33
44
|
const ability = useContext(AbilityContext);
|
|
34
45
|
const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
35
46
|
const onSeverityChange = (payload) => {
|
|
@@ -39,9 +50,8 @@ export default function Review(props) {
|
|
|
39
50
|
React.createElement("form", { className: "review-form card card-light push-bottom" },
|
|
40
51
|
React.createElement(AccountSelector, null),
|
|
41
52
|
React.createElement(OwnerSelector, null),
|
|
42
|
-
React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true,
|
|
53
|
+
React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true, isOnReviewPage: true }),
|
|
43
54
|
React.createElement(OpenShiftClusterId, null),
|
|
44
|
-
caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT && React.createElement(Hostname, null),
|
|
45
55
|
React.createElement(KtQuestions, { inlineEditable: true, hideSaveCancel: true, onlyShowKT4: caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT }),
|
|
46
56
|
React.createElement(CaseType, null),
|
|
47
57
|
React.createElement(SupportLevel, null),
|
|
@@ -54,11 +64,8 @@ export default function Review(props) {
|
|
|
54
64
|
React.createElement(Fts, { inlineEditable: true, initialIsEditing: isEmpty(contactInfo24x7), hideSaveCancel: true }),
|
|
55
65
|
React.createElement(Grid, { hasGutter: true },
|
|
56
66
|
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
57
|
-
React.createElement(CaseLanguageSelector, null)),
|
|
58
|
-
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
59
|
-
React.createElement(CaseGroup, null))),
|
|
67
|
+
React.createElement(CaseLanguageSelector, null))),
|
|
60
68
|
canSeeEmailNotifications && React.createElement(CaseContactSelector, null),
|
|
61
69
|
React.createElement(RHAssociatesSelector, null),
|
|
62
|
-
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true })
|
|
63
|
-
React.createElement(Cep, null))));
|
|
70
|
+
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }))));
|
|
64
71
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { ISessionItem } from '@cee-eng/hydrajs/@types/api/pcm/troubleshootSession';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { RouteComponentProps } from 'react-router-dom';
|
|
3
4
|
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
4
5
|
interface IProps {
|
|
5
6
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
7
|
}
|
|
8
|
+
export declare const isSessionFromCurrentAuthCycle: (sessionItem: ISessionItem | undefined, currentLoginStartTime: number) => boolean;
|
|
7
9
|
export declare function SessionRestore(props: IProps): React.JSX.Element;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=SessionRestore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgC,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAQjH,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAmBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,6BAA6B,GAAI,aAAa,YAAY,GAAG,SAAS,EAAE,uBAAuB,MAAM,YAKjH,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBAmX3C"}
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
11
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
11
12
|
import { pcm } from '@cee-eng/hydrajs';
|
|
12
13
|
import { useDebounce, useDeepCompareDebounce, usePrevious } from '@rh-support/components';
|
|
13
14
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
@@ -32,7 +33,18 @@ import { restoreFilesFromSession } from '../shared/fileUpload/reducer/Attachment
|
|
|
32
33
|
import { AttachmentDispatchContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
33
34
|
import { RestoreLastSessionModal } from './RestoreLastSessionModal';
|
|
34
35
|
import { SessionRestoreCard } from './SessionRestoreCard';
|
|
36
|
+
export const isSessionFromCurrentAuthCycle = (sessionItem, currentLoginStartTime) => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
if (isEmpty(sessionItem) || !currentLoginStartTime)
|
|
39
|
+
return true;
|
|
40
|
+
const sessionModifiedTime = Date.parse((_b = (_a = sessionItem === null || sessionItem === void 0 ? void 0 : sessionItem.session) === null || _a === void 0 ? void 0 : _a.modifiedDate) !== null && _b !== void 0 ? _b : '');
|
|
41
|
+
if (Number.isNaN(sessionModifiedTime))
|
|
42
|
+
return true;
|
|
43
|
+
return sessionModifiedTime >= currentLoginStartTime;
|
|
44
|
+
};
|
|
35
45
|
export function SessionRestore(props) {
|
|
46
|
+
var _a;
|
|
47
|
+
const apolloClient = useApolloClient();
|
|
36
48
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
37
49
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
38
50
|
const { sessionRestore } = useContext(SessionRestoreStateContext);
|
|
@@ -45,7 +57,7 @@ export function SessionRestore(props) {
|
|
|
45
57
|
ABTestVariation: state.ABTestVariation,
|
|
46
58
|
}), isEqual);
|
|
47
59
|
const caseDispatch = useCaseDispatch();
|
|
48
|
-
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights, referrerUrl }, } = useContext(GlobalMetadataStateContext);
|
|
60
|
+
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights, referrerUrl, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
|
|
49
61
|
const queryParamsFromUrl = RouteUtils.getQueryParams(props.routeProps);
|
|
50
62
|
const currentUrlSeSessionId = queryParamsFromUrl.seSessionId;
|
|
51
63
|
const previousUrlSeSessionId = usePrevious(currentUrlSeSessionId);
|
|
@@ -55,6 +67,7 @@ export function SessionRestore(props) {
|
|
|
55
67
|
const previousActiveSessionId = usePrevious(sessionRestore.activeSessionId);
|
|
56
68
|
const isFirstMountRef = useRef(true);
|
|
57
69
|
const { getMetadata } = useMetadata();
|
|
70
|
+
const currentLoginStartTime = ((_a = loggedInUserJwtToken === null || loggedInUserJwtToken === void 0 ? void 0 : loggedInUserJwtToken.iat) !== null && _a !== void 0 ? _a : 0) * 1000;
|
|
58
71
|
/**
|
|
59
72
|
* Fetching previous sessions on load
|
|
60
73
|
*/
|
|
@@ -90,8 +103,9 @@ export function SessionRestore(props) {
|
|
|
90
103
|
}
|
|
91
104
|
const currentRelevantSession = getRelevantSessionFromSessions(sessionRestoreDispatch, currentUrlSeSessionId, sessionRestore.previousSessions.data, caseDetails);
|
|
92
105
|
const relevantSession = sessionRestore.previousSessions.data[currentRelevantSession];
|
|
106
|
+
const canReuseRelevantSession = !isEmpty(relevantSession) && isSessionFromCurrentAuthCycle(relevantSession, currentLoginStartTime);
|
|
93
107
|
const setSession = () => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
const needsNewSessionId = hasProductVersionOrSummary &&
|
|
108
|
+
const needsNewSessionId = hasProductVersionOrSummary && !canReuseRelevantSession;
|
|
95
109
|
if (needsNewSessionId) {
|
|
96
110
|
const userAgent = getUserAgentForCaseMode(isCaseCreate);
|
|
97
111
|
const userAgentAB = userAgent + (isEqual(ABTestVariation, 'A') ? '-A-1' : '-B-1');
|
|
@@ -105,7 +119,7 @@ export function SessionRestore(props) {
|
|
|
105
119
|
yield createSession(sessionRestoreDispatch, getSessionDetailsFromCase(caseDetails, selectedNotificationContacts), session);
|
|
106
120
|
}
|
|
107
121
|
}
|
|
108
|
-
else if (
|
|
122
|
+
else if (canReuseRelevantSession) {
|
|
109
123
|
// Checking if session needs to be restored based on found relevant session
|
|
110
124
|
// Found relevent session is not same as activeSessionId and is not being restored
|
|
111
125
|
if (currentRelevantSession !== sessionRestore.activeSessionId && !isRestoring) {
|
|
@@ -114,6 +128,9 @@ export function SessionRestore(props) {
|
|
|
114
128
|
}
|
|
115
129
|
else if (isEmpty(relevantSession) && !isEmpty(currentUrlSeSessionId)) {
|
|
116
130
|
updateActiveSessionId(sessionRestoreDispatch, undefined);
|
|
131
|
+
const currentParams = RouteUtils.getQueryParams(props.routeProps);
|
|
132
|
+
delete currentParams.seSessionId;
|
|
133
|
+
RouteUtils.updateQueryParams(props.routeProps, currentParams, true);
|
|
117
134
|
}
|
|
118
135
|
});
|
|
119
136
|
setSession();
|
|
@@ -227,7 +244,7 @@ export function SessionRestore(props) {
|
|
|
227
244
|
const reg = new RegExp('Cluster Name: (.*) ');
|
|
228
245
|
const v3ClusterName = reg.exec(sessionDetails.description) ? reg.exec(sessionDetails.description)[1] : '';
|
|
229
246
|
setCaseState(caseDispatch, { v3ClusterName });
|
|
230
|
-
yield updateCaseWithSession(caseDispatch, sessionItem, loggedInUserRights.data.getAccountNumber(), loggedInUserRights.data.getHydraContactFromLoggedInUser(), loggedInUsersAccount.data);
|
|
247
|
+
yield updateCaseWithSession(caseDispatch, sessionItem, loggedInUserRights.data.getAccountNumber(), loggedInUserRights.data.getHydraContactFromLoggedInUser(), loggedInUsersAccount.data, apolloClient);
|
|
231
248
|
if (!isAISureSession(sessionItem)) {
|
|
232
249
|
restoreFilesFromSession(dispatchToAttachmentReducer, sessionItem.session.id);
|
|
233
250
|
}
|
|
@@ -283,6 +300,7 @@ export function SessionRestore(props) {
|
|
|
283
300
|
if (sessionItem.session.id !== sessionRestore.activeSessionId &&
|
|
284
301
|
sessionItem.session.isActive &&
|
|
285
302
|
!sessionItem.session.isResolved &&
|
|
303
|
+
isSessionFromCurrentAuthCycle(sessionItem, currentLoginStartTime) &&
|
|
286
304
|
sessionItem.sessionDetails.summary &&
|
|
287
305
|
sessionItem.sessionDetails.product) {
|
|
288
306
|
previousSessions.push(sessionItem);
|
|
@@ -295,6 +313,7 @@ export function SessionRestore(props) {
|
|
|
295
313
|
var _a, _b, _c, _d, _e, _f;
|
|
296
314
|
return s.session.isActive &&
|
|
297
315
|
!s.session.isResolved &&
|
|
316
|
+
isSessionFromCurrentAuthCycle(s, currentLoginStartTime) &&
|
|
298
317
|
s.session.id !== sessionRestore.activeSessionId &&
|
|
299
318
|
((!isEmpty(caseDetails.product) && caseDetails.product === s.sessionDetails.product) ||
|
|
300
319
|
includes(((_a = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.summary) !== null && _a !== void 0 ? _a : '').toLowerCase(), ((_c = (_b = s === null || s === void 0 ? void 0 : s.sessionDetails) === null || _b === void 0 ? void 0 : _b.summary) !== null && _c !== void 0 ? _c : '').toLowerCase()) ||
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface IProps {
|
|
3
3
|
onChatWithAIClick?: () => void;
|
|
4
|
+
isExpanded?: boolean;
|
|
5
|
+
onToggleExpanded?: (value: boolean | ((prev: boolean) => boolean)) => void;
|
|
4
6
|
}
|
|
5
|
-
export declare const AskRedHat: ({ onChatWithAIClick }: IProps) => React.JSX.Element;
|
|
7
|
+
export declare const AskRedHat: ({ onChatWithAIClick, isExpanded: isExpandedProp, onToggleExpanded }: IProps) => React.JSX.Element;
|
|
6
8
|
export {};
|
|
7
9
|
//# sourceMappingURL=AskRedHat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAmChF,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAmChF,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,IAAI,CAAC;CAC9E;AAED,eAAO,MAAM,SAAS,GAAI,qEAAqE,MAAM,sBA2iBpG,CAAC"}
|
|
@@ -44,10 +44,12 @@ const getSessResFromAISources = (sources, visibilityStatus) => {
|
|
|
44
44
|
return;
|
|
45
45
|
return sources.map((source, index) => getSessResFromARHSource(source, visibilityStatus, index + 1));
|
|
46
46
|
};
|
|
47
|
-
export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
47
|
+
export const AskRedHat = ({ onChatWithAIClick, isExpanded: isExpandedProp, onToggleExpanded }) => {
|
|
48
48
|
var _a, _b, _c, _d;
|
|
49
49
|
const { t } = useTranslation();
|
|
50
|
-
const [
|
|
50
|
+
const [isExpandedLocal, setIsExpandedLocal] = useState(false);
|
|
51
|
+
const isExpanded = onToggleExpanded ? isExpandedProp !== null && isExpandedProp !== void 0 ? isExpandedProp : false : isExpandedLocal;
|
|
52
|
+
const setIsExpanded = onToggleExpanded !== null && onToggleExpanded !== void 0 ? onToggleExpanded : setIsExpandedLocal;
|
|
51
53
|
const [showFeedbackCard, setShowFeedbackCard] = useState(false);
|
|
52
54
|
const [showFeedbackComplete, setShowFeedbackComplete] = useState(false);
|
|
53
55
|
const [feedbackType, setFeedbackType] = useState('');
|
|
@@ -246,15 +248,10 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
|
246
248
|
React.createElement(Icon, { iconSize: "lg", status: "danger", className: "pf-v6-u-mr-sm" },
|
|
247
249
|
React.createElement(ExclamationCircleIcon, null)),
|
|
248
250
|
' ',
|
|
249
|
-
"Chat limit reached"),
|
|
251
|
+
React.createElement(Trans, null, "Chat limit reached")),
|
|
250
252
|
React.createElement(EmptyStateBody, null,
|
|
251
253
|
React.createElement(Content, { component: ContentVariants.p },
|
|
252
|
-
"You've reached the maximum number of chats. You can start up to",
|
|
253
|
-
' ',
|
|
254
|
-
aiResponseState.quotaLimit,
|
|
255
|
-
" chats within a",
|
|
256
|
-
React.createElement("br", null),
|
|
257
|
-
"24-hour period. Please try again after your limit resets."))))));
|
|
254
|
+
React.createElement(Trans, { i18nKey: "You've reached the maximum number of chats. You can start up to {{quotaLimit}} chats within a <br/>24-hour period. Please try again after your limit resets.", values: { quotaLimit: aiResponseState.quotaLimit }, components: { br: React.createElement("br", null) } })))))));
|
|
258
255
|
}
|
|
259
256
|
if (aiResponseState.error) {
|
|
260
257
|
return (React.createElement("div", { className: "ask-redhat" },
|
|
@@ -326,7 +323,8 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
|
326
323
|
React.createElement("div", null,
|
|
327
324
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: parseMarkdown(answer) } }),
|
|
328
325
|
sourcesCount > 0 && (React.createElement(React.Fragment, null,
|
|
329
|
-
React.createElement("p", null,
|
|
326
|
+
React.createElement("p", null,
|
|
327
|
+
React.createElement(Trans, { i18nKey: "{{count}} sources", values: { count: sourcesCount } })),
|
|
330
328
|
React.createElement("div", { className: "ask-redhat-cards" }, sources.map((source, index) => (React.createElement(Card, { className: "ask-redhat-card", key: index },
|
|
331
329
|
React.createElement(CardHeader, null,
|
|
332
330
|
React.createElement("h3", { className: "ask-redhat-card-title" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseActions.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/ResponseActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ResponseActions.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/ResponseActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAA+B,MAAM,OAAO,CAAC;AAKpG,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,aAAa,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE;QACL,QAAQ,CAAC,EAAE,WAAW,CAAC;QACvB,QAAQ,CAAC,EAAE,WAAW,CAAC;QACvB,IAAI,CAAC,EAAE,WAAW,CAAC;KACtB,CAAC;IACF,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,mBAAmB,CA0FlE,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -2,9 +2,11 @@ import OutlinedCopyIcon from '@patternfly/react-icons/dist/esm/icons/outlined-co
|
|
|
2
2
|
import OutlinedThumbsDownIcon from '@patternfly/react-icons/dist/esm/icons/outlined-thumbs-down-icon';
|
|
3
3
|
import OutlinedThumbsUpIcon from '@patternfly/react-icons/dist/esm/icons/outlined-thumbs-up-icon';
|
|
4
4
|
import React, { useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
5
6
|
import ResponseActionButton from './ResponseActionButton';
|
|
6
7
|
export const ResponseActions = ({ actions, submittedFeedbackTypes = [] }) => {
|
|
7
8
|
var _a, _b, _c, _d, _e, _f;
|
|
9
|
+
const { t } = useTranslation();
|
|
8
10
|
const [activeButton, setActiveButton] = useState();
|
|
9
11
|
const [clickStatePersisted, setClickStatePersisted] = useState(false);
|
|
10
12
|
useEffect(() => {
|
|
@@ -45,8 +47,8 @@ export const ResponseActions = ({ actions, submittedFeedbackTypes = [] }) => {
|
|
|
45
47
|
onClick && onClick(e);
|
|
46
48
|
};
|
|
47
49
|
return (React.createElement("div", { ref: responseActions, className: "pf-chatbot__response-actions" },
|
|
48
|
-
positive && (React.createElement(ResponseActionButton, { ariaLabel:
|
|
49
|
-
negative && (React.createElement(ResponseActionButton, { ariaLabel:
|
|
50
|
-
copy && (React.createElement(ResponseActionButton, { ariaLabel:
|
|
50
|
+
positive && (React.createElement(ResponseActionButton, { ariaLabel: t('Good response'), clickedAriaLabel: t('Response recorded'), onClick: (e) => handleClick(e, 'positive', positive.onClick), tooltipContent: (_a = positive.tooltipContent) !== null && _a !== void 0 ? _a : t('Good response'), clickedTooltipContent: (_b = positive.clickedTooltipContent) !== null && _b !== void 0 ? _b : t('Response recorded'), icon: React.createElement(OutlinedThumbsUpIcon, null), isClicked: activeButton === 'positive', isDisabled: submittedFeedbackTypes === null || submittedFeedbackTypes === void 0 ? void 0 : submittedFeedbackTypes.includes('positive') })),
|
|
51
|
+
negative && (React.createElement(ResponseActionButton, { ariaLabel: t('Bad response'), clickedAriaLabel: t('Response recorded'), onClick: (e) => handleClick(e, 'negative', negative.onClick), tooltipContent: (_c = negative.tooltipContent) !== null && _c !== void 0 ? _c : t('Bad response'), clickedTooltipContent: (_d = negative.clickedTooltipContent) !== null && _d !== void 0 ? _d : t('Response recorded'), icon: React.createElement(OutlinedThumbsDownIcon, null), isClicked: activeButton === 'negative', isDisabled: submittedFeedbackTypes === null || submittedFeedbackTypes === void 0 ? void 0 : submittedFeedbackTypes.includes('negative') })),
|
|
52
|
+
copy && (React.createElement(ResponseActionButton, { ariaLabel: t('Copy'), clickedAriaLabel: t('Copied'), onClick: (e) => handleClick(e, 'copy', copy.onClick), tooltipContent: (_e = copy.tooltipContent) !== null && _e !== void 0 ? _e : t('Copy'), clickedTooltipContent: (_f = copy.clickedTooltipContent) !== null && _f !== void 0 ? _f : t('Copied'), icon: React.createElement(OutlinedCopyIcon, null), isClicked: activeButton === 'copy' }))));
|
|
51
53
|
};
|
|
52
54
|
export default ResponseActions;
|
|
@@ -370,7 +370,7 @@ function TroubleshootSection(props) {
|
|
|
370
370
|
React.createElement(Trans, { i18nKey: 'i18nKeyPopularSolutions' }, "Red Hat hand picked support articles"),
|
|
371
371
|
React.createElement(Tooltip, { content: React.createElement("div", null,
|
|
372
372
|
React.createElement(Trans, null, "Support articles are matched to the product and version details you selected, not the problem details you entered.")) },
|
|
373
|
-
React.createElement(InfoCircleIcon, { className: "pf-v6-u-ml-sm", "aria-label":
|
|
373
|
+
React.createElement(InfoCircleIcon, { className: "pf-v6-u-ml-sm", "aria-label": t('More info about how support articles are matched') }))),
|
|
374
374
|
React.createElement(CardBody, { "aria-label": t('No recommendations for this product'), className: "file-recs-no-recommendation pf-v6-u-mt-md" },
|
|
375
375
|
React.createElement(Trans, null, "No recommendations for this product")))),
|
|
376
376
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading suggestions') } }, canShowTopContent && !isEmpty(version) && !isVariationA && React.createElement(Suggestions, null)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserFeedback.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAMH,SAAS,EAET,SAAS,EAEZ,MAAM,wBAAwB,CAAC;AAEhC,OAAc,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAIhE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS;IAC7E,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"UserFeedback.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAMH,SAAS,EAET,SAAS,EAEZ,MAAM,wBAAwB,CAAC;AAEhC,OAAc,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAIhE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS;IAC7E,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAmFtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { ActionGroup, Button, Card, CardBody, CardHeader, Form, TextArea, } from '@patternfly/react-core';
|
|
13
13
|
import isEmpty from 'lodash/isEmpty';
|
|
14
14
|
import React, { useState } from 'react';
|
|
15
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
16
16
|
import CloseButton from './CloseButton';
|
|
17
17
|
import QuickResponse from './QuickResponse';
|
|
18
18
|
const UserFeedback = (_a) => {
|
|
@@ -35,14 +35,16 @@ const UserFeedback = (_a) => {
|
|
|
35
35
|
hasTextArea && (React.createElement(React.Fragment, null,
|
|
36
36
|
React.createElement(TextArea, { value: value, onChange: (_event, value) => {
|
|
37
37
|
setValue(value);
|
|
38
|
-
}, placeholder:
|
|
38
|
+
}, placeholder: t('Provide optional additional feedback'), "aria-label": t('Provide optional additional feedback'), resizeOrientation: "vertical" }),
|
|
39
39
|
React.createElement("div", { className: "privacy-notice-container" },
|
|
40
|
-
React.createElement("
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
React.createElement(Trans, { i18nKey: "Do not share any personal or other sensitive information in your feedback. Feedback may\n be used to improve Red Hat's products or services. For more information about Red Hat\u2019s\n privacy practices, please refer to the <a><u>Red Hat Privacy Statement.</u></a>", components: {
|
|
41
|
+
a: (
|
|
42
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
43
|
+
React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noreferrer" })),
|
|
44
|
+
u: React.createElement("u", null),
|
|
45
|
+
} })))),
|
|
45
46
|
React.createElement(ActionGroup, null,
|
|
46
|
-
React.createElement(Button, { onClick: () => onSubmit(selectedResponse, value), isDisabled: isSubmitting, isLoading: isSubmitting },
|
|
47
|
+
React.createElement(Button, { onClick: () => onSubmit(selectedResponse, value), isDisabled: isSubmitting, isLoading: isSubmitting },
|
|
48
|
+
React.createElement(Trans, null, "Send Feedback")))))));
|
|
47
49
|
};
|
|
48
50
|
export default UserFeedback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserFeedbackComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedbackComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,SAAS,EAAa,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UserFeedbackComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedbackComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,SAAS,EAAa,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKtD,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,SAAS;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,QAAA,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,yBAAyB,CAiFtE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -11,9 +11,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core';
|
|
13
13
|
import React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
14
15
|
import CloseButton from './CloseButton';
|
|
15
16
|
const UserFeedbackComplete = (_a) => {
|
|
16
|
-
var { title
|
|
17
|
+
var { title: propsTitle, body: propsBody, onClose, isCompact } = _a, props = __rest(_a, ["title", "body", "onClose", "isCompact"]);
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const title = propsTitle !== null && propsTitle !== void 0 ? propsTitle : t('Feedback submitted');
|
|
20
|
+
const body = propsBody !== null && propsBody !== void 0 ? propsBody : t("We've received your response. Thank you for sharing your feedback!");
|
|
17
21
|
return (React.createElement(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__feedback-card pf-chatbot__feedback-card-complete" }, props),
|
|
18
22
|
React.createElement(CardHeader, { className: onClose
|
|
19
23
|
? 'pf-chatbot__feedback-card-complete-header'
|
|
@@ -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;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,
|
|
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,qBAiPxC;kBAjPQ,kBAAkB;;;AAqP3B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -169,7 +169,8 @@ function WidgetFileUploader(props) {
|
|
|
169
169
|
showViewRecBtn &&
|
|
170
170
|
!props.isIdea &&
|
|
171
171
|
!isAnalysingAnyAttachment(attachmentState.caseFiles.selectedLocalFiles) &&
|
|
172
|
-
hasAnalysedSomeAttachments(attachmentState.caseFiles.selectedLocalFiles) &&
|
|
172
|
+
hasAnalysedSomeAttachments(attachmentState.caseFiles.selectedLocalFiles) &&
|
|
173
|
+
rulesState.allResults.length > 0 && (React.createElement(Button, { "data-tracking-id": "widget-file-uploader-view-recs", onClick: onViewRecBtnClick },
|
|
173
174
|
React.createElement(Trans, null, "View recommendations"))))));
|
|
174
175
|
}
|
|
175
176
|
WidgetFileUploader.defaultProps = defaultProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAyB1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKnE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAuQ9D"}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { contacts } from '@cee-eng/hydrajs';
|
|
1
|
+
// import { contacts } from '@cee-eng/hydrajs';
|
|
11
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
12
|
-
import find from 'lodash/find';
|
|
3
|
+
// import find from 'lodash/find';
|
|
13
4
|
import isEmpty from 'lodash/isEmpty';
|
|
14
5
|
import isEqual from 'lodash/isEqual';
|
|
15
|
-
import React, { useContext
|
|
6
|
+
import React, { useContext } from 'react';
|
|
7
|
+
// import React, { useContext, useEffect, useState } from 'react';
|
|
16
8
|
import { Trans } from 'react-i18next';
|
|
17
9
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
18
|
-
import { RouteContext
|
|
10
|
+
import { RouteContext } from '../../context/RouteContext';
|
|
11
|
+
// import { RouteContext, useRouteDispatchContext } from '../../context/RouteContext';
|
|
19
12
|
import { TCStateContext } from '../../context/TopContentContext';
|
|
20
13
|
import { useAB } from '../../hooks/useAB';
|
|
21
14
|
import { CASE_DEATILS_ENVIRONMENT_LIMIT, CASE_REFERENCE_NUMBER_LIMIT, CONTACT_INFO_24X7_LIMIT, HOSTNAME_LENGTH_LIMIT, ISSUE_SUMMARY_LENGTH_LIMIT, KTQUESTION_MAX_LIMIT, TITLE_SUMMARY_LENGTH_LIMIT, } from '../../reducers/CaseConstNTypes';
|
|
22
15
|
import { isCaseInformationSectionValid, isCaseManagementStateValid, isCaseStateValid, isClusterIDValid, isIdeaCaseStateValid, } from '../../reducers/CaseHelpers';
|
|
23
16
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
24
|
-
import { setNoValidEntitlement } from '../../reducers/RouteReducer';
|
|
25
17
|
import { AttachmentStateContext } from './fileUpload/reducer/AttachmentReducerContext';
|
|
26
18
|
export function useIsSectionValid(sectionName) {
|
|
27
|
-
var _a, _b;
|
|
28
19
|
const { isVariationA } = useAB();
|
|
29
|
-
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue,
|
|
20
|
+
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue, manageSupportCases, } = useCaseSelector((state) => ({
|
|
30
21
|
caseState: state,
|
|
31
22
|
caseType: state.caseDetails.caseType,
|
|
32
23
|
product: state.caseDetails.product,
|
|
@@ -42,35 +33,38 @@ export function useIsSectionValid(sectionName) {
|
|
|
42
33
|
environment: state.caseDetails.environment,
|
|
43
34
|
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
44
35
|
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
45
|
-
ssoUsername: state.selectedOwner.data.ssoUsername,
|
|
36
|
+
// ssoUsername: state.selectedOwner.data.ssoUsername,
|
|
46
37
|
manageSupportCases: state.selectedOwner.data.manageSupportCases,
|
|
47
38
|
}), isEqual);
|
|
48
|
-
const routeDispatch = useRouteDispatchContext();
|
|
49
|
-
const [isEntitlement, setIsEntitlement] = useState(null);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//&seSessionId=8e8960ac-680b-443e-bf67-9e13f2acd64e
|
|
39
|
+
// const routeDispatch = useRouteDispatchContext();
|
|
40
|
+
// const [isEntitlement, setIsEntitlement] = useState<boolean | null>(null);
|
|
41
|
+
// useEffect(() => {
|
|
42
|
+
// const fetchContactDetails = async () => {
|
|
43
|
+
// if (ssoUsername) {
|
|
44
|
+
// try {
|
|
45
|
+
// const response = await contacts.getSFDCContactBySso(ssoUsername);
|
|
46
|
+
// setIsEntitlement(response?.isEntitled ?? null);
|
|
47
|
+
// setNoValidEntitlement(routeDispatch, !response?.isEntitled);
|
|
48
|
+
// } catch (error) {
|
|
49
|
+
// console.error('Error fetching contact details:', error);
|
|
50
|
+
// setIsEntitlement(null);
|
|
51
|
+
// setNoValidEntitlement(routeDispatch, null);
|
|
52
|
+
// }
|
|
53
|
+
// }
|
|
54
|
+
// };
|
|
55
|
+
// fetchContactDetails();
|
|
56
|
+
// }, [ssoUsername, routeDispatch]);
|
|
57
|
+
// Contact-level entitlement hardcoded to true — now resolved from SFDCProductJSON__c
|
|
58
|
+
const isEntitlement = true;
|
|
69
59
|
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
70
|
-
const { globalMetadataState: { allProducts,
|
|
60
|
+
const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
71
61
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
72
|
-
|
|
73
|
-
const
|
|
62
|
+
// isEntitledProduct — commented out; product-level entitlement now resolved from SFDCProductJSON__c
|
|
63
|
+
// const isEntitledProduct = find(
|
|
64
|
+
// allProducts?.data?.productsResult,
|
|
65
|
+
// (p) => p.product === caseState.caseDetails.product
|
|
66
|
+
// )?.isEntitledProduct;
|
|
67
|
+
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
74
68
|
const { attachmentState } = useContext(AttachmentStateContext);
|
|
75
69
|
const selectedLocalFiles = attachmentState.caseFiles.selectedLocalFiles;
|
|
76
70
|
const allowedTypesIdea = ['image/jpeg', 'image/png', 'image/jpg', 'image/gif'];
|
|
@@ -111,8 +105,6 @@ export function useIsSectionValid(sectionName) {
|
|
|
111
105
|
}
|
|
112
106
|
return (!isEmpty(product) &&
|
|
113
107
|
!isEmpty(version) &&
|
|
114
|
-
!isEmpty(accountNumber) &&
|
|
115
|
-
!isEmpty(contactSSOName) &&
|
|
116
108
|
!isEmpty(summary) &&
|
|
117
109
|
(summary === null || summary === void 0 ? void 0 : summary.length) <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
118
110
|
!isEmpty(issue) &&
|
|
@@ -123,30 +115,29 @@ export function useIsSectionValid(sectionName) {
|
|
|
123
115
|
? (contactInfo24x7 === null || contactInfo24x7 === void 0 ? void 0 : contactInfo24x7.length) <= CONTACT_INFO_24X7_LIMIT
|
|
124
116
|
: true;
|
|
125
117
|
const hasAlternateCaseIdValidLength = alternateId ? (alternateId === null || alternateId === void 0 ? void 0 : alternateId.length) <= CASE_REFERENCE_NUMBER_LIMIT : true;
|
|
126
|
-
return (isCaseManagementStateValid(caseState,
|
|
118
|
+
return (isCaseManagementStateValid(caseState, loggedInUserRights) &&
|
|
127
119
|
hasContactInfo24x7ValidLength &&
|
|
128
120
|
hasAlternateCaseIdValidLength);
|
|
129
121
|
};
|
|
130
122
|
const isResourcesSectionValid = () => {
|
|
131
123
|
var _a;
|
|
132
|
-
//
|
|
133
|
-
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
134
|
-
// Skip cluster ID validation for Variant A
|
|
124
|
+
// isEntitledProduct check removed — product-level entitlement now resolved from SFDCProductJSON__c
|
|
135
125
|
const clusterIdValid = isVariationA ? true : isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
136
|
-
return
|
|
126
|
+
return clusterIdValid;
|
|
137
127
|
};
|
|
138
128
|
const isReviewSectionValid = () => {
|
|
139
129
|
var _a;
|
|
140
|
-
return (
|
|
141
|
-
|
|
130
|
+
return (
|
|
131
|
+
// isEntitledProduct — product-level entitlement now resolved from SFDCProductJSON__c
|
|
132
|
+
isCaseStateValid(caseState, loggedInUserRights) &&
|
|
142
133
|
isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) &&
|
|
143
134
|
isSummarizeSectionValid() &&
|
|
144
135
|
isAdditionalInformationSectionValidLocal());
|
|
145
136
|
};
|
|
146
137
|
const isDescribeIdeaSectionValid = () => {
|
|
147
|
-
return (isCaseManagementStateValid(caseState,
|
|
148
|
-
isEntitledProduct
|
|
149
|
-
isIdeaCaseStateValid(caseState,
|
|
138
|
+
return (isCaseManagementStateValid(caseState, loggedInUserRights) &&
|
|
139
|
+
// isEntitledProduct — product-level entitlement now resolved from SFDCProductJSON__c
|
|
140
|
+
isIdeaCaseStateValid(caseState, loggedInUserRights) &&
|
|
150
141
|
checkUnallowedFiles());
|
|
151
142
|
};
|
|
152
143
|
const isAdditionalInformationSectionValidLocal = () => {
|
|
@@ -154,7 +145,7 @@ export function useIsSectionValid(sectionName) {
|
|
|
154
145
|
const hostnameIsValid = hostname ? (hostname === null || hostname === void 0 ? void 0 : hostname.length) <= HOSTNAME_LENGTH_LIMIT : true;
|
|
155
146
|
return (!caseState.hasInvalidEntitlements &&
|
|
156
147
|
isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) &&
|
|
157
|
-
isCaseInformationSectionValid(caseState,
|
|
148
|
+
isCaseInformationSectionValid(caseState, loggedInUserRights) &&
|
|
158
149
|
hostnameIsValid &&
|
|
159
150
|
environment.length <= CASE_DEATILS_ENVIRONMENT_LIMIT &&
|
|
160
151
|
timeFramesAndUrgency.length <= KTQUESTION_MAX_LIMIT &&
|
|
@@ -185,14 +176,8 @@ export function useIsSectionValid(sectionName) {
|
|
|
185
176
|
}
|
|
186
177
|
};
|
|
187
178
|
const recommendationSectionError = () => {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
191
|
-
return !isEntitledProductLocal ? (React.createElement(Trans, { i18nKey: "i18ValidEntitlementContactCustomerService" },
|
|
192
|
-
"You need a valid entitlement to create a case.\u00A0 Please contact",
|
|
193
|
-
' ',
|
|
194
|
-
React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
|
|
195
|
-
" for assistance.")) : ('');
|
|
179
|
+
// isEntitledProduct check removed — product-level entitlement now resolved from SFDCProductJSON__c
|
|
180
|
+
return '';
|
|
196
181
|
};
|
|
197
182
|
const getSupportSectionError = () => {
|
|
198
183
|
if (manageSupportCases === false) {
|
|
@@ -202,13 +187,14 @@ export function useIsSectionValid(sectionName) {
|
|
|
202
187
|
React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
|
|
203
188
|
" for assistance."));
|
|
204
189
|
}
|
|
205
|
-
if (isEntitlement === false) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
190
|
+
// if (isEntitlement === false) {
|
|
191
|
+
// return (
|
|
192
|
+
// <Trans i18nKey="i18ValidEntitlementContactCustomerService">
|
|
193
|
+
// You need a valid entitlement to create a case. Please contact{' '}
|
|
194
|
+
// <a href="/support/contact/customerService">Customer Service</a> for assistance.
|
|
195
|
+
// </Trans>
|
|
196
|
+
// );
|
|
197
|
+
// }
|
|
212
198
|
return '';
|
|
213
199
|
};
|
|
214
200
|
const activeSectionError = (sectionNameLocal) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAYvG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,qBA2VtD"}
|