@rh-support/components 2.5.18 → 2.5.20

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,10 +2,10 @@ import React from 'react';
2
2
  interface IProps {
3
3
  isModalOpen: boolean;
4
4
  onClose: () => void;
5
- caseSummaryId?: number;
5
+ caseSummaryId?: number | null;
6
6
  feedbackFooterMessage?: string;
7
- isCaseSummary?: boolean;
8
7
  errorMessage?: string;
8
+ isCaseSummary: boolean;
9
9
  }
10
10
  declare function SupportFeedbackModal(props: IProps): React.JSX.Element;
11
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;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAkP1C;kBAlPQ,oBAAoB;;;AAqP7B,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"SupportFeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/SupportFeedbackForm/SupportFeedbackModal.tsx"],"names":[],"mappings":"AAWA,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,qBAwQ1C;kBAxQQ,oBAAoB;;;AA2Q7B,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -15,6 +15,7 @@ import OutlinedGrinIcon from '@patternfly/react-icons/dist/js/icons/outlined-gri
15
15
  import OutlinedMehIcon from '@patternfly/react-icons/dist/js/icons/outlined-meh-icon';
16
16
  import OutlinedSmileIcon from '@patternfly/react-icons/dist/js/icons/outlined-smile-icon';
17
17
  import { getUrlParsedParams } from '@rh-support/utils';
18
+ import emojiRegex from 'emoji-regex';
18
19
  import isEmpty from 'lodash/isEmpty';
19
20
  import React, { useEffect, useState } from 'react';
20
21
  import { Trans, useTranslation } from 'react-i18next';
@@ -69,11 +70,24 @@ function SupportFeedbackModal(props) {
69
70
  };
70
71
  // To handle submit
71
72
  const handleSubmit = (event) => __awaiter(this, void 0, void 0, function* () {
73
+ var _a;
72
74
  event.preventDefault();
73
75
  if (!isSubmitButtonValid) {
76
+ let updatedValues = Object.assign({}, values);
77
+ if (props.isCaseSummary) {
78
+ const extraInfo = [
79
+ props.errorMessage && `caseSummaryErrorMessage:'${props.errorMessage}'\n`,
80
+ props.caseSummaryId && `caseSummaryId:'${props.caseSummaryId}'\n`,
81
+ ];
82
+ updatedValues = Object.assign(Object.assign({}, updatedValues), { moreInfo: `${extraInfo}${updatedValues.moreInfo || ''}`.trim() });
83
+ delete updatedValues.caseSummaryErrorMessage;
84
+ delete updatedValues.caseSummaryId;
85
+ }
74
86
  try {
75
- yield request(values, window.sessionjs, window.location.href, seSessionId);
76
- setValues(formInitState);
87
+ updatedValues.moreInfo = (_a = updatedValues.moreInfo) === null || _a === void 0 ? void 0 : _a.replace(emojiRegex(), (match) => encodeURIComponent(match));
88
+ // Call the request with the updated values
89
+ yield request(updatedValues, window.sessionjs, window.location.href, seSessionId);
90
+ setValues(formInitState); // Reset form state after successful submission
77
91
  ToastNotification.addSuccessMessage(t(`Thank you. We've received your feedback.`), t('Have a great day!'));
78
92
  handleModalToggle();
79
93
  }
@@ -126,7 +140,7 @@ function SupportFeedbackModal(props) {
126
140
  React.createElement("form", { className: "support-feedback-form", action: "", onSubmit: handleSubmit },
127
141
  React.createElement("fieldset", { className: "form-group radios feedback-satisfaction pf-v5-u-mb-sm", role: "radiogroup", "aria-labelledby": "feedback-satisfaction-label" },
128
142
  React.createElement("legend", { id: "feedback-satisfaction-label", className: "pf-v5-u-mb-md" },
129
- React.createElement(Trans, null, "How satisfied are you with customer support\u2019s web experience?"),
143
+ 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?")),
130
144
  React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*"),
131
145
  ' '),
132
146
  React.createElement("div", { className: "satisfaction-values-wrapper" }, sentiments.map((sentiment) => {
@@ -146,7 +160,8 @@ function SupportFeedbackModal(props) {
146
160
  React.createElement("p", null, props.isCaseSummary ? (React.createElement(Trans, { i18nKey: "feedbackPrivacyNotice" },
147
161
  "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",
148
162
  ' ',
149
- React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" }, "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."))))));
163
+ React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" },
164
+ 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."))))));
150
165
  }
151
166
  function returnModalAction() {
152
167
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/components",
3
- "version": "2.5.18",
3
+ "version": "2.5.20",
4
4
  "description": "Contains all reusabel components for support app",
5
5
  "author": "Vikas Rathee <vrathee@redhat.com>",
6
6
  "license": "ISC",
@@ -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.12",
72
- "@rh-support/utils": "2.5.11",
71
+ "@rh-support/user-permissions": "2.5.13",
72
+ "@rh-support/utils": "2.5.12",
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": "48b1925b17a320ff0c74ed3a018274a5e4cb0a87"
109
+ "gitHead": "1b833d4c1dfeea406f617d1b448972d280954a28"
110
110
  }