@rh-support/troubleshoot 2.1.12 → 2.1.14

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.
@@ -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,eA0V7C"}
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,eA6V7C"}
@@ -33,7 +33,7 @@ import { ESSRemoteSession, RemoteSessionAgreement } from './RequestRemoteSession
33
33
  export function CaseDetailsAside(props) {
34
34
  var _a, _b;
35
35
  const { t } = useTranslation();
36
- const { severity, status, isFetchingCaseDetails, isFetchingCaseDetailsError, acceptedRemoteSessionTerms, screenSessionRequested, product, } = useCaseSelector((state) => ({
36
+ const { severity, status, isFetchingCaseDetails, isFetchingCaseDetailsError, acceptedRemoteSessionTerms, screenSessionRequested, product, remoteSessionTermsAcked, } = useCaseSelector((state) => ({
37
37
  severity: state.caseDetails.severity,
38
38
  status: state.caseDetails.status,
39
39
  isFetchingCaseDetails: state.isFetchingCaseDetails,
@@ -41,6 +41,7 @@ export function CaseDetailsAside(props) {
41
41
  acceptedRemoteSessionTerms: state.caseDetails.remoteSessionTermsAcked,
42
42
  screenSessionRequested: state.caseDetails.screenSessionRequested,
43
43
  product: state.caseDetails.product,
44
+ remoteSessionTermsAcked: state.caseDetails.remoteSessionTermsAcked,
44
45
  }), isEqual);
45
46
  const selectedProduct = product;
46
47
  const { caseDetailsPageState: { caseEscalations }, } = useCaseDetailsPageStateContext();
@@ -208,6 +209,6 @@ export function CaseDetailsAside(props) {
208
209
  React.createElement(ActiveCustomerEscalation, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef }))),
209
210
  isExternal &&
210
211
  (isESSCustomer ? (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading requesting remote session') } },
211
- React.createElement(ESSRemoteSession, { screenSessionRequested: screenSessionRequested, caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, readOnly: canReadCase }))) : (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading remote session agreement') } },
212
+ React.createElement(ESSRemoteSession, { screenSessionRequested: screenSessionRequested, caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, readOnly: canReadCase, remoteSessionTermsAcked: remoteSessionTermsAcked }))) : (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading remote session agreement') } },
212
213
  React.createElement(RemoteSessionAgreement, { caseNumber: caseNumber, caseSeverity: severity, caseStatus: status, ref: createEscalationRef, acceptedRemoteSessionTerms: acceptedRemoteSessionTerms, readOnly: canReadCase }))))))));
213
214
  }
@@ -5,6 +5,7 @@ interface IProps {
5
5
  caseStatus: string;
6
6
  readOnly: boolean;
7
7
  screenSessionRequested: boolean;
8
+ remoteSessionTermsAcked?: boolean;
8
9
  }
9
10
  export declare const ESSRemoteSession: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLDivElement>>;
10
11
  export {};
@@ -1 +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"}
1
+ {"version":3,"file":"ESSRemoteSession.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,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;IAChC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,gBAAgB,+EA0G3B,CAAC"}
@@ -3,12 +3,14 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-ic
3
3
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
4
4
  import React, { forwardRef, useContext, useRef, useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
+ import { TnC } from '../../../constants/tncConstants';
6
7
  import { ESSRemoteSessionModal } from './ESSRemoteSessionModal';
8
+ import { NewEssRSAModal } from './NewEssRSAModal';
7
9
  export const ESSRemoteSession = forwardRef((props, ref) => {
8
10
  const tooltipRef = useRef();
9
11
  const { t } = useTranslation();
10
12
  const canEditCase = useCanEditCase();
11
- const { caseNumber, caseStatus, screenSessionRequested, readOnly } = props;
13
+ const { caseNumber, caseStatus, screenSessionRequested, readOnly, remoteSessionTermsAcked } = props;
12
14
  const { globalMetadataState: { loggedInUser, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
13
15
  const [openESSRemoteSessionModal, setOpenESSRemoteSessionModal] = useState(false);
14
16
  // To toggle ESS RS Modal
@@ -31,8 +33,8 @@ export const ESSRemoteSession = forwardRef((props, ref) => {
31
33
  React.createElement("li", null, t('Agreed upon by both Red Hat and you, the end user'))),
32
34
  React.createElement("p", { className: "rrs-light-grey-text" }, t('Red Hat will add a comment to your case to schedule your remote session.')),
33
35
  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')))));
36
+ 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, isDisabled: screenSessionRequested }, screenSessionRequested ? t('Remote session requested') : t('Request remote session')))));
35
37
  return (React.createElement(React.Fragment, null,
36
38
  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 })));
