@bigbinary/neeto-thank-you-frontend 2.0.4 → 2.1.0
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/app/javascript/src/translations/en.json +1 -0
- package/dist/BrandingInfo-cb3c7c87.js +26 -0
- package/dist/BrandingInfo-cb3c7c87.js.map +1 -0
- package/dist/ConfigureThankYou.js +453 -375
- package/dist/ConfigureThankYou.js.map +1 -1
- package/dist/ShowThankYou.js +80 -69
- package/dist/ShowThankYou.js.map +1 -1
- package/dist/SocialShare-4ece80cd.js +44 -0
- package/dist/SocialShare-4ece80cd.js.map +1 -0
- package/dist/cjs/BrandingInfo-2f9123ba.js +28 -0
- package/dist/cjs/BrandingInfo-2f9123ba.js.map +1 -0
- package/dist/cjs/ConfigureThankYou.js +453 -376
- package/dist/cjs/ConfigureThankYou.js.map +1 -1
- package/dist/cjs/ShowThankYou.js +80 -70
- package/dist/cjs/ShowThankYou.js.map +1 -1
- package/dist/cjs/SocialShare-5ebb5ae3.js +48 -0
- package/dist/cjs/SocialShare-5ebb5ae3.js.map +1 -0
- package/dist/cjs/commons.js +24 -27
- package/dist/cjs/commons.js.map +1 -1
- package/dist/cjs/constants.js +3 -3
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/index.js +8 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{query-95d5312e.js → query-63e48fba.js} +3 -3
- package/dist/cjs/{query-95d5312e.js.map → query-63e48fba.js.map} +1 -1
- package/dist/cjs/useShowThankYouConfiguration.js +2 -2
- package/dist/cjs/useShowThankYouPage.js +2 -2
- package/dist/cjs/useThankYouConfigurationApi-27b0ace0.js +101 -0
- package/dist/cjs/useThankYouConfigurationApi-27b0ace0.js.map +1 -0
- package/dist/cjs/useThankYouPageApi-8d0e4fbc.js +41 -0
- package/dist/cjs/useThankYouPageApi-8d0e4fbc.js.map +1 -0
- package/dist/cjs/utils.js +11 -5
- package/dist/cjs/utils.js.map +1 -1
- package/dist/commons.js +24 -23
- package/dist/commons.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/{query-ab526f47.js → query-3e439d01.js} +3 -3
- package/dist/{query-ab526f47.js.map → query-3e439d01.js.map} +1 -1
- package/dist/useShowThankYouConfiguration.js +3 -3
- package/dist/useShowThankYouPage.js +3 -3
- package/dist/useThankYouConfigurationApi-5b45610e.js +93 -0
- package/dist/useThankYouConfigurationApi-5b45610e.js.map +1 -0
- package/dist/useThankYouPageApi-660012d0.js +35 -0
- package/dist/useThankYouPageApi-660012d0.js.map +1 -0
- package/dist/utils.js +11 -5
- package/dist/utils.js.map +1 -1
- package/package.json +11 -11
- package/dist/BrandingInfo-da0b773a.js +0 -32
- package/dist/BrandingInfo-da0b773a.js.map +0 -1
- package/dist/SocialShare-e7e5efc6.js +0 -45
- package/dist/SocialShare-e7e5efc6.js.map +0 -1
- package/dist/cjs/BrandingInfo-cdb9a379.js +0 -38
- package/dist/cjs/BrandingInfo-cdb9a379.js.map +0 -1
- package/dist/cjs/SocialShare-4607aba6.js +0 -53
- package/dist/cjs/SocialShare-4607aba6.js.map +0 -1
- package/dist/cjs/useThankYouConfigurationApi-302df56a.js +0 -58
- package/dist/cjs/useThankYouConfigurationApi-302df56a.js.map +0 -1
- package/dist/cjs/useThankYouPageApi-b6b47745.js +0 -43
- package/dist/cjs/useThankYouPageApi-b6b47745.js.map +0 -1
- package/dist/useThankYouConfigurationApi-ed20746a.js +0 -51
- package/dist/useThankYouConfigurationApi-ed20746a.js.map +0 -1
- package/dist/useThankYouPageApi-1ac56883.js +0 -37
- package/dist/useThankYouPageApi-1ac56883.js.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import React__default, { useState, useEffect, useRef } from 'react';
|
|
3
1
|
import { hyphenate, noop } from '@bigbinary/neeto-cist';
|
|
4
2
|
import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
|
|
5
|
-
import { n, T as THANK_YOU_TEXT_ALIGNMENTS, S as SocialShare } from './SocialShare-
|
|
3
|
+
import { n, T as THANK_YOU_TEXT_ALIGNMENTS, S as SocialShare } from './SocialShare-4ece80cd.js';
|
|
4
|
+
import { u as useShowThankYouConfiguration, _ as _defineProperty, a as useUpdateThankYouConfiguration } from './useThankYouConfigurationApi-5b45610e.js';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { useState, useEffect, memo, useRef } from 'react';
|
|
6
7
|
import classNames from 'classnames';
|
|
7
8
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
8
9
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
@@ -10,7 +11,6 @@ import BlockNavigation from '@bigbinary/neetoui/formik/BlockNavigation';
|
|
|
10
11
|
import NeetoUIForm from '@bigbinary/neetoui/formik/Form';
|
|
11
12
|
import Radio from '@bigbinary/neetoui/formik/Radio';
|
|
12
13
|
import { isEmpty } from 'ramda';
|
|
13
|
-
import { u as useShowThankYouConfiguration, a as useUpdateThankYouConfiguration } from './useThankYouConfigurationApi-ed20746a.js';
|
|
14
14
|
import { t } from 'i18next';
|
|
15
15
|
import { useFormikContext } from 'formik';
|
|
16
16
|
import FormikEditor from '@bigbinary/neeto-editor/FormikEditor';
|
|
@@ -19,28 +19,29 @@ import Input from '@bigbinary/neetoui/formik/Input';
|
|
|
19
19
|
import Switch from '@bigbinary/neetoui/formik/Switch';
|
|
20
20
|
import { useTranslation } from 'react-i18next';
|
|
21
21
|
import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
|
|
22
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
22
23
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
23
24
|
import Button from '@bigbinary/neetoui/Button';
|
|
24
25
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
25
26
|
import Modal from '@bigbinary/neetoui/Modal';
|
|
26
27
|
import EditorContent from '@bigbinary/neeto-editor/EditorContent';
|
|
27
|
-
import { B as BrandingInfo } from './BrandingInfo-
|
|
28
|
+
import { B as BrandingInfo } from './BrandingInfo-cb3c7c87.js';
|
|
28
29
|
import Link from '@bigbinary/neeto-icons/Link';
|
|
29
30
|
import { isEditorEmpty } from '@bigbinary/neeto-editor/utils';
|
|
30
31
|
import * as yup from 'yup';
|
|
31
32
|
import NeetoUIHeader from '@bigbinary/neeto-molecules/Header';
|
|
32
33
|
import '@tanstack/react-query';
|
|
33
34
|
import 'axios';
|
|
34
|
-
import './query-
|
|
35
|
+
import './query-3e439d01.js';
|
|
35
36
|
import './utils.js';
|
|
36
37
|
import '@bigbinary/neeto-commons-frontend/utils';
|
|
37
38
|
import './constants.js';
|
|
38
39
|
import '@bigbinary/neeto-commons-frontend/initializers';
|
|
39
40
|
|
|
40
|
-
var css = ".neeto-thank-you-configuration-radio__item{align-items:flex-start;background-color:rgb(var(--neeto-ui-white));border:1px solid rgb(var(--neeto-ui-gray-300));border-radius:var(--neeto-ui-rounded);padding:12px 16px}.neeto-thank-you-configuration-radio__item.neeto-ui-radio__item:not(:last-child){margin-right:0!important}.neeto-thank-you-configuration-radio__item.neeto-ui-radio__item{align-items:start!important}.neeto-thank-you-configuration-radio__item.neeto-ui-radio__item .neeto-ui-radio{margin-top:3px}.neeto-thank-you-configuration-radio__item.active{
|
|
41
|
+
var css = ".neeto-thank-you-configuration-radio__item{align-items:flex-start;background-color:rgb(var(--neeto-ui-white));border:1px solid rgb(var(--neeto-ui-gray-300));border-radius:var(--neeto-ui-rounded);padding:12px 16px}.neeto-thank-you-configuration-radio__item.neeto-ui-radio__item:not(:last-child){margin-right:0!important}.neeto-thank-you-configuration-radio__item.neeto-ui-radio__item{align-items:start!important}.neeto-thank-you-configuration-radio__item.neeto-ui-radio__item .neeto-ui-radio{margin-top:3px}.neeto-thank-you-configuration-radio__item.active{border:1.5px solid rgb(var(--neeto-ui-primary-800))}";
|
|
41
42
|
n(css,{});
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
var FORM_OPTIONS = {
|
|
44
45
|
customize: {
|
|
45
46
|
label: t("neetoThankYou.thankYou.customize"),
|
|
46
47
|
description: t("neetoThankYou.thankYou.customizeDescription"),
|
|
@@ -52,38 +53,77 @@ const FORM_OPTIONS = {
|
|
|
52
53
|
kind: "redirect_to_url"
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
|
-
|
|
56
|
+
var DEFAULT_IMAGE_PROPERTIES = {
|
|
56
57
|
imageSignedId: null,
|
|
57
58
|
imageUrl: ""
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
+
var EXTERNAL_URL_PREFIX = "https://";
|
|
60
61
|
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
function _arrayWithHoles(arr) {
|
|
63
|
+
if (Array.isArray(arr)) return arr;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function _iterableToArrayLimit(r, l) {
|
|
67
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
68
|
+
if (null != t) {
|
|
69
|
+
var e,
|
|
70
|
+
n,
|
|
71
|
+
i,
|
|
72
|
+
u,
|
|
73
|
+
a = [],
|
|
74
|
+
f = !0,
|
|
75
|
+
o = !1;
|
|
76
|
+
try {
|
|
77
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
78
|
+
if (Object(t) !== t) return;
|
|
79
|
+
f = !1;
|
|
80
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
81
|
+
} catch (r) {
|
|
82
|
+
o = !0, n = r;
|
|
83
|
+
} finally {
|
|
84
|
+
try {
|
|
85
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
86
|
+
} finally {
|
|
87
|
+
if (o) throw n;
|
|
69
88
|
}
|
|
70
89
|
}
|
|
71
|
-
return
|
|
72
|
-
}
|
|
73
|
-
|
|
90
|
+
return a;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _arrayLikeToArray(arr, len) {
|
|
95
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
96
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
97
|
+
return arr2;
|
|
74
98
|
}
|
|
75
99
|
|
|
76
|
-
|
|
77
|
-
|
|
100
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
101
|
+
if (!o) return;
|
|
102
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
103
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
104
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
105
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
106
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function _nonIterableRest() {
|
|
110
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function _slicedToArray(arr, i) {
|
|
114
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
var IMAGE_SIZE_LIMIT = 1; // MB
|
|
118
|
+
var IMAGE_UPLOADER_CONFIG = {
|
|
78
119
|
maxImageSize: IMAGE_SIZE_LIMIT
|
|
79
120
|
};
|
|
80
121
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setFieldValue,
|
|
84
|
-
values
|
|
85
|
-
|
|
86
|
-
const handleImageChange = image => {
|
|
122
|
+
var Image = function Image() {
|
|
123
|
+
var _useFormikContext = useFormikContext(),
|
|
124
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
125
|
+
values = _useFormikContext.values;
|
|
126
|
+
var handleImageChange = function handleImageChange(image) {
|
|
87
127
|
if (isEmpty(image.signedId)) {
|
|
88
128
|
setFieldValue("imageUrl", "");
|
|
89
129
|
setFieldValue("imageSignedId", null);
|
|
@@ -92,106 +132,122 @@ const Image = () => {
|
|
|
92
132
|
setFieldValue("imageUrl", image.url);
|
|
93
133
|
setFieldValue("imageSignedId", image.signedId);
|
|
94
134
|
};
|
|
95
|
-
return /*#__PURE__*/
|
|
135
|
+
return /*#__PURE__*/jsx(ImageUploader, {
|
|
96
136
|
className: "h-60",
|
|
97
|
-
key: values.imageUrl,
|
|
98
137
|
src: values.imageUrl,
|
|
99
138
|
uploadConfig: IMAGE_UPLOADER_CONFIG,
|
|
100
139
|
onUploadComplete: handleImageChange
|
|
101
|
-
});
|
|
140
|
+
}, values.imageUrl);
|
|
102
141
|
};
|
|
103
142
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
143
|
+
var ResubmissionWarningModal = withT(function (_ref) {
|
|
144
|
+
var t = _ref.t,
|
|
145
|
+
isOpen = _ref.isOpen,
|
|
146
|
+
setIsOpen = _ref.setIsOpen,
|
|
147
|
+
uniqueSubmissionLink = _ref.uniqueSubmissionLink;
|
|
148
|
+
return /*#__PURE__*/jsxs(Modal, {
|
|
149
|
+
isOpen: isOpen,
|
|
150
|
+
onClose: function onClose() {
|
|
151
|
+
return setIsOpen(false);
|
|
152
|
+
},
|
|
153
|
+
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
154
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
155
|
+
style: "h3",
|
|
156
|
+
weight: "semibold",
|
|
157
|
+
children: [t("neetoThankYou.common.alert"), "!"]
|
|
158
|
+
})
|
|
159
|
+
}), /*#__PURE__*/jsx(Modal.Body, {
|
|
160
|
+
children: t("neetoThankYou.thankYou.resubmissionWarning")
|
|
161
|
+
}), /*#__PURE__*/jsxs(Modal.Footer, {
|
|
162
|
+
className: "space-x-2",
|
|
163
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
164
|
+
label: t("neetoThankYou.common.ok"),
|
|
165
|
+
style: "tertiary",
|
|
166
|
+
onClick: function onClick() {
|
|
167
|
+
return setIsOpen(false);
|
|
168
|
+
}
|
|
169
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
170
|
+
label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
|
|
171
|
+
to: uniqueSubmissionLink
|
|
172
|
+
})]
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
127
175
|
});
|
|
128
176
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
useEffect(()
|
|
177
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
178
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
179
|
+
var Customize = function Customize(_ref) {
|
|
180
|
+
var editorRef = _ref.editorRef,
|
|
181
|
+
uniqueSubmissionEnabled = _ref.uniqueSubmissionEnabled,
|
|
182
|
+
hasImageUploader = _ref.hasImageUploader,
|
|
183
|
+
uniqueSubmissionLink = _ref.uniqueSubmissionLink,
|
|
184
|
+
entityId = _ref.entityId,
|
|
185
|
+
disableSocialShare = _ref.disableSocialShare,
|
|
186
|
+
disableSubmitAnotherResponse = _ref.disableSubmitAnotherResponse,
|
|
187
|
+
editorProps = _ref.editorProps;
|
|
188
|
+
var _useState = useState(false),
|
|
189
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
190
|
+
isUniqueSubmissionWarningModalOpen = _useState2[0],
|
|
191
|
+
setIsUniqueSubmissionWarningModalOpen = _useState2[1];
|
|
192
|
+
var _useTranslation = useTranslation(),
|
|
193
|
+
t = _useTranslation.t;
|
|
194
|
+
var _useFormikContext = useFormikContext(),
|
|
195
|
+
values = _useFormikContext.values,
|
|
196
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
197
|
+
var _useShowThankYouConfi = useShowThankYouConfiguration({
|
|
198
|
+
entityId: entityId
|
|
199
|
+
}),
|
|
200
|
+
_useShowThankYouConfi2 = _useShowThankYouConfi.data,
|
|
201
|
+
_useShowThankYouConfi3 = _useShowThankYouConfi2 === void 0 ? {} : _useShowThankYouConfi2,
|
|
202
|
+
thankYouConfiguration = _useShowThankYouConfi3.thankYouConfiguration,
|
|
203
|
+
isFetching = _useShowThankYouConfi.isFetching;
|
|
204
|
+
useEffect(function () {
|
|
205
|
+
var _editorRef$current$ed;
|
|
157
206
|
if (isFetching) return;
|
|
158
207
|
setFieldValue("message", thankYouConfiguration.message);
|
|
159
|
-
editorRef.current.editor
|
|
208
|
+
(_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 || _editorRef$current$ed.commands.setContent(thankYouConfiguration.message);
|
|
160
209
|
}, [isFetching]);
|
|
161
|
-
|
|
210
|
+
var handleResubmitLinkChange = function handleResubmitLinkChange(event) {
|
|
162
211
|
uniqueSubmissionEnabled ? setIsUniqueSubmissionWarningModalOpen(true) : setFieldValue("showResubmitLink", event.target.checked);
|
|
163
212
|
};
|
|
164
|
-
return /*#__PURE__*/
|
|
165
|
-
className: "flex flex-col gap-4"
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
213
|
+
return /*#__PURE__*/jsxs("div", {
|
|
214
|
+
className: "flex flex-col gap-4",
|
|
215
|
+
children: [hasImageUploader && /*#__PURE__*/jsxs("div", {
|
|
216
|
+
className: "flex flex-col gap-2",
|
|
217
|
+
children: [/*#__PURE__*/jsx(Label$1, {
|
|
218
|
+
children: t("neetoThankYou.thankYou.imageLabel")
|
|
219
|
+
}), /*#__PURE__*/jsx(Image, {})]
|
|
220
|
+
}), /*#__PURE__*/jsx("div", {
|
|
221
|
+
className: "flex flex-col gap-2",
|
|
222
|
+
children: /*#__PURE__*/jsx(FormikEditor, _objectSpread$1({
|
|
223
|
+
required: true,
|
|
224
|
+
"data-cy": "thank-you-message-editor",
|
|
225
|
+
label: t("neetoThankYou.thankYou.messageLabel"),
|
|
226
|
+
name: "message",
|
|
227
|
+
ref: editorRef
|
|
228
|
+
}, editorProps))
|
|
229
|
+
}), !disableSocialShare && /*#__PURE__*/jsx(Switch, {
|
|
230
|
+
label: t("neetoThankYou.thankYou.socialShareIcons"),
|
|
231
|
+
name: "socialSharingEnabled"
|
|
232
|
+
}), !disableSubmitAnotherResponse && /*#__PURE__*/jsxs(Fragment, {
|
|
233
|
+
children: [/*#__PURE__*/jsx(Switch, {
|
|
234
|
+
label: t("neetoThankYou.thankYou.showResubmitLink"),
|
|
235
|
+
name: "showResubmitLink",
|
|
236
|
+
className: classNames({
|
|
237
|
+
"neeto-ui-switch--disabled": uniqueSubmissionEnabled
|
|
238
|
+
}),
|
|
239
|
+
onChange: handleResubmitLinkChange
|
|
240
|
+
}), values.showResubmitLink && /*#__PURE__*/jsx(Input, {
|
|
241
|
+
required: true,
|
|
242
|
+
label: t("neetoThankYou.thankYou.resubmitLinkText"),
|
|
243
|
+
name: "resubmitLinkText"
|
|
244
|
+
})]
|
|
245
|
+
}), /*#__PURE__*/jsx(ResubmissionWarningModal, {
|
|
246
|
+
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
247
|
+
isOpen: isUniqueSubmissionWarningModalOpen,
|
|
248
|
+
setIsOpen: setIsUniqueSubmissionWarningModalOpen
|
|
249
|
+
})]
|
|
250
|
+
});
|
|
195
251
|
};
|
|
196
252
|
|
|
197
253
|
var _ellipse, _ellipse2, _ellipse3;
|
|
@@ -221,102 +277,110 @@ const SvgBrowserControls = props => /*#__PURE__*/React.createElement("svg", _ext
|
|
|
221
277
|
ry: 5.859
|
|
222
278
|
})));
|
|
223
279
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
thankYouTextAlignment,
|
|
229
|
-
resubmitLink,
|
|
230
|
-
publicLinkId,
|
|
231
|
-
isPublished,
|
|
232
|
-
appName,
|
|
233
|
-
brandingInfo
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
"
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
var MemoizedEditorContent = /*#__PURE__*/memo(EditorContent);
|
|
281
|
+
var Preview = function Preview(_ref) {
|
|
282
|
+
var _values$resubmitLinkT;
|
|
283
|
+
var socialHandles = _ref.socialHandles,
|
|
284
|
+
thankYouTextAlignment = _ref.thankYouTextAlignment,
|
|
285
|
+
resubmitLink = _ref.resubmitLink,
|
|
286
|
+
publicLinkId = _ref.publicLinkId,
|
|
287
|
+
isPublished = _ref.isPublished,
|
|
288
|
+
appName = _ref.appName,
|
|
289
|
+
brandingInfo = _ref.brandingInfo;
|
|
290
|
+
var _useFormikContext = useFormikContext(),
|
|
291
|
+
values = _useFormikContext.values;
|
|
292
|
+
var _useTranslation = useTranslation(),
|
|
293
|
+
t = _useTranslation.t;
|
|
294
|
+
return /*#__PURE__*/jsxs("div", {
|
|
295
|
+
className: "flex flex-col",
|
|
296
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
297
|
+
className: "mb-3 block md:hidden",
|
|
298
|
+
lineHeight: "normal",
|
|
299
|
+
style: "h3",
|
|
300
|
+
weight: "semibold",
|
|
301
|
+
children: t("neetoThankYou.thankYou.preview")
|
|
302
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
303
|
+
className: classNames("neeto-thank-you-configuration-preview pointer-events-none", {
|
|
304
|
+
"neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
|
|
305
|
+
"neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center,
|
|
306
|
+
"pointer-events-none": !isPublished
|
|
307
|
+
}),
|
|
308
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
309
|
+
className: "neeto-thank-you-configuration-preview__browser-header",
|
|
310
|
+
children: /*#__PURE__*/jsx(SvgBrowserControls, {})
|
|
311
|
+
}), /*#__PURE__*/jsx("div", {
|
|
312
|
+
className: "neeto-thank-you-configuration",
|
|
313
|
+
children: /*#__PURE__*/jsx("main", {
|
|
314
|
+
className: "neeto-thank-you-configuration__main",
|
|
315
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
316
|
+
className: "neeto-thank-you-configuration__box",
|
|
317
|
+
children: [!isEmpty(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/jsx("div", {
|
|
318
|
+
className: "neeto-thank-you-configuration__img",
|
|
319
|
+
children: /*#__PURE__*/jsx("img", {
|
|
320
|
+
alt: "",
|
|
321
|
+
src: values.imageUrl
|
|
322
|
+
})
|
|
323
|
+
}), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/jsx("div", {
|
|
324
|
+
className: "neeto-thank-you-configuration__description",
|
|
325
|
+
children: /*#__PURE__*/jsx(MemoizedEditorContent, {
|
|
326
|
+
content: values.message,
|
|
327
|
+
"data-cy": "preview-editor-content"
|
|
328
|
+
})
|
|
329
|
+
}), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/jsx("a", {
|
|
330
|
+
className: "neeto-thank-you-configuration__resubmit",
|
|
331
|
+
href: resubmitLink,
|
|
332
|
+
children: (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")
|
|
333
|
+
}), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/jsx(SocialShare, {
|
|
334
|
+
publicLinkId: publicLinkId,
|
|
335
|
+
socialHandles: socialHandles
|
|
336
|
+
})]
|
|
337
|
+
})
|
|
338
|
+
})
|
|
339
|
+
}), (values === null || values === void 0 ? void 0 : values.brandingEnabled) && /*#__PURE__*/jsx(BrandingInfo, {
|
|
340
|
+
appName: appName,
|
|
341
|
+
brandingInfo: brandingInfo
|
|
342
|
+
})]
|
|
343
|
+
})]
|
|
344
|
+
});
|
|
282
345
|
};
|
|
283
346
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
t
|
|
287
|
-
|
|
288
|
-
return /*#__PURE__*/React__default.createElement(Input, {
|
|
347
|
+
var ExternalLink = function ExternalLink() {
|
|
348
|
+
var _useTranslation = useTranslation(),
|
|
349
|
+
t = _useTranslation.t;
|
|
350
|
+
return /*#__PURE__*/jsx(Input, {
|
|
289
351
|
autoFocus: true,
|
|
290
352
|
required: true,
|
|
291
353
|
label: t("neetoThankYou.thankYou.link"),
|
|
292
354
|
name: "redirectUrl",
|
|
293
355
|
placeholder: EXTERNAL_URL_PREFIX,
|
|
294
|
-
prefix: /*#__PURE__*/
|
|
356
|
+
prefix: /*#__PURE__*/jsx(Link, {})
|
|
295
357
|
});
|
|
296
358
|
};
|
|
297
359
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
} = _ref;
|
|
304
|
-
return /*#__PURE__*/React__default.createElement(Typography, {
|
|
360
|
+
var Label = function Label(_ref) {
|
|
361
|
+
var label = _ref.label,
|
|
362
|
+
description = _ref.description,
|
|
363
|
+
kind = _ref.kind;
|
|
364
|
+
return /*#__PURE__*/jsxs(Typography, {
|
|
305
365
|
className: "neeto-ui-text-gray-700",
|
|
306
|
-
"data-cy":
|
|
366
|
+
"data-cy": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-label"),
|
|
307
367
|
style: "body2",
|
|
308
|
-
weight: "semibold"
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
368
|
+
weight: "semibold",
|
|
369
|
+
children: [label, /*#__PURE__*/jsx("span", {
|
|
370
|
+
className: "block text-xs font-normal leading-snug",
|
|
371
|
+
"data-cy": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-description"),
|
|
372
|
+
children: description
|
|
373
|
+
})]
|
|
374
|
+
});
|
|
313
375
|
};
|
|
314
376
|
|
|
315
|
-
|
|
316
|
-
|
|
377
|
+
var buildValidationSchema = function buildValidationSchema() {
|
|
378
|
+
var allowEmptyCustomMessage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
317
379
|
return yup.object().shape({
|
|
318
380
|
kind: yup.string().required(),
|
|
319
|
-
message: yup.string().test("message", t("neetoThankYou.thankYou.validations.messageRequired"),
|
|
381
|
+
message: yup.string().test("message", t("neetoThankYou.thankYou.validations.messageRequired"), function (value) {
|
|
382
|
+
return allowEmptyCustomMessage || !isEditorEmpty(value);
|
|
383
|
+
}),
|
|
320
384
|
socialSharingEnabled: yup.bool(),
|
|
321
385
|
showResubmitLink: yup.bool(),
|
|
322
386
|
resubmitLinkText: yup.string().when("showResubmitLink", {
|
|
@@ -333,199 +397,213 @@ const buildValidationSchema = function () {
|
|
|
333
397
|
});
|
|
334
398
|
};
|
|
335
399
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
} = useUpdateThankYouConfiguration();
|
|
370
|
-
const editorRef = useRef({
|
|
400
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
401
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
402
|
+
var Form = function Form(_ref) {
|
|
403
|
+
var socialHandles = _ref.socialHandles,
|
|
404
|
+
entityId = _ref.entityId,
|
|
405
|
+
publicLinkId = _ref.publicLinkId,
|
|
406
|
+
hasImageUploader = _ref.hasImageUploader,
|
|
407
|
+
uniqueSubmissionEnabled = _ref.uniqueSubmissionEnabled,
|
|
408
|
+
uniqueSubmissionLink = _ref.uniqueSubmissionLink,
|
|
409
|
+
redirectToOnCancel = _ref.redirectToOnCancel,
|
|
410
|
+
thankYouTextAlignment = _ref.thankYouTextAlignment,
|
|
411
|
+
resubmitLink = _ref.resubmitLink,
|
|
412
|
+
isPublished = _ref.isPublished,
|
|
413
|
+
disableSubmitAnotherResponse = _ref.disableSubmitAnotherResponse,
|
|
414
|
+
disableRadioSelection = _ref.disableRadioSelection,
|
|
415
|
+
appName = _ref.appName,
|
|
416
|
+
blockNavigation = _ref.blockNavigation,
|
|
417
|
+
onConfigUpdateSuccess = _ref.onConfigUpdateSuccess,
|
|
418
|
+
brandingInfo = _ref.brandingInfo,
|
|
419
|
+
editorProps = _ref.editorProps,
|
|
420
|
+
CustomPreview = _ref.preview,
|
|
421
|
+
allowEmptyCustomMessage = _ref.allowEmptyCustomMessage;
|
|
422
|
+
var _useShowThankYouConfi = useShowThankYouConfiguration({
|
|
423
|
+
entityId: entityId
|
|
424
|
+
}),
|
|
425
|
+
_useShowThankYouConfi2 = _useShowThankYouConfi.data,
|
|
426
|
+
_useShowThankYouConfi3 = _useShowThankYouConfi2 === void 0 ? {} : _useShowThankYouConfi2,
|
|
427
|
+
thankYouConfiguration = _useShowThankYouConfi3.thankYouConfiguration,
|
|
428
|
+
isLoading = _useShowThankYouConfi.isLoading;
|
|
429
|
+
var _useUpdateThankYouCon = useUpdateThankYouConfiguration(),
|
|
430
|
+
updateThankYouConfiguration = _useUpdateThankYouCon.mutate,
|
|
431
|
+
isUpdatingForm = _useUpdateThankYouCon.isPending;
|
|
432
|
+
var editorRef = useRef({
|
|
371
433
|
editor: {}
|
|
372
434
|
});
|
|
373
435
|
if (isLoading) {
|
|
374
|
-
return /*#__PURE__*/
|
|
375
|
-
className: "flex h-full w-full items-center justify-center"
|
|
376
|
-
|
|
436
|
+
return /*#__PURE__*/jsx("div", {
|
|
437
|
+
className: "flex h-full w-full items-center justify-center",
|
|
438
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
439
|
+
});
|
|
377
440
|
}
|
|
378
|
-
|
|
379
|
-
|
|
441
|
+
var resetEditor = function resetEditor() {
|
|
442
|
+
var _editorRef$current$ed;
|
|
443
|
+
return (_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : _editorRef$current$ed.commands.setContent(thankYouConfiguration.message);
|
|
444
|
+
};
|
|
445
|
+
return /*#__PURE__*/jsx(NeetoUIForm, {
|
|
380
446
|
formikProps: {
|
|
381
447
|
enableReinitialize: true,
|
|
382
|
-
initialValues: {
|
|
383
|
-
...DEFAULT_IMAGE_PROPERTIES,
|
|
384
|
-
...thankYouConfiguration
|
|
385
|
-
},
|
|
448
|
+
initialValues: _objectSpread(_objectSpread({}, DEFAULT_IMAGE_PROPERTIES), thankYouConfiguration),
|
|
386
449
|
validationSchema: buildValidationSchema(allowEmptyCustomMessage),
|
|
387
|
-
onSubmit: values
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
450
|
+
onSubmit: function onSubmit(values) {
|
|
451
|
+
return updateThankYouConfiguration({
|
|
452
|
+
entityId: entityId,
|
|
453
|
+
payload: _objectSpread(_objectSpread({}, values), {}, {
|
|
454
|
+
image: values.imageSignedId
|
|
455
|
+
})
|
|
456
|
+
}, {
|
|
457
|
+
onSuccess: function onSuccess() {
|
|
458
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
459
|
+
args[_key] = arguments[_key];
|
|
460
|
+
}
|
|
461
|
+
return onConfigUpdateSuccess(args, thankYouConfiguration);
|
|
397
462
|
}
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
})
|
|
401
|
-
}
|
|
402
|
-
}, _ref2 => {
|
|
403
|
-
let {
|
|
404
|
-
values
|
|
405
|
-
} = _ref2;
|
|
406
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
407
|
-
className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6"
|
|
408
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
409
|
-
className: "flex flex-col"
|
|
410
|
-
}, blockNavigation && /*#__PURE__*/React__default.createElement(BlockNavigation, null), !disableRadioSelection && /*#__PURE__*/React__default.createElement("div", {
|
|
411
|
-
className: "mb-6 w-full"
|
|
412
|
-
}, /*#__PURE__*/React__default.createElement(Radio, {
|
|
413
|
-
containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
|
|
414
|
-
name: "kind"
|
|
415
|
-
}, Object.values(FORM_OPTIONS).map(option => /*#__PURE__*/React__default.createElement(Radio.Item, {
|
|
416
|
-
key: option.kind,
|
|
417
|
-
label: /*#__PURE__*/React__default.createElement(Label, option),
|
|
418
|
-
name: "kind",
|
|
419
|
-
value: option.kind,
|
|
420
|
-
className: classNames("neeto-thank-you-configuration-radio__item", {
|
|
421
|
-
active: values.kind === option.kind
|
|
422
|
-
})
|
|
423
|
-
})))), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/React__default.createElement(Customize, {
|
|
424
|
-
disableSubmitAnotherResponse,
|
|
425
|
-
editorProps,
|
|
426
|
-
editorRef,
|
|
427
|
-
entityId,
|
|
428
|
-
hasImageUploader,
|
|
429
|
-
uniqueSubmissionEnabled,
|
|
430
|
-
uniqueSubmissionLink,
|
|
431
|
-
disableSocialShare: isEmpty(socialHandles)
|
|
432
|
-
}) : /*#__PURE__*/React__default.createElement(ExternalLink, null), /*#__PURE__*/React__default.createElement(ActionBlock, {
|
|
433
|
-
className: "mt-6",
|
|
434
|
-
isSubmitting: isUpdatingForm,
|
|
435
|
-
cancelButtonProps: {
|
|
436
|
-
"data-cy": "neeto-thank-you-configuration-cancel-button",
|
|
437
|
-
...(redirectToOnCancel ? {
|
|
438
|
-
to: redirectToOnCancel,
|
|
439
|
-
onClick: noop
|
|
440
|
-
} : {
|
|
441
|
-
type: "reset",
|
|
442
|
-
onClick: resetEditor
|
|
443
|
-
})
|
|
444
|
-
},
|
|
445
|
-
submitButtonProps: {
|
|
446
|
-
"data-cy": "neeto-thank-you-configuration-save-button"
|
|
463
|
+
});
|
|
447
464
|
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
465
|
+
},
|
|
466
|
+
children: function children(_ref2) {
|
|
467
|
+
var values = _ref2.values;
|
|
468
|
+
return /*#__PURE__*/jsxs("div", {
|
|
469
|
+
className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6",
|
|
470
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
471
|
+
className: "flex flex-col",
|
|
472
|
+
children: [blockNavigation && /*#__PURE__*/jsx(BlockNavigation, {}), !disableRadioSelection && /*#__PURE__*/jsx("div", {
|
|
473
|
+
className: "mb-6 w-full",
|
|
474
|
+
children: /*#__PURE__*/jsx(Radio, {
|
|
475
|
+
containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
|
|
476
|
+
name: "kind",
|
|
477
|
+
children: Object.values(FORM_OPTIONS).map(function (option) {
|
|
478
|
+
return /*#__PURE__*/jsx(Radio.Item, {
|
|
479
|
+
label: /*#__PURE__*/jsx(Label, _objectSpread({}, option)),
|
|
480
|
+
name: "kind",
|
|
481
|
+
value: option.kind,
|
|
482
|
+
className: classNames("neeto-thank-you-configuration-radio__item", {
|
|
483
|
+
active: values.kind === option.kind
|
|
484
|
+
})
|
|
485
|
+
}, option.kind);
|
|
486
|
+
})
|
|
487
|
+
})
|
|
488
|
+
}), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/jsx(Customize, {
|
|
489
|
+
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
490
|
+
editorProps: editorProps,
|
|
491
|
+
editorRef: editorRef,
|
|
492
|
+
entityId: entityId,
|
|
493
|
+
hasImageUploader: hasImageUploader,
|
|
494
|
+
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
495
|
+
uniqueSubmissionLink: uniqueSubmissionLink,
|
|
496
|
+
disableSocialShare: isEmpty(socialHandles)
|
|
497
|
+
}) : /*#__PURE__*/jsx(ExternalLink, {}), /*#__PURE__*/jsx(ActionBlock, {
|
|
498
|
+
className: "mt-6",
|
|
499
|
+
isSubmitting: isUpdatingForm,
|
|
500
|
+
cancelButtonProps: _objectSpread({
|
|
501
|
+
"data-cy": "neeto-thank-you-configuration-cancel-button"
|
|
502
|
+
}, redirectToOnCancel ? {
|
|
503
|
+
to: redirectToOnCancel,
|
|
504
|
+
onClick: noop
|
|
505
|
+
} : {
|
|
506
|
+
type: "reset",
|
|
507
|
+
onClick: resetEditor
|
|
508
|
+
}),
|
|
509
|
+
submitButtonProps: {
|
|
510
|
+
"data-cy": "neeto-thank-you-configuration-save-button"
|
|
511
|
+
}
|
|
512
|
+
})]
|
|
513
|
+
}), values.kind === FORM_OPTIONS.customize.kind && (CustomPreview ? /*#__PURE__*/jsx(CustomPreview, {
|
|
514
|
+
values: values
|
|
515
|
+
}) : /*#__PURE__*/jsx(Preview, {
|
|
516
|
+
appName: appName,
|
|
517
|
+
brandingInfo: brandingInfo,
|
|
518
|
+
isPublished: isPublished,
|
|
519
|
+
publicLinkId: publicLinkId,
|
|
520
|
+
resubmitLink: resubmitLink,
|
|
521
|
+
socialHandles: socialHandles,
|
|
522
|
+
thankYouTextAlignment: thankYouTextAlignment
|
|
523
|
+
}))]
|
|
524
|
+
});
|
|
525
|
+
}
|
|
459
526
|
});
|
|
460
527
|
};
|
|
461
528
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
title: t("neetoThankYou.common.thankYou")
|
|
475
|
-
}));
|
|
529
|
+
var Header = function Header(_ref) {
|
|
530
|
+
var breadcrumbs = _ref.breadcrumbs;
|
|
531
|
+
var _useTranslation = useTranslation(),
|
|
532
|
+
t = _useTranslation.t;
|
|
533
|
+
return /*#__PURE__*/jsx("div", {
|
|
534
|
+
className: "w-full px-6",
|
|
535
|
+
children: /*#__PURE__*/jsx(NeetoUIHeader, {
|
|
536
|
+
breadcrumbs: breadcrumbs,
|
|
537
|
+
size: "small",
|
|
538
|
+
title: t("neetoThankYou.common.thankYou")
|
|
539
|
+
})
|
|
540
|
+
});
|
|
476
541
|
};
|
|
477
542
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
socialHandles = [],
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
allowEmptyCustomMessage,
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
543
|
+
var ConfigureThankYou = function ConfigureThankYou(_ref) {
|
|
544
|
+
var breadcrumbs = _ref.breadcrumbs,
|
|
545
|
+
isPublished = _ref.isPublished,
|
|
546
|
+
entityId = _ref.entityId,
|
|
547
|
+
publicLinkId = _ref.publicLinkId,
|
|
548
|
+
resubmitLink = _ref.resubmitLink,
|
|
549
|
+
redirectToOnCancel = _ref.redirectToOnCancel,
|
|
550
|
+
_ref$socialHandles = _ref.socialHandles,
|
|
551
|
+
socialHandles = _ref$socialHandles === void 0 ? [] : _ref$socialHandles,
|
|
552
|
+
_ref$uniqueSubmission = _ref.uniqueSubmissionLink,
|
|
553
|
+
uniqueSubmissionLink = _ref$uniqueSubmission === void 0 ? "" : _ref$uniqueSubmission,
|
|
554
|
+
_ref$uniqueSubmission2 = _ref.uniqueSubmissionEnabled,
|
|
555
|
+
uniqueSubmissionEnabled = _ref$uniqueSubmission2 === void 0 ? false : _ref$uniqueSubmission2,
|
|
556
|
+
_ref$hasImageUploader = _ref.hasImageUploader,
|
|
557
|
+
hasImageUploader = _ref$hasImageUploader === void 0 ? false : _ref$hasImageUploader,
|
|
558
|
+
_ref$disableSubmitAno = _ref.disableSubmitAnotherResponse,
|
|
559
|
+
disableSubmitAnotherResponse = _ref$disableSubmitAno === void 0 ? false : _ref$disableSubmitAno,
|
|
560
|
+
_ref$disableRadioSele = _ref.disableRadioSelection,
|
|
561
|
+
disableRadioSelection = _ref$disableRadioSele === void 0 ? false : _ref$disableRadioSele,
|
|
562
|
+
_ref$thankYouTextAlig = _ref.thankYouTextAlignment,
|
|
563
|
+
thankYouTextAlignment = _ref$thankYouTextAlig === void 0 ? THANK_YOU_TEXT_ALIGNMENTS.center : _ref$thankYouTextAlig,
|
|
564
|
+
customHeader = _ref.customHeader,
|
|
565
|
+
appName = _ref.appName,
|
|
566
|
+
_ref$blockNavigation = _ref.blockNavigation,
|
|
567
|
+
blockNavigation = _ref$blockNavigation === void 0 ? false : _ref$blockNavigation,
|
|
568
|
+
_ref$onConfigUpdateSu = _ref.onConfigUpdateSuccess,
|
|
569
|
+
onConfigUpdateSuccess = _ref$onConfigUpdateSu === void 0 ? noop : _ref$onConfigUpdateSu,
|
|
570
|
+
brandingInfo = _ref.brandingInfo,
|
|
571
|
+
_ref$editorProps = _ref.editorProps,
|
|
572
|
+
editorProps = _ref$editorProps === void 0 ? {} : _ref$editorProps,
|
|
573
|
+
preview = _ref.preview,
|
|
574
|
+
_ref$allowEmptyCustom = _ref.allowEmptyCustomMessage,
|
|
575
|
+
allowEmptyCustomMessage = _ref$allowEmptyCustom === void 0 ? false : _ref$allowEmptyCustom;
|
|
576
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
577
|
+
children: [customHeader || /*#__PURE__*/jsx(Header, {
|
|
578
|
+
breadcrumbs: breadcrumbs
|
|
579
|
+
}), /*#__PURE__*/jsx(Scrollable, {
|
|
580
|
+
className: "w-full p-6 pt-0",
|
|
581
|
+
children: /*#__PURE__*/jsx("div", {
|
|
582
|
+
className: "mx-auto h-full max-w-7xl",
|
|
583
|
+
children: /*#__PURE__*/jsx(Form, {
|
|
584
|
+
allowEmptyCustomMessage: allowEmptyCustomMessage,
|
|
585
|
+
appName: appName,
|
|
586
|
+
blockNavigation: blockNavigation,
|
|
587
|
+
brandingInfo: brandingInfo,
|
|
588
|
+
disableRadioSelection: disableRadioSelection,
|
|
589
|
+
disableSubmitAnotherResponse: disableSubmitAnotherResponse,
|
|
590
|
+
editorProps: editorProps,
|
|
591
|
+
entityId: entityId,
|
|
592
|
+
hasImageUploader: hasImageUploader,
|
|
593
|
+
isPublished: isPublished,
|
|
594
|
+
onConfigUpdateSuccess: onConfigUpdateSuccess,
|
|
595
|
+
preview: preview,
|
|
596
|
+
publicLinkId: publicLinkId,
|
|
597
|
+
redirectToOnCancel: redirectToOnCancel,
|
|
598
|
+
resubmitLink: resubmitLink,
|
|
599
|
+
socialHandles: socialHandles,
|
|
600
|
+
thankYouTextAlignment: thankYouTextAlignment,
|
|
601
|
+
uniqueSubmissionEnabled: uniqueSubmissionEnabled,
|
|
602
|
+
uniqueSubmissionLink: uniqueSubmissionLink
|
|
603
|
+
})
|
|
604
|
+
})
|
|
605
|
+
})]
|
|
606
|
+
});
|
|
529
607
|
};
|
|
530
608
|
|
|
531
609
|
export { ConfigureThankYou as default };
|