@rh-support/troubleshoot 2.1.7 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +2 -3
  3. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +15 -7
  5. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts +11 -0
  6. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts.map +1 -0
  7. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.js +38 -0
  8. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts +15 -0
  9. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -0
  10. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +106 -0
  11. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.js +3 -3
  12. package/lib/esm/components/CaseEditView/RequestRemoteSession/index.d.ts +1 -0
  13. package/lib/esm/components/CaseEditView/RequestRemoteSession/index.d.ts.map +1 -1
  14. package/lib/esm/components/CaseEditView/RequestRemoteSession/index.js +1 -0
  15. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  16. package/lib/esm/components/CaseManagement/CaseManagement.js +13 -2
  17. package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.d.ts +3 -0
  18. package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.d.ts.map +1 -0
  19. package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.js +41 -0
  20. package/lib/esm/components/Issue/Issue.d.ts.map +1 -1
  21. package/lib/esm/components/Issue/Issue.js +1 -0
  22. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"AccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/AccountSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAOnC,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAcrE,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC;AAEF,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eA4KrC;kBA5KQ,eAAe;;;AAgLxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"AccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/AccountSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAOnC,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAcrE,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC;AAEF,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eA2KrC;kBA3KQ,eAAe;;;AA+KxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -39,7 +39,7 @@ function AccountSelector(props) {
39
39
  const routeDispatch = useRouteDispatchContext();
40
40
  const { globalMetadataState: { bookmarkedGroupAccounts, loggedInUserRights, managedAccounts, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
41
41
  const { t } = useTranslation();
42
- /** Various Abilities */
42
+ // Various Abilities
43
43
  const ability = useContext(AbilityContext);
44
44
  const canAccessManagedAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.MANAGED_ACCOUNTS);
45
45
  const canBookmarkAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.BOOKMARK_ACCOUNTS);
@@ -76,8 +76,7 @@ function AccountSelector(props) {
76
76
  accountNumber: selectedAccountDetails.data.accountNumber,
77
77
  subscriptionAbuse: selectedAccountDetails.data.subscriptionAbuse,
78
78
  };
79
- // When internal user wants to open a case for a customer but
80
- // customer account doesn't have entitlement, we show an error
79
+ // When internal user wants to open a case for a customer but customer account doesn't have entitlement, we show an error
81
80
  useEffect(() => {
82
81
  const getAccountEntitlement = () => __awaiter(this, void 0, void 0, function* () {
83
82
  // internal user doesn't open case for customer. No need to check account entitlement
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AA8BA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAiU7C"}
1
+ {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AA8BA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eA2V7C"}
@@ -17,7 +17,7 @@ import TrendUpIcon from '@patternfly/react-icons/dist/js/icons/trend-up-icon';
17
17
  import { ErrorBoundary, ToastNotification, useBreakpoint, useForceUpdate } from '@rh-support/components';
18
18
  import { GlobalMetadataDispatchContext, toggleViewAsCustomerFlag, useGlobalStateContext, useUserPreferences, } from '@rh-support/react-context';
19
19
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
20
- import { scrollIntoView } from '@rh-support/utils';
20
+ import { isSpecialSupportOfferingEnabled, scrollIntoView } from '@rh-support/utils';
21
21
  import isEmpty from 'lodash/isEmpty';
22
22
  import isEqual from 'lodash/isEqual';
23
23
  import React, { useContext, useEffect, useRef, useState } from 'react';
@@ -29,17 +29,20 @@ import { useRecommendationStateContext } from '../../context/RecommendationConte
29
29
  import { ActiveCustomerEscalation } from './ActiveCustomerEscalation';
30
30
  import { CaseSolutions } from './CaseSolutions';
31
31
  import { PDFContext } from './PDFContainer';
32
- import { RemoteSessionAgreement } from './RequestRemoteSession';
32
+ import { ESSRemoteSession, RemoteSessionAgreement } from './RequestRemoteSession';
33
33
  export function CaseDetailsAside(props) {
34
- var _a;
34
+ var _a, _b;
35
35
  const { t } = useTranslation();
36
- const { severity, status, isFetchingCaseDetails, isFetchingCaseDetailsError, acceptedRemoteSessionTerms } = useCaseSelector((state) => ({
36
+ const { severity, status, isFetchingCaseDetails, isFetchingCaseDetailsError, acceptedRemoteSessionTerms, screenSessionRequested, product, } = useCaseSelector((state) => ({
37
37
  severity: state.caseDetails.severity,
38
38
  status: state.caseDetails.status,
39
39
  isFetchingCaseDetails: state.isFetchingCaseDetails,
40
40
  isFetchingCaseDetailsError: state.isFetchingCaseDetailsError,
41
41
  acceptedRemoteSessionTerms: state.caseDetails.remoteSessionTermsAcked,
42
+ screenSessionRequested: state.caseDetails.screenSessionRequested,
43
+ product: state.caseDetails.product,
42
44
  }), isEqual);
45
+ const selectedProduct = product;
43
46
  const { caseDetailsPageState: { caseEscalations }, } = useCaseDetailsPageStateContext();
44
47
  const isCreateRMEVisible = (caseEscalations.data || []).length === 0 || caseEscalations.data.every((item) => item.status === 'Closed');
45
48
  const { recommendationState: { isLoadingRecommendations, allDocs }, } = useRecommendationStateContext();
@@ -58,7 +61,7 @@ export function CaseDetailsAside(props) {
58
61
  const isXLScreen = breakPoint.xl;
59
62
  const toggleCustomerViewRef = useRef(null);
60
63
  const isFirstMountRef = useRef(true);
61
- const { globalMetadataState: { navBarRef, viewAsCustomer, loggedInUsersAccount, loggedInUserRights }, } = useGlobalStateContext();
64
+ const { globalMetadataState: { navBarRef, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, allProducts }, } = useGlobalStateContext();
62
65
  const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
63
66
  // To enable RSA Section for external users
64
67
  const isExternal = loggedInUserRights.data.isExternal();
@@ -163,6 +166,8 @@ export function CaseDetailsAside(props) {
163
166
  return t('View internal information available to Red Hat associates only.');
164
167
  }
165
168
  };
169
+ // To check if the user is ESS Customer and Product has ESS Support
170
+ const isESSCustomer = isSpecialSupportOfferingEnabled((_b = allProducts.data) === null || _b === void 0 ? void 0 : _b.productsResult, selectedProduct);
166
171
  return (React.createElement("aside", { className: `grid-aside ${isSideBarExpanded ? '' : 'sidebar-collapsed'} ` },
167
172
  React.createElement("pfe-collapse-toggle", { "aria-controls": "case-details-aside-content", onClick: onToggleAside }, isSideBarExpanded ? (React.createElement("div", { className: `sidebar-header ${isExportingPDF ? 'hide-in-pdf' : ''}` },
168
173
  React.createElement(Button, { variant: "link", isInline: true, title: t('Collapse sidebar') },
@@ -201,6 +206,9 @@ export function CaseDetailsAside(props) {
201
206
  React.createElement(CaseSolutions, { caseNumber: caseNumber, ref: topSolutionsRef, isSecureSupportAccount: isSecureSupportAccount })),
202
207
  !caseEscalations.isFetching && canViewACESection && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading customer escalation') } },
203
208
  React.createElement(ActiveCustomerEscalation, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef }))),
204
- isExternal && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading remote session agreement') } },
205
- React.createElement(RemoteSessionAgreement, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, acceptedRemoteSessionTerms: acceptedRemoteSessionTerms, readOnly: canReadCase })))))));
209
+ isESSCustomer
210
+ ? isExternal && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading remote session agreement') } },
211
+ React.createElement(RemoteSessionAgreement, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, acceptedRemoteSessionTerms: acceptedRemoteSessionTerms, readOnly: canReadCase })))
212
+ : isExternal && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading requesting remote session') } },
213
+ React.createElement(ESSRemoteSession, { screenSessionRequested: screenSessionRequested, caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, readOnly: canReadCase })))))));
206
214
  }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ caseNumber: string;
