@bigbinary/neeto-thank-you-frontend 2.1.46 → 2.2.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/README.md CHANGED
@@ -104,8 +104,8 @@ application.
104
104
  - `entityId` - Set the entity ID associated with the "Thank You" page
105
105
  - `publicLinkId` - Set the public link ID of the entity associated with the
106
106
  thank you configuration for social media sharing
107
- - `hasImageUploader` - Boolean to show the image uploader section in the thank
108
- you configuration page
107
+ - `hasImageUploader` - Boolean to enable the image upload feature in the message editor on your
108
+ configuration page
109
109
  - `uniqueSubmissionEnabled` - Boolean to show link for unique submission
110
110
  - `uniqueSubmissionLink` - Set link for unique submission
111
111
  - `resubmitLink` - Set link for resubmission
@@ -0,0 +1,55 @@
1
+ {
2
+ "neetoThankYou": {
3
+ "common": {
4
+ "thankYouPage": "Dankeseite",
5
+ "alert": "Alarm",
6
+ "ok": "Ok",
7
+ "resubmit": "Erneut einreichen"
8
+ },
9
+ "thankYou": {
10
+ "title": "Dankeseite konfigurieren",
11
+ "description": "Zeigen Sie eine angepasste Dankeseite an, nachdem der Benutzer das Formular eingereicht hat.",
12
+ "customize": "Benutzerdefinierte Nachricht",
13
+ "customizeDescription": "Zeigen Sie nach der Formularübermittlung eine angepasste Dankeseite an.",
14
+ "externalLink": "Auf externen Link umleiten",
15
+ "externalLinkDescription": "Leiten Sie den Formularausfüller zu einem externen Link.",
16
+ "link": "Link",
17
+ "imageLabel": "Bild",
18
+ "submitAnotherResponse": "Klicken Sie hier, um eine weitere Antwort einzureichen",
19
+ "removeImage": "Bild entfernen",
20
+ "acceptedTypes": "PNG, JPG, GIF, SVG bis 1MB",
21
+ "imageUpload": "Ziehen Sie es hierher oder <span>browsen</span>",
22
+ "messageLabel": "Nachricht",
23
+ "socialShareIcons": "Soziale Share-Icons anzeigen",
24
+ "showResubmitLink": "Link zur erneuten Einreichung anzeigen",
25
+ "resubmitLinkText": "Linktext zur erneuten Einreichung",
26
+ "resubmit": "Erneut einreichen",
27
+ "socialShareHeading": "Teilen Sie dieses NeetoForm in sozialen Medien",
28
+ "resubmissionWarning": "Sie haben die eindeutige Einreichung für dieses Formular aktiviert, bitte deaktivieren Sie die eindeutige Einreichung, bevor Sie den Link zur erneuten Einreichung aktivieren.",
29
+ "uniqueSubmissionLinkText": "Gehe zu den Einstellungen für eindeutige Einreichungen",
30
+ "draftVersionForm": "Sie verwenden die Entwurfsversion des Formulars. Die Daten werden nicht eingereicht.",
31
+ "preview": "Vorschau",
32
+ "madeWith": "Hergestellt mit",
33
+ "showMessageWhileRedirecting": "Nachricht während der Umleitung anzeigen",
34
+ "passEventDetails": "Übermitteln Sie die Veranstaltungsdetails an Ihre umgeleitete Seite",
35
+ "redirecting_in_seconds_message": "Umleitung in {{seconds}} Sekunden.",
36
+ "redirect_failure_message": "Wir konnten Sie im Moment nicht umleiten. Bitte <Link>klicken Sie hier</Link>, um fortzufahren.",
37
+ "validations": {
38
+ "messageRequired": "Nachricht ist erforderlich",
39
+ "redirectMessageRequired": "Umleitungsnachricht ist erforderlich",
40
+ "resubmitLinkTextIsRequired": "Linktext ist erforderlich",
41
+ "invalidLink": "Geben Sie einen gültigen Link ein."
42
+ },
43
+ "errors": {
44
+ "fileTypeError": "Bitte laden Sie eine Datei mit einem der folgenden Dateitypen hoch: {{acceptedTypes}}.",
45
+ "fileSizeLimitExceeded": "Ihre Datei ist größer als {{maxSizeInReadableUnits}}. Bitte versuchen Sie es erneut mit einer kleineren Datei.",
46
+ "somethingWentWrong": "Etwas ist schiefgelaufen"
47
+ }
48
+ },
49
+ "buttons": {
50
+ "saveChanges": "Änderungen speichern",
51
+ "cancel": "Abbrechen",
52
+ "resetChanges": "Änderungen zurücksetzen"
53
+ }
54
+ }
55
+ }
@@ -14,11 +14,6 @@
14
14
  "externalLink": "Redirect to external link",
