@rh-support/components 2.5.17 → 2.5.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,6 +2,10 @@ import React from 'react';
|
|
|
2
2
|
interface IProps {
|
|
3
3
|
isModalOpen: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
|
+
caseSummaryId?: number | null;
|
|
6
|
+
feedbackFooterMessage?: string;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
isCaseSummary: boolean;
|
|
5
9
|
}
|
|
6
10
|
declare function SupportFeedbackModal(props: IProps): React.JSX.Element;
|
|
7
11
|
declare namespace SupportFeedbackModal {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportFeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/SupportFeedbackForm/SupportFeedbackModal.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAanD,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SupportFeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/SupportFeedbackForm/SupportFeedbackModal.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAanD,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAMD,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAqQ1C;kBArQQ,oBAAoB;;;AAwQ7B,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -50,6 +50,14 @@ function SupportFeedbackModal(props) {
|
|
|
50
50
|
});
|
|
51
51
|
setSubmitButtonValid(!valid);
|
|
52
52
|
}, [values]);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (props.caseSummaryId) {
|
|
55
|
+
setValues((prev) => (Object.assign(Object.assign({}, prev), { caseSummaryId: props.caseSummaryId })));
|
|
56
|
+
}
|
|
57
|
+
if (props.errorMessage) {
|
|
58
|
+
setValues((prev) => (Object.assign(Object.assign({}, prev), { caseSummaryErrorMessage: props.errorMessage })));
|
|
59
|
+
}
|
|
60
|
+
}, [props.caseSummaryId, props.errorMessage]);
|
|
53
61
|
// To Handle the Feedback Satisfaction values
|
|
54
62
|
const handleSentimentChange = (event) => {
|
|
55
63
|
setIsSubmitDisabled(false);
|
|
@@ -63,9 +71,20 @@ function SupportFeedbackModal(props) {
|
|
|
63
71
|
const handleSubmit = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
64
72
|
event.preventDefault();
|
|
65
73
|
if (!isSubmitButtonValid) {
|
|
74
|
+
let updatedValues = Object.assign({}, values);
|
|
75
|
+
if (props.isCaseSummary) {
|
|
76
|
+
const extraInfo = [
|
|
77
|
+
props.errorMessage && `caseSummaryErrorMessage:'${props.errorMessage}'\n`,
|
|
78
|
+
props.caseSummaryId && `caseSummaryId:'${props.caseSummaryId}'\n`,
|
|
79
|
+
];
|
|
80
|
+
updatedValues = Object.assign(Object.assign({}, updatedValues), { moreInfo: `${extraInfo}${updatedValues.moreInfo || ''}`.trim() });
|
|
81
|
+
delete updatedValues.caseSummaryErrorMessage;
|
|
82
|
+
delete updatedValues.caseSummaryId;
|
|
83
|
+
}
|
|
66
84
|
try {
|
|
67
|
-
|
|
68
|
-
|
|
85
|
+
// Call the request with the updated values
|
|
86
|
+
yield request(updatedValues, window.sessionjs, window.location.href, seSessionId);
|
|
87
|
+
setValues(formInitState); // Reset form state after successful submission
|
|
69
88
|
ToastNotification.addSuccessMessage(t(`Thank you. We've received your feedback.`), t('Have a great day!'));
|
|
70
89
|
handleModalToggle();
|
|
71
90
|
}
|
|
@@ -118,7 +137,7 @@ function SupportFeedbackModal(props) {
|
|
|
118
137
|
React.createElement("form", { className: "support-feedback-form", action: "", onSubmit: handleSubmit },
|
|
119
138
|
React.createElement("fieldset", { className: "form-group radios feedback-satisfaction pf-v5-u-mb-sm", role: "radiogroup", "aria-labelledby": "feedback-satisfaction-label" },
|
|
120
139
|
React.createElement("legend", { id: "feedback-satisfaction-label", className: "pf-v5-u-mb-md" },
|
|
121
|
-
React.createElement(Trans, null, "How satisfied are you with customer support\u2019s web experience?"),
|
|
140
|
+
props.isCaseSummary ? (React.createElement(Trans, null, "How satisfied are you with generated AI case summary ?")) : (React.createElement(Trans, null, "How satisfied are you with customer support\u2019s web experience?")),
|
|
122
141
|
React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*"),
|
|
123
142
|
' '),
|
|
124
143
|
React.createElement("div", { className: "satisfaction-values-wrapper" }, sentiments.map((sentiment) => {
|
|
@@ -135,8 +154,11 @@ function SupportFeedbackModal(props) {
|
|
|
135
154
|
React.createElement("label", { htmlFor: "moreFeedback" },
|
|
136
155
|
React.createElement(Trans, null, "How can we improve?")),
|
|
137
156
|
React.createElement(TextAreaAutosize, { name: "moreInfo", id: "moreFeedback", placeholder: t('i18nDescribeSuggestionDetail', 'Describe your suggestion in detail'), disabled: isFetching, value: values.moreInfo, className: "form-control", onChange: handleFeedbackTextChange, rowsMin: 3 })),
|
|
138
|
-
React.createElement("p", null,
|
|
139
|
-
|
|
157
|
+
React.createElement("p", null, props.isCaseSummary ? (React.createElement(Trans, { i18nKey: "feedbackPrivacyNotice" },
|
|
158
|
+
"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\u2019s privacy practices, please refer to the",
|
|
159
|
+
' ',
|
|
160
|
+
React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" },
|
|
161
|
+
React.createElement("u", null, "Red Hat Privacy Statement.")))) : (React.createElement(Trans, null, "Feedback is sent to the web team working on this application, not the support associate working on your case."))))));
|
|
140
162
|
}
|
|
141
163
|
function returnModalAction() {
|
|
142
164
|
return [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/components",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.19",
|
|
4
4
|
"description": "Contains all reusabel components for support app",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"prepublishOnly": "npm run build"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@cee-eng/hydrajs": "4.18.
|
|
47
|
+
"@cee-eng/hydrajs": "4.18.57",
|
|
48
48
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
49
49
|
"@patternfly/patternfly": "5.4.2",
|
|
50
50
|
"@patternfly/react-core": "5.4.2",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"use-deep-compare-effect": "^1.6.1"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@cee-eng/hydrajs": "4.18.
|
|
63
|
+
"@cee-eng/hydrajs": "4.18.57",
|
|
64
64
|
"@cee-eng/ui-toolkit": "1.1.8",
|
|
65
65
|
"@patternfly/patternfly": "5.4.2",
|
|
66
66
|
"@patternfly/react-core": "5.4.2",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"@patternfly/react-table": "5.4.2",
|
|
69
69
|
"@patternfly/react-tokens": "^5.4.0",
|
|
70
70
|
"@rh-support/types": "2.0.5",
|
|
71
|
-
"@rh-support/user-permissions": "2.5.
|
|
72
|
-
"@rh-support/utils": "2.5.
|
|
71
|
+
"@rh-support/user-permissions": "2.5.12",
|
|
72
|
+
"@rh-support/utils": "2.5.11",
|
|
73
73
|
"dompurify": "^2.2.6",
|
|
74
74
|
"js-worker-search": "^1.4.1",
|
|
75
75
|
"lazysizes": "^5.3.2",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"defaults and supports es6-module",
|
|
107
107
|
"maintained node versions"
|
|
108
108
|
],
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "055bc8a9de6f81109f7fc040923b44d279c447c1"
|
|
110
110
|
}
|