@rh-support/troubleshoot 2.6.75 → 2.6.77
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/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +36 -15
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +36 -13
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/AskRedHat.js +54 -17
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +4 -0
- package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/UserFeedback.js +5 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +1 -1
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelectorImage.js +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +4 -3
- package/lib/esm/constants/askRedHatMessages.d.ts +12 -12
- package/lib/esm/constants/askRedHatMessages.d.ts.map +1 -1
- package/lib/esm/constants/askRedHatMessages.js +45 -20
- package/lib/esm/css/AskRedHat.css +10 -0
- package/lib/esm/hooks/useARHResponse.d.ts.map +1 -1
- package/lib/esm/hooks/useARHResponse.js +17 -2
- package/lib/esm/i18n/template-de.d.ts +33 -0
- package/lib/esm/i18n/template-de.d.ts.map +1 -1
- package/lib/esm/i18n/template-de.js +33 -0
- package/lib/esm/i18n/template-es.d.ts +33 -0
- package/lib/esm/i18n/template-es.d.ts.map +1 -1
- package/lib/esm/i18n/template-es.js +33 -0
- package/lib/esm/i18n/template-fr.d.ts +33 -0
- package/lib/esm/i18n/template-fr.d.ts.map +1 -1
- package/lib/esm/i18n/template-fr.js +33 -0
- package/lib/esm/i18n/template-it.d.ts +33 -0
- package/lib/esm/i18n/template-it.d.ts.map +1 -1
- package/lib/esm/i18n/template-it.js +33 -0
- package/lib/esm/i18n/template-jp.d.ts +33 -0
- package/lib/esm/i18n/template-jp.d.ts.map +1 -1
- package/lib/esm/i18n/template-jp.js +33 -0
- package/lib/esm/i18n/template-ko.d.ts +33 -0
- package/lib/esm/i18n/template-ko.d.ts.map +1 -1
- package/lib/esm/i18n/template-ko.js +33 -0
- package/lib/esm/i18n/template-pt.d.ts +33 -0
- package/lib/esm/i18n/template-pt.d.ts.map +1 -1
- package/lib/esm/i18n/template-pt.js +33 -0
- package/lib/esm/i18n/template-ru.d.ts +33 -0
- package/lib/esm/i18n/template-ru.d.ts.map +1 -1
- package/lib/esm/i18n/template-ru.js +33 -0
- package/lib/esm/i18n/template-zh.d.ts +33 -1
- package/lib/esm/i18n/template-zh.d.ts.map +1 -1
- package/lib/esm/i18n/template-zh.js +33 -1
- package/lib/esm/reducers/AIResponseConstNTypes.d.ts +12 -2
- package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/AIResponseConstNTypes.js +3 -0
- package/lib/esm/reducers/AIResponseReducer.d.ts +2 -1
- package/lib/esm/reducers/AIResponseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/AIResponseReducer.js +9 -4
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
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;AAiBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,
|
|
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;AAiBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAmY7C"}
|
|
@@ -11,7 +11,7 @@ import { publicApi } from '@cee-eng/hydrajs';
|
|
|
11
11
|
import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
|
|
12
12
|
import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
|
|
13
13
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
14
|
-
import { SingleSelectDropdown,
|
|
14
|
+
import { SingleSelectDropdown, useFetch } from '@rh-support/components';
|
|
15
15
|
import isEqual from 'lodash/isEqual';
|
|
16
16
|
import React, { useEffect, useState } from 'react';
|
|
17
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -59,6 +59,7 @@ export function NewEssTermsModal(props) {
|
|
|
59
59
|
const [sessionExpectations, setSessionExpectations] = useState('');
|
|
60
60
|
const [impact, setImpact] = useState('');
|
|
61
61
|
const [sessionLink, setSessionLink] = useState('');
|
|
62
|
+
const [hasSubmitted, setHasSubmitted] = useState(false);
|
|
62
63
|
useEffect(() => {
|
|
63
64
|
const fetchTerms = () => __awaiter(this, void 0, void 0, function* () {
|
|
64
65
|
try {
|
|
@@ -102,6 +103,7 @@ export function NewEssTermsModal(props) {
|
|
|
102
103
|
setImpact('');
|
|
103
104
|
setSessionLink('');
|
|
104
105
|
setIsRemoteSessionForm(remoteSessionTermsAcked);
|
|
106
|
+
setHasSubmitted(false);
|
|
105
107
|
props.onClose && props.onClose();
|
|
106
108
|
};
|
|
107
109
|
const languageOptions = Object.keys(allTranslations).map((option) => ({
|
|
@@ -117,7 +119,7 @@ export function NewEssTermsModal(props) {
|
|
|
117
119
|
};
|
|
118
120
|
// Function to ack remote session terms and post comment
|
|
119
121
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
const requestComment = t(
|
|
122
|
+
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${sessionLink}\n\n` : ''}This action does not initiate a remote session. A Red Hat Associate will get back to you soon.`);
|
|
121
123
|
try {
|
|
122
124
|
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
123
125
|
remoteSessionTermsAcked: true,
|
|
@@ -132,15 +134,21 @@ export function NewEssTermsModal(props) {
|
|
|
132
134
|
});
|
|
133
135
|
updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
134
136
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
|
|
135
|
-
onCancel();
|
|
136
137
|
setAgreeLoading(false);
|
|
137
|
-
|
|
138
|
+
setHasSubmitted(true);
|
|
139
|
+
// ToastNotification.addSuccessMessage(
|
|
140
|
+
// t('Remote session has been requested successfully'),
|
|
141
|
+
// t('Red Hat will add a comment to your case to schedule your remote session.')
|
|
142
|
+
// );
|
|
138
143
|
}
|
|
139
144
|
catch (e) {
|
|
140
145
|
onCancel();
|
|
141
146
|
setAgreeLoading(false);
|
|
142
147
|
setIsTermsChecked(false);
|
|
143
|
-
ToastNotification.addWarningMessage(
|
|
148
|
+
// ToastNotification.addWarningMessage(
|
|
149
|
+
// t('Could not submit a comment'),
|
|
150
|
+
// t('Rest assured, we have noted you have accepted the agreement')
|
|
151
|
+
// );
|
|
144
152
|
}
|
|
145
153
|
}
|
|
146
154
|
catch (e) {
|
|
@@ -148,7 +156,7 @@ export function NewEssTermsModal(props) {
|
|
|
148
156
|
onCancel();
|
|
149
157
|
setAgreeLoading(false);
|
|
150
158
|
setIsTermsChecked(false);
|
|
151
|
-
ToastNotification.addDangerMessage(t('You are not authorized to update this case.'));
|
|
159
|
+
// ToastNotification.addDangerMessage(t('You are not authorized to update this case.'));
|
|
152
160
|
}
|
|
153
161
|
else {
|
|
154
162
|
onCancel();
|
|
@@ -157,7 +165,10 @@ export function NewEssTermsModal(props) {
|
|
|
157
165
|
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
158
166
|
screenSessionRequested: false,
|
|
159
167
|
});
|
|
160
|
-
ToastNotification.addDangerMessage(
|
|
168
|
+
// ToastNotification.addDangerMessage(
|
|
169
|
+
// t('Could not submit a request for remote session'),
|
|
170
|
+
// t('Please try again.')
|
|
171
|
+
// );
|
|
161
172
|
}
|
|
162
173
|
}
|
|
163
174
|
});
|
|
@@ -177,12 +188,16 @@ export function NewEssTermsModal(props) {
|
|
|
177
188
|
};
|
|
178
189
|
// To check and if I agree button is loading
|
|
179
190
|
const isAgreeLoading = agreeLoading || isPostingComment;
|
|
180
|
-
const modalActions =
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
191
|
+
const modalActions = hasSubmitted
|
|
192
|
+
? [
|
|
193
|
+
React.createElement(Button, { key: "close", variant: ButtonVariant.primary, onClick: onCancel }, t('Close')),
|
|
194
|
+
]
|
|
195
|
+
: [
|
|
196
|
+
React.createElement(Button, { "aria-label": t('I agree'), variant: ButtonVariant.primary, onClick: isRemoteSessionForm || remoteSessionTermsAcked ? onSubmit : toggleRemoteSessionForm, "data-tracking-id": "remote-session-agreement-check", isLoading: isAgreeLoading, isDisabled: (isRemoteSessionForm || remoteSessionTermsAcked
|
|
197
|
+
? !sessionExpectations.trim() || !impact.trim()
|
|
198
|
+
: !isTermsChecked) || isAgreeLoading }, t(isRemoteSessionForm || remoteSessionTermsAcked ? 'Submit' : 'I agree')),
|
|
199
|
+
React.createElement(Button, { key: "cancel", variant: "link", onClick: onCancel, isDisabled: isAgreeLoading }, "Cancel"),
|
|
200
|
+
];
|
|
186
201
|
const renderRemoteSessionForm = (React.createElement("div", { id: "remoteSessionForm", className: "form-group" },
|
|
187
202
|
React.createElement(Alert, { variant: "info", isInline: true, title: React.createElement(React.Fragment, null,
|
|
188
203
|
"What is a Remote Support Session and how to acknowledge the Remote Access Rider?",
|
|
@@ -226,13 +241,19 @@ export function NewEssTermsModal(props) {
|
|
|
226
241
|
React.createElement("a", { className: "pf-v6-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" },
|
|
227
242
|
React.createElement(Trans, null, "terms "),
|
|
228
243
|
React.createElement(ExternalLinkAltIcon, null))), isChecked: isTermsChecked, "aria-label": t('I have read and agree to the terms'), onChange: onCheckBoxChange }))));
|
|
244
|
+
// Success message content
|
|
245
|
+
const renderSuccessMessage = (React.createElement("div", null,
|
|
246
|
+
React.createElement("p", null, t('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).'))));
|
|
229
247
|
// Body of ESS RSA Modal
|
|
230
248
|
const EssRSAModalBody = () => {
|
|
249
|
+
if (hasSubmitted) {
|
|
250
|
+
return renderSuccessMessage;
|
|
251
|
+
}
|
|
231
252
|
return isRemoteSessionForm ? renderRemoteSessionForm : renderRemoteSessionAgreement;
|
|
232
253
|
};
|
|
233
|
-
return (React.createElement(Modal, { id: "remote-session-agreement-modal", "aria-label": isRemoteSessionForm ? t('Request remote session') : t('Remote session agreement'), title: isRemoteSessionForm ? t('Request remote session') : t('Remote session agreement'), isOpen: props.show, onClose: onCancel },
|
|
254
|
+
return (React.createElement(Modal, { id: "remote-session-agreement-modal", "aria-label": hasSubmitted || isRemoteSessionForm ? t('Request remote session') : t('Remote session agreement'), title: hasSubmitted || isRemoteSessionForm ? t('Request remote session') : t('Remote session agreement'), isOpen: props.show, onClose: onCancel },
|
|
234
255
|
React.createElement(ModalHeader, null,
|
|
235
|
-
React.createElement("h2", null, isRemoteSessionForm ? t('Request remote session') : t('Remote session agreement'))),
|
|
256
|
+
React.createElement("h2", null, hasSubmitted || isRemoteSessionForm ? t('Request remote session') : t('Remote session agreement'))),
|
|
236
257
|
React.createElement(ModalBody, null, EssRSAModalBody()),
|
|
237
258
|
React.createElement(ModalFooter, null, modalActions)));
|
|
238
259
|
}
|
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":"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;AAiBD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,
|
|
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;AAiBD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBA0XxD"}
|
|
@@ -11,7 +11,7 @@ import { publicApi } from '@cee-eng/hydrajs';
|
|
|
11
11
|
import { Alert, Button, ButtonVariant, Checkbox, Modal, ModalBody, ModalFooter, ModalHeader, TextArea, TextInput, } from '@patternfly/react-core';
|
|
12
12
|
import DownloadIcon from '@patternfly/react-icons/dist/js/icons/download-icon';
|
|
13
13
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
14
|
-
import { SingleSelectDropdown,
|
|
14
|
+
import { SingleSelectDropdown, useFetch } from '@rh-support/components';
|
|
15
15
|
import isEqual from 'lodash/isEqual';
|
|
16
16
|
import React, { useEffect, useState } from 'react';
|
|
17
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -59,6 +59,7 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
59
59
|
const [sessionExpectations, setSessionExpectations] = useState('');
|
|
60
60
|
const [impact, setImpact] = useState('');
|
|
61
61
|
const [sessionLink, setSessionLink] = useState('');
|
|
62
|
+
const [hasSubmitted, setHasSubmitted] = useState(false);
|
|
62
63
|
useEffect(() => {
|
|
63
64
|
const fetchTerms = () => __awaiter(this, void 0, void 0, function* () {
|
|
64
65
|
try {
|
|
@@ -102,12 +103,13 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
102
103
|
setImpact('');
|
|
103
104
|
setSessionLink('');
|
|
104
105
|
setIsRemoteSessionForm(remoteSessionTermsAcked);
|
|
106
|
+
setHasSubmitted(false);
|
|
105
107
|
props.onClose && props.onClose();
|
|
106
108
|
};
|
|
107
109
|
const toggleRemoteSessionForm = () => setIsRemoteSessionForm(true);
|
|
108
110
|
// Function to ack remote session terms and post comment
|
|
109
111
|
const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
const requestComment = t(
|
|
112
|
+
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${sessionLink}\n\n` : ''}This action does not initiate a remote session. A Red Hat Associate will get back to you soon.`);
|
|
111
113
|
try {
|
|
112
114
|
yield updateCaseDetails(caseDispatch, props.caseNumber, {
|
|
113
115
|
remoteSessionTermsAcked: true,
|
|
@@ -123,21 +125,30 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
123
125
|
updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
124
126
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, props.loggedInUserRights.data.isInternal(), props.caseStatus);
|
|
125
127
|
setAgreeLoading(false);
|
|
126
|
-
|
|
128
|
+
setHasSubmitted(true);
|
|
129
|
+
// ToastNotification.addSuccessMessage(
|
|
130
|
+
// t('Remote session has been requested successfully'),
|
|
131
|
+
// t('Red Hat will add a comment to your case to schedule your remote session')
|
|
132
|
+
// );
|
|
127
133
|
}
|
|
128
134
|
catch (e) {
|
|
129
|
-
ToastNotification.addWarningMessage(
|
|
135
|
+
// ToastNotification.addWarningMessage(
|
|
136
|
+
// t('Could not submit a comment'),
|
|
137
|
+
// t('Rest assured, we have noted you have accepted the agreement')
|
|
138
|
+
// );
|
|
130
139
|
setAgreeLoading(false);
|
|
131
140
|
props.onClose();
|
|
132
141
|
}
|
|
133
|
-
props.onClose();
|
|
134
142
|
}
|
|
135
143
|
catch (e) {
|
|
136
144
|
if (props.readOnly) {
|
|
137
|
-
ToastNotification.addDangerMessage(t('You are not authorized to update this case.'));
|
|
145
|
+
// ToastNotification.addDangerMessage(t('You are not authorized to update this case.'));
|
|
138
146
|
}
|
|
139
147
|
else {
|
|
140
|
-
ToastNotification.addDangerMessage(
|
|
148
|
+
// ToastNotification.addDangerMessage(
|
|
149
|
+
// t('Could not accept the remote access rider agreement'),
|
|
150
|
+
// t('Please try again.')
|
|
151
|
+
// );
|
|
141
152
|
}
|
|
142
153
|
setAgreeLoading(false);
|
|
143
154
|
setIsTermsChecked(false);
|
|
@@ -213,17 +224,29 @@ export function RemoteSessionAgreementModal(props) {
|
|
|
213
224
|
React.createElement("a", { className: "pf-v6-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" },
|
|
214
225
|
React.createElement(Trans, null, "terms "),
|
|
215
226
|
React.createElement(ExternalLinkAltIcon, null))), isChecked: isTermsChecked, "aria-label": t('I have read and agree to the terms'), onChange: onCheckBoxChange }))));
|
|
227
|
+
// Success message content
|
|
228
|
+
const renderSuccessMessage = (React.createElement("div", null,
|
|
229
|
+
React.createElement("p", null, t('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).'))));
|
|
216
230
|
// Body of RSA Modal
|
|
217
231
|
const RemoteSessionAgreementModalBody = () => {
|
|
232
|
+
if (hasSubmitted) {
|
|
233
|
+
return renderSuccessMessage;
|
|
234
|
+
}
|
|
218
235
|
return isRemoteSessionForm ? renderRemoteSessionForm : renderRemoteSessionAgreement;
|
|
219
236
|
};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
React.createElement("
|
|
223
|
-
|
|
224
|
-
|
|
237
|
+
const modalActions = hasSubmitted
|
|
238
|
+
? [
|
|
239
|
+
React.createElement(Button, { key: "close", variant: ButtonVariant.primary, onClick: onCancel }, t('Close')),
|
|
240
|
+
]
|
|
241
|
+
: [
|
|
225
242
|
React.createElement(Button, { "aria-label": t('I agree'), variant: ButtonVariant.primary, onClick: isRemoteSessionForm || remoteSessionTermsAcked ? onSubmit : toggleRemoteSessionForm, "data-tracking-id": "remote-session-agreement-check", isLoading: isAgreeLoading, isDisabled: (isRemoteSessionForm || remoteSessionTermsAcked
|
|
226
243
|
? !sessionExpectations.trim() || !impact.trim()
|
|
227
244
|
: !isTermsChecked) || isAgreeLoading }, t(isRemoteSessionForm || remoteSessionTermsAcked ? 'Submit' : 'I agree')),
|
|
228
|
-
React.createElement(Button, { key: "cancel", variant:
|
|
245
|
+
React.createElement(Button, { key: "cancel", variant: ButtonVariant.primary, onClick: onCancel, isDisabled: isAgreeLoading }, "Cancel"),
|
|
246
|
+
];
|
|
247
|
+
return (React.createElement(Modal, { id: "remote-session-agreement-modal", "aria-label": hasSubmitted || isRemoteSessionForm ? t('Request remote session') : t('Remote session agreement'), isOpen: props.show, onClose: onCancel },
|
|
248
|
+
React.createElement(ModalHeader, null,
|
|
249
|
+
React.createElement("h2", null, hasSubmitted || isRemoteSessionForm ? t('Request remote session') : t('Remote session agreement'))),
|
|
250
|
+
React.createElement(ModalBody, null, RemoteSessionAgreementModalBody()),
|
|
251
|
+
React.createElement(ModalFooter, null, modalActions)));
|
|
229
252
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAkCvE,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,0BAA2B,MAAM,sBAudtD,CAAC"}
|
|
@@ -12,8 +12,10 @@ import { sendRHDirectMessageFeedback } from '@ifd-ui/ask-redhat-core';
|
|
|
12
12
|
import { Button, Card, CardBody, CardHeader, Content, ContentVariants, EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateVariant, Icon, Label, Modal, ModalVariant, Skeleton, Spinner, } from '@patternfly/react-core';
|
|
13
13
|
import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
|
|
14
14
|
import { useFetch } from '@rh-support/components';
|
|
15
|
+
import { dtmTrackEventAskRedhat } from '@rh-support/utils';
|
|
15
16
|
import isEqual from 'lodash/isEqual';
|
|
16
17
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
18
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
17
19
|
import { MODAL_MESSAGES, QUICK_RESPONSES, TOOLTIP_MESSAGES } from '../../constants/askRedHatMessages';
|
|
18
20
|
import { useAIResponseDispatch, useAIResponseState } from '../../context/AIResponseContext';
|
|
19
21
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
@@ -43,6 +45,7 @@ const getSessResFromAISources = (sources, visibilityStatus) => {
|
|
|
43
45
|
};
|
|
44
46
|
export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
45
47
|
var _a, _b, _c, _d;
|
|
48
|
+
const { t } = useTranslation();
|
|
46
49
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
47
50
|
const [showFeedbackCard, setShowFeedbackCard] = useState(false);
|
|
48
51
|
const [showFeedbackComplete, setShowFeedbackComplete] = useState(false);
|
|
@@ -97,6 +100,9 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
|
97
100
|
const handleChatWithAIClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
101
|
var _a;
|
|
99
102
|
onChatWithAIClick === null || onChatWithAIClick === void 0 ? void 0 : onChatWithAIClick();
|
|
103
|
+
if (!!conversationId) {
|
|
104
|
+
dtmTrackEventAskRedhat(conversationId, appSourceId_ARH);
|
|
105
|
+
}
|
|
100
106
|
if (updateSessionOrigin) {
|
|
101
107
|
yield updateSessionOrigin(activeSessionId, {
|
|
102
108
|
id: (_a = sessionResourceTracking[SessionResourceSource.ASK_RED_HAT]) === null || _a === void 0 ? void 0 : _a.resourceOriginId,
|
|
@@ -134,7 +140,7 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
|
134
140
|
// Use accumulated response if streaming, otherwise use the final response
|
|
135
141
|
const answer = aiResponseState.isStreaming && aiResponseState.accumulatedResponse
|
|
136
142
|
? aiResponseState.accumulatedResponse
|
|
137
|
-
: (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.answer) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.content) || 'No AI response available yet.';
|
|
143
|
+
: (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.answer) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.content) || t('No AI response available yet.');
|
|
138
144
|
const sources = React.useMemo(() => (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.sources) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.references) || [], [aiResponse]);
|
|
139
145
|
const sourcesCount = sources.length || 0;
|
|
140
146
|
// Show loading only when streaming has started but no content received yet
|
|
@@ -174,44 +180,72 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
|
174
180
|
navigator.clipboard.writeText(answer);
|
|
175
181
|
} }, TOOLTIP_MESSAGES.copy),
|
|
176
182
|
};
|
|
177
|
-
if (aiResponseState.
|
|
183
|
+
if (aiResponseState.isRateLimited) {
|
|
178
184
|
return (React.createElement("div", { className: "ask-redhat" },
|
|
179
185
|
React.createElement("p", { className: "ask-redhat-title" },
|
|
180
186
|
React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
181
187
|
isCaseCreate ? 'Resolve your issue now with AI insights' : 'Troubleshoot with AI insights',
|
|
182
188
|
React.createElement(Label, { variant: "outline" }, "PREVIEW")),
|
|
189
|
+
React.createElement("div", { className: "ask-redhat-content-wrapper ask-redhat-rate-limit-error" },
|
|
190
|
+
React.createElement(EmptyState, { titleText: "", headingLevel: "h4" },
|
|
191
|
+
React.createElement("h4", null,
|
|
192
|
+
React.createElement(Icon, { iconSize: "lg", status: "danger", className: "pf-v6-u-mr-sm" },
|
|
193
|
+
React.createElement(ExclamationCircleIcon, null)),
|
|
194
|
+
' ',
|
|
195
|
+
"Chat limit reached"),
|
|
196
|
+
React.createElement(EmptyStateBody, null,
|
|
197
|
+
React.createElement(Content, { component: ContentVariants.p },
|
|
198
|
+
"You've reached the maximum number of chats. You can start up to",
|
|
199
|
+
' ',
|
|
200
|
+
aiResponseState.quotaLimit,
|
|
201
|
+
" chats within a",
|
|
202
|
+
React.createElement("br", null),
|
|
203
|
+
"24-hour period. Please try again after your limit resets."))))));
|
|
204
|
+
}
|
|
205
|
+
if (aiResponseState.error) {
|
|
206
|
+
return (React.createElement("div", { className: "ask-redhat" },
|
|
207
|
+
React.createElement("p", { className: "ask-redhat-title" },
|
|
208
|
+
React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
209
|
+
isCaseCreate ? t('Resolve your issue now with AI insights') : t('Troubleshoot with AI insights'),
|
|
210
|
+
React.createElement(Label, { variant: "outline" },
|
|
211
|
+
React.createElement(Trans, null, "PREVIEW"))),
|
|
183
212
|
React.createElement("div", { className: "ask-redhat-content-wrapper ask-redhat-error" },
|
|
184
213
|
React.createElement(EmptyState, { variant: EmptyStateVariant.xs, titleText: "", headingLevel: "h4" },
|
|
185
214
|
React.createElement("h4", null,
|
|
186
215
|
React.createElement(Icon, { iconSize: "lg", status: "danger", className: "pf-v6-u-mr-sm" },
|
|
187
216
|
React.createElement(ExclamationCircleIcon, null)),
|
|
188
217
|
' ',
|
|
189
|
-
"Error while loading AI insights"),
|
|
218
|
+
React.createElement(Trans, null, "Error while loading AI insights")),
|
|
190
219
|
React.createElement(EmptyStateBody, null,
|
|
191
|
-
React.createElement(Content, { component: ContentVariants.p },
|
|
220
|
+
React.createElement(Content, { component: ContentVariants.p },
|
|
221
|
+
React.createElement(Trans, null, "AI insights is currently unavailable, try reloading."))),
|
|
192
222
|
React.createElement(EmptyStateFooter, null,
|
|
193
|
-
React.createElement(Button, { variant: "tertiary", size: "sm", onClick: fetchARHResponse },
|
|
223
|
+
React.createElement(Button, { variant: "tertiary", size: "sm", onClick: fetchARHResponse },
|
|
224
|
+
React.createElement(Trans, null, "Reload")))))));
|
|
194
225
|
}
|
|
195
226
|
if (isLoading) {
|
|
196
227
|
return (React.createElement("div", { className: "ask-redhat" },
|
|
197
228
|
React.createElement("p", { className: "ask-redhat-title" },
|
|
198
229
|
React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
199
|
-
isCaseCreate ? 'Resolve your issue now with AI insights' : 'Troubleshoot with AI insights',
|
|
200
|
-
React.createElement(Label, { variant: "outline" },
|
|
230
|
+
isCaseCreate ? t('Resolve your issue now with AI insights') : t('Troubleshoot with AI insights'),
|
|
231
|
+
React.createElement(Label, { variant: "outline" },
|
|
232
|
+
React.createElement(Trans, null, "PREVIEW"))),
|
|
201
233
|
React.createElement("div", { className: "ask-redhat-content-wrapper" },
|
|
202
234
|
React.createElement("div", { className: "pf-v6-u-display-flex pf-v6-u-flex-direction-column pf-v6-u-justify-content-space-between" }, [...Array(3)].map((_, i) => (React.createElement("div", { className: "pf-v6-u-mb-sm", key: `AI-insights-loading-${i}` },
|
|
203
|
-
React.createElement(Skeleton, { width: "100%", screenreaderText:
|
|
235
|
+
React.createElement(Skeleton, { width: "100%", screenreaderText: t('Getting AI insights...') }),
|
|
204
236
|
React.createElement("br", null)))))),
|
|
205
237
|
!aiResponseState.isStreaming && (React.createElement("div", { className: "ask-redhat-toggle-button" },
|
|
206
|
-
React.createElement(Button, { variant: "link", onClick: handleChatWithAIClick, className: "ask-redhat-chat-button" },
|
|
238
|
+
React.createElement(Button, { variant: "link", onClick: handleChatWithAIClick, className: "ask-redhat-chat-button" },
|
|
239
|
+
React.createElement(Trans, null, "Chat with AI to get started"))))));
|
|
207
240
|
}
|
|
208
241
|
// Show streaming content
|
|
209
242
|
if (isStreaming && aiResponseState.accumulatedResponse && aiResponseState.accumulatedResponse !== '') {
|
|
210
243
|
return (React.createElement("div", { className: "ask-redhat" },
|
|
211
244
|
React.createElement("p", { className: "ask-redhat-title" },
|
|
212
245
|
React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
213
|
-
isCaseCreate ? 'Resolve your issue now with AI insights' : 'Troubleshoot with AI insights',
|
|
214
|
-
React.createElement(Label, { variant: "outline" },
|
|
246
|
+
isCaseCreate ? t('Resolve your issue now with AI insights') : t('Troubleshoot with AI insights'),
|
|
247
|
+
React.createElement(Label, { variant: "outline" },
|
|
248
|
+
React.createElement(Trans, null, "PREVIEW"))),
|
|
215
249
|
React.createElement("div", { className: "ask-redhat-content-wrapper" },
|
|
216
250
|
React.createElement("div", { ref: contentRef, className: `ask-redhat-content ${isExpanded ? 'ask-redhat-content--expanded' : ''}` },
|
|
217
251
|
React.createElement("div", { className: `ask-redhat-content-scrollable ${isExpanded ? 'ask-redhat-content--expanded-scrollable' : ''}` },
|
|
@@ -224,13 +258,14 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
|
224
258
|
React.createElement("div", { className: "ask-redhat-border-line" }),
|
|
225
259
|
React.createElement(Button, { onClick: onToggle, className: isExpanded ? 'ask-redhat-toggle-button-collapsed' : 'ask-redhat-toggle-button', "data-tracking-id": "ask-redhat-read-more-button" },
|
|
226
260
|
isExpanded ? React.createElement(CollapseIcon, null) : React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
227
|
-
isExpanded ? '' : 'Read more'))));
|
|
261
|
+
isExpanded ? '' : t('Read more')))));
|
|
228
262
|
}
|
|
229
263
|
return (React.createElement("div", { className: "ask-redhat" },
|
|
230
264
|
React.createElement("p", { className: "ask-redhat-title" },
|
|
231
265
|
React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
232
|
-
isCaseCreate ? 'Resolve your issue now with AI insights' : 'Troubleshoot with AI insights',
|
|
233
|
-
React.createElement(Label, { variant: "outline" },
|
|
266
|
+
isCaseCreate ? t('Resolve your issue now with AI insights') : t('Troubleshoot with AI insights'),
|
|
267
|
+
React.createElement(Label, { variant: "outline" },
|
|
268
|
+
React.createElement(Trans, null, "PREVIEW"))),
|
|
234
269
|
React.createElement("div", { className: "ask-redhat-content-wrapper" },
|
|
235
270
|
React.createElement("div", { ref: contentRef, className: `ask-redhat-content ${isExpanded ? 'ask-redhat-content--expanded' : ''}` },
|
|
236
271
|
React.createElement("div", { className: `ask-redhat-content-scrollable ${isExpanded ? 'ask-redhat-content--expanded-scrollable' : ''}` },
|
|
@@ -248,14 +283,16 @@ export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
|
248
283
|
React.createElement("div", { className: "response-actions-wrapper" },
|
|
249
284
|
React.createElement(ResponseActions, { actions: responseActions, submittedFeedbackTypes: aiResponseState.submittedFeedbackTypes })),
|
|
250
285
|
React.createElement("div", { className: "ask-redhat-footer" },
|
|
251
|
-
React.createElement("p", { className: "ask-redhat-footer-text" },
|
|
252
|
-
|
|
286
|
+
React.createElement("p", { className: "ask-redhat-footer-text" },
|
|
287
|
+
React.createElement(Trans, null, "Want to continue the conversation? Dive deeper with our AI assistant")),
|
|
288
|
+
React.createElement(Button, { onClick: handleChatWithAIClick, className: 'ask-redhat-chat-button', "data-tracking-id": "ask-redhat-chat-button", icon: React.createElement(StarIcon, null) },
|
|
289
|
+
React.createElement(Trans, null, "Chat with AI")))),
|
|
253
290
|
!isExpanded && React.createElement("div", { className: "ask-redhat-fade-overlay" }))),
|
|
254
291
|
React.createElement("div", { className: "ask-redhat-toggle-button-wrapper" },
|
|
255
292
|
React.createElement("div", { className: "ask-redhat-border-line" }),
|
|
256
293
|
React.createElement(Button, { onClick: onToggle, className: isExpanded ? 'ask-redhat-toggle-button-collapsed' : 'ask-redhat-toggle-button' },
|
|
257
294
|
isExpanded ? React.createElement(CollapseIcon, null) : React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
258
|
-
isExpanded ? '' : 'Read more')),
|
|
295
|
+
isExpanded ? '' : t('Read more'))),
|
|
259
296
|
React.createElement(Modal, { variant: ModalVariant.small, isOpen: showFeedbackCard, onClose: () => {
|
|
260
297
|
setShowFeedbackCard(false);
|
|
261
298
|
setFeedbackType('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AAUrD,OAAO,KAA6B,MAAM,OAAO,CAAC;AAclD,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAUD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAAA,OAAO,6CAA6C,CAAC;AAUrD,OAAO,KAA6B,MAAM,OAAO,CAAC;AAclD,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAUD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAoNzC;kBApNQ,mBAAmB;;;AAuN5B,eAAe,mBAAmB,CAAC"}
|
|
@@ -115,6 +115,10 @@ function TroubleshootSection(props) {
|
|
|
115
115
|
enableHeaderMenu: false,
|
|
116
116
|
enableTheme: false,
|
|
117
117
|
openLinkInNewTab: true,
|
|
118
|
+
customPrivacyMessage: (React.createElement(React.Fragment, null,
|
|
119
|
+
"This feature uses AI technology. Interactions may be used to improve Red Hat's products or services. For more information about Red Hat\u2019s privacy practices, please refer to the",
|
|
120
|
+
' ',
|
|
121
|
+
React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" }, "Red Hat Privacy Statement."))),
|
|
118
122
|
tokenAuth: {
|
|
119
123
|
auth: {
|
|
120
124
|
userInfo: (_h = (_g = (_f = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _f === void 0 ? void 0 : _f.getToken) === null || _g === void 0 ? void 0 : _g.call(_f)) !== null && _h !== void 0 ? _h : {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserFeedback.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAMH,SAAS,EAET,SAAS,EAEZ,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"UserFeedback.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAMH,SAAS,EAET,SAAS,EAEZ,MAAM,wBAAwB,CAAC;AAEhC,OAAc,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAIhE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS;IAC7E,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAgFtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -10,11 +10,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { ActionGroup, Button, Card, CardBody, CardHeader, Form, TextArea, } from '@patternfly/react-core';
|
|
13
|
+
import isEmpty from 'lodash/isEmpty';
|
|
13
14
|
import React, { useState } from 'react';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
14
16
|
import CloseButton from './CloseButton';
|
|
15
17
|
import QuickResponse from './QuickResponse';
|
|
16
18
|
const UserFeedback = (_a) => {
|
|
17
|
-
var { title
|
|
19
|
+
var { title: propsTitle, hasTextArea, quickResponses, onSubmit, onClose, isCompact, isSubmitting = false } = _a, props = __rest(_a, ["title", "hasTextArea", "quickResponses", "onSubmit", "onClose", "isCompact", "isSubmitting"]);
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const title = !isEmpty(propsTitle) ? propsTitle : t('Why did you choose this rating?');
|
|
18
22
|
const [selectedResponse, setSelectedResponse] = useState();
|
|
19
23
|
const [value, setValue] = useState('');
|
|
20
24
|
return (React.createElement(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__feedback-card" }, props),
|
|
@@ -39,7 +39,7 @@ function WidgetFileSelector({ id = '', className = '', isSessionId, isPrivate =
|
|
|
39
39
|
isDragActive ? t(`Drop your file here...`) : React.createElement(Trans, null, "Drag and drop, or browse to upload a file"),
|
|
40
40
|
isIdea && (React.createElement("div", { className: "pf-v6-u-text-align-center pf-v6-u-color-300 pf-v6-u-font-weight-normal" },
|
|
41
41
|
React.createElement(Trans, null, "Files must be less than 5 MB.")))),
|
|
42
|
-
isIdea && (React.createElement("p", { className: "pf-v6-u-
|
|
42
|
+
isIdea && (React.createElement("p", { className: "pf-v6-u-text-color-status-danger" },
|
|
43
43
|
rejectedFiles.map((rejectedFile) => {
|
|
44
44
|
const isImage = /image\/(png|gif|jpe?g)/.test(rejectedFile.type);
|
|
45
45
|
return !isImage ? (React.createElement("div", null,
|
|
@@ -30,7 +30,7 @@ function WidgetFileSelectorImage({ id = '', className = '', isSessionId, isPriva
|
|
|
30
30
|
React.createElement("div", { className: "pf-v6-u-text-align-center pf-v6-u-color-300 pf-v6-u-font-weight-normal" },
|
|
31
31
|
React.createElement(Trans, null, "Files must be less than 5 MB."))),
|
|
32
32
|
' ',
|
|
33
|
-
React.createElement("p", { className: "pf-v6-u-
|
|
33
|
+
React.createElement("p", { className: "pf-v6-u-text-color-status-danger" }, rejectedFiles.map((rejectedFile) => {
|
|
34
34
|
const isImage = /image\/(png|gif|jpe?g)/.test(rejectedFile.type);
|
|
35
35
|
return !isImage ? (React.createElement("div", null,
|
|
36
36
|
rejectedFile.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAM3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACrE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAM3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACrE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAkXtC;kBAlXQ,gBAAgB;;;AAoXzB,eAAe,gBAAgB,CAAC"}
|
|
@@ -218,8 +218,9 @@ function WizardNavigation(props) {
|
|
|
218
218
|
});
|
|
219
219
|
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
220
220
|
const nextButtonDisabledLogic = () => {
|
|
221
|
+
const isLoadingARH = props.isLoadingARH && props.activeStep.id === AppRouteSections.RESOURCES && !isCaseCreate;
|
|
221
222
|
if (isBTestvariation) {
|
|
222
|
-
let value =
|
|
223
|
+
let value = isLoadingARH ||
|
|
223
224
|
((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
|
|
224
225
|
props.activeStep.id ===
|
|
225
226
|
(isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) ||
|
|
@@ -231,7 +232,7 @@ function WizardNavigation(props) {
|
|
|
231
232
|
return value;
|
|
232
233
|
}
|
|
233
234
|
else if (isATestvariation) {
|
|
234
|
-
let value =
|
|
235
|
+
let value = isLoadingARH ||
|
|
235
236
|
((isEmpty(summary) || isEmpty(issue) || isEmpty(product) || isEmpty(version)) &&
|
|
236
237
|
props.activeStep.id ===
|
|
237
238
|
(isCaseCreate ? AppRouteSections.SUMMARIZE : AppRouteSections.TROUBLESHOOT)) ||
|
|
@@ -243,7 +244,7 @@ function WizardNavigation(props) {
|
|
|
243
244
|
return value;
|
|
244
245
|
}
|
|
245
246
|
else if (isATestvariation && !isCaseCreate) {
|
|
246
|
-
let value =
|
|
247
|
+
let value = isLoadingARH ||
|
|
247
248
|
isEmpty(summary) ||
|
|
248
249
|
isEmpty(issue) ||
|
|
249
250
|
(!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
export declare const QUICK_RESPONSES: {
|
|
2
|
-
positive: {
|
|
2
|
+
readonly positive: {
|
|
3
3
|
id: string;
|
|
4
4
|
content: string;
|
|
5
5
|
}[];
|
|
6
|
-
negative: {
|
|
6
|
+
readonly negative: {
|
|
7
7
|
id: string;
|
|
8
8
|
content: string;
|
|
9
9
|
}[];
|
|
10
10
|
};
|
|
11
11
|
export declare const TOOLTIP_MESSAGES: {
|
|
12
12
|
readonly positive: {
|
|
13
|
-
readonly tooltipContent:
|
|
14
|
-
readonly clickedTooltipContent:
|
|
13
|
+
readonly tooltipContent: string;
|
|
14
|
+
readonly clickedTooltipContent: string;
|
|
15
15
|
};
|
|
16
16
|
readonly negative: {
|
|
17
|
-
readonly tooltipContent:
|
|
18
|
-
readonly clickedTooltipContent:
|
|
17
|
+
readonly tooltipContent: string;
|
|
18
|
+
readonly clickedTooltipContent: string;
|
|
19
19
|
};
|
|
20
20
|
readonly copy: {
|
|
21
|
-
readonly tooltipContent:
|
|
22
|
-
readonly clickedTooltipContent:
|
|
21
|
+
readonly tooltipContent: string;
|
|
22
|
+
readonly clickedTooltipContent: string;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
export declare const MODAL_MESSAGES: {
|
|
26
26
|
readonly feedback: {
|
|
27
|
-
readonly positive:
|
|
28
|
-
readonly negative:
|
|
27
|
+
readonly positive: string;
|
|
28
|
+
readonly negative: string;
|
|
29
29
|
};
|
|
30
30
|
readonly complete: {
|
|
31
|
-
readonly title:
|
|
32
|
-
readonly body:
|
|
31
|
+
readonly title: string;
|
|
32
|
+
readonly body: string;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=askRedHatMessages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"askRedHatMessages.d.ts","sourceRoot":"","sources":["../../../src/constants/askRedHatMessages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"askRedHatMessages.d.ts","sourceRoot":"","sources":["../../../src/constants/askRedHatMessages.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;CAe3B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;CAyBnB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;CAiBjB,CAAC"}
|