15
15
  "externalLinkDescription": "Take the form submitter to an external link.",
16
16
  "link": "Link",
17
- "imageLabel": "Image",
18
- "submitAnotherResponse": "Click here to submit another response",
19
- "removeImage": "Remove Image",
20
- "acceptedTypes": "PNG, JPG, GIF, SVG up to 1MB",
21
- "imageUpload": "Drag and drop or <span>browse</span>",
22
17
  "messageLabel": "Message",
23
18
  "socialShareIcons": "Show social share icons",
24
19
  "showResubmitLink": "Show link to submit another response",
@@ -29,7 +24,6 @@
29
24
  "uniqueSubmissionLinkText": "Go to Unique submissions settings",
30
25
  "draftVersionForm": "You are using the draft version of the form. The data will not be submitted.",
31
26
  "preview": "Preview",
32
- "madeWith": "Made with",
33
27
  "showMessageWhileRedirecting": "Show message while redirecting",
34
28
  "passEventDetails": "Pass event details to your redirected page",
35
29
  "redirecting_in_seconds_message": "Redirecting in {{seconds}} seconds.",
@@ -39,17 +33,7 @@
39
33
  "redirectMessageRequired": "Redirect message is required",
40
34
  "resubmitLinkTextIsRequired": "Link text is required",
41
35
  "invalidLink": "Enter a valid link."
42
- },
43
- "errors": {
44
- "fileTypeError": "Please upload a file with one of the following file types: {{acceptedTypes}}.",
45
- "fileSizeLimitExceeded": "Your file is larger than {{maxSizeInReadableUnits}}. Please try again with a smaller file.",
46
- "somethingWentWrong": "Something went wrong"
47
36
  }
48
- },
49
- "buttons": {
50
- "saveChanges": "Save changes",
51
- "cancel": "Cancel",
52
- "resetChanges": "Reset changes"
53
37
  }
54
38
  }
55
39
  }
