@rh-support/troubleshoot 2.6.299 → 2.6.300
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 +40 -28
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +19 -46
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +17 -49
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +8 -25
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +17 -31
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +6 -8
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +28 -39
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +3 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +4 -3
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +7 -4
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +36 -13
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +33 -11
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +34 -38
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +59 -19
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +9 -16
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +148 -110
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +2 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +241 -147
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +3 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +1 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -35
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +224 -63
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -7
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +9 -7
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +5 -7
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +24 -37
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +55 -32
- 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 +9 -4
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +7 -4
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +12 -11
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -30
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +18 -16
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +8 -5
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +64 -50
- package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
- package/lib/esm/components/shared/usePostComment.js +10 -6
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +24 -105
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +7 -6
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -10
- package/lib/esm/context/CaseContext.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +11 -18
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -86
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +1 -5
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +1 -3
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +5 -22
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +2 -0
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +28 -1
- package/lib/esm/reducers/CaseHelpers.d.ts +1 -2
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +2 -34
- package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
- package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
- package/lib/esm/reducers/CaseReducer.d.ts +8 -27
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +33 -127
- package/package.json +6 -6
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -3
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -22
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -15
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -19
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -49
- package/lib/esm/graphql/index.d.ts +0 -4
- package/lib/esm/graphql/index.d.ts.map +0 -1
- package/lib/esm/graphql/index.js +0 -3
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
- package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
- package/lib/esm/graphql/mutations/index.d.ts +0 -2
- package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
- package/lib/esm/graphql/mutations/index.js +0 -1
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
- package/lib/esm/graphql/queries/getEscalationDetails.js +0 -24
- package/lib/esm/graphql/queries/getParentId.d.ts +0 -2
- package/lib/esm/graphql/queries/getParentId.d.ts.map +0 -1
- package/lib/esm/graphql/queries/getParentId.js +0 -16
- package/lib/esm/graphql/queries/index.d.ts +0 -3
- package/lib/esm/graphql/queries/index.d.ts.map +0 -1
- package/lib/esm/graphql/queries/index.js +0 -2
- package/lib/esm/graphql/schemas/escalation.d.ts +0 -84
- package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
- package/lib/esm/graphql/schemas/escalation.js +0 -1
- package/lib/esm/graphql/schemas/index.d.ts +0 -2
- package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
- package/lib/esm/graphql/schemas/index.js +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +0 -4
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +0 -12
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -55
- package/lib/esm/hooks/useCaseComments/index.d.ts +0 -7
- package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/index.js +0 -5
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -66
- package/lib/esm/hooks/useCaseComments/types.d.ts +0 -80
- package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/types.js +0 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -16
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -25
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
- package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
- package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseHistory.js +0 -98
- package/lib/esm/models/caseHistory.d.ts +0 -80
- package/lib/esm/models/caseHistory.d.ts.map +0 -1
- package/lib/esm/models/caseHistory.js +0 -1
- package/lib/esm/utils/TimelineUtils.d.ts +0 -41
- package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
- package/lib/esm/utils/TimelineUtils.js +0 -134
- package/lib/esm/utils/caseHistoryUtils.d.ts +0 -66
- package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
- package/lib/esm/utils/caseHistoryUtils.js +0 -165
|
@@ -2,8 +2,9 @@ import { IDClassNameProps } from '@rh-support/types/shared';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
interface IProps extends IDClassNameProps {
|
|
4
4
|
selectedStatus: string;
|
|
5
|
-
onStatusChange: (
|
|
5
|
+
onStatusChange: (val: string) => void | Promise<void>;
|
|
6
6
|
isDisabled: boolean;
|
|
7
|
+
allStatuses: string[];
|
|
7
8
|
isFetching: boolean;
|
|
8
9
|
hasError: boolean;
|
|
9
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseStatus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseStatus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBA8DhC;kBA9DQ,UAAU;;;AAiEnB,eAAe,UAAU,CAAC"}
|
|
@@ -8,10 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { SingleSelectDropdown, ValueChangedIcon } from '@rh-support/components';
|
|
11
|
-
import { mapSfdcStatusToPortalStatus, PORTAL_DISPLAY_STATUSES } from '@rh-support/utils';
|
|
12
11
|
import isEmpty from 'lodash/isEmpty';
|
|
13
12
|
import map from 'lodash/map';
|
|
14
|
-
import React, { useContext,
|
|
13
|
+
import React, { useContext, useState } from 'react';
|
|
15
14
|
import { Trans, useTranslation } from 'react-i18next';
|
|
16
15
|
import { CaseValuesToWatch } from '../../shared/Constants';
|
|
17
16
|
import { getChangedValueTooltip } from '../../shared/utils';
|
|
@@ -27,30 +26,29 @@ function CaseStatus(props) {
|
|
|
27
26
|
setIsCaseStatusInValid(isEmpty(selectedItem));
|
|
28
27
|
};
|
|
29
28
|
const { isExportingPDF } = useContext(PDFContext);
|
|
30
|
-
const selectedPortalStatus = useMemo(() => mapSfdcStatusToPortalStatus(props.selectedStatus), [props.selectedStatus]);
|
|
31
29
|
// value changed logic to show a non local status change
|
|
32
30
|
const [localStatusChange, setLocalStatusChange] = useState(false);
|
|
33
31
|
const afterLocalChange = () => setLocalStatusChange(false);
|
|
34
32
|
const onCaseStatusChange = (option) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
if (option.value ===
|
|
33
|
+
if (option.value === props.selectedStatus) {
|
|
36
34
|
return;
|
|
37
35
|
}
|
|
38
36
|
yield props.onStatusChange(option.value);
|
|
39
37
|
setLocalStatusChange(true);
|
|
40
38
|
validateCaseStatus(option);
|
|
41
39
|
});
|
|
42
|
-
const getDropdownOptions = map(
|
|
40
|
+
const getDropdownOptions = map(props.allStatuses || [], (option) => ({
|
|
43
41
|
label: option,
|
|
44
42
|
value: option,
|
|
45
43
|
}));
|
|
46
44
|
const getSelectedDropdownOption = {
|
|
47
|
-
label:
|
|
48
|
-
value:
|
|
45
|
+
label: props.selectedStatus,
|
|
46
|
+
value: props.selectedStatus,
|
|
49
47
|
};
|
|
50
48
|
return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
|
|
51
49
|
React.createElement("h3", { className: "subheading subheading-sm" },
|
|
52
50
|
React.createElement(Trans, null, "Status"),
|
|
53
|
-
React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localStatusChange, value:
|
|
51
|
+
React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localStatusChange, value: props.selectedStatus, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.status) }),
|
|
54
52
|
React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*")),
|
|
55
53
|
React.createElement(SingleSelectDropdown, { placeholder: t(`Select a status`), dataTrackingId: "case-details-status-selector", options: getDropdownOptions, selected: getSelectedDropdownOption, isDisabled: props.hasError || props.isDisabled || props.isFetching, isLoading: props.isFetching, isInvalid: isCaseStatusInValid, onSelect: onCaseStatusChange })));
|
|
56
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAkD,MAAM,OAAO,CAAC;AA4BvE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,qBA0fjD"}
|
|
@@ -7,14 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
11
10
|
import { Alert, AlertVariant, Button, ButtonVariant, ExpandableSection, Label, ModalVariant, } from '@patternfly/react-core';
|
|
12
11
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
13
12
|
import LockIcon from '@patternfly/react-icons/dist/js/icons/lock-icon';
|
|
14
13
|
import { ToastNotification, useConfirmation } from '@rh-support/components';
|
|
15
|
-
import { CloseCaseModal,
|
|
14
|
+
import { CloseCaseModal, fetchCaseSeverities, fetchCaseTypes, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
16
15
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
17
|
-
import { dtmTrackEventCaseStepEncountered, haventLoadedMetadata, isOpenShiftOnlineProduct,
|
|
16
|
+
import { dtmTrackEventCaseStepEncountered, haventLoadedMetadata, isOpenShiftOnlineProduct, PreviousCaseTypes, toNewCaseTypeMapper, toNewCaseTypeSwitcher, } from '@rh-support/utils';
|
|
18
17
|
import isEqual from 'lodash/isEqual';
|
|
19
18
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
20
19
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -23,8 +22,8 @@ import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
|
23
22
|
import { CaseOverviewDispatchContext, CaseOverviewStateContext } from '../../../context/CaseOverviewContext';
|
|
24
23
|
import { useCaseUpdateErrorMessage } from '../../../hooks/useCaseUpdateErrorMessage';
|
|
25
24
|
import { SupportLevelDisplay } from '../../../reducers/CaseConstNTypes';
|
|
26
|
-
import { fetchCaseHydra, setSeverityUpdating, setStatusUpdating, setTypeUpdating, } from '../../../reducers/CaseOverviewReducer';
|
|
27
|
-
import {
|
|
25
|
+
import { fetchAllStatuses, fetchCaseHydra, setSeverityUpdating, setStatusUpdating, setTypeUpdating, } from '../../../reducers/CaseOverviewReducer';
|
|
26
|
+
import { updateCaseDetails } from '../../../reducers/CaseReducer';
|
|
28
27
|
import Severity from '../../CaseInformation/Severity';
|
|
29
28
|
import { usePostComment } from '../../shared/usePostComment';
|
|
30
29
|
import { ReopenCaseModal } from '../ConfirmationModals/ReopenCaseModal';
|
|
@@ -50,14 +49,14 @@ export default function CaseOverview(props) {
|
|
|
50
49
|
const { isExportingPDF, exportPDFButton } = useContext(PDFContext);
|
|
51
50
|
const reopenStatusRef = useRef(null);
|
|
52
51
|
const { postComment, isPostingComment } = usePostComment({ caseNumber: props.caseNumber });
|
|
53
|
-
const { product, version, status, caseType, createdDate,
|
|
52
|
+
const { product, version, status, caseType, createdDate, createdById, ownerId, caseNumber, entitlementSla, cep, accountNumber, isPrivate, isCaseUpdating, contactIsPartner, hotfixRequested, hotfixDelivered, selectedAccountDetails, firstCaseInactivityWarningSentAt, secondCaseInactivityWarningSentAt, } = useCaseSelector((state) => ({
|
|
54
53
|
product: state.caseDetails.product,
|
|
55
54
|
version: state.caseDetails.version,
|
|
56
55
|
status: state.caseDetails.status,
|
|
57
56
|
caseType: state.caseDetails.caseType,
|
|
58
57
|
caseSeverity: state.caseDetails.severity,
|
|
59
58
|
createdDate: state.caseDetails.createdDate,
|
|
60
|
-
|
|
59
|
+
createdById: state.caseDetails.createdById,
|
|
61
60
|
ownerId: state.caseDetails.ownerId,
|
|
62
61
|
caseNumber: state.caseDetails.caseNumber,
|
|
63
62
|
entitlementSla: state.caseDetails.entitlementSla,
|
|
@@ -75,12 +74,7 @@ export default function CaseOverview(props) {
|
|
|
75
74
|
const canEditCase = useCanEditCase();
|
|
76
75
|
const caseDispatch = useCaseDispatch();
|
|
77
76
|
const globalMetadataDispatchContext = useContext(GlobalMetadataDispatchContext);
|
|
78
|
-
const
|
|
79
|
-
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
80
|
-
const updateOverviewCaseDetails = (payload) => updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, payload, false, {
|
|
81
|
-
existingCaseDetails,
|
|
82
|
-
});
|
|
83
|
-
const { globalMetadataState: { allCaseTypes, allCaseSeverities, allCaseStatuses, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
77
|
+
const { globalMetadataState: { allCaseTypes, allCaseSeverities, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
84
78
|
const canManageCase = loggedInUserRights.data.canManageCases();
|
|
85
79
|
const switchedCaseType = toNewCaseTypeSwitcher(caseType);
|
|
86
80
|
const updatingUser = loggedInUsersAccount.data.name;
|
|
@@ -95,24 +89,24 @@ export default function CaseOverview(props) {
|
|
|
95
89
|
}
|
|
96
90
|
}
|
|
97
91
|
if (haventLoadedMetadata(allCaseSeverities)) {
|
|
98
|
-
fetchCaseSeverities(globalMetadataDispatchContext,
|
|
92
|
+
fetchCaseSeverities(globalMetadataDispatchContext, loggedInUsersAccount.data.secureSupport);
|
|
99
93
|
}
|
|
100
94
|
if (haventLoadedMetadata(allCaseTypes)) {
|
|
101
|
-
fetchCaseTypes(globalMetadataDispatchContext,
|
|
95
|
+
fetchCaseTypes(globalMetadataDispatchContext, loggedInUsersAccount.data.secureSupport);
|
|
102
96
|
}
|
|
103
|
-
if (haventLoadedMetadata(allCaseStatuses)) {
|
|
104
|
-
fetchAllStatuses(
|
|
97
|
+
if (haventLoadedMetadata(caseOverviewState.allCaseStatuses)) {
|
|
98
|
+
fetchAllStatuses(caseOverviewDispatch, loggedInUsersAccount.data.secureSupport);
|
|
105
99
|
}
|
|
106
100
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
101
|
}, [
|
|
108
102
|
globalMetadataDispatchContext,
|
|
109
|
-
apolloClient,
|
|
110
103
|
allCaseSeverities,
|
|
111
104
|
allCaseTypes,
|
|
112
|
-
allCaseStatuses,
|
|
105
|
+
caseOverviewState.allCaseStatuses,
|
|
113
106
|
caseOverviewState.caseDetailsHydra,
|
|
114
107
|
canSeeCaseOwnerInfo,
|
|
115
108
|
caseNumber,
|
|
109
|
+
loggedInUsersAccount.data.secureSupport,
|
|
116
110
|
]);
|
|
117
111
|
const onTypeChange = (type) => __awaiter(this, void 0, void 0, function* () {
|
|
118
112
|
if (canEditCase.alert())
|
|
@@ -123,7 +117,7 @@ export default function CaseOverview(props) {
|
|
|
123
117
|
if (type === PreviousCaseTypes.FEATURE_ENHANCEMENT) {
|
|
124
118
|
newCaseDetails = Object.assign(Object.assign({}, newCaseDetails), { fts: false });
|
|
125
119
|
}
|
|
126
|
-
yield
|
|
120
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, newCaseDetails);
|
|
127
121
|
setTypeUpdating(caseOverviewDispatch, false);
|
|
128
122
|
ToastNotification.addSuccessMessage(t('Support type has been successfully updated'));
|
|
129
123
|
}
|
|
@@ -144,7 +138,7 @@ export default function CaseOverview(props) {
|
|
|
144
138
|
});
|
|
145
139
|
setSeverityUpdating(caseOverviewDispatch, true);
|
|
146
140
|
try {
|
|
147
|
-
yield
|
|
141
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, payLoad);
|
|
148
142
|
setSeverityUpdating(caseOverviewDispatch, false);
|
|
149
143
|
ToastNotification.addSuccessMessage(t('Severity has been successfully updated'));
|
|
150
144
|
}
|
|
@@ -163,7 +157,7 @@ export default function CaseOverview(props) {
|
|
|
163
157
|
reopenedReasonOther: reopenedReasonOther,
|
|
164
158
|
};
|
|
165
159
|
try {
|
|
166
|
-
yield
|
|
160
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, updateStatusObj);
|
|
167
161
|
setStatusUpdating(caseOverviewDispatch, false);
|
|
168
162
|
onStatusUpdate && (yield onStatusUpdate());
|
|
169
163
|
ToastNotification.addSuccessMessage(t('Status has been successfully updated'));
|
|
@@ -173,28 +167,24 @@ export default function CaseOverview(props) {
|
|
|
173
167
|
caseUpdateError.showError(e, t('Status failed to update'));
|
|
174
168
|
}
|
|
175
169
|
});
|
|
176
|
-
const onStatusChange = (
|
|
170
|
+
const onStatusChange = (newStatus) => __awaiter(this, void 0, void 0, function* () {
|
|
177
171
|
if (canEditCase.alert())
|
|
178
172
|
return;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (currentPortalStatus === 'Closed' && newPortalStatus !== 'Closed') {
|
|
182
|
-
onCaseReopen(newPortalStatus);
|
|
173
|
+
if (status === CaseStatusEnum.CLOSED && newStatus !== CaseStatusEnum.CLOSED) {
|
|
174
|
+
onCaseReopen(newStatus);
|
|
183
175
|
}
|
|
184
|
-
else if (
|
|
176
|
+
else if (newStatus === CaseStatusEnum.CLOSED) {
|
|
185
177
|
onCaseClose();
|
|
186
178
|
}
|
|
187
179
|
else {
|
|
188
180
|
yield confirm({
|
|
189
181
|
title: t(`Update the status of the case?`),
|
|
190
|
-
description: t('Are you sure you want to change the case status to {{newStatus}}?', {
|
|
191
|
-
newStatus: newPortalStatus,
|
|
192
|
-
}),
|
|
182
|
+
description: t('Are you sure you want to change the case status to {{newStatus}}?', { newStatus }),
|
|
193
183
|
confirmText: t('Yes, confirm'),
|
|
194
184
|
cancelText: t('No, cancel'),
|
|
195
185
|
modalVariant: ModalVariant.small,
|
|
196
186
|
});
|
|
197
|
-
updateStatusState(
|
|
187
|
+
updateStatusState(newStatus);
|
|
198
188
|
}
|
|
199
189
|
});
|
|
200
190
|
const onCaseClose = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -233,7 +223,7 @@ export default function CaseOverview(props) {
|
|
|
233
223
|
React.createElement("span", { className: "pf-v6-u-ml-sm" },
|
|
234
224
|
React.createElement(ExternalLinkAltIcon, null))));
|
|
235
225
|
};
|
|
236
|
-
const isCaseInOpenState =
|
|
226
|
+
const isCaseInOpenState = status !== CaseStatusEnum.CLOSED;
|
|
237
227
|
// To switch from old case type to new support type
|
|
238
228
|
const newCaseTypesArray = toNewCaseTypeMapper(allCaseTypes.data).sort();
|
|
239
229
|
return (React.createElement(React.Fragment, null,
|
|
@@ -299,13 +289,13 @@ export default function CaseOverview(props) {
|
|
|
299
289
|
React.createElement("div", { className: "created-by" },
|
|
300
290
|
React.createElement("h3", { className: "subheading subheading-sm" },
|
|
301
291
|
React.createElement(Trans, null, "Created by")),
|
|
302
|
-
React.createElement("div", null,
|
|
292
|
+
React.createElement("div", null, createdById),
|
|
303
293
|
React.createElement("div", null, createdDate ? React.createElement(DateTime, { dateTimeString: createdDate }) : null)),
|
|
304
294
|
canSeeCaseOwnerInfo && (React.createElement(CaseOwnerInfo, { owner: ownerId, caseDetailsHydra: caseOverviewState.caseDetailsHydra }))),
|
|
305
295
|
React.createElement("div", { className: "case-overview-secondary card card-md card-light push-bottom" },
|
|
306
296
|
React.createElement("div", { className: "pf-v6-l-grid pf-m-gutter pf-m-all-4-col-on-lg" },
|
|
307
297
|
React.createElement("div", { className: "form-wrapper" },
|
|
308
|
-
React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || allCaseStatuses.isFetching, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: allCaseStatuses.isError })),
|
|
298
|
+
React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || caseOverviewState.allCaseStatuses.isFetching, allStatuses: caseOverviewState.allCaseStatuses.data, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: caseOverviewState.allCaseStatuses.isError })),
|
|
309
299
|
React.createElement("div", { className: "form-wrapper" },
|
|
310
300
|
React.createElement(CaseType, { selectedType: switchedCaseType, onTypeChange: onTypeChange, isDisabled: !canManageCase || allCaseTypes.isFetching || isCaseUpdating, allTypes: newCaseTypesArray, isFetching: caseOverviewState.caseTypeUpdating && isCaseUpdating, hasError: allCaseTypes.isError })),
|
|
311
301
|
React.createElement("div", { className: "form-wrapper" },
|
|
@@ -320,14 +310,13 @@ export default function CaseOverview(props) {
|
|
|
320
310
|
}), isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, onClose: () => {
|
|
321
311
|
setShowCaseCloseModal(false);
|
|
322
312
|
}, caseNumber: caseNumber })),
|
|
323
|
-
showReOpenCaseModal && (React.createElement(ReopenCaseModal, { isInternal: loggedInUserRights.data.isInternal(), onConfirm: (commentBody,
|
|
324
|
-
|
|
325
|
-
yield updateStatusState(newApiStatus, reopenedAt || null, reopenedBySSOName || null, reopenedReason || null, reopenedReasonOther || null, () => __awaiter(this, void 0, void 0, function* () {
|
|
313
|
+
showReOpenCaseModal && (React.createElement(ReopenCaseModal, { isInternal: loggedInUserRights.data.isInternal(), onConfirm: (commentBody, newStatus, reopenedAt, reopenedBySSOName, reopenedReason, reopenedReasonOther) => __awaiter(this, void 0, void 0, function* () {
|
|
314
|
+
yield updateStatusState(newStatus, reopenedAt || null, reopenedBySSOName || null, reopenedReason || null, reopenedReasonOther || null, () => __awaiter(this, void 0, void 0, function* () {
|
|
326
315
|
yield postCommentAfterStatusUpdate(commentBody);
|
|
327
316
|
dtmTrackEventCaseStepEncountered('reopen', caseNumber, product, version);
|
|
328
317
|
}));
|
|
329
318
|
setShowReopenCaseModal(false);
|
|
330
319
|
}), onClose: () => {
|
|
331
320
|
setShowReopenCaseModal(false);
|
|
332
|
-
}, caseNumber: caseNumber, reopenStatus: reopenStatusRef.current, isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, whoIsUpdating: updatingUser }))));
|
|
321
|
+
}, caseNumber: caseNumber, reopenStatus: reopenStatusRef.current, allStatuses: caseOverviewState.allCaseStatuses.data, isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, whoIsUpdating: updatingUser }))));
|
|
333
322
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { CaseStatusEnum } from '../../../constants/caseDetailsConstants';
|
|
2
3
|
interface IProps {
|
|
3
4
|
onConfirm: (commentBody: any, newStatus: any, reopenedAt?: any, reopenedBySSOName?: any, reopenedReason?: any, reopenedReasonOther?: any) => void;
|
|
4
5
|
onClose: () => void;
|
|
5
6
|
caseNumber: string;
|
|
6
7
|
isInternal: boolean;
|
|
8
|
+
allStatuses: string[];
|
|
7
9
|
isUpdating: boolean;
|
|
8
|
-
reopenStatus:
|
|
10
|
+
reopenStatus: CaseStatusEnum;
|
|
9
11
|
whoIsUpdating: string;
|
|
10
12
|
}
|
|
11
13
|
export declare function ReopenCaseModal(props: IProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReopenCaseModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ConfirmationModals/ReopenCaseModal.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,KAAA,EAAE,SAAS,KAAA,EAAE,UAAU,CAAC,KAAA,EAAE,iBAAiB,CAAC,KAAA,EAAE,cAAc,CAAC,KAAA,EAAE,mBAAmB,CAAC,KAAA,KAAK,IAAI,CAAC;IACpH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"ReopenCaseModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ConfirmationModals/ReopenCaseModal.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,KAAA,EAAE,SAAS,KAAA,EAAE,UAAU,CAAC,KAAA,EAAE,iBAAiB,CAAC,KAAA,EAAE,cAAc,CAAC,KAAA,EAAE,mBAAmB,CAAC,KAAA,KAAK,IAAI,CAAC;IACpH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,cAAc,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;CACzB;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAkN5C"}
|
|
@@ -9,11 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { Button, ButtonVariant, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, TextArea, } from '@patternfly/react-core';
|
|
11
11
|
import { SingleSelectDropdown } from '@rh-support/components';
|
|
12
|
-
import { formatDateTime
|
|
12
|
+
import { formatDateTime } from '@rh-support/utils';
|
|
13
13
|
import isEmpty from 'lodash/isEmpty';
|
|
14
14
|
import map from 'lodash/map';
|
|
15
15
|
import React, { useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
|
+
import { CaseStatusEnum } from '../../../constants/caseDetailsConstants';
|
|
17
18
|
const reasonWithDescription = ['Other'];
|
|
18
19
|
const reasonWithoutDescription = ['I am experiencing the same issue', 'My case has been closed prematurely'];
|
|
19
20
|
const reasonsList = [...reasonWithoutDescription, ...reasonWithDescription];
|
|
@@ -53,7 +54,7 @@ export function ReopenCaseModal(props) {
|
|
|
53
54
|
if (!checkForRequiredFields())
|
|
54
55
|
return;
|
|
55
56
|
let submissionDate = new Date();
|
|
56
|
-
props.onConfirm(getCommentBody(), props.reopenStatus || selectedStatus ||
|
|
57
|
+
props.onConfirm(getCommentBody(), props.reopenStatus || selectedStatus || CaseStatusEnum.WAITING_ON_REDHAT, submissionDate, props.whoIsUpdating, selectedReason, reopenDescription);
|
|
57
58
|
});
|
|
58
59
|
const onReasonChange = (option) => {
|
|
59
60
|
setSelectedReason(option.value);
|
|
@@ -69,7 +70,7 @@ export function ReopenCaseModal(props) {
|
|
|
69
70
|
label: option,
|
|
70
71
|
value: option,
|
|
71
72
|
}));
|
|
72
|
-
const getStatusDropdownOptions = map(
|
|
73
|
+
const getStatusDropdownOptions = map(props.allStatuses.filter((status) => status !== CaseStatusEnum.CLOSED), (option) => ({
|
|
73
74
|
label: option,
|
|
74
75
|
value: option,
|
|
75
76
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ESSRemoteSessionModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ESSRemoteSessionModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAmB,MAAM,OAAO,CAAC;AAgBxC,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;IAClB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBAsKlD"}
|
|
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
11
10
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
12
11
|
import { Button, ButtonVariant, Icon, Modal, ModalFooter, ModalHeader, ModalVariant, Title, TitleSizes, } from '@patternfly/react-core';
|
|
13
12
|
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
@@ -15,16 +14,20 @@ import { ToastNotification, useFetch } from '@rh-support/components';
|
|
|
15
14
|
import React, { useState } from 'react';
|
|
16
15
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
16
|
import { useCaseDispatch } from '../../../context/CaseContext';
|
|
18
|
-
import {
|
|
17
|
+
import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
|
|
18
|
+
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
|
|
19
|
+
import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
|
|
19
20
|
import { checkForCaseStatusToggleOnAttachOrComment, setCaseDetails, updateCaseDetails, } from '../../../reducers/CaseReducer';
|
|
20
21
|
export function ESSRemoteSessionModal(props) {
|
|
21
22
|
const { t } = useTranslation();
|
|
22
23
|
const caseDispatch = useCaseDispatch();
|
|
23
24
|
const [agreeLoading, setAgreeLoading] = useState(false);
|
|
24
|
-
const client = useApolloClient();
|
|
25
25
|
const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
|
|
26
26
|
propgateErrors: true,
|
|
27
27
|
});
|
|
28
|
+
const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
|
|
29
|
+
const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
|
|
30
|
+
const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
|
|
28
31
|
// To handle modal cancel and close
|
|
29
32
|
const onCancel = () => {
|
|
30
33
|
props.onClose && props.onClose();
|
|
@@ -43,7 +46,7 @@ export function ESSRemoteSessionModal(props) {
|
|
|
43
46
|
commentBody: requestComment,
|
|
44
47
|
contentType: 'markdown',
|
|
45
48
|
});
|
|
46
|
-
|
|
49
|
+
updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
47
50
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
|
|
48
51
|
onCancel();
|
|
49
52
|
setAgreeLoading(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewEssTermsModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NewEssTermsModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAYnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;CACrB;AA4BD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAmY7C"}
|
|
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
11
10
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
12
11
|
import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
|
|
13
12
|
import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
|
|
@@ -17,19 +16,41 @@ import isEqual from 'lodash/isEqual';
|
|
|
17
16
|
import React, { useEffect, useState } from 'react';
|
|
18
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
19
18
|
import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
19
|
+
import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
|
|
20
|
+
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
|
|
21
|
+
import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
|
|
22
|
+
import { checkForCaseStatusToggleOnAttachOrComment, updateCaseDetails } from '../../../reducers/CaseReducer';
|
|
23
|
+
const getLocaleNameFromLocalCode = (localeCode) => {
|
|
24
|
+
if ('Intl' in window && 'DisplayNames' in Intl) {
|
|
25
|
+
try {
|
|
26
|
+
const [lang, locale] = localeCode.includes('_') ? localeCode.split('_') : localeCode.split('-');
|
|
27
|
+
// https://github.com/microsoft/TypeScript/issues/41338
|
|
28
|
+
const langName = new Intl.DisplayNames([lang], { type: 'language' });
|
|
29
|
+
const regionNamesInLang = new Intl.DisplayNames([lang], { type: 'region' });
|
|
30
|
+
return `${regionNamesInLang.of(locale)} (${langName.of(lang)})`;
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
return localeCode;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return localeCode;
|
|
37
|
+
};
|
|
38
|
+
const formatSessionLinks = (sessionLink) => {
|
|
39
|
+
const links = sessionLink
|
|
40
|
+
.split(/[;,| \n\r\t]+/)
|
|
41
|
+
.map((link) => link.trim())
|
|
42
|
+
.filter(Boolean);
|
|
43
|
+
const formattedLinks = links.map((link) => `[${link}](${link})`).join('\n');
|
|
44
|
+
return formattedLinks;
|
|
45
|
+
};
|
|
23
46
|
export function NewEssTermsModal(props) {
|
|
24
47
|
const { t } = useTranslation();
|
|
25
48
|
const { remoteSessionTermsAcked } = useCaseSelector((state) => ({
|
|
26
49
|
remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
|
|
27
50
|
}), isEqual);
|
|
28
51
|
const [isTermsChecked, setIsTermsChecked] = useState(false);
|
|
29
|
-
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
30
52
|
const { request } = useFetch(publicApi.terms.getRequiredTerms);
|
|
31
53
|
const caseDispatch = useCaseDispatch();
|
|
32
|
-
const apolloClient = useApolloClient();
|
|
33
54
|
const [selectedTranslation, setSelectedTranslation] = useState({
|
|
34
55
|
id: '5001',
|
|
35
56
|
isDefault: false,
|
|
@@ -72,10 +93,12 @@ export function NewEssTermsModal(props) {
|
|
|
72
93
|
fetchTerms();
|
|
73
94
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
95
|
}, []);
|
|
75
|
-
const client = useApolloClient();
|
|
76
96
|
const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
|
|
77
97
|
propgateErrors: true,
|
|
78
98
|
});
|
|
99
|
+
const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
|
|
100
|
+
const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
|
|
101
|
+
const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
|
|
79
102
|
const updateSessionExpectation = (event, value) => setSessionExpectations(value);
|
|
80
103
|
const updateImpact = (event, value) => setImpact(value);
|
|
81
104
|
const updateSessionLink = (event, value) => setSessionLink(value);
|
|
@@ -106,17 +129,18 @@ export function NewEssTermsModal(props) {
|
|
|
106
129
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
107
130
|
const requestComment = t(`\n**Thank you for submitting the request for a remote session. A support manager will review the request, and updates will be provided in the support case. Please continue to provide any data requested by the support engineers in the case prior to the remote session (if applicable).**\n\nSubmitted a remote session request with following details:\n\n**Preferred Time and Expectations of remote session**\n${sessionExpectations}\n\n**Describe the impact to you or the business**\n${impact}\n\n${sessionLink ? `**Remote session link**\n${formatSessionLinks(sessionLink)}\n\n` : ''}This action does not initiate a remote session. A Red Hat Associate will get back to you soon.`);
|
|
108
131
|
try {
|
|
109
|
-
yield
|
|
132
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
110
133
|
remoteSessionTermsAcked: true,
|
|
134
|
+
screenSessionRequested: true,
|
|
111
135
|
waitingOnCallback: true,
|
|
112
|
-
}
|
|
136
|
+
});
|
|
113
137
|
try {
|
|
114
138
|
yield postCommentRequest({
|
|
115
139
|
caseNumber: props.caseNumber,
|
|
116
140
|
commentBody: requestComment,
|
|
117
141
|
contentType: 'markdown',
|
|
118
142
|
});
|
|
119
|
-
|
|
143
|
+
updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
120
144
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
|
|
121
145
|
setAgreeLoading(false);
|
|
122
146
|
setHasSubmitted(true);
|
|
@@ -146,9 +170,8 @@ export function NewEssTermsModal(props) {
|
|
|
146
170
|
onCancel();
|
|
147
171
|
setAgreeLoading(false);
|
|
148
172
|
setIsTermsChecked(false);
|
|
149
|
-
yield
|
|
150
|
-
|
|
151
|
-
waitingOnCallback: false,
|
|
173
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
174
|
+
screenSessionRequested: false,
|
|
152
175
|
});
|
|
153
176
|
// ToastNotification.addDangerMessage(
|
|
154
177
|
// t('Could not submit a request for remote session'),
|
package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAgBnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;CACrB;AA4BD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBA0XxD"}
|
|
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
11
10
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
12
11
|
import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
|
|
13
12
|
import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
|
|
@@ -17,19 +16,41 @@ import isEqual from 'lodash/isEqual';
|
|
|
17
16
|
import React, { useEffect, useState } from 'react';
|
|
18
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
19
18
|
import { useCaseDispatch, useCaseSelector } from '../../../context/CaseContext';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
19
|
+
import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
|
|
20
|
+
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
|
|
21
|
+
import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
|
|
22
|
+
import { checkForCaseStatusToggleOnAttachOrComment, setRemoteRiderFlag, updateCaseDetails, } from '../../../reducers/CaseReducer';
|
|
23
|
+
const getLocaleNameFromLocalCode = (localeCode) => {
|
|
24
|
+
if ('Intl' in window && 'DisplayNames' in Intl) {
|
|
25
|
+
try {
|
|
26
|
+
const [lang, locale] = localeCode.includes('_') ? localeCode.split('_') : localeCode.split('-');
|
|
27
|
+
// https://github.com/microsoft/TypeScript/issues/41338
|
|
28
|
+
const langName = new Intl.DisplayNames([lang], { type: 'language' });
|
|
29
|
+
const regionNamesInLang = new Intl.DisplayNames([lang], { type: 'region' });
|
|
30
|
+
return `${regionNamesInLang.of(locale)} (${langName.of(lang)})`;
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
return localeCode;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return localeCode;
|
|
37
|
+
};
|
|
38
|
+
const formatSessionLinks = (sessionLink) => {
|
|
39
|
+
const links = sessionLink
|
|
40
|
+
.split(/[;,| \n\r\t]+/)
|
|
41
|
+
.map((link) => link.trim())
|
|
42
|
+
.filter(Boolean);
|
|
43
|
+
const formattedLinks = links.map((link) => `[${link}](${link})`).join('\n');
|
|
44
|
+
return formattedLinks;
|
|
45
|
+
};
|
|
23
46
|
export function RemoteSessionAgreementModal(props) {
|
|
24
47
|
const { t } = useTranslation();
|
|
25
48
|
const { remoteSessionTermsAcked } = useCaseSelector((state) => ({
|
|
26
49
|
remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
|
|
27
|
-
caseDetails: state.caseDetails,
|
|
28
50
|
}), isEqual);
|
|
29
51
|
const [isTermsChecked, setIsTermsChecked] = useState(false);
|
|
30
52
|
const { request } = useFetch(publicApi.terms.getRequiredTerms);
|
|
31
53
|
const caseDispatch = useCaseDispatch();
|
|
32
|
-
const apolloClient = useApolloClient();
|
|
33
54
|
const [selectedTranslation, setSelectedTranslation] = useState({
|
|
34
55
|
id: '5001',
|
|
35
56
|
isDefault: false,
|
|
@@ -72,10 +93,12 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
72
93
|
fetchTerms();
|
|
73
94
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
95
|
}, []);
|
|
75
|
-
const client = useApolloClient();
|
|
76
96
|
const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
|
|
77
97
|
propgateErrors: true,
|
|
78
98
|
});
|
|
99
|
+
const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
|
|
100
|
+
const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
|
|
101
|
+
const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
|
|
79
102
|
const updateSessionExpectation = (event, value) => setSessionExpectations(value);
|
|
80
103
|
const updateImpact = (event, value) => setImpact(value);
|
|
81
104
|
const updateSessionLink = (event, value) => setSessionLink(value);
|
|
@@ -92,15 +115,14 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
92
115
|
props.onClose && props.onClose();
|
|
93
116
|
};
|
|
94
117
|
const toggleRemoteSessionForm = () => setIsRemoteSessionForm(true);
|
|
95
|
-
const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
|
|
96
118
|
// Function to ack remote session terms and post comment
|
|
97
119
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
98
120
|
const requestComment = t(`\n**Thank you for submitting the request for a remote session. A support manager will review the request, and updates will be provided in the support case. Please continue to provide any data requested by the support engineers in the case prior to the remote session (if applicable).**\n\nSubmitted a remote session request with following details:\n\n**Preferred Time and Expectations of remote session**\n${sessionExpectations}\n\n**Describe the impact to you or the business**\n${impact}\n\n${sessionLink ? `**Remote session link**\n${formatSessionLinks(sessionLink)}\n\n` : ''}This action does not initiate a remote session. A Red Hat Associate will get back to you soon.`);
|
|
99
121
|
try {
|
|
100
|
-
yield
|
|
122
|
+
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
101
123
|
remoteSessionTermsAcked: true,
|
|
102
124
|
waitingOnCallback: true,
|
|
103
|
-
}
|
|
125
|
+
});
|
|
104
126
|
setRemoteRiderFlag(caseDispatch, true);
|
|
105
127
|
try {
|
|
106
128
|
yield postCommentRequest({
|
|
@@ -108,7 +130,7 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
108
130
|
commentBody: requestComment,
|
|
109
131
|
contentType: 'markdown',
|
|
110
132
|
});
|
|
111
|
-
|
|
133
|
+
updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
112
134
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
|
|
113
135
|
setAgreeLoading(false);
|
|
114
136
|
setHasSubmitted(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AASA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAgB/D,wBAAgB,sBAAsB,sBAoYrC"}
|