4
+ caseSeverity: string;
5
+ caseStatus: string;
6
+ readOnly: boolean;
7
+ screenSessionRequested: boolean;
8
+ }
9
+ export declare const ESSRemoteSession: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLDivElement>>;
10
+ export {};
11
+ //# sourceMappingURL=ESSRemoteSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ESSRemoteSession.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,eAAO,MAAM,gBAAgB,+EA2F3B,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Button, Popover, Tooltip } from '@patternfly/react-core';
2
+ import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
3
+ import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
4
+ import React, { forwardRef, useContext, useRef, useState } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { ESSRemoteSessionModal } from './ESSRemoteSessionModal';
7
+ export const ESSRemoteSession = forwardRef((props, ref) => {
8
+ const tooltipRef = useRef();
9
+ const { t } = useTranslation();
10
+ const canEditCase = useCanEditCase();
11
+ const { caseNumber, caseStatus, screenSessionRequested, readOnly } = props;
12
+ const { globalMetadataState: { loggedInUser, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
13
+ const [openESSRemoteSessionModal, setOpenESSRemoteSessionModal] = useState(false);
14
+ // To toggle ESS RS Modal
15
+ const toggleESSRemoteSessionModal = () => {
16
+ if (canEditCase.alert())
17
+ return;
18
+ setOpenESSRemoteSessionModal((openESSRemoteSessionModal) => !openESSRemoteSessionModal);
19
+ };
20
+ // ESS RS Aside Section Body
21
+ const ESSRemoteSessionSectionBody = (React.createElement("div", { className: "card card-white card-support escalations", ref: ref },
22
+ React.createElement("h3", { className: "card-heading pf-u-display-flex pf-u-justify-content-space-between" },
23
+ t('Remote session'),
24
+ React.createElement(Popover, { "aria-label": t('Remote Session Helper Info'), bodyContent: t('A remote session allows support engineers to view or access your computer to simplify collaboration and troubleshooting.'), footerContent: React.createElement("a", { href: "/articles/3566571", target: "_blank", rel: "noopener noreferrer", "aria-label": t('Read more about remote sessions') }, t('Read more about remote sessions')) },
25
+ React.createElement(InfoCircleIcon, null))),
26
+ React.createElement("div", { className: "card-body" },
27
+ React.createElement("p", null,
28
+ React.createElement("strong", null, `${t('Red Hat may agree to remotely access your systems if:')}`)),
29
+ React.createElement("ul", null,
30
+ React.createElement("li", null, t(`Such access will help diagnose, debug or lead to the resolution of a software defect`)),
31
+ React.createElement("li", null, t('Agreed upon by both Red Hat and you, the end user'))),
32
+ React.createElement("p", { className: "rrs-light-grey-text" }, t('Red Hat will add a comment to your case to schedule your remote session.')),
33
+ screenSessionRequested && (React.createElement(Tooltip, { content: t('Remote session agreement has already been accepted.'), reference: tooltipRef, "aria-live": 'polite' })),
34
+ React.createElement(Button, { "aria-label": screenSessionRequested ? t('Remote session requested') : t('Request remote session'), variant: screenSessionRequested ? 'primary' : 'secondary', onClick: toggleESSRemoteSessionModal, "data-tracking-id": "accept-remote-session-agreement-trigger", isAriaDisabled: screenSessionRequested, ref: tooltipRef }, screenSessionRequested ? t('Remote session requested') : t('Request remote session')))));
35
+ return (React.createElement(React.Fragment, null,
36
+ ESSRemoteSessionSectionBody,
37
+ React.createElement(ESSRemoteSessionModal, { caseNumber: caseNumber, caseStatus: caseStatus, screenSessionRequested: screenSessionRequested, show: openESSRemoteSessionModal, onClose: toggleESSRemoteSessionModal, loggedInUser: loggedInUser.data.ssoUsername === undefined ? '' : loggedInUser.data.ssoUsername, loggedInUserRights: loggedInUserRights, readOnly: readOnly })));
38
+ });
@@ -0,0 +1,15 @@
1
+ import { IApiResponseDetails } from '@rh-support/types/shared';
2
+ import { UserAuth } from '@rh-support/user-permissions';
3
+ interface IProps {
4
+ caseNumber: string;
5
+ onClose?: () => void;
6
+ loggedInUser: string;
7
+ caseStatus: string;
8
+ show: boolean;
9
+ loggedInUserRights: IApiResponseDetails<UserAuth>;
10
+ readOnly: boolean;
11
+ screenSessionRequested: boolean;
12
+ }
13
+ export declare function ESSRemoteSessionModal(props: IProps): JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=ESSRemoteSessionModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ESSRemoteSessionModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAkBxD,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,eAiKlD"}
@@ -0,0 +1,106 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
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 { publicApi } from '@cee-eng/hydrajs';
11
+ import { Button, ButtonVariant, Modal, ModalVariant, Title, TitleSizes } from '@patternfly/react-core';
12
+ import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
13
+ import { ToastNotification, useFetch } from '@rh-support/components';
14
+ import React, { useState } from 'react';
15
+ import { Trans, useTranslation } from 'react-i18next';
16
+ import { useCaseDispatch } from '../../../context/CaseContext';
17
+ import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
18
+ import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
19
+ import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
20
+ import { checkForCaseStatusToggleOnAttachOrComment, setCaseDetails, setRemoteRiderFlag, updateCaseDetails, } from '../../../reducers/CaseReducer';
21
+ export function ESSRemoteSessionModal(props) {
22
+ const { t } = useTranslation();
23
+ const caseDispatch = useCaseDispatch();
24
+ const [agreeLoading, setAgreeLoading] = useState(false);
25
+ const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
26
+ propgateErrors: true,
27
+ });
28
+ const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
29
+ const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
30
+ const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
31
+ // To handle modal cancel and close
32
+ const onCancel = () => {
33
+ props.onClose && props.onClose();
34
+ };
35
+ // Function to ack remote session terms and post comment
36
+ const submitESSRemoteSessionRequest = () => __awaiter(this, void 0, void 0, function* () {
37
+ const requestComment = t('Submitted a remote session request.');
38
+ try {
39
+ yield updateCaseDetails(caseDispatch, props.caseNumber, { screenSessionRequested: true });
40
+ setCaseDetails(caseDispatch, {
41
+ screenSessionRequested: true,
42
+ });
43
+ setRemoteRiderFlag(caseDispatch, true);
44
+ try {
45
+ yield postCommentRequest({
46
+ caseNumber: props.caseNumber,
47
+ commentBody: requestComment,
48
+ contentType: 'markdown',
49
+ });
50
+ updateDiscussionStateComments(dispatchDiscussion, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
51
+ checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
52
+ setAgreeLoading(false);
53
+ ToastNotification.addSuccessMessage(t('Remote session has been requested successfully'), t('Red Hat will add a comment to your case to schedule your remote session.'));
54
+ }
55
+ catch (e) {
56
+ ToastNotification.addWarningMessage(t('Could not submit a comment'), t('Rest assured, we have noted you have accepted the agreement'));
57
+ setAgreeLoading(false);
58
+ props.onClose();
59
+ }
60
+ props.onClose();
61
+ }
62
+ catch (e) {
63
+ if (props.readOnly) {
64
+ ToastNotification.addDangerMessage(t('You are not authorized to update this case.'));
65
+ }
66
+ else {
67
+ ToastNotification.addDangerMessage(t('Could not submit a request for remote session'), t('Please try again.'));
68
+ }
69
+ setAgreeLoading(false);
70
+ props.onClose();
71
+ }
72
+ });
73
+ // To check if terms acked and if not disable submit button
74
+ const onSubmit = () => {
75
+ setAgreeLoading(true);
76
+ submitESSRemoteSessionRequest();
77
+ };
78
+ // To check and if Request remote session button is loading
79
+ const isAgreeLoading = agreeLoading || isPostingComment;
80
+ // ESS RS Modal Actions
81
+ const modalActions = [
82
+ React.createElement(Button, { "aria-label": t('Request remote session'), variant: ButtonVariant.primary, onClick: onSubmit, "data-tracking-id": "ess-request-remote-session", isLoading: isAgreeLoading }, t('Request remote session')),
83
+ React.createElement(Button, { key: "cancel", variant: "link", onClick: props.onClose }, t('Cancel')),
84
+ ];
85
+ const acceptedModalActions = [
86
+ React.createElement(Button, { key: "cancel", variant: "link", onClick: props.onClose },
87
+ React.createElement(Trans, null, "Close")),
88
+ ];
89
+ // Body of ESS Modal
90
+ const ESSRemoteSessionModalBody = () => {
91
+ return (React.createElement(React.Fragment, null,
92
+ React.createElement("p", { className: "pf-u-mt-xs" },
93
+ React.createElement(Trans, null, "To troubleshoot your problem, Red Hat support accesses your network or systems remotely."))));
94
+ };
95
+ const RequestedESSRemoteSessionModalBody = () => {
96
+ return (React.createElement(React.Fragment, null,
97
+ React.createElement("p", { className: "pf-u-mt-xs" },
98
+ React.createElement(Trans, null, "Red Hat will add a comment to your case to schedule your remote session."))));
99
+ };
100
+ const essModalHeader = props.screenSessionRequested ? (React.createElement(React.Fragment, null,
101
+ React.createElement(Title, { className: "pf-u-mb-xs", id: "modal-custom-header-label", headingLevel: "h1", size: TitleSizes['2xl'] },
102
+ React.createElement(CheckCircleIcon, { size: "lg" }),
103
+ t('Remote session has been requested')))) : (React.createElement(React.Fragment, null,
104
+ React.createElement(Title, { className: "pf-u-mb-xs", id: "modal-custom-header-label", headingLevel: "h1", size: TitleSizes['2xl'] }, t('Request a remote session?'))));
105
+ return (React.createElement(Modal, { variant: ModalVariant.small, id: "remote-session-agreement-modal", "aria-label": props.screenSessionRequested ? t('Remote session has been requested') : t('Request a remote session?'), header: essModalHeader, isOpen: props.show, onClose: onCancel, actions: props.screenSessionRequested ? acceptedModalActions : modalActions }, props.screenSessionRequested ? RequestedESSRemoteSessionModalBody() : ESSRemoteSessionModalBody()));
106
+ }
@@ -11,18 +11,18 @@ export const RemoteSessionAgreement = forwardRef((props, ref) => {
11
11
  const canEditCase = useCanEditCase();
12
12
  const { caseNumber, caseStatus, acceptedRemoteSessionTerms, readOnly } = props;
13
13
  const { globalMetadataState: { loggedInUser, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
14
- const [openRequestRemoteSessionModal, setOpenRequestRemoteSessionnModal] = useState(false);
14
+ const [openRequestRemoteSessionModal, setOpenRequestRemoteSessionModal] = useState(false);
15
15
  // To toggle RSA Modal
16
16
  const toggleRemoteSessionAgreementModal = () => {
17
17
  if (canEditCase.alert())
18
18
  return;
19
- setOpenRequestRemoteSessionnModal((openRequestRemoteSessionModal) => !openRequestRemoteSessionModal);
19
+ setOpenRequestRemoteSessionModal((openRequestRemoteSessionModal) => !openRequestRemoteSessionModal);
20
20
  };
21
21
  // RSA Aside Section Body
22
22
  const RemoteSessionAgreementSectionBody = (React.createElement("div", { className: "card card-white card-support escalations", ref: ref },
23
23
  React.createElement("h3", { className: "card-heading pf-u-display-flex pf-u-justify-content-space-between" },
24
24
  t('Remote session agreement'),
25
- React.createElement(Popover, { "aria-label": t('Remote Session Helper Info'), bodyContent: t('Before Red Hat logs into your systems to analyze your support issue during a remote session, Red Hat needs your approval and authorization for such remote access.'), footerContent: React.createElement("a", { href: "/articles/3566571", target: "_blank", rel: "noopener noreferrer", "aria-label": t('Read more about remote sessions') }, t('Read more about remote sessions')) },
25
+ React.createElement(Popover, { "aria-label": t('Remote Session Helper Info'), bodyContent: t('Before Red Hat logs into your systems to analyze your support issue during a remote session, Red Hat needs your approval and authorization for such remote access'), footerContent: React.createElement("a", { href: "/articles/3566571", target: "_blank", rel: "noopener noreferrer", "aria-label": t('Read more about remote sessions') }, t('Read more about remote sessions')) },
26
26
  React.createElement(InfoCircleIcon, null))),
27
27
  React.createElement("div", { className: "card-body" },
28
28
  React.createElement("p", null,
@@ -1,2 +1,3 @@
1
1
  export * from './RemoteSessionAgreement';
2
+ export * from './ESSRemoteSession';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from './RemoteSessionAgreement';
2
+ export * from './ESSRemoteSession';
@@ -1 +1 @@
1
- {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eA4BnD"}
1
+ {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AAqBA,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eA4CnD"}
@@ -1,6 +1,9 @@
1
1
  import { Flex, FlexItem } from '@patternfly/react-core';
2
+ import { useGlobalStateContext } from '@rh-support/react-context';
3
+ import { isSpecialSupportOfferingEnabled } from '@rh-support/utils';
4
+ import { isEqual } from 'lodash';
2
5
  import React from 'react';
3
- import { useCaseDispatch } from '../../context/CaseContext';
6
+ import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
4
7
  import { setCaseDetails } from '../../reducers/CaseReducer';
5
8
  import CaseGroup from '../CaseInformation/CaseGroup';
6
9
  import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
@@ -10,14 +13,21 @@ import Severity from '../CaseInformation/Severity';
10
13
  import SupportLevel from '../CaseInformation/SupportLevel';
11
14
  import CaseLanguageSelector from './CaseLanguageSelector';
12
15
  import { Cep } from './Cep';
16
+ import ESSRemoteSessionCheckBox from './ESSRemoteSessionCheckBox';
13
17
  import OpenReferenceNumber from './OpenReferenceNumber';
14
18
  import { RHAssociatesSelector } from './RHAssociatesSelector';
15
19
  import CaseContactSelector from './SendNotifications/CaseContactSelector';
16
20
  export default function CaseManagement(props) {
21
+ var _a;
17
22
  const caseDispatch = useCaseDispatch();
18
23
  const onSeverityChange = (payload) => {
19
24
  setCaseDetails(caseDispatch, payload);
20
25
  };
26
+ const { globalMetadataState: { allProducts }, } = useGlobalStateContext();
27
+ const { product } = useCaseSelector((state) => ({
28
+ product: state.caseDetails.product,
29
+ }), isEqual);
30
+ const selectedProduct = product;
21
31
  return (React.createElement("form", null,
22
32
  React.createElement(SupportLevel, null),
23
33
  React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
@@ -32,5 +42,6 @@ export default function CaseManagement(props) {
32
42
  React.createElement(CaseContactSelector, null),
33
43
  React.createElement(RHAssociatesSelector, null),
34
44
  React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
35
- React.createElement(Cep, null)));
45
+ React.createElement(Cep, null),
46
+ isSpecialSupportOfferingEnabled((_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, selectedProduct) && (React.createElement(ESSRemoteSessionCheckBox, null))));
36
47
  }
@@ -0,0 +1,3 @@
1
+ declare const ESSRemoteSessionCheck: () => JSX.Element;
2
+ export default ESSRemoteSessionCheck;
3
+ //# sourceMappingURL=ESSRemoteSessionCheckBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ESSRemoteSessionCheckBox.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/ESSRemoteSessionCheckBox.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,qBAAqB,mBAmD1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { Checkbox } from '@patternfly/react-core';
2
+ import isEqual from 'lodash/isEmpty';
3
+ import React, { useState } from 'react';
4
+ import { Trans, useTranslation } from 'react-i18next';
5
+ import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
6
+ import { setCaseDetails, updateCaseDetails } from '../../reducers/CaseReducer';
7
+ const ESSRemoteSessionCheck = () => {
8
+ const { t } = useTranslation();
9
+ const { caseNumber, isCaseUpdating } = useCaseSelector((state) => ({
10
+ caseNumber: state.caseDetails.caseNumber,
11
+ status: state.caseDetails.status,
12
+ isCaseUpdating: state.isCaseUpdating,
13
+ }), isEqual);
14
+ const caseDispatch = useCaseDispatch();
15
+ const [remoteSessionChecked, setRemoteSessionChecked] = useState(false);
16
+ const handleEssRemoteSessionChange = (checked) => {
17
+ remoteSessionChecked &&
18
+ setCaseDetails(caseDispatch, {
19
+ screenSessionRequested: checked,
20
+ });
21
+ try {
22
+ updateCaseDetails(caseDispatch, caseNumber, { screenSessionRequested: checked });
23
+ }
24
+ catch (e) {
25
+ setCaseDetails(caseDispatch, {
26
+ screenSessionRequested: false,
27
+ });
28
+ updateCaseDetails(caseDispatch, caseNumber, { screenSessionRequested: false });
29
+ }
30
+ };
31
+ const handleChange = (checked) => {
32
+ setRemoteSessionChecked(checked);
33
+ handleEssRemoteSessionChange(checked);
34
+ };
35
+ return (React.createElement(Checkbox, { id: "case-management-remote-session", label: React.createElement(React.Fragment, null,
36
+ React.createElement(Trans, null, "I want a"),
37
+ ' ',
38
+ React.createElement("a", { href: "https://access.redhat.com/articles/3566571", target: "_blank", rel: "noopener noreferrer" },
39
+ React.createElement(Trans, null, "remote session"))), description: t('Red Hat will add a comment to your case to schedule your remote session.'), "data-tracking-id": "case-management-remote-session-check", isChecked: remoteSessionChecked, onChange: handleChange, isDisabled: isCaseUpdating }));
40
+ };
41
+ export default ESSRemoteSessionCheck;
@@ -1 +1 @@
1
- {"version":3,"file":"Issue.d.ts","sourceRoot":"","sources":["../../../../src/components/Issue/Issue.tsx"],"names":[],"mappings":"AAmBA,MAAM,CAAC,OAAO,UAAU,KAAK,gBA0F5B"}
1
+ {"version":3,"file":"Issue.d.ts","sourceRoot":"","sources":["../../../../src/components/Issue/Issue.tsx"],"names":[],"mappings":"AAmBA,MAAM,CAAC,OAAO,UAAU,KAAK,gBA2F5B"}
@@ -27,6 +27,7 @@ export default function Issue() {
27
27
  const onCaseDetailsChange = (caseDetails) => {
28
28
  setCaseDetails(caseDispatch, caseDetails);
29
29
  };
30
+ // To handle change of KTQ1
30
31
  const onKTQ1IssueChange = (value, e) => {
31
32
  const ktQ1Local = isEmpty(value === null || value === void 0 ? void 0 : value.trim()) ? '' : value;
32
33
  const description = getUpdatedDescription(ktQ1Local, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.15.78",
29
+ "@cee-eng/hydrajs": "4.15.81",
30
30
  "@cee-eng/ui-toolkit": "1.1.6",
31
31
  "@patternfly/patternfly": "4.196.7",
32
32
  "@patternfly/pfe-accordion": "1.12.3",
@@ -56,7 +56,7 @@
56
56
  "react-virtualized": "^9.21.2"
57
57
  },
58
58
  "dependencies": {
59
- "@cee-eng/hydrajs": "4.15.78",
59
+ "@cee-eng/hydrajs": "4.15.81",
60
60
  "@cee-eng/ui-toolkit": "1.1.6",
61
61
  "@patternfly/patternfly": "4.196.7",
62
62
  "@patternfly/pfe-accordion": "1.12.3",
@@ -66,11 +66,11 @@
66
66
  "@patternfly/react-core": "4.264.0",
67
67
  "@progress/kendo-drawing": "^1.6.0",
68
68
  "@progress/kendo-react-pdf": "^3.12.0",
69
- "@rh-support/components": "2.0.5",
70
- "@rh-support/react-context": "2.0.5",
71
- "@rh-support/types": "2.0.1",
72
- "@rh-support/user-permissions": "2.0.5",
73
- "@rh-support/utils": "2.0.5",
69
+ "@rh-support/components": "2.0.7",
70
+ "@rh-support/react-context": "2.0.7",
71
+ "@rh-support/types": "2.0.2",
72
+ "@rh-support/user-permissions": "2.0.7",
73
+ "@rh-support/utils": "2.0.7",
74
74
  "@types/react-redux": "^7.1.12",
75
75
  "@types/redux": "^3.6.0",
76
76
  "dompurify": "^2.4.1",
@@ -134,5 +134,5 @@
134
134
  "not ie <= 11",
135
135
  "not op_mini all"
136
136
  ],
137
- "gitHead": "81f772293e311afe41a2b5b09d0e122c9aa168b6"
137
+ "gitHead": "c05aa6c2542ab83bfc1984ec113a116f0885d123"
138
138
  }