@@ -0,0 +1,55 @@
1
+ {
2
+ "neetoThankYou": {
3
+ "common": {
4
+ "thankYouPage": "Página de agradecimiento",
5
+ "alert": "Alerta",
6
+ "ok": "Aceptar",
7
+ "resubmit": "Reenvío"
8
+ },
9
+ "thankYou": {
10
+ "title": "Configurar la página de agradecimiento",
11
+ "description": "Muestra una página de agradecimiento personalizada a tu usuario una vez que envíe el formulario.",
12
+ "customize": "Mensaje personalizado",
13
+ "customizeDescription": "Al enviar el formulario, muestra una página de agradecimiento personalizada.",
14
+ "externalLink": "Redirigir a enlace externo",
15
+ "externalLinkDescription": "Llevar al que envió el formulario a un enlace externo.",
16
+ "link": "Enlace",
17
+ "imageLabel": "Imagen",
18
+ "submitAnotherResponse": "Haz clic aquí para enviar otra respuesta",
19
+ "removeImage": "Eliminar imagen",
20
+ "acceptedTypes": "PNG, JPG, GIF, SVG hasta 1MB",
21
+ "imageUpload": "Arrastra y suelta o <span>explora</span>",
22
+ "messageLabel": "Mensaje",
23
+ "socialShareIcons": "Mostrar íconos para compartir en redes sociales",
24
+ "showResubmitLink": "Mostrar enlace para enviar otra respuesta",
25
+ "resubmitLinkText": "Texto del enlace para enviar otra respuesta",
26
+ "resubmit": "Reenvío",
27
+ "socialShareHeading": "Comparte este NeetoForm en redes sociales",
28
+ "resubmissionWarning": "Has habilitado el envío único para este formulario, por favor desactiva el envío único antes de habilitar el enlace de reenvío.",
29
+ "uniqueSubmissionLinkText": "Ir a la configuración de envíos únicos",
30
+ "draftVersionForm": "Estás utilizando la versión de borrador del formulario. Los datos no serán enviados.",
31
+ "preview": "Vista previa",
32
+ "madeWith": "Hecho con",
33
+ "showMessageWhileRedirecting": "Mostrar mensaje mientras se redirige",
34
+ "passEventDetails": "Pasar detalles del evento a tu página redirigida",
35
+ "redirecting_in_seconds_message": "Redirigiendo en {{seconds}} segundos.",
36
+ "redirect_failure_message": "No pudimos redirigirte en este momento. Por favor <Link>haz clic aquí</Link> para continuar.",
37
+ "validations": {
38
+ "messageRequired": "Se requiere un mensaje",
39
+ "redirectMessageRequired": "Se requiere un mensaje de redirección",
40
+ "resubmitLinkTextIsRequired": "Se requiere texto para el enlace",
41
+ "invalidLink": "Ingresa un enlace válido."
42
+ },
43
+ "errors": {
44
+ "fileTypeError": "Por favor, carga un archivo con uno de los siguientes tipos de archivo: {{acceptedTypes}}.",
45
+ "fileSizeLimitExceeded": "Tu archivo es más grande que {{maxSizeInReadableUnits}}. Por favor, intenta nuevamente con un archivo más pequeño.",
46
+ "somethingWentWrong": "Algo salió mal"
47
+ }
48
+ },
49
+ "buttons": {
50
+ "saveChanges": "Guardar cambios",
51
+ "cancel": "Cancelar",
52
+ "resetChanges": "Restablecer cambios"
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "neetoThankYou": {
3
+ "common": {
4
+ "thankYouPage": "Page de remerciement",
5
+ "alert": "Alerte",
6
+ "ok": "D'accord",
7
+ "resubmit": "Soumettre à nouveau"
8
+ },
9
+ "thankYou": {
10
+ "title": "Configurer la page de remerciement",
11
+ "description": "Afficher une page de remerciement personnalisée à votre utilisateur une fois que l'utilisateur soumet le formulaire.",
12
+ "customize": "Message personnalisé",
13
+ "customizeDescription": "Après la soumission du formulaire, afficher une page de remerciement personnalisée.",
14
+ "externalLink": "Rediriger vers un lien externe",
15
+ "externalLinkDescription": "Envoyer l'auteur du formulaire vers un lien externe.",
16
+ "link": "Lien",
17
+ "imageLabel": "Image",
18
+ "submitAnotherResponse": "Cliquez ici pour soumettre une autre réponse",
19
+ "removeImage": "Supprimer l'image",
20
+ "acceptedTypes": "PNG, JPG, GIF, SVG jusqu'à 1 Mo",
21
+ "imageUpload": "Glissez-déposez ou <span>parcourir</span>",
22
+ "messageLabel": "Message",
23
+ "socialShareIcons": "Afficher les icônes de partage sur les réseaux sociaux",
24
+ "showResubmitLink": "Afficher le lien pour soumettre une autre réponse",
25
+ "resubmitLinkText": "Texte du lien de soumission d'une autre réponse",
26
+ "resubmit": "Soumettre à nouveau",
27
+ "socialShareHeading": "Partagez ce NeetoForm sur les réseaux sociaux",
28
+ "resubmissionWarning": "Vous avez activé la soumission unique pour ce formulaire, veuillez désactiver la soumission unique avant d'activer le lien de soumission.",
29
+ "uniqueSubmissionLinkText": "Aller aux paramètres de soumissions uniques",
30
+ "draftVersionForm": "Vous utilisez la version brouillon du formulaire. Les données ne seront pas soumises.",
31
+ "preview": "Aperçu",
32
+ "madeWith": "Fait avec",
33
+ "showMessageWhileRedirecting": "Afficher un message pendant la redirection",
34
+ "passEventDetails": "Transmettre les détails de l'événement à votre page redirigée",
35
+ "redirecting_in_seconds_message": "Redirection dans {{seconds}} secondes.",
36
+ "redirect_failure_message": "Nous n'avons pas pu vous rediriger pour le moment. Veuillez <Link>clicquer ici</Link> pour continuer.",
37
+ "validations": {
38
+ "messageRequired": "Le message est requis",
39
+ "redirectMessageRequired": "Le message de redirection est requis",
40
+ "resubmitLinkTextIsRequired": "Le texte du lien est requis",
41
+ "invalidLink": "Entrez un lien valide."
42
+ },
43
+ "errors": {
44
+ "fileTypeError": "Veuillez télécharger un fichier avec l'un des types de fichiers suivants : {{acceptedTypes}}.",
45
+ "fileSizeLimitExceeded": "Votre fichier est plus grand que {{maxSizeInReadableUnits}}. Veuillez réessayer avec un fichier plus petit.",
46
+ "somethingWentWrong": "Un problème est survenu"
47
+ }
48
+ },
49
+ "buttons": {
50
+ "saveChanges": "Enregistrer les modifications",
51
+ "cancel": "Annuler",
52
+ "resetChanges": "Réinitialiser les modifications"
53
+ }
54
+ }
55
+ }
@@ -1,5 +1,5 @@
1
- import { isPresent, hyphenate, isNotEmpty, noop } from '@bigbinary/neeto-cist';
2
- import { n, S as SocialShare, R as REDIRECT_DELAY, T as THANK_YOU_TEXT_ALIGNMENTS, F as FORM_OPTIONS, a as THANK_YOU_KINDS } from './SocialShare-DR_yGnQY.js';
1
+ import { hyphenate, isNotEmpty, isPresent, noop } from '@bigbinary/neeto-cist';
2
+ import { n, S as SocialShare, R as REDIRECT_DELAY, T as THANK_YOU_TEXT_ALIGNMENTS, F as FORM_OPTIONS, a as THANK_YOU_KINDS } from './SocialShare-SyR23dOh.js';
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
5
  import { useEffect, memo, useState, useRef } from 'react';
@@ -10,20 +10,18 @@ import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
10
10
  import BlockNavigation from '@bigbinary/neetoui/formik/BlockNavigation';
11
11
  import NeetoUIForm from '@bigbinary/neetoui/formik/Form';
12
12
  import Radio from '@bigbinary/neetoui/formik/Radio';
13
- import { isEmpty, mergeLeft } from 'ramda';
13
+ import { isEmpty } from 'ramda';
14
14
  import { u as useFetchThankYouConfigurations, b as useShowThankYouConfiguration, c as useUpdateThankYouConfiguration } from './useThankYouConfigurationApi-BiVg-jmY.js';
15
15
  import { useFormikContext } from 'formik';
16
16
  import FormikEditor from '@bigbinary/neeto-editor/FormikEditor';
17
- import Label$1 from '@bigbinary/neetoui/Label';
18
17
  import Input from '@bigbinary/neetoui/formik/Input';
19
18
  import Switch from '@bigbinary/neetoui/formik/Switch';
20
19
  import { useTranslation } from 'react-i18next';
21
- import ImageUploader from '@bigbinary/neeto-image-uploader-frontend/ImageUploader';
22
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
23
20
  import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
24
21
  import Button from '@bigbinary/neetoui/Button';
25
22
  import Typography from '@bigbinary/neetoui/Typography';
26
23
  import Modal from '@bigbinary/neetoui/Modal';
24
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
27
25
  import BrowserPreview from '@bigbinary/neeto-molecules/BrowserPreview';
28
26
  import { B as BrandingInfo } from './BrandingInfo-CVoR92MO.js';
29
27
  import { IS_PRO_ORGANIZATION } from './constants.js';
@@ -31,6 +29,7 @@ import EditorContent from '@bigbinary/neeto-editor/EditorContent';
31
29
  import Link from '@bigbinary/neeto-icons/Link';
32
30
  import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
33
31
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
32
+ import Label$1 from '@bigbinary/neetoui/Label';
34
33
  import NeetoUIHeader from '@bigbinary/neeto-molecules/Header';
35
34
  import { t } from 'i18next';
36
35
  import { isEditorEmpty } from '@bigbinary/neeto-editor/utils';
@@ -46,38 +45,6 @@ import '@bigbinary/neeto-commons-frontend/initializers';
46
45
  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:.75rem 1rem}.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:.1875rem}.neeto-thank-you-configuration-radio__item.active{border:1.5px solid rgb(var(--neeto-ui-primary-800))}";