39
+ remoteSessionTermsAcked ? (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 })) : (React.createElement(NewEssRSAModal, { caseNumber: caseNumber, caseStatus: caseStatus, show: openESSRemoteSessionModal, onClose: toggleESSRemoteSessionModal, siteCode: TnC.REMOTE_RIDER_SITE_CODE, eventCode: TnC.REMOTER_RIDER_EVENT_CODE, loggedInUser: loggedInUser.data.ssoUsername === undefined ? '' : loggedInUser.data.ssoUsername, loggedInUserRights: loggedInUserRights, readOnly: readOnly }))));
38
40
  });
@@ -1 +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"}
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;AAiBxD,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,eAgKlD"}
@@ -17,7 +17,7 @@ import { useCaseDispatch } from '../../../context/CaseContext';
17
17
  import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
18
18
  import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
19
19
  import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
20
- import { checkForCaseStatusToggleOnAttachOrComment, setCaseDetails, setRemoteRiderFlag, updateCaseDetails, } from '../../../reducers/CaseReducer';
20
+ import { checkForCaseStatusToggleOnAttachOrComment, setCaseDetails, setRemoteRiderFlag, } from '../../../reducers/CaseReducer';
21
21
  export function ESSRemoteSessionModal(props) {
22
22
  const { t } = useTranslation();
23
23
  const caseDispatch = useCaseDispatch();
@@ -36,7 +36,6 @@ export function ESSRemoteSessionModal(props) {
36
36
  const submitESSRemoteSessionRequest = () => __awaiter(this, void 0, void 0, function* () {
37
37
  const requestComment = t('Submitted a remote session request.');
38
38
  try {
39
- yield updateCaseDetails(caseDispatch, props.caseNumber, { screenSessionRequested: true });
40
39
  setCaseDetails(caseDispatch, {
41
40
  screenSessionRequested: true,
42
41
  });
@@ -0,0 +1,17 @@
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
+ termsAcked?: boolean;
7
+ siteCode: string;
8
+ eventCode: string;
9
+ loggedInUser: string;
10
+ caseStatus: string;
11
+ show: boolean;
12
+ loggedInUserRights: IApiResponseDetails<UserAuth>;
13
+ readOnly: boolean;
14
+ }
15
+ export declare function NewEssRSAModal(props: IProps): JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=NewEssRSAModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NewEssRSAModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/NewEssRSAModal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAiBxD,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;AAiBD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eA+P3C"}
@@ -0,0 +1,181 @@
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, Checkbox, Modal, Select, SelectOption } from '@patternfly/react-core';
12
+ import DownloadIcon from '@patternfly/react-icons/dist/esm/icons/download-icon';
13
+ import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
14
+ import { ToastNotification, useFetch } from '@rh-support/components';
15
+ import React, { useEffect, useState } from 'react';
16
+ import { Trans, useTranslation } from 'react-i18next';
17
+ import { useCaseDispatch } from '../../../context/CaseContext';
18
+ import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
19
+ import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../context/CaseDiscussionTabContext';
20
+ import { updateDiscussionStateComments } from '../../../reducers/CaseDiscussionTabReducer';
21
+ import { checkForCaseStatusToggleOnAttachOrComment, setRemoteRiderFlag, updateCaseDetails, } from '../../../reducers/CaseReducer';
22
+ const getLocaleNameFromLocalCode = (localeCode) => {
23
+ if ('Intl' in window && 'DisplayNames' in Intl) {
24
+ try {
25
+ const [lang, locale] = localeCode.includes('_') ? localeCode.split('_') : localeCode.split('-');
26
+ // https://github.com/microsoft/TypeScript/issues/41338
27
+ const langName = new Intl.DisplayNames([lang], { type: 'language' });
28
+ const regionNamesInLang = new Intl.DisplayNames([lang], { type: 'region' });
29
+ return `${regionNamesInLang.of(locale)} (${langName.of(lang)})`;
30
+ }
31
+ catch (e) {
32
+ return localeCode;
33
+ }
34
+ }
35
+ return localeCode;
36
+ };
37
+ export function NewEssRSAModal(props) {
38
+ const { t } = useTranslation();
39
+ const [isTermsChecked, setIsTermsChecked] = useState(false);
40
+ const { request } = useFetch(publicApi.terms.getRequiredTerms);
41
+ const [isLangSelectorDropdownOpen, setisLangSelectorDropdownOpen] = useState(false);
42
+ const caseDispatch = useCaseDispatch();
43
+ const [selectedTranslation, setSelectedTranslation] = useState({
44
+ id: '5001',
45
+ isDefault: false,
46
+ localeCode: 'en_US',
47
+ pdfDownloadUrl: '/wapps/tnc/viewterms/7275e6f5-5f32-4d9c-aeaf-c796b56817fd',
48
+ termsPdfId: '7275e6f5-5f32-4d9c-aeaf-c796b56817fd',
49
+ translatedDescription: 'Your acceptance of this Remote Access Rider is required when you request Red Hat’s support team to remotely access your network or systems. Remote access to your network or systems is not a standard Red Hat problem resolution process. Before Red Hat logs onto your systems to analyze your support issue, Red Hat needs your approval and authorization for such remote access.',
50
+ translatedInstructions: 'Please read and accept the Remote Access Rider terms below to allow Red Hat to access your network or systems.',
51
+ translatedTermsName: 'Remote Access Rider',
52
+ });
53
+ const [allTranslations, setAllTranslations] = useState({});
54
+ const [agreeLoading, setAgreeLoading] = useState(false);
55
+ useEffect(() => {
56
+ const fetchTerms = () => __awaiter(this, void 0, void 0, function* () {
57
+ try {
58
+ const { siteCode, eventCode, loggedInUser } = props;
59
+ const response = yield request(siteCode, eventCode, loggedInUser);
60
+ let defaultTranslation = response[0].translations[0];
61
+ const translationLangInfoMap = response[0].translations.reduce((allTranslationsmap, translation) => {
62
+ if (translation.isDefault) {
63
+ defaultTranslation = translation;
64
+ }
65
+ allTranslationsmap[translation['localeCode']] = translation;
66
+ return allTranslationsmap;
67
+ }, {});
68
+ setSelectedTranslation(defaultTranslation);
69
+ setAllTranslations(translationLangInfoMap);
70
+ }
71
+ catch (e) {
72
+ console.log(e);
73
+ }
74
+ });
75
+ fetchTerms();
76
+ // eslint-disable-next-line react-hooks/exhaustive-deps
77
+ }, []);
78
+ const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
79
+ propgateErrors: true,
80
+ });
81
+ const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
82
+ const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
83
+ const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
84
+ // To handle modal cancel and close
85
+ const onCancel = () => {
86
+ props.onClose && props.onClose();
87
+ };
88
+ // Function to ack remote session terms and post comment
89
+ const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
90
+ const requestComment = t('Submitted a remote session request.');
91
+ try {
92
+ yield updateCaseDetails(caseDispatch, props.caseNumber, { remoteSessionTermsAcked: true });
93
+ try {
94
+ yield updateCaseDetails(caseDispatch, props.caseNumber, { screenSessionRequested: true });
95
+ setRemoteRiderFlag(caseDispatch, true);
96
+ try {
97
+ yield postCommentRequest({
98
+ caseNumber: props.caseNumber,
99
+ commentBody: requestComment,
100
+ contentType: 'markdown',
101
+ });
102
+ updateDiscussionStateComments(dispatchDiscussion, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
103
+ checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
104
+ setAgreeLoading(false);
105
+ ToastNotification.addSuccessMessage(t('Remote Access Rider agreement has been accepted'), t('This action does not initiate a remote session. Please make a case comment if you would like to submit a request.'));
106
+ }
107
+ catch (e) {
108
+ ToastNotification.addWarningMessage(t('Could not submit a comment'), t('Rest assured, we have noted you have accepted the agreement'));
109
+ setAgreeLoading(false);
110
+ props.onClose();
111
+ }
112
+ props.onClose();
113
+ }
114
+ catch (e) {
115
+ yield updateCaseDetails(caseDispatch, props.caseNumber, { screenSessionRequested: false });
116
+ ToastNotification.addDangerMessage(t('Could not submit a request for remote session'), t('Please try again.'));
117
+ props.onClose();
118
+ }
119
+ }
120
+ catch (e) {
121
+ if (props.readOnly) {
122
+ ToastNotification.addDangerMessage(t('You are not authorized to update this case.'));
123
+ }
124
+ else {
125
+ ToastNotification.addDangerMessage(t('Could not accept the remote access rider agreement'), t('Please try again.'));
126
+ }
127
+ setAgreeLoading(false);
128
+ setIsTermsChecked(false);
129
+ props.onClose();
130
+ }
131
+ });
132
+ // To check if terms acked and if not disable submit button
133
+ const onSubmit = () => {
134
+ setAgreeLoading(true);
135
+ submitRemoteSessionAgreement(selectedTranslation.termsPdfId);
136
+ };
137
+ // Handle terms checkbox
138
+ const onCheckBoxChange = (value) => {
139
+ setIsTermsChecked(value);
140
+ };
141
+ // Handle language change
142
+ const onLangChange = (event, lang) => {
143
+ setSelectedTranslation(allTranslations[lang]);
144
+ setisLangSelectorDropdownOpen(false);
145
+ };
146
+ // To handle dropdown toggle
147
+ const onDropdownToggle = (toggle) => setisLangSelectorDropdownOpen(toggle);
148
+ // To check and if I agree button is loading
149
+ const isAgreeLoading = agreeLoading || isPostingComment;
150
+ // ESS RSA Modal Actions
151
+ const modalActions = [
152
+ React.createElement(Button, { "aria-label": t('I agree'), variant: ButtonVariant.primary, onClick: onSubmit, "data-tracking-id": "remote-session-agreement-check", isLoading: isAgreeLoading, isDisabled: !isTermsChecked || isAgreeLoading }, t('I agree')),
153
+ ];
154
+ // Body of ESS RSA Modal
155
+ const EssRSAModalBody = () => {
156
+ return (React.createElement(React.Fragment, null,
157
+ React.createElement("p", { className: "pf-u-mt-xs" },
158
+ React.createElement(Trans, null,
159
+ "Your acceptance of this Remote Access Rider is required ",
160
+ React.createElement("strong", null, "for each case"),
161
+ " when you request Red Hat\u2019s support team to directly access your network or systems.")),
162
+ React.createElement("p", { className: "pf-u-mt-md" },
163
+ React.createElement(Trans, null, "Remote access to your network or systems is not a standard Red Hat problem resolution process. 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.")),
164
+ React.createElement("p", { className: "pf-u-mt-md" },
165
+ React.createElement(Trans, null, "Please read and accept the Remote Access Rider terms below to allow Red Hat to access your network or systems.")),
166
+ React.createElement("div", null,
167
+ React.createElement(Select, { className: "pf-u-mt-md", "aria-label": t('Select language'), id: "terms-language-selector", selections: selectedTranslation.localeCode, onSelect: onLangChange, isOpen: isLangSelectorDropdownOpen, menuAppendTo: document.body, placeholderText: t('Select an option that best fits'), onToggle: onDropdownToggle, width: 350 }, Object.keys(allTranslations).map((option, index) => (React.createElement(SelectOption, { key: index, value: option }, getLocaleNameFromLocalCode(option))))),
168
+ React.createElement("a", { "aria-label": t('Download'), "data-tracking-id": "rsa-modal-terms-download", className: "pf-u-ml-md", href: selectedTranslation.pdfDownloadUrl, rel: "noopener noreferrer", target: "_blank" },
169
+ t('Download'),
170
+ " ",
171
+ React.createElement(DownloadIcon, { className: "pf-u-ml-xs" }))),
172
+ React.createElement("div", null,
173
+ React.createElement(Checkbox, { className: "pf-u-mt-md rsa-checkbox", id: "terms-accept-checkbox", label: React.createElement(React.Fragment, null,
174
+ React.createElement(Trans, null, "I have read and agree to the"),
175
+ ' ',
176
+ React.createElement("a", { className: "pf-c-button pf-m-link pf-m-inline align-link-items", rel: "noopener noreferrer", target: "_blank", href: selectedTranslation.pdfDownloadUrl, "data-tracking-id": "case-details-request-remote-session-terms" },
177
+ React.createElement(Trans, null, "terms "),
178
+ React.createElement(ExternalLinkAltIcon, null))), isChecked: isTermsChecked, "aria-label": t('I have read and agree to the terms'), onChange: onCheckBoxChange }))));
179
+ };
180
+ return (React.createElement(Modal, { id: "remote-session-agreement-modal", "aria-label": t('Remote Session Agreement'), title: t('Remote Session Agreement'), isOpen: props.show, onClose: onCancel, actions: modalActions }, EssRSAModalBody()));
181
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AA4BA,MAAM,CAAC,OAAO,UAAU,UAAU,gBA4RjC"}
1
+ {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AAkCA,MAAM,CAAC,OAAO,UAAU,UAAU,gBAiSjC"}
@@ -3,7 +3,7 @@ import { ActionList, ActionListItem, Button, Text, TextVariants } from '@pattern
3
3
  import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
4
4
  import { AlertMessage, AlertType, useFetch } from '@rh-support/components';
5
5
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
6
- import { getConfigField, getRedhatDotComHost, PCM_CONFIG_FIELD_TYPE, PreviousCaseTypes } from '@rh-support/utils';
6
+ import { getConfigField, getRedhatDotComHost, isSpecialSupportOfferingEnabled, PCM_CONFIG_FIELD_TYPE, PreviousCaseTypes, } from '@rh-support/utils';
7
7
  import find from 'lodash/find';
8
8
  import isEmpty from 'lodash/isEmpty';
9
9
  import isEqual from 'lodash/isEqual';
@@ -25,7 +25,8 @@ import { isUploadedAndAnalyzed, isUploadingAttachment } from '../shared/fileUplo
25
25
  import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
26
26
  import Suggestions from '../Suggestions/Suggestions';
27
27
  export default function SubmitCase() {
28
- const { entitlementSla, severity, caseNumber, caseType, version, versionsDetails, addNotifiedUserError, isCreatingCase, caseCreationError, caseCreationErrorMessage, selectedAccountDetails, } = useCaseSelector((state) => ({
28
+ var _a;
29
+ const { entitlementSla, severity, caseNumber, caseType, version, versionsDetails, addNotifiedUserError, isCreatingCase, caseCreationError, caseCreationErrorMessage, selectedAccountDetails, product, } = useCaseSelector((state) => ({
29
30
  entitlementSla: state.caseDetails.entitlementSla,
30
31
  severity: state.caseDetails.severity,
31
32
  caseNumber: state.caseDetails.caseNumber,
@@ -37,14 +38,16 @@ export default function SubmitCase() {
37
38
  caseCreationError: state.caseCreationError,
38
39
  caseCreationErrorMessage: state.caseCreationErrorMessage,
39
40
  selectedAccountDetails: state.selectedAccountDetails,
41
+ product: state.caseDetails.product,
40
42
  }), isEqual);
43
+ const selectedProduct = product;
41
44
  const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
42
45
  const { topContentState: { topContent }, } = useContext(TCStateContext);
43
46
  const { rulesState } = useContext(RulesStateContext);
44
47
  const { clusterRecommendationsState: { clusterRecommendations }, } = useContext(ClusterRecommendationsContext);
45
48
  const { attachmentState } = useContext(AttachmentStateContext);
46
49
  const [isRemoteRiderBannerVisible, setIsRemoteRiderBannerVisible] = useState(true);
47
- const { globalMetadataState: { loggedInUser, loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
50
+ const { globalMetadataState: { loggedInUser, loggedInUsersAccount, pcmConfig, allProducts }, } = useContext(GlobalMetadataStateContext);
48
51
  const getBusinessHours = useFetch(publicApi.businessHours.getBusinessHours);
49
52
  const { t } = useTranslation();
50
53
  const showRemoteRiderTermsInline = getConfigField(pcmConfig.data, 'showInlineRemoteRiderTerms', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
@@ -82,12 +85,14 @@ export default function SubmitCase() {
82
85
  ? false
83
86
  : attachmentState.caseFiles.selectedLocalFiles.every((localFile) => !isUploadedAndAnalyzed(localFile));
84
87
  const isNotAnIdea = caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT;
88
+ // To check if the user is ESS Customer and Product has ESS Support
89
+ const isESSCustomer = isSpecialSupportOfferingEnabled((_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, selectedProduct);
85
90
  return (React.createElement("article", { className: "gird-main" },
86
91
  React.createElement(AlertMessage, { className: "push-top", title: t('Failed to add user.'), variant: AlertType.DANGER, show: addNotifiedUserError }),
87
92
  React.createElement(AlertMessage, { className: "push-top", variant: AlertType.DANGER, show: caseCreationError, title: t("Sorry, we're experiencing an error"), isInline: true },
88
93
  React.createElement(React.Fragment, null, caseCreationErrorMessage)),
89
94
  !isCreatingCase && !caseCreationError && (React.createElement(React.Fragment, null,
90
- showRemoteRiderBanner && !loggedInUser.data.isInternal && (React.createElement(RemoteRiderBanner, { onConfirm: onRemoteRiderConfirm, onClose: onRemoteRiderClose, caseNumber: caseNumber, isSecureSupport: loggedInUsersAccount.data.secureSupport })),
95
+ showRemoteRiderBanner && !loggedInUser.data.isInternal && !isESSCustomer && (React.createElement(RemoteRiderBanner, { onConfirm: onRemoteRiderConfirm, onClose: onRemoteRiderClose, caseNumber: caseNumber, isSecureSupport: loggedInUsersAccount.data.secureSupport })),
91
96
  React.createElement("div", { className: "submit-case-header-container" },
92
97
  React.createElement("p", { className: "kicker kicker-sm pf-u-mb-sm" }, !isEmpty(RouteUtils.seBasePath) &&
93
98
  !isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles) ? (React.createElement(React.Fragment, null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -133,5 +133,5 @@
133
133
  "defaults and supports es6-module",
134
134
  "maintained node versions"
135
135
  ],
136
- "gitHead": "19377aef011c0242cb5290e36ee927eace353f27"
136
+ "gitHead": "b58b25951bb84533b380d7868f120eaa33461f5e"
137
137
  }