@rh-support/troubleshoot 2.6.42 → 2.6.46
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/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts +0 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +5 -31
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +34 -33
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +2 -3
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +0 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +18 -14
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +22 -16
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSession.js +2 -2
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +102 -53
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreement.js +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +21 -23
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CasePhoneNumberConfirmAlert.js +4 -7
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +9 -7
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +8 -0
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +2 -6
- package/lib/esm/components/CaseInformation/Severity.js +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +0 -3
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +20 -15
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +7 -5
- package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.js +18 -20
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +9 -6
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +15 -22
- package/lib/esm/components/Cve/CveModal.d.ts.map +1 -1
- package/lib/esm/components/Cve/CveModal.js +3 -2
- package/lib/esm/components/Cve/CveSidebar.js +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +9 -6
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +10 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +3 -3
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationsModal.js +7 -4
- package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleInfoAccordion.js +3 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +1 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.js +9 -2
- package/lib/esm/components/Recommendations/RecommendationFeedbackModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RecommendationFeedbackModal.js +4 -4
- package/lib/esm/components/Recommendations/Recommendations.js +2 -2
- package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +7 -4
- package/lib/esm/components/Recommendations/WatsonxAiIcon.js +1 -1
- package/lib/esm/components/SessionRestore/RestoreLastSessionModal.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +5 -3
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -1
- package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/Suggestions.js +17 -12
- package/lib/esm/components/Suggestions/TopContent.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/TopContent.js +13 -13
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +0 -7
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +13 -99
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +3 -3
- package/lib/esm/components/shared/fileUpload/css/fileSelector.css +1 -0
- package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts +1 -0
- package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts.map +1 -1
- package/lib/esm/components/shared/input/ContactSelectorInternal.js +6 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +7 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +8 -2
- package/lib/esm/components/wizardLayout/WizardAside.js +3 -3
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +6 -9
- package/lib/esm/components/wizardLayout/WizardMain.d.ts +1 -7
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +18 -202
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +2 -4
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +16 -13
- package/lib/esm/components/wizardLayout/index.d.ts +0 -1
- package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/index.js +0 -1
- package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
- package/lib/esm/context/RootTroubleshootProvider.js +6 -8
- package/lib/esm/css/app.css +5 -4
- package/lib/esm/css/case.css +39 -6
- package/lib/esm/css/results.css +2 -2
- package/lib/esm/hooks/useWizard.d.ts +0 -6
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +1 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts +0 -2
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +0 -2
- package/lib/esm/scss/_main.scss +84 -22
- package/lib/esm/scss/_pf-overrides.scss +37 -10
- package/package.json +6 -7
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +0 -7
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/AskRedHat.js +0 -151
- package/lib/esm/components/TroubleshootSection/CloseButton.d.ts +0 -9
- package/lib/esm/components/TroubleshootSection/CloseButton.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/CloseButton.js +0 -5
- package/lib/esm/components/TroubleshootSection/QuickResponse.d.ts +0 -15
- package/lib/esm/components/TroubleshootSection/QuickResponse.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/QuickResponse.js +0 -26
- package/lib/esm/components/TroubleshootSection/ResponseActionButton.d.ts +0 -18
- package/lib/esm/components/TroubleshootSection/ResponseActionButton.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/ResponseActionButton.js +0 -28
- package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts +0 -20
- package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/ResponseActions.js +0 -52
- package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts +0 -12
- package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/UserFeedback.js +0 -44
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts +0 -10
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.js +0 -46
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts +0 -9
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.js +0 -9
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts +0 -9
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.js +0 -17
- package/lib/esm/constants/askRedHatMessages.d.ts +0 -35
- package/lib/esm/constants/askRedHatMessages.d.ts.map +0 -1
- package/lib/esm/constants/askRedHatMessages.js +0 -36
- package/lib/esm/context/AIResponseContext.d.ts +0 -10
- package/lib/esm/context/AIResponseContext.d.ts.map +0 -1
- package/lib/esm/context/AIResponseContext.js +0 -26
- package/lib/esm/css/AskRedHat.css +0 -359
- package/lib/esm/reducers/AIResponseConstNTypes.d.ts +0 -48
- package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +0 -1
- package/lib/esm/reducers/AIResponseConstNTypes.js +0 -16
- package/lib/esm/reducers/AIResponseReducer.d.ts +0 -9
- package/lib/esm/reducers/AIResponseReducer.d.ts.map +0 -1
- package/lib/esm/reducers/AIResponseReducer.js +0 -43
|
@@ -1,151 +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 { Env } from '@cee-eng/hydrajs';
|
|
11
|
-
import { sendRHDirectMessageFeedback } from '@ifd-ui/ask-redhat-core';
|
|
12
|
-
import { Button, Card, CardBody, CardHeader, Modal, ModalVariant, Spinner } from '@patternfly/react-core';
|
|
13
|
-
import React, { useRef, useState } from 'react';
|
|
14
|
-
import { MODAL_MESSAGES, QUICK_RESPONSES, TOOLTIP_MESSAGES } from '../../constants/askRedHatMessages';
|
|
15
|
-
import { useAIResponseState } from '../../context/AIResponseContext';
|
|
16
|
-
import { useParseRuleMarkdown } from '../../hooks/useParseRuleMarkdown';
|
|
17
|
-
import { appSourceId_ARH } from '../../reducers/CaseConstNTypes';
|
|
18
|
-
import { CollapseIcon } from './icons/CollapseIcon';
|
|
19
|
-
import { StarIcon } from './icons/StarIcon';
|
|
20
|
-
import ResponseActions from './ResponseActions';
|
|
21
|
-
import UserFeedback from './UserFeedback';
|
|
22
|
-
import UserFeedbackComplete from './UserFeedbackComplete';
|
|
23
|
-
export const AskRedHat = ({ onChatWithAIClick }) => {
|
|
24
|
-
var _a, _b, _c;
|
|
25
|
-
const [isExpanded, setIsExpanded] = useState(false);
|
|
26
|
-
const [showFeedbackCard, setShowFeedbackCard] = useState(false);
|
|
27
|
-
const [showFeedbackComplete, setShowFeedbackComplete] = useState(false);
|
|
28
|
-
const [feedbackType, setFeedbackType] = useState('');
|
|
29
|
-
const [submittedFeedbackTypes, setSubmittedFeedbackTypes] = useState([]);
|
|
30
|
-
const aiResponseState = useAIResponseState();
|
|
31
|
-
const contentRef = useRef(null);
|
|
32
|
-
const onToggle = () => {
|
|
33
|
-
if (isExpanded && contentRef.current) {
|
|
34
|
-
contentRef.current.scrollTop = 0;
|
|
35
|
-
}
|
|
36
|
-
setIsExpanded((prev) => !prev);
|
|
37
|
-
};
|
|
38
|
-
const handleChatWithAIClick = () => onChatWithAIClick === null || onChatWithAIClick === void 0 ? void 0 : onChatWithAIClick();
|
|
39
|
-
const aiResponse = aiResponseState.aiResponse;
|
|
40
|
-
const messageId = aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.messageId;
|
|
41
|
-
const conversationId = aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.conversationId;
|
|
42
|
-
const answer = (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.answer) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.content) || 'No AI response available yet.';
|
|
43
|
-
const sources = (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.sources) || (aiResponse === null || aiResponse === void 0 ? void 0 : aiResponse.references) || [];
|
|
44
|
-
const sourcesCount = sources.length || 0;
|
|
45
|
-
const isLoading = aiResponseState.isLoading || !aiResponse;
|
|
46
|
-
const { parseMarkdown } = useParseRuleMarkdown();
|
|
47
|
-
const config = {
|
|
48
|
-
appSourceId: appSourceId_ARH,
|
|
49
|
-
packageVersion: (_a = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _a === void 0 ? void 0 : _a.packageVersion,
|
|
50
|
-
authToken: (_c = (_b = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _b === void 0 ? void 0 : _b.getEncodedToken()) !== null && _c !== void 0 ? _c : '',
|
|
51
|
-
appEnv: Env.getEnvName(),
|
|
52
|
-
};
|
|
53
|
-
const handleFeedbackSubmit = (selectedResponse, additionalFeedback) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
-
setShowFeedbackCard(false);
|
|
55
|
-
try {
|
|
56
|
-
const payload = {
|
|
57
|
-
rating: (feedbackType === 'positive' ? 'positive' : 'negative'),
|
|
58
|
-
freeform: additionalFeedback || undefined,
|
|
59
|
-
predefined_response: selectedResponse,
|
|
60
|
-
};
|
|
61
|
-
yield sendRHDirectMessageFeedback(conversationId, messageId, payload, config);
|
|
62
|
-
setShowFeedbackComplete(true);
|
|
63
|
-
setSubmittedFeedbackTypes(prev => [...prev, feedbackType]);
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
setShowFeedbackCard(false);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
const responseActions = {
|
|
70
|
-
positive: Object.assign({ onClick: () => {
|
|
71
|
-
setFeedbackType('positive');
|
|
72
|
-
setShowFeedbackCard(true);
|
|
73
|
-
} }, TOOLTIP_MESSAGES.positive),
|
|
74
|
-
negative: Object.assign({ onClick: () => {
|
|
75
|
-
setFeedbackType('negative');
|
|
76
|
-
setShowFeedbackCard(true);
|
|
77
|
-
} }, TOOLTIP_MESSAGES.negative),
|
|
78
|
-
copy: Object.assign({ onClick: () => {
|
|
79
|
-
navigator.clipboard.writeText(answer);
|
|
80
|
-
} }, TOOLTIP_MESSAGES.copy),
|
|
81
|
-
};
|
|
82
|
-
if (isLoading) {
|
|
83
|
-
return (React.createElement("div", { className: "ask-redhat" },
|
|
84
|
-
React.createElement("p", { className: "ask-redhat-title" },
|
|
85
|
-
React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
86
|
-
"Resolve your issue now with AI insights"),
|
|
87
|
-
React.createElement("div", { className: "ask-redhat-content-wrapper" },
|
|
88
|
-
React.createElement("div", { className: "ask-redhat-content", style: { textAlign: 'center', padding: '2rem' } },
|
|
89
|
-
React.createElement(Spinner, { size: "lg" }),
|
|
90
|
-
React.createElement("p", { style: { marginTop: '1rem' } }, "Getting AI insights..."))),
|
|
91
|
-
!aiResponseState.isLoading && (React.createElement("div", { className: "ask-redhat-toggle-button" },
|
|
92
|
-
React.createElement(Button, { variant: "link", onClick: handleChatWithAIClick, className: "ask-redhat-chat-button" }, "Chat with AI to get started")))));
|
|
93
|
-
}
|
|
94
|
-
if (aiResponseState.error) {
|
|
95
|
-
return (React.createElement("div", { className: "ask-redhat" },
|
|
96
|
-
React.createElement("p", { className: "ask-redhat-title" },
|
|
97
|
-
React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
98
|
-
"Resolve your issue now with AI insights"),
|
|
99
|
-
React.createElement("div", { className: "ask-redhat-content-wrapper" },
|
|
100
|
-
React.createElement("div", { className: "ask-redhat-content", style: { textAlign: 'center', padding: '2rem' } },
|
|
101
|
-
React.createElement("p", { style: { color: '#d73502', marginBottom: '1rem' } }, "Unable to get AI insights. Please try again later."),
|
|
102
|
-
React.createElement(Button, { variant: "link", onClick: handleChatWithAIClick, className: "ask-redhat-chat-button", icon: React.createElement(StarIcon, null) }, "Try again with AI Chat")))));
|
|
103
|
-
}
|
|
104
|
-
return (React.createElement("div", { className: "ask-redhat" },
|
|
105
|
-
React.createElement("p", { className: "ask-redhat-title" },
|
|
106
|
-
React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
107
|
-
"Resolve your issue now with AI insights"),
|
|
108
|
-
React.createElement("div", { className: "ask-redhat-content-wrapper" },
|
|
109
|
-
React.createElement("div", { ref: contentRef, className: `ask-redhat-content ${isExpanded ? 'ask-redhat-content--expanded' : ''}` },
|
|
110
|
-
React.createElement("div", { className: `ask-redhat-content-scrollable ${isExpanded ? 'ask-redhat-content--expanded-scrollable' : ''}` },
|
|
111
|
-
React.createElement("div", null,
|
|
112
|
-
React.createElement("div", { dangerouslySetInnerHTML: { __html: parseMarkdown(answer) } }),
|
|
113
|
-
sourcesCount > 0 && (React.createElement(React.Fragment, null,
|
|
114
|
-
React.createElement("p", null, "2 sources"),
|
|
115
|
-
React.createElement("div", { className: "ask-redhat-cards" }, sources.map((source, index) => (React.createElement(Card, { className: "ask-redhat-card", key: index },
|
|
116
|
-
React.createElement(CardHeader, null,
|
|
117
|
-
React.createElement("h3", { className: "ask-redhat-card-title" },
|
|
118
|
-
React.createElement("a", { href: source.link, target: "_blank", rel: "noopener noreferrer" }, source.title))),
|
|
119
|
-
React.createElement(CardBody, null,
|
|
120
|
-
React.createElement("p", null, source.snippet)))))))),
|
|
121
|
-
React.createElement("div", { className: "response-actions-wrapper" },
|
|
122
|
-
React.createElement(ResponseActions, { actions: responseActions, submittedFeedbackTypes: submittedFeedbackTypes })))),
|
|
123
|
-
React.createElement("div", { className: "ask-redhat-footer-wrapper" },
|
|
124
|
-
React.createElement("div", { className: "ask-redhat-footer" },
|
|
125
|
-
React.createElement("p", { className: "ask-redhat-footer-text" }, "Want to continue the conversation? Dive deeper with our AI assistant"),
|
|
126
|
-
React.createElement(Button, { onClick: handleChatWithAIClick, className: 'ask-redhat-chat-button', icon: React.createElement(StarIcon, null) }, "Chat with AI"))),
|
|
127
|
-
!isExpanded && React.createElement("div", { className: "ask-redhat-fade-overlay" }))),
|
|
128
|
-
React.createElement("div", { className: "ask-redhat-toggle-button-wrapper" },
|
|
129
|
-
React.createElement("div", { className: "ask-redhat-border-line" }),
|
|
130
|
-
React.createElement(Button, { onClick: onToggle, className: isExpanded ? 'ask-redhat-toggle-button-collapsed' : 'ask-redhat-toggle-button' },
|
|
131
|
-
isExpanded ? React.createElement(CollapseIcon, null) : React.createElement(StarIcon, { width: 20, height: 20 }),
|
|
132
|
-
isExpanded ? '' : 'Read more')),
|
|
133
|
-
React.createElement(Modal, { variant: ModalVariant.small, isOpen: showFeedbackCard, onClose: () => {
|
|
134
|
-
setShowFeedbackCard(false);
|
|
135
|
-
setFeedbackType('');
|
|
136
|
-
} },
|
|
137
|
-
React.createElement(UserFeedback, { title: feedbackType === 'positive'
|
|
138
|
-
? MODAL_MESSAGES.feedback.positive
|
|
139
|
-
: MODAL_MESSAGES.feedback.negative, hasTextArea: true, quickResponses: feedbackType === 'positive' ? QUICK_RESPONSES.positive : QUICK_RESPONSES.negative, onSubmit: handleFeedbackSubmit, onClose: () => {
|
|
140
|
-
setShowFeedbackCard(false);
|
|
141
|
-
setFeedbackType('');
|
|
142
|
-
} })),
|
|
143
|
-
React.createElement(Modal, { variant: ModalVariant.small, isOpen: showFeedbackComplete, onClose: () => {
|
|
144
|
-
setShowFeedbackComplete(false);
|
|
145
|
-
setFeedbackType('');
|
|
146
|
-
} },
|
|
147
|
-
React.createElement(UserFeedbackComplete, { title: MODAL_MESSAGES.complete.title, body: MODAL_MESSAGES.complete.body, onClose: () => {
|
|
148
|
-
setShowFeedbackComplete(false);
|
|
149
|
-
setFeedbackType('');
|
|
150
|
-
} }))));
|
|
151
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@patternfly/react-core';
|
|
2
|
-
import { type FunctionComponent } from 'react';
|
|
3
|
-
export interface CloseButtonProps extends ButtonProps {
|
|
4
|
-
onClose?: () => void;
|
|
5
|
-
ariaLabel?: string;
|
|
6
|
-
}
|
|
7
|
-
declare const CloseButton: FunctionComponent<CloseButtonProps>;
|
|
8
|
-
export default CloseButton;
|
|
9
|
-
//# sourceMappingURL=CloseButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CloseButton.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/CloseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAEpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Button } from '@patternfly/react-core';
|
|
2
|
-
import CloseIcon from '@patternfly/react-icons/dist/esm/icons/close-icon';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
const CloseButton = ({ onClose, ariaLabel }) => (React.createElement(Button, { variant: "plain", onClick: onClose, icon: React.createElement(CloseIcon, null), "aria-label": ariaLabel }));
|
|
5
|
-
export default CloseButton;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LabelGroupProps, LabelProps } from '@patternfly/react-core';
|
|
2
|
-
import { type FunctionComponent } from 'react';
|
|
3
|
-
export interface QuickResponse extends Omit<LabelProps, 'children'> {
|
|
4
|
-
content: string;
|
|
5
|
-
id: string;
|
|
6
|
-
}
|
|
7
|
-
export interface QuickResponseProps {
|
|
8
|
-
quickResponses: QuickResponse[];
|
|
9
|
-
quickResponseContainerProps?: Omit<LabelGroupProps, 'ref'>;
|
|
10
|
-
onSelect?: (id: string) => void;
|
|
11
|
-
isCompact?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const QuickResponse: FunctionComponent<QuickResponseProps>;
|
|
14
|
-
export default QuickResponse;
|
|
15
|
-
//# sourceMappingURL=QuickResponse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QuickResponse.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/QuickResponse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAc,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAEhE,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IAC/B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,2BAA2B,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IAC3D,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CAqC/D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { Label, LabelGroup } from '@patternfly/react-core';
|
|
13
|
-
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
14
|
-
import React, { useState } from 'react';
|
|
15
|
-
export const QuickResponse = ({ quickResponses, quickResponseContainerProps = { numLabels: 5 }, onSelect, isCompact, }) => {
|
|
16
|
-
const [selectedQuickResponse, setSelectedQuickResponse] = useState();
|
|
17
|
-
const handleQuickResponseClick = (id) => {
|
|
18
|
-
setSelectedQuickResponse(id);
|
|
19
|
-
onSelect && onSelect(id);
|
|
20
|
-
};
|
|
21
|
-
return (React.createElement(LabelGroup, Object.assign({ className: `pf-chatbot__message-quick-response ${(quickResponseContainerProps === null || quickResponseContainerProps === void 0 ? void 0 : quickResponseContainerProps.className) ? quickResponseContainerProps === null || quickResponseContainerProps === void 0 ? void 0 : quickResponseContainerProps.className : ''}` }, quickResponseContainerProps), quickResponses.map((_a) => {
|
|
22
|
-
var { id, content, className } = _a, props = __rest(_a, ["id", "content", "className"]);
|
|
23
|
-
return (React.createElement(Label, Object.assign({ variant: id === selectedQuickResponse ? undefined : 'outline', icon: id === selectedQuickResponse ? React.createElement(CheckIcon, null) : undefined, color: "blue", key: id, onClick: () => handleQuickResponseClick(id), className: `${id === selectedQuickResponse ? 'pf-chatbot__message-quick-response--selected' : ''} ${className ? className : ''}`, isCompact: isCompact }, props), content));
|
|
24
|
-
})));
|
|
25
|
-
};
|
|
26
|
-
export default QuickResponse;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@patternfly/react-core';
|
|
2
|
-
import React, { type FunctionComponent, type MouseEvent } from 'react';
|
|
3
|
-
export interface ResponseActionButtonProps extends ButtonProps {
|
|
4
|
-
ariaLabel?: string;
|
|
5
|
-
clickedAriaLabel?: string;
|
|
6
|
-
icon: React.ReactNode;
|
|
7
|
-
onClick?: ((event: MouseEvent | React.MouseEvent<Element, MouseEvent> | KeyboardEvent) => void) | undefined;
|
|
8
|
-
tooltipContent?: string;
|
|
9
|
-
clickedTooltipContent?: string;
|
|
10
|
-
/** Props to control if the button should be disabled */
|
|
11
|
-
isDisabled?: boolean;
|
|
12
|
-
isClicked?: boolean;
|
|
13
|
-
innerRef?: React.Ref<HTMLButtonElement>;
|
|
14
|
-
}
|
|
15
|
-
export declare const ResponseActionButtonBase: FunctionComponent<ResponseActionButtonProps>;
|
|
16
|
-
declare const ResponseActionButton: React.ForwardRefExoticComponent<ResponseActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
-
export default ResponseActionButton;
|
|
18
|
-
//# sourceMappingURL=ResponseActionButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseActionButton.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/ResponseActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAiB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAwB,MAAM,OAAO,CAAC;AAE7F,MAAM,WAAW,yBAA0B,SAAQ,WAAW;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,aAAa,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,wDAAwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,yBAAyB,CAmDjF,CAAC;AAEF,QAAA,MAAM,oBAAoB,qGAExB,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { Button, Icon, Tooltip } from '@patternfly/react-core';
|
|
13
|
-
import React, { forwardRef } from 'react';
|
|
14
|
-
export const ResponseActionButtonBase = (_a) => {
|
|
15
|
-
var { ariaLabel, clickedAriaLabel = ariaLabel, icon, onClick, tooltipContent, clickedTooltipContent = tooltipContent, isDisabled, isClicked = false, innerRef } = _a, props = __rest(_a, ["ariaLabel", "clickedAriaLabel", "icon", "onClick", "tooltipContent", "clickedTooltipContent", "isDisabled", "isClicked", "innerRef"]);
|
|
16
|
-
const generateAriaLabel = () => {
|
|
17
|
-
if (ariaLabel) {
|
|
18
|
-
return isClicked ? clickedAriaLabel : ariaLabel;
|
|
19
|
-
}
|
|
20
|
-
return isClicked ? clickedTooltipContent : tooltipContent;
|
|
21
|
-
};
|
|
22
|
-
return (React.createElement(Tooltip, { id: `pf-chatbot__tooltip-response-action-${tooltipContent}`, content: isClicked ? clickedTooltipContent : tooltipContent, "aria-live": "polite", position: "bottom", entryDelay: 0, exitDelay: 0, distance: 8, animationDuration: 0,
|
|
23
|
-
// prevents VO announcements of both aria label and tooltip
|
|
24
|
-
aria: "none" },
|
|
25
|
-
React.createElement(Button, Object.assign({ variant: "plain", className: `pf-chatbot__button--response-action ${isClicked ? 'pf-chatbot__button--response-action-clicked' : ''}`, "aria-label": generateAriaLabel(), icon: React.createElement(Icon, { isInline: true, size: "lg" }, icon), isDisabled: isDisabled, onClick: onClick, size: "sm", ref: innerRef }, props))));
|
|
26
|
-
};
|
|
27
|
-
const ResponseActionButton = forwardRef((props, ref) => (React.createElement(ResponseActionButtonBase, Object.assign({ innerRef: ref }, props))));
|
|
28
|
-
export default ResponseActionButton;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '@patternfly/react-core';
|
|
2
|
-
import React, { type FunctionComponent, type MouseEvent } from 'react';
|
|
3
|
-
export interface ActionProps extends Omit<ButtonProps, 'ref'> {
|
|
4
|
-
ariaLabel?: string;
|
|
5
|
-
clickedAriaLabel?: string;
|
|
6
|
-
onClick?: ((event: MouseEvent | React.MouseEvent<Element, MouseEvent> | KeyboardEvent) => void) | undefined;
|
|
7
|
-
tooltipContent?: string;
|
|
8
|
-
clickedTooltipContent?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ResponseActionProps {
|
|
11
|
-
actions: {
|
|
12
|
-
positive?: ActionProps;
|
|
13
|
-
negative?: ActionProps;
|
|
14
|
-
copy?: ActionProps;
|
|
15
|
-
};
|
|
16
|
-
submittedFeedbackTypes?: string[];
|
|
17
|
-
}
|
|
18
|
-
export declare const ResponseActions: FunctionComponent<ResponseActionProps>;
|
|
19
|
-
export default ResponseActions;
|
|
20
|
-
//# sourceMappingURL=ResponseActions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseActions.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/ResponseActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAA+B,MAAM,OAAO,CAAC;AAIpG,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,aAAa,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5G,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE;QACL,QAAQ,CAAC,EAAE,WAAW,CAAC;QACvB,QAAQ,CAAC,EAAE,WAAW,CAAC;QACvB,IAAI,CAAC,EAAE,WAAW,CAAC;KACtB,CAAC;IACF,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,mBAAmB,CA4FlE,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import OutlinedCopyIcon from '@patternfly/react-icons/dist/esm/icons/outlined-copy-icon';
|
|
2
|
-
import OutlinedThumbsDownIcon from '@patternfly/react-icons/dist/esm/icons/outlined-thumbs-down-icon';
|
|
3
|
-
import OutlinedThumbsUpIcon from '@patternfly/react-icons/dist/esm/icons/outlined-thumbs-up-icon';
|
|
4
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import ResponseActionButton from './ResponseActionButton';
|
|
6
|
-
export const ResponseActions = ({ actions, submittedFeedbackTypes = [], }) => {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f;
|
|
8
|
-
const [activeButton, setActiveButton] = useState();
|
|
9
|
-
const [clickStatePersisted, setClickStatePersisted] = useState(false);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
// Define the order of precedence for checking initial `isClicked`
|
|
12
|
-
const actionPrecedence = ['positive', 'negative', 'copy'];
|
|
13
|
-
let initialActive;
|
|
14
|
-
// Check predefined actions first based on precedence
|
|
15
|
-
for (const actionName of actionPrecedence) {
|
|
16
|
-
const actionProp = actions[actionName];
|
|
17
|
-
if (actionProp === null || actionProp === void 0 ? void 0 : actionProp.isClicked) {
|
|
18
|
-
initialActive = actionName;
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (initialActive) {
|
|
23
|
-
// Click state is explicitly controlled by consumer.
|
|
24
|
-
setClickStatePersisted(true);
|
|
25
|
-
}
|
|
26
|
-
setActiveButton(initialActive);
|
|
27
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
-
}, [actions]);
|
|
29
|
-
const { positive, negative, copy } = actions;
|
|
30
|
-
const responseActions = useRef(null);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
const handleClickOutside = (e) => {
|
|
33
|
-
if (responseActions.current && !responseActions.current.contains(e.target) && !clickStatePersisted) {
|
|
34
|
-
setActiveButton(undefined);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
window.addEventListener('click', handleClickOutside);
|
|
38
|
-
return () => {
|
|
39
|
-
window.removeEventListener('click', handleClickOutside);
|
|
40
|
-
};
|
|
41
|
-
}, [clickStatePersisted]);
|
|
42
|
-
const handleClick = (e, id, onClick) => {
|
|
43
|
-
setClickStatePersisted(false);
|
|
44
|
-
setActiveButton(id);
|
|
45
|
-
onClick && onClick(e);
|
|
46
|
-
};
|
|
47
|
-
return (React.createElement("div", { ref: responseActions, className: "pf-chatbot__response-actions" },
|
|
48
|
-
positive && (React.createElement(ResponseActionButton, { ariaLabel: "Good response", clickedAriaLabel: "Response recorded", onClick: (e) => handleClick(e, 'positive', positive.onClick), tooltipContent: (_a = positive.tooltipContent) !== null && _a !== void 0 ? _a : 'Good response', clickedTooltipContent: (_b = positive.clickedTooltipContent) !== null && _b !== void 0 ? _b : 'Response recorded', icon: React.createElement(OutlinedThumbsUpIcon, null), isClicked: activeButton === 'positive', isDisabled: submittedFeedbackTypes === null || submittedFeedbackTypes === void 0 ? void 0 : submittedFeedbackTypes.includes('positive') })),
|
|
49
|
-
negative && (React.createElement(ResponseActionButton, { ariaLabel: "Bad response", clickedAriaLabel: "Response recorded", onClick: (e) => handleClick(e, 'negative', negative.onClick), tooltipContent: (_c = negative.tooltipContent) !== null && _c !== void 0 ? _c : 'Bad response', clickedTooltipContent: (_d = negative.clickedTooltipContent) !== null && _d !== void 0 ? _d : 'Response recorded', icon: React.createElement(OutlinedThumbsDownIcon, null), isClicked: activeButton === 'negative', isDisabled: submittedFeedbackTypes === null || submittedFeedbackTypes === void 0 ? void 0 : submittedFeedbackTypes.includes('negative') })),
|
|
50
|
-
copy && (React.createElement(ResponseActionButton, { ariaLabel: "Copy", clickedAriaLabel: "Copied", onClick: (e) => handleClick(e, 'copy', copy.onClick), tooltipContent: (_e = copy.tooltipContent) !== null && _e !== void 0 ? _e : 'Copy', clickedTooltipContent: (_f = copy.clickedTooltipContent) !== null && _f !== void 0 ? _f : 'Copied', icon: React.createElement(OutlinedCopyIcon, null), isClicked: activeButton === 'copy' }))));
|
|
51
|
-
};
|
|
52
|
-
export default ResponseActions;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CardProps, OUIAProps } from '@patternfly/react-core';
|
|
2
|
-
import { type FunctionComponent } from 'react';
|
|
3
|
-
import QuickResponse from './QuickResponse';
|
|
4
|
-
export interface UserFeedbackProps extends Omit<CardProps, 'onSubmit'>, OUIAProps {
|
|
5
|
-
quickResponses?: QuickResponse[];
|
|
6
|
-
hasTextArea?: boolean;
|
|
7
|
-
onSubmit: (selectedResponse?: string, additionalFeedback?: string) => void;
|
|
8
|
-
onClose: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const UserFeedback: FunctionComponent<UserFeedbackProps>;
|
|
11
|
-
export default UserFeedback;
|
|
12
|
-
//# sourceMappingURL=UserFeedback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAChC,OAAc,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAGhE,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;CACvB;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAqEtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { ActionGroup, Button, Card, CardBody, CardHeader, Form, TextArea, } from '@patternfly/react-core';
|
|
13
|
-
import React, { useState } from 'react';
|
|
14
|
-
import CloseButton from './CloseButton';
|
|
15
|
-
import QuickResponse from './QuickResponse';
|
|
16
|
-
const UserFeedback = (_a) => {
|
|
17
|
-
var { title = 'Why did you choose this rating?', hasTextArea, quickResponses, onSubmit, onClose, isCompact } = _a, props = __rest(_a, ["title", "hasTextArea", "quickResponses", "onSubmit", "onClose", "isCompact"]);
|
|
18
|
-
const [selectedResponse, setSelectedResponse] = useState();
|
|
19
|
-
const [value, setValue] = useState('');
|
|
20
|
-
return (React.createElement(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__feedback-card" }, props),
|
|
21
|
-
React.createElement(CardHeader, { actions: {
|
|
22
|
-
actions: React.createElement(CloseButton, { onClose: onClose }),
|
|
23
|
-
} },
|
|
24
|
-
React.createElement("h1", { className: "pf-chatbot__feedback-card-title" }, title)),
|
|
25
|
-
React.createElement(CardBody, null,
|
|
26
|
-
React.createElement(Form, { className: `pf-chatbot__feedback-card-form ${isCompact ? 'pf-m-compact' : ''}` },
|
|
27
|
-
quickResponses && (React.createElement(QuickResponse, { quickResponses: quickResponses, onSelect: (id) => {
|
|
28
|
-
const selectedQuickResponse = quickResponses.find((response) => response.id === id);
|
|
29
|
-
setSelectedResponse(selectedQuickResponse === null || selectedQuickResponse === void 0 ? void 0 : selectedQuickResponse.content);
|
|
30
|
-
}, isCompact: isCompact })),
|
|
31
|
-
hasTextArea && (React.createElement(React.Fragment, null,
|
|
32
|
-
React.createElement(TextArea, { value: value, onChange: (_event, value) => {
|
|
33
|
-
setValue(value);
|
|
34
|
-
}, placeholder: "Provide optional additional feedback", "aria-label": "Provide optional additional feedback", resizeOrientation: "vertical" }),
|
|
35
|
-
React.createElement("div", { className: "privacy-notice-container" },
|
|
36
|
-
React.createElement("p", null,
|
|
37
|
-
"Do not share any personal or other sensitive information in your feedback. Feedback may be used to improve Red Hat's products or services. For more information about Red Hat's privacy practices, please refer to the",
|
|
38
|
-
' ',
|
|
39
|
-
React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" }, "Red Hat Privacy Statement"),
|
|
40
|
-
".")))),
|
|
41
|
-
React.createElement(ActionGroup, null,
|
|
42
|
-
React.createElement(Button, { onClick: () => onSubmit(selectedResponse, value) }, "Send Feedback"))))));
|
|
43
|
-
};
|
|
44
|
-
export default UserFeedback;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CardProps, OUIAProps } from '@patternfly/react-core';
|
|
2
|
-
import React, { type FunctionComponent } from 'react';
|
|
3
|
-
export interface UserFeedbackCompleteProps extends Omit<CardProps, 'ref'>, OUIAProps {
|
|
4
|
-
title?: string;
|
|
5
|
-
body?: string | React.ReactNode;
|
|
6
|
-
onClose?: () => void;
|
|
7
|
-
}
|
|
8
|
-
declare const UserFeedbackComplete: FunctionComponent<UserFeedbackCompleteProps>;
|
|
9
|
-
export default UserFeedbackComplete;
|
|
10
|
-
//# sourceMappingURL=UserFeedbackComplete.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserFeedbackComplete.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/UserFeedbackComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,SAAS,EAAa,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAItD,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,SAAS;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,QAAA,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,yBAAyB,CAyEtE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { Card, CardBody, CardHeader, CardTitle } from '@patternfly/react-core';
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import CloseButton from './CloseButton';
|
|
15
|
-
const UserFeedbackComplete = (_a) => {
|
|
16
|
-
var { title = 'Feedback submitted', body = "We've received your response. Thank you for sharing your feedback!", onClose, isCompact } = _a, props = __rest(_a, ["title", "body", "onClose", "isCompact"]);
|
|
17
|
-
return (React.createElement(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__feedback-card pf-chatbot__feedback-card-complete" }, props),
|
|
18
|
-
React.createElement(CardHeader, { className: onClose
|
|
19
|
-
? 'pf-chatbot__feedback-card-complete-header'
|
|
20
|
-
: 'pf-chatbot__feedback-card-complete-empty-header', actions: onClose
|
|
21
|
-
? {
|
|
22
|
-
actions: React.createElement(CloseButton, { onClose: onClose }),
|
|
23
|
-
}
|
|
24
|
-
: undefined }),
|
|
25
|
-
React.createElement("div", { className: "pf-chatbot__feedback-complete-body" },
|
|
26
|
-
React.createElement("div", { className: "pf-chatbot__feedback-complete-image" },
|
|
27
|
-
React.createElement("svg", { width: "60", height: "64", viewBox: "0 0 60 64", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
28
|
-
React.createElement("path", { d: "M53.0555 21.5975H6.94323C3.57013 21.5975 0.835693 24.3319 0.835693 27.705V57.8925C0.835693 61.2656 3.57013 64 6.94323 64H53.0555C56.4286 64 59.1631 61.2656 59.1631 57.8925V27.705C59.1631 24.3319 56.4286 21.5975 53.0555 21.5975Z", fill: "#F8AE54" }),
|
|
29
|
-
React.createElement("path", { d: "M55.8973 19.8247C52.5894 15.7926 29.9992 0 29.9992 0C29.9992 0 7.40996 15.7926 4.10102 19.8247C0.79312 23.8568 0.835476 25.7184 0.835476 27.8899H59.1629C59.1629 25.7184 59.2052 23.8578 55.8973 19.8257V19.8247Z", fill: "#FFCC17" }),
|
|
30
|
-
React.createElement("g", null,
|
|
31
|
-
React.createElement("path", { d: "M53.0567 8.48981H6.94336V61.8388H53.0567V8.48981Z", fill: "#F2F2F2" })),
|
|
32
|
-
React.createElement("path", { d: "M51.6589 7.49908H8.34204V60.8481H51.6589V7.49908Z", fill: "white" }),
|
|
33
|
-
React.createElement("path", { d: "M0.835693 29.1296V57.8925C0.835693 59.2375 1.27165 60.4803 2.00823 61.4896L23.0303 43.5462L0.835693 29.1296Z", fill: "#FFCC17" }),
|
|
34
|
-
React.createElement("path", { d: "M36.9695 43.5472L57.9905 61.4907C58.7271 60.4813 59.1631 59.2386 59.1631 57.8935V29.1306L36.9685 43.5472H36.9695Z", fill: "#FFF4CC" }),
|
|
35
|
-
React.createElement("path", { d: "M0.835693 57.8925V57.8067L22.4146 42.7992L29.9994 37.5244L37.5842 42.7992L59.1641 57.8067V57.8925C59.1641 61.2665 56.4296 64 53.0566 64H6.94323C3.57024 64 0.835693 61.2665 0.835693 57.8925Z", fill: "#FFE072" }),
|
|
36
|
-
React.createElement("g", null,
|
|
37
|
-
React.createElement("path", { d: "M22.1563 42.978L0.835693 57.8067V56.6993L22.1563 42.978Z", fill: "#FEF07C" })),
|
|
38
|
-
React.createElement("g", null,
|
|
39
|
-
React.createElement("path", { d: "M37.8425 42.978L59.1631 57.8067V56.6993L37.8425 42.978Z", fill: "#FEF07C" })),
|
|
40
|
-
React.createElement("path", { d: "M37.8037 32.2373C42.1136 27.9273 42.1136 20.9395 37.8037 16.6295C33.4937 12.3196 26.5059 12.3196 22.196 16.6295C17.886 20.9395 17.886 27.9273 22.196 32.2373C26.5059 36.5472 33.4937 36.5472 37.8037 32.2373Z", fill: "#0066CC" }),
|
|
41
|
-
React.createElement("path", { d: "M27.7803 30.1276C27.6098 30.1276 27.4497 30.0614 27.3298 29.9406L22.9465 25.5562C22.8267 25.4364 22.7595 25.2762 22.7595 25.1068C22.7595 24.9374 22.8256 24.7762 22.9465 24.6554L24.2379 23.364C24.3577 23.2442 24.5178 23.177 24.6883 23.177C24.8587 23.177 25.0168 23.2431 25.1377 23.363L27.7803 26.0056L34.861 18.9259C34.9808 18.8061 35.1409 18.7389 35.3103 18.7389C35.4798 18.7389 35.6389 18.8051 35.7597 18.9239L37.0531 20.2173C37.173 20.3361 37.2401 20.4962 37.2401 20.6677C37.2401 20.8392 37.174 20.9983 37.0531 21.1181L28.2317 29.9406C28.1119 30.0604 27.9518 30.1265 27.7823 30.1265L27.7803 30.1276Z", fill: "white" }))),
|
|
42
|
-
React.createElement("div", { className: "pf-chatbot__feedback-complete-text" },
|
|
43
|
-
React.createElement(CardTitle, { className: "pf-chatbot__feedback-complete-title" }, title),
|
|
44
|
-
React.createElement(CardBody, { className: `pf-chatbot__feedback-complete-card-body` }, body)))));
|
|
45
|
-
};
|
|
46
|
-
export default UserFeedbackComplete;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CollapseIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/TroubleshootSection/icons/CollapseIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,SAAS;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,UAAW,SAAS,sBAiB5C,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export const CollapseIcon = (props) => {
|
|
3
|
-
const { width = 18.118, height = 12 } = props;
|
|
4
|
-
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 19 11", fill: "none", style: {
|
|
5
|
-
flexShrink: 0,
|
|
6
|
-
} },
|
|
7
|
-
React.createElement("path", { d: "M9.05895 0L16.9042 7.07143H1.21367L9.05895 0Z", fill: "#9F549C" }),
|
|
8
|
-
React.createElement("path", { d: "M9.05895 1.57129L16.9042 8.64272H1.21367L9.05895 1.57129Z", fill: "white" })));
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StarIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/TroubleshootSection/icons/StarIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,SAAS;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,UAAW,SAAS,sBAgDxC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export const StarIcon = (props) => {
|
|
3
|
-
const { width = 16, height = 15.273 } = props;
|
|
4
|
-
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 16 15.273", fill: "none", style: {
|
|
5
|
-
flexShrink: 0,
|
|
6
|
-
aspectRatio: '16.00/15.27',
|
|
7
|
-
} },
|
|
8
|
-
React.createElement("path", { d: "M16.197 9.21581L11.3573 8.18825L10.3297 3.34854C10.2937 3.16868 10.1345 3.04541 9.95463 3.04541C9.77478 3.04541 9.61558 3.17385 9.57958 3.34854L8.55202 8.18825L3.71231 9.21581C3.53245 9.25181 3.40918 9.41101 3.40918 9.59087C3.40918 9.77072 3.53762 9.92992 3.71231 9.96592L8.55202 10.9935L9.57958 15.8332C9.61558 16.013 9.77478 16.1363 9.95463 16.1363C10.1345 16.1363 10.2937 16.0079 10.3297 15.8332L11.3573 10.9935L16.197 9.96592C16.3768 9.92992 16.5001 9.77072 16.5001 9.59087C16.5001 9.41101 16.3717 9.25181 16.197 9.21581Z", fill: "url(#paint0_linear_5146_16767)" }),
|
|
9
|
-
React.createElement("path", { d: "M3.40909 6.68195C3.58647 6.68195 3.74356 6.55526 3.77905 6.38297L4.16931 4.53308L6.0192 4.14282C6.19658 4.10733 6.31818 3.95024 6.31818 3.77286C6.31818 3.59548 6.19149 3.43839 6.0192 3.4029L4.16931 3.01264L3.77905 1.16275C3.74356 0.98537 3.58647 0.86377 3.40909 0.86377C3.23171 0.86377 3.07462 0.990461 3.03913 1.16275L2.64887 3.01264L0.798982 3.4029C0.6216 3.43839 0.5 3.59548 0.5 3.77286C0.5 3.95024 0.626691 4.10733 0.798982 4.14282L2.64887 4.53308L3.03913 6.38297C3.07462 6.56035 3.23171 6.68195 3.40909 6.68195Z", fill: "url(#paint1_linear_5146_16767)" }),
|
|
10
|
-
React.createElement("defs", null,
|
|
11
|
-
React.createElement("linearGradient", { id: "paint0_linear_5146_16767", x1: "9.95463", y1: "3.04541", x2: "9.95463", y2: "16.1363", gradientUnits: "userSpaceOnUse" },
|
|
12
|
-
React.createElement("stop", { stopColor: "#F56E6E" }),
|
|
13
|
-
React.createElement("stop", { offset: "1", stopColor: "#5E40BE" })),
|
|
14
|
-
React.createElement("linearGradient", { id: "paint1_linear_5146_16767", x1: "3.40909", y1: "0.86377", x2: "3.40909", y2: "6.68195", gradientUnits: "userSpaceOnUse" },
|
|
15
|
-
React.createElement("stop", { stopColor: "#F56E6E" }),
|
|
16
|
-
React.createElement("stop", { offset: "1", stopColor: "#5E40BE" })))));
|
|
17
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export declare const QUICK_RESPONSES: {
|
|
2
|
-
positive: {
|
|
3
|
-
id: string;
|
|
4
|
-
content: string;
|
|
5
|
-
}[];
|
|
6
|
-
negative: {
|
|
7
|
-
id: string;
|
|
8
|
-
content: string;
|
|
9
|
-
}[];
|
|
10
|
-
};
|
|
11
|
-
export declare const TOOLTIP_MESSAGES: {
|
|
12
|
-
readonly positive: {
|
|
13
|
-
readonly tooltipContent: "Good response";
|
|
14
|
-
readonly clickedTooltipContent: "Response recorded as helpful";
|
|
15
|
-
};
|
|
16
|
-
readonly negative: {
|
|
17
|
-
readonly tooltipContent: "Bad response";
|
|
18
|
-
readonly clickedTooltipContent: "Response recorded as unhelpful";
|
|
19
|
-
};
|
|
20
|
-
readonly copy: {
|
|
21
|
-
readonly tooltipContent: "Copy";
|
|
22
|
-
readonly clickedTooltipContent: "Response copied";
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare const MODAL_MESSAGES: {
|
|
26
|
-
readonly feedback: {
|
|
27
|
-
readonly positive: "Thank you. Any more feedback?";
|
|
28
|
-
readonly negative: "Thank you. How can we improve?";
|
|
29
|
-
};
|
|
30
|
-
readonly complete: {
|
|
31
|
-
readonly title: "We appreciate your input.";
|
|
32
|
-
readonly body: "It helps us improve this experience.";
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=askRedHatMessages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"askRedHatMessages.d.ts","sourceRoot":"","sources":["../../../src/constants/askRedHatMessages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;CAW3B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;CAanB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;CASjB,CAAC"}
|