47
46
  n(css,{});
48
47
 
49
- var DEFAULT_IMAGE_PROPERTIES = {
50
- imageSignedId: null,
51
- imageUrl: ""
52
- };
53
- var EXTERNAL_URL_PREFIX = "https://";
54
-
55
- var IMAGE_SIZE_LIMIT = 1; // MB
56
- var IMAGE_UPLOADER_CONFIG = {
57
- maxImageSize: IMAGE_SIZE_LIMIT
58
- };
59
-
60
- var Image = function Image() {
61
- var _useFormikContext = useFormikContext(),
62
- setFieldValue = _useFormikContext.setFieldValue,
63
- values = _useFormikContext.values;
64
- var handleImageChange = function handleImageChange(image) {
65
- if (isEmpty(image.signedId)) {
66
- setFieldValue("imageUrl", "");
67
- setFieldValue("imageSignedId", null);
68
- return;
69
- }
70
- setFieldValue("imageUrl", image.url);
71
- setFieldValue("imageSignedId", image.signedId);
72
- };
73
- return /*#__PURE__*/jsx(ImageUploader, {
74
- className: "h-28",
75
- src: values.imageUrl,
76
- uploadConfig: IMAGE_UPLOADER_CONFIG,
77
- onUploadComplete: handleImageChange
78
- }, values.imageUrl);
79
- };
80
-
81
48
  var ResubmissionWarningModal = withT(function (_ref) {
82
49
  var t = _ref.t,
83
50
  isOpen = _ref.isOpen,
@@ -140,15 +107,11 @@ var Customize = function Customize(_ref) {
140
107
  };
141
108
  return /*#__PURE__*/jsxs("div", {
142
109
  className: "flex flex-col gap-4",
143
- children: [hasImageUploader && /*#__PURE__*/jsxs("div", {
144
- className: "flex flex-col gap-2",
145
- children: [/*#__PURE__*/jsx(Label$1, {
146
- children: t("neetoThankYou.thankYou.imageLabel")
147
- }), /*#__PURE__*/jsx(Image, {})]
148
- }), /*#__PURE__*/jsx("div", {
110
+ children: [/*#__PURE__*/jsx("div", {
149
111
  className: "flex flex-col gap-2",
150
112
  children: /*#__PURE__*/jsx(FormikEditor, _objectSpread$5({
151
113
  required: true,
114
+ addons: hasImageUploader ? ["image-upload"] : [],
152
115
  "data-cy": "thank-you-message-editor",
153
116
  label: t("neetoThankYou.thankYou.messageLabel"),
154
117
  name: "message",
@@ -192,14 +155,7 @@ var CustomMessage = function CustomMessage(_ref) {
192
155
  var _useFormikContext = useFormikContext(),
193
156
  values = _useFormikContext.values;
194
157
  return /*#__PURE__*/jsxs(Fragment, {
195
- children: [isPresent(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/jsx("div", {
196
- className: "neeto-thank-you-configuration__img",
197
- children: /*#__PURE__*/jsx("img", {
198
- alt: "",
199
- "data-cy": "preview-image",
200
- src: values.imageUrl
201
- })
202
- }), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/jsx("div", {
158
+ children: [(values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/jsx("div", {
203
159
  className: "neeto-thank-you-configuration__description neeto-ui-text-gray-800",
204
160
  children: /*#__PURE__*/jsx(MemoizedEditorContent$1, _objectSpread$4({
205
161
  content: values.message,
@@ -291,6 +247,8 @@ var Preview = function Preview(_ref) {
291
247
  });
292
248
  };
293
249
 
250
+ var EXTERNAL_URL_PREFIX = "https://";
251
+
294
252
  var _excluded = ["name", "title", "className"];
295
253
  function ownKeys$2(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; }
296
254
  function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -487,18 +445,14 @@ var Form = function Form(_ref) {
487
445
  var shouldBlockNavigation = blockNavigation && !isUpdatingForm && !isUniqueSubmissionWarningModalOpen;
488
446
  var handleSubmit = function handleSubmit(values) {
489
447
  var showResubmitLink = values.showResubmitLink,
490
- kind = values.kind,
491
- imageSignedId = values.imageSignedId;
448
+ kind = values.kind;
492
449
  if (uniqueSubmissionEnabled && kind === THANK_YOU_KINDS.CUSTOM_MESSAGE && showResubmitLink) {
493
450
  setIsUniqueSubmissionWarningModalOpen(true);
494
451
  return;
495
452
  }
496
- var payload = _objectSpread(_objectSpread({}, values), {}, {
497
- image: imageSignedId
498
- });
499
453
  updateThankYouConfiguration({
500
454
  entityId: entityId,
501
- payload: payload
455
+ payload: values
502
456
  }, {
503
457
  onSuccess: function onSuccess() {
504
458
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -528,7 +482,7 @@ var Form = function Form(_ref) {
528
482
  className: "h-full w-full",
529
483
  formikProps: {
530
484
  enableReinitialize: true,
531
- initialValues: mergeLeft(thankYouConfiguration, DEFAULT_IMAGE_PROPERTIES),
485
+ initialValues: thankYouConfiguration || {},
532
486
  validationSchema: buildValidationSchema(allowEmptyCustomMessage),
533
487
  onSubmit: handleSubmit
534
488
  },