@rh-support/troubleshoot 2.1.17 → 2.1.19
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/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +6 -15
- package/lib/esm/components/CaseEditView/RequestRemoteSession/index.d.ts +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/index.js +0 -1
- package/lib/esm/components/CaseInformation/FileDiag.d.ts +5 -1
- package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/FileDiag.js +2 -2
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +2 -15
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.js +5 -2
- package/lib/esm/components/Recommendations/RecommendationFeedbackModal.js +1 -1
- package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +25 -9
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +2 -12
- package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +4 -9
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +16 -11
- package/lib/esm/components/wizardLayout/WizardAside.js +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +50 -4
- package/lib/esm/reducers/CaseConstNTypes.d.ts +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +1 -1
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +2 -5
- package/lib/esm/reducers/CaseReducer.d.ts +0 -1
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +1 -21
- package/lib/esm/scss/_main.scss +13 -0
- package/lib/esm/scss/_pf4-overrides.scss +24 -1
- package/package.json +6 -6
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts +0 -12
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.js +0 -48
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts +0 -15
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +0 -108
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts +0 -17
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +0 -181
- package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.d.ts +0 -3
- package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.d.ts.map +0 -1
- package/lib/esm/components/CaseManagement/ESSRemoteSessionCheckBox.js +0 -167
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ESSRemoteSessionCheckBox.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/ESSRemoteSessionCheckBox.tsx"],"names":[],"mappings":"AA8BA,QAAA,MAAM,qBAAqB,mBAyO1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,167 +0,0 @@
|
|
|
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 { useFetch } from '@rh-support/components';
|
|
15
|
-
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
16
|
-
import isEqual from 'lodash/isEmpty';
|
|
17
|
-
import React, { useContext, useEffect, useState } from 'react';
|
|
18
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
19
|
-
import { TnC } from '../../constants/tncConstants';
|
|
20
|
-
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
21
|
-
import { setCaseDetails } 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
|
-
const ESSRemoteSessionCheck = () => {
|
|
38
|
-
const { t } = useTranslation();
|
|
39
|
-
const { request } = useFetch(publicApi.terms.getRequiredTerms);
|
|
40
|
-
const [selectedTranslation, setSelectedTranslation] = useState({
|
|
41
|
-
id: '5001',
|
|
42
|
-
isDefault: false,
|
|
43
|
-
localeCode: 'en_US',
|
|
44
|
-
pdfDownloadUrl: '/wapps/tnc/viewterms/7275e6f5-5f32-4d9c-aeaf-c796b56817fd',
|
|
45
|
-
termsPdfId: '7275e6f5-5f32-4d9c-aeaf-c796b56817fd',
|
|
46
|
-
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.',
|
|
47
|
-
translatedInstructions: 'Please read and accept the Remote Access Rider terms below to allow Red Hat to access your network or systems.',
|
|
48
|
-
translatedTermsName: 'Remote Access Rider',
|
|
49
|
-
});
|
|
50
|
-
const [allTranslations, setAllTranslations] = useState({});
|
|
51
|
-
const [agreeLoading, setAgreeLoading] = useState(false);
|
|
52
|
-
const [isLangSelectorDropdownOpen, setisLangSelectorDropdownOpen] = useState(false);
|
|
53
|
-
const [isTermsChecked, setIsTermsChecked] = useState(false);
|
|
54
|
-
const [isRSAModalOpen, setIsRSAModalOpen] = useState(false);
|
|
55
|
-
const { isCaseUpdating, screenSessionRequested } = useCaseSelector((state) => ({
|
|
56
|
-
caseNumber: state.caseDetails.caseNumber,
|
|
57
|
-
isCaseUpdating: state.isCaseUpdating,
|
|
58
|
-
screenSessionRequested: state.caseDetails.screenSessionRequested,
|
|
59
|
-
}), isEqual);
|
|
60
|
-
const caseDispatch = useCaseDispatch();
|
|
61
|
-
const [remoteSessionChecked, setRemoteSessionChecked] = useState(screenSessionRequested);
|
|
62
|
-
const { globalMetadataState: { loggedInUser, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
63
|
-
const siteCode = TnC.REMOTE_RIDER_SITE_CODE;
|
|
64
|
-
const eventCode = TnC.REMOTER_RIDER_EVENT_CODE;
|
|
65
|
-
const user = loggedInUser.data.ssoUsername === undefined ? '' : loggedInUser.data.ssoUsername;
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
const fetchTerms = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
-
try {
|
|
69
|
-
const response = yield request(siteCode, eventCode, user);
|
|
70
|
-
let defaultTranslation = response[0].translations[0];
|
|
71
|
-
const translationLangInfoMap = response[0].translations.reduce((allTranslationsmap, translation) => {
|
|
72
|
-
if (translation.isDefault) {
|
|
73
|
-
defaultTranslation = translation;
|
|
74
|
-
}
|
|
75
|
-
allTranslationsmap[translation['localeCode']] = translation;
|
|
76
|
-
return allTranslationsmap;
|
|
77
|
-
}, {});
|
|
78
|
-
setSelectedTranslation(defaultTranslation);
|
|
79
|
-
setAllTranslations(translationLangInfoMap);
|
|
80
|
-
}
|
|
81
|
-
catch (e) {
|
|
82
|
-
console.log(e);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
fetchTerms();
|
|
86
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
-
}, []);
|
|
88
|
-
const handleCheckBoxChange = (checked) => {
|
|
89
|
-
setRemoteSessionChecked(checked);
|
|
90
|
-
setCaseDetails(caseDispatch, {
|
|
91
|
-
screenSessionRequested: checked,
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
const handleTermsCheckBoxChange = (checked) => {
|
|
95
|
-
setRemoteSessionChecked(checked);
|
|
96
|
-
setIsRSAModalOpen(checked);
|
|
97
|
-
};
|
|
98
|
-
// To handle RSA submit
|
|
99
|
-
const submitRemoteSessionAgreement = () => {
|
|
100
|
-
setAgreeLoading(true);
|
|
101
|
-
setRemoteSessionChecked(isTermsChecked);
|
|
102
|
-
setCaseDetails(caseDispatch, {
|
|
103
|
-
remoteSessionTermsAcked: isTermsChecked,
|
|
104
|
-
screenSessionRequested: isTermsChecked,
|
|
105
|
-
});
|
|
106
|
-
setAgreeLoading(false);
|
|
107
|
-
setIsRSAModalOpen(false);
|
|
108
|
-
};
|
|
109
|
-
// Handle terms checkbox
|
|
110
|
-
const onCheckBoxChange = (value) => {
|
|
111
|
-
setIsTermsChecked(value);
|
|
112
|
-
};
|
|
113
|
-
// Handle language change
|
|
114
|
-
const onLangChange = (event, lang) => {
|
|
115
|
-
setSelectedTranslation(allTranslations[lang]);
|
|
116
|
-
setisLangSelectorDropdownOpen(false);
|
|
117
|
-
};
|
|
118
|
-
// To handle dropdown toggle
|
|
119
|
-
const onDropdownToggle = (toggle) => setisLangSelectorDropdownOpen(toggle);
|
|
120
|
-
// To handle modal cancel and close
|
|
121
|
-
const onCancel = () => {
|
|
122
|
-
setIsRSAModalOpen(false);
|
|
123
|
-
setCaseDetails(caseDispatch, {
|
|
124
|
-
remoteSessionTermsAcked: false,
|
|
125
|
-
screenSessionRequested: false,
|
|
126
|
-
});
|
|
127
|
-
setRemoteSessionChecked(false);
|
|
128
|
-
setAgreeLoading(false);
|
|
129
|
-
};
|
|
130
|
-
const modalActions = [
|
|
131
|
-
React.createElement(Button, { key: "submit", "aria-label": t('I agree'), variant: ButtonVariant.primary, onClick: submitRemoteSessionAgreement, "data-tracking-id": "ess-remote-session-agreement-check", isLoading: agreeLoading, isDisabled: !isTermsChecked || agreeLoading }, t('I agree')),
|
|
132
|
-
];
|
|
133
|
-
// To check if terms have been accepted on account level
|
|
134
|
-
const termsAcceptedOnAccountLevel = loggedInUsersAccount.data.remoteSessionTermsAcked;
|
|
135
|
-
return (React.createElement(React.Fragment, null,
|
|
136
|
-
React.createElement(Checkbox, { id: "case-management-remote-session", label: React.createElement(React.Fragment, null,
|
|
137
|
-
React.createElement(Trans, null, "I want a"),
|
|
138
|
-
' ',
|
|
139
|
-
React.createElement("a", { href: "https://access.redhat.com/articles/3566571", target: "_blank", rel: "noopener noreferrer" },
|
|
140
|
-
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: termsAcceptedOnAccountLevel ? handleCheckBoxChange : handleTermsCheckBoxChange, isDisabled: isCaseUpdating, className: "rsa-checkbox" }),
|
|
141
|
-
React.createElement(Modal, { id: "remote-session-check-modal", "aria-label": t('Remote Session Agreement'), title: t('Remote Session Agreement'), isOpen: isRSAModalOpen, onClose: onCancel, actions: modalActions },
|
|
142
|
-
React.createElement(React.Fragment, null,
|
|
143
|
-
React.createElement("p", { className: "pf-u-mt-xs" },
|
|
144
|
-
React.createElement(Trans, null,
|
|
145
|
-
"Your acceptance of this Remote Access Agreement is required",
|
|
146
|
-
' ',
|
|
147
|
-
React.createElement("strong", null, "for creating a case"),
|
|
148
|
-
" for Red Hat\u2019s support team to remotely access your network or systems.")),
|
|
149
|
-
React.createElement("p", { className: "pf-u-mt-md" },
|
|
150
|
-
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.")),
|
|
151
|
-
React.createElement("p", { className: "pf-u-mt-md" },
|
|
152
|
-
React.createElement(Trans, null, "Please read and accept the Remote Access Agreement terms below to allow Red Hat to access your network or systems.")),
|
|
153
|
-
React.createElement("div", null,
|
|
154
|
-
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))))),
|
|
155
|
-
React.createElement("a", { "aria-label": t('Download'), "data-tracking-id": "ess-rsa-modal-terms-download", className: "pf-u-ml-md", href: selectedTranslation.pdfDownloadUrl, rel: "noopener noreferrer", target: "_blank" },
|
|
156
|
-
t('Download'),
|
|
157
|
-
" ",
|
|
158
|
-
React.createElement(DownloadIcon, { className: "pf-u-ml-xs" }))),
|
|
159
|
-
React.createElement("div", null,
|
|
160
|
-
React.createElement(Checkbox, { className: "pf-u-mt-md rsa-checkbox", id: "terms-accept-checkbox", label: React.createElement(React.Fragment, null,
|
|
161
|
-
React.createElement(Trans, null, "I have read and agree to the"),
|
|
162
|
-
' ',
|
|
163
|
-
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": "ccase-management-ess-request-rsa" },
|
|
164
|
-
React.createElement(Trans, null, "terms "),
|
|
165
|
-
React.createElement(ExternalLinkAltIcon, null))), isChecked: isTermsChecked, "aria-label": t('I have read and agree to the terms'), onChange: onCheckBoxChange }))))));
|
|
166
|
-
};
|
|
167
|
-
export default ESSRemoteSessionCheck;
|