@bigbinary/neeto-email-notifications-frontend 2.2.15 → 2.2.17
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 +2 -2
- package/app/javascript/src/translations/ar.json +17 -0
- package/app/javascript/src/translations/bg.json +17 -0
- package/app/javascript/src/translations/ca.json +17 -0
- package/app/javascript/src/translations/cs.json +17 -0
- package/app/javascript/src/translations/da.json +17 -0
- package/app/javascript/src/translations/es-MX.json +17 -0
- package/app/javascript/src/translations/et.json +17 -0
- package/app/javascript/src/translations/fi.json +17 -0
- package/app/javascript/src/translations/fil.json +17 -0
- package/app/javascript/src/translations/hi.json +17 -0
- package/app/javascript/src/translations/hr.json +17 -0
- package/app/javascript/src/translations/id.json +17 -0
- package/app/javascript/src/translations/it.json +17 -0
- package/app/javascript/src/translations/ja.json +17 -0
- package/app/javascript/src/translations/ko.json +17 -0
- package/app/javascript/src/translations/nl.json +17 -0
- package/app/javascript/src/translations/pl.json +17 -0
- package/app/javascript/src/translations/pt-BR.json +17 -0
- package/app/javascript/src/translations/pt.json +17 -0
- package/app/javascript/src/translations/ro.json +17 -0
- package/app/javascript/src/translations/ru.json +17 -0
- package/app/javascript/src/translations/sk.json +17 -0
- package/app/javascript/src/translations/sl.json +17 -0
- package/app/javascript/src/translations/sv.json +17 -0
- package/app/javascript/src/translations/th.json +17 -0
- package/app/javascript/src/translations/tr.json +17 -0
- package/app/javascript/src/translations/uk.json +17 -0
- package/app/javascript/src/translations/vi.json +17 -0
- package/app/javascript/src/translations/zh-CN.json +17 -0
- package/app/javascript/src/translations/zh-TW.json +17 -0
- package/dist/NeetoEmailNotificationForm.js +22 -5
- package/dist/NeetoEmailNotificationForm.js.map +1 -1
- package/dist/cjs/NeetoEmailNotificationForm.js +21 -4
- package/dist/cjs/NeetoEmailNotificationForm.js.map +1 -1
- package/package.json +18 -17
- package/types.d.ts +2 -0
package/README.md
CHANGED
|
@@ -73,9 +73,9 @@ bundle exec rails db:migrate
|
|
|
73
73
|
Add the engine's routes to your application's `config/routes.rb`:
|
|
74
74
|
```ruby
|
|
75
75
|
# config/routes.rb
|
|
76
|
-
mount NeetoEmailNotificationsEngine::Engine, at: "/neeto_email_notifications"
|
|
76
|
+
mount NeetoEmailNotificationsEngine::Engine, at: "/neeto_email_notifications"
|
|
77
77
|
```
|
|
78
|
-
|
|
78
|
+
**NOTE: The mount point & base URL must be `/neeto_email_notifications` and cannot be changed to any other path.**
|
|
79
79
|
> **Note:** The engine uses the [`liquid`](https://github.com/Shopify/liquid)
|
|
80
80
|
> gem for template rendering. This will be installed automatically as a
|
|
81
81
|
> dependency.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "مرحبًا بك في نيتو ويل نانو",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "يرجى إدخال عنوان بريد إلكتروني صالح",
|
|
6
|
+
"sendFromRequired": "'البريد الإلكتروني المرسل من' مطلوب",
|
|
7
|
+
"sendToRequired": "'البريد الإلكتروني المرسل إلى' مطلوب",
|
|
8
|
+
"subjectRequired": "الموضوع مطلوب",
|
|
9
|
+
"messageRequired": "الرسالة مطلوبة"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "إشعار البريد الإلكتروني",
|
|
13
|
+
"notificationToggleLabel": "إرسال إشعار عبر البريد الإلكتروني عند حدوث حدث جديد"
|
|
14
|
+
},
|
|
15
|
+
"preview": "معاينة"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Добре дошли в neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Моля, въведете валиден имейл адрес",
|
|
6
|
+
"sendFromRequired": "'Изпратено от' имейл адрес е задължителен",
|
|
7
|
+
"sendToRequired": "'Изпратено до' имейл адрес е задължителен",
|
|
8
|
+
"subjectRequired": "Темата е задължителна",
|
|
9
|
+
"messageRequired": "Съобщението е задължително"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Имейл известие",
|
|
13
|
+
"notificationToggleLabel": "Изпратете имейл известие, когато се случи ново събитие"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Преглед"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Benvingut a neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Si us plau, introduceix una adreça de correu electrònic vàlida",
|
|
6
|
+
"sendFromRequired": "L'adreça de correu electrònic 'Enviar des de' és requerida",
|
|
7
|
+
"sendToRequired": "L'adreça de correu electrònic 'Enviar a' és requerida",
|
|
8
|
+
"subjectRequired": "El tema és requerit",
|
|
9
|
+
"messageRequired": "El missatge és requerit"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Notificació per correu electrònic",
|
|
13
|
+
"notificationToggleLabel": "Enviar una notificació per correu electrònic quan es produeixi un nou esdeveniment"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Previsualització"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Vítejte v neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Zadejte platnou e-mailovou adresu",
|
|
6
|
+
"sendFromRequired": "E-mailová adresa 'Odesílatel' je povinná",
|
|
7
|
+
"sendToRequired": "E-mailová adresa 'Příjemce' je povinná",
|
|
8
|
+
"subjectRequired": "Předmět je povinný",
|
|
9
|
+
"messageRequired": "Zpráva je povinná"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "E-mailová notifikace",
|
|
13
|
+
"notificationToggleLabel": "Odeslat e-mailovou notifikaci, když dojde k nové události"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Náhled"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Velkommen til neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Indtast venligst en gyldig e-mailadresse",
|
|
6
|
+
"sendFromRequired": "'Send fra' e-mailadresse er påkrævet",
|
|
7
|
+
"sendToRequired": "'Send til' e-mailadresse er påkrævet",
|
|
8
|
+
"subjectRequired": "Emne er påkrævet",
|
|
9
|
+
"messageRequired": "Besked er påkrævet"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "E-mailnotifikation",
|
|
13
|
+
"notificationToggleLabel": "Send en e-mailnotifikation, når der opstår en ny begivenhed"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Forhåndsvisning"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Bienvenido a neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Por favor, introduce una dirección de correo electrónico válida",
|
|
6
|
+
"sendFromRequired": "Se requiere una dirección de correo electrónico 'De'",
|
|
7
|
+
"sendToRequired": "Se requiere una dirección de correo electrónico 'Para'",
|
|
8
|
+
"subjectRequired": "Se requiere el asunto",
|
|
9
|
+
"messageRequired": "Se requiere el mensaje"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Notificación por correo electrónico",
|
|
13
|
+
"notificationToggleLabel": "Enviar una notificación por correo electrónico cuando ocurra un nuevo evento"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Vista previa"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Tere tulemast neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Palun sisestage kehtiv e-posti aadress",
|
|
6
|
+
"sendFromRequired": "'Saatja' e-posti aadress on kohustuslik",
|
|
7
|
+
"sendToRequired": "'Saaja' e-posti aadress on kohustuslik",
|
|
8
|
+
"subjectRequired": "Pealkiri on kohustuslik",
|
|
9
|
+
"messageRequired": "Sõnum on kohustuslik"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "E-posti teade",
|
|
13
|
+
"notificationToggleLabel": "Saada e-posti teade, kui uus sündmus toimub"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Eelvaade"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Tervetuloa neeto wheel nanoon",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Anna voimassa oleva sähköpostiosoite",
|
|
6
|
+
"sendFromRequired": "'Lähettäjä' sähköpostiosoite on pakollinen",
|
|
7
|
+
"sendToRequired": "'Vastaanottaja' sähköpostiosoite on pakollinen",
|
|
8
|
+
"subjectRequired": "Aihe on pakollinen",
|
|
9
|
+
"messageRequired": "Viesti on pakollinen"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Sähköpostilähetys",
|
|
13
|
+
"notificationToggleLabel": "Lähetä sähköpostilähetys, kun uusi tapahtuma tapahtuu"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Esikatselu"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Maligayang pagdating sa neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Mangyaring maglagay ng wastong email address",
|
|
6
|
+
"sendFromRequired": "Kailangan ang 'Send from' email address",
|
|
7
|
+
"sendToRequired": "Kailangan ang 'Send to' email address",
|
|
8
|
+
"subjectRequired": "Kailangan ang paksa",
|
|
9
|
+
"messageRequired": "Kailangan ang mensahe"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Abiso sa email",
|
|
13
|
+
"notificationToggleLabel": "Magpadala ng abiso sa email kapag may bagong kaganapan"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Tingnan"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "नीटो व्हील नैनो में आपका स्वागत है",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "कृपया एक मान्य ईमेल पता दर्ज करें",
|
|
6
|
+
"sendFromRequired": "'भेजने वाले' ईमेल पते की आवश्यकता है",
|
|
7
|
+
"sendToRequired": "'प्राप्तकर्ता' ईमेल पते की आवश्यकता है",
|
|
8
|
+
"subjectRequired": "विषय की आवश्यकता है",
|
|
9
|
+
"messageRequired": "संदेश की आवश्यकता है"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "ईमेल सूचना",
|
|
13
|
+
"notificationToggleLabel": "जब एक नया घटना होती है तो एक ईमेल सूचना भेजें"
|
|
14
|
+
},
|
|
15
|
+
"preview": "पूर्वावलोकन"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Dobrodošli u neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Molimo unesite važeću email adresu",
|
|
6
|
+
"sendFromRequired": "Adresu email 'Pošaljitelja' je potrebno unijeti",
|
|
7
|
+
"sendToRequired": "Adresu email 'Primatelja' je potrebno unijeti",
|
|
8
|
+
"subjectRequired": "Predmet je obavezan",
|
|
9
|
+
"messageRequired": "Poruka je obavezna"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Email obavijest",
|
|
13
|
+
"notificationToggleLabel": "Pošalji email obavijest kada se dogodi novi događaj"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Pregled"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Selamat datang di neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Silakan masukkan alamat email yang valid",
|
|
6
|
+
"sendFromRequired": "Alamat email 'Kirim dari' diperlukan",
|
|
7
|
+
"sendToRequired": "Alamat email 'Kirim ke' diperlukan",
|
|
8
|
+
"subjectRequired": "Subjek diperlukan",
|
|
9
|
+
"messageRequired": "Pesan diperlukan"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Notifikasi email",
|
|
13
|
+
"notificationToggleLabel": "Kirim notifikasi email ketika terjadi acara baru"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Prabaca"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Benvenuto in neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Si prega di inserire un indirizzo email valido",
|
|
6
|
+
"sendFromRequired": "L'indirizzo email 'Inviato da' è obbligatorio",
|
|
7
|
+
"sendToRequired": "L'indirizzo email 'Inviato a' è obbligatorio",
|
|
8
|
+
"subjectRequired": "Il soggetto è obbligatorio",
|
|
9
|
+
"messageRequired": "Il messaggio è obbligatorio"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Notifica email",
|
|
13
|
+
"notificationToggleLabel": "Invia una notifica email quando si verifica un nuovo evento"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Anteprima"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "neeto wheel nanoへようこそ",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "有効なメールアドレスを入力してください",
|
|
6
|
+
"sendFromRequired": "'送信元'メールアドレスは必須です",
|
|
7
|
+
"sendToRequired": "'送信先'メールアドレスは必須です",
|
|
8
|
+
"subjectRequired": "件名は必須です",
|
|
9
|
+
"messageRequired": "メッセージは必須です"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "メール通知",
|
|
13
|
+
"notificationToggleLabel": "新しいイベントが発生したときにメール通知を送信する"
|
|
14
|
+
},
|
|
15
|
+
"preview": "プレビュー"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "neeto wheel nano에 오신 것을 환영합니다",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "유효한 이메일 주소를 입력하십시오",
|
|
6
|
+
"sendFromRequired": "'보내는 사람' 이메일 주소는 필수입니다",
|
|
7
|
+
"sendToRequired": "'받는 사람' 이메일 주소는 필수입니다",
|
|
8
|
+
"subjectRequired": "제목은 필수입니다",
|
|
9
|
+
"messageRequired": "메시지는 필수입니다"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "이메일 알림",
|
|
13
|
+
"notificationToggleLabel": "새 이벤트가 발생할 때 이메일 알림 보내기"
|
|
14
|
+
},
|
|
15
|
+
"preview": "미리보기"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Welkom bij neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Voer een geldig e-mailadres in",
|
|
6
|
+
"sendFromRequired": "'Verstuur van'-e-mailadres is vereist",
|
|
7
|
+
"sendToRequired": "'Verstuur naar'-e-mailadres is vereist",
|
|
8
|
+
"subjectRequired": "Onderwerp is vereist",
|
|
9
|
+
"messageRequired": "Bericht is vereist"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "E-mailmelding",
|
|
13
|
+
"notificationToggleLabel": "Stuur een e-mailmelding wanneer er een nieuwe gebeurtenis plaatsvond"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Voorbeeld"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Witamy w neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Proszę wpisać prawidłowy adres e-mail",
|
|
6
|
+
"sendFromRequired": "Adres e-mail 'Wyślij z' jest wymagany",
|
|
7
|
+
"sendToRequired": "Adres e-mail 'Wyślij do' jest wymagany",
|
|
8
|
+
"subjectRequired": "Temat jest wymagany",
|
|
9
|
+
"messageRequired": "Wiadomość jest wymagana"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Powiadomienie e-mail",
|
|
13
|
+
"notificationToggleLabel": "Wyślij powiadomienie e-mail, gdy wystąpi nowe zdarzenie"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Podgląd"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Bem-vindo ao neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Por favor, insira um endereço de e-mail válido",
|
|
6
|
+
"sendFromRequired": "O endereço de e-mail 'De' é obrigatório",
|
|
7
|
+
"sendToRequired": "O endereço de e-mail 'Para' é obrigatório",
|
|
8
|
+
"subjectRequired": "O assunto é obrigatório",
|
|
9
|
+
"messageRequired": "A mensagem é obrigatória"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Notificação por e-mail",
|
|
13
|
+
"notificationToggleLabel": "Envie uma notificação por e-mail quando um novo evento ocorrer"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Pré-visualização"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Bem-vindo ao neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Por favor, insira um endereço de e-mail válido",
|
|
6
|
+
"sendFromRequired": "O endereço de e-mail 'Enviar de' é obrigatório",
|
|
7
|
+
"sendToRequired": "O endereço de e-mail 'Enviar para' é obrigatório",
|
|
8
|
+
"subjectRequired": "O assunto é obrigatório",
|
|
9
|
+
"messageRequired": "A mensagem é obrigatória"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Notificação por e-mail",
|
|
13
|
+
"notificationToggleLabel": "Enviar uma notificação por e-mail quando um novo evento ocorrer"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Pré-visualização"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Bine ați venit la neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Vă rugăm să introduceți o adresă de email validă",
|
|
6
|
+
"sendFromRequired": "Adresa de email 'Trimite de la' este obligatorie",
|
|
7
|
+
"sendToRequired": "Adresa de email 'Trimite către' este obligatorie",
|
|
8
|
+
"subjectRequired": "Subiectul este obligatoriu",
|
|
9
|
+
"messageRequired": "Mesajul este obligatoriu"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Notificare prin email",
|
|
13
|
+
"notificationToggleLabel": "Trimite o notificare prin email când are loc un nou eveniment"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Previzualizare"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Добро пожаловать в neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Пожалуйста, введите действительный адрес электронной почты",
|
|
6
|
+
"sendFromRequired": "Адрес электронной почты 'От' обязателен",
|
|
7
|
+
"sendToRequired": "Адрес электронной почты 'Кому' обязателен",
|
|
8
|
+
"subjectRequired": "Тема обязательна",
|
|
9
|
+
"messageRequired": "Сообщение обязательно"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Уведомление по электронной почте",
|
|
13
|
+
"notificationToggleLabel": "Отправить уведомление по электронной почте, когда произойдет новое событие"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Предварительный просмотр"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Vitajte v neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Zadajte platnú e-mailovú adresu",
|
|
6
|
+
"sendFromRequired": "E-mailová adresa 'Odoslať z' je povinná",
|
|
7
|
+
"sendToRequired": "E-mailová adresa 'Odoslať na' je povinná",
|
|
8
|
+
"subjectRequired": "Predmet je povinný",
|
|
9
|
+
"messageRequired": "Správa je povinná"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "E-mailové oznámenie",
|
|
13
|
+
"notificationToggleLabel": "Poslať e-mailové oznámenie, keď dôjde k novej udalosti"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Náhľad"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Dobrodošli v neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Prosim, vnesite veljavne e-poštni naslov",
|
|
6
|
+
"sendFromRequired": "'Pošlji iz' e-poštni naslov je obvezen",
|
|
7
|
+
"sendToRequired": "'Pošlji na' e-poštni naslov je obvezen",
|
|
8
|
+
"subjectRequired": "Zadeva je obvezna",
|
|
9
|
+
"messageRequired": "Sporočilo je obvezno"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "E-poštno obvestilo",
|
|
13
|
+
"notificationToggleLabel": "Pošlji e-poštno obvestilo, ko se zgodi nova dogodka"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Predogled"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Välkommen till neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Vänligen ange en giltig e-postadress",
|
|
6
|
+
"sendFromRequired": "'Skicka från' e-postadress är obligatorisk",
|
|
7
|
+
"sendToRequired": "'Skicka till' e-postadress är obligatorisk",
|
|
8
|
+
"subjectRequired": "Ämnet är obligatoriskt",
|
|
9
|
+
"messageRequired": "Meddelandet är obligatoriskt"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "E-postmeddelande",
|
|
13
|
+
"notificationToggleLabel": "Skicka ett e-postmeddelande när en ny händelse inträffar"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Förhandsvisning"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "ยินดีต้อนรับสู่ neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "โปรดป้อนที่อยู่อีเมลที่ถูกต้อง",
|
|
6
|
+
"sendFromRequired": "'ส่งจาก' ที่อยู่อีเมลจำเป็นต้องระบุ",
|
|
7
|
+
"sendToRequired": "'ส่งถึง' ที่อยู่อีเมลจำเป็นต้องระบุ",
|
|
8
|
+
"subjectRequired": "หัวข้อจำเป็นต้องระบุ",
|
|
9
|
+
"messageRequired": "ข้อความจำเป็นต้องระบุ"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "การแจ้งเตือนทางอีเมล",
|
|
13
|
+
"notificationToggleLabel": "ส่งการแจ้งเตือนทางอีเมลเมื่อมีเหตุการณ์ใหม่เกิดขึ้น"
|
|
14
|
+
},
|
|
15
|
+
"preview": "ตัวอย่าง"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Neeto Wheel Nano'ya hoş geldiniz",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Lütfen geçerli bir e-posta adresi girin",
|
|
6
|
+
"sendFromRequired": "'Gönderen' e-posta adresi gereklidir",
|
|
7
|
+
"sendToRequired": "'Alıcı' e-posta adresi gereklidir",
|
|
8
|
+
"subjectRequired": "Konu gereklidir",
|
|
9
|
+
"messageRequired": "Mesaj gereklidir"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "E-posta bildirimi",
|
|
13
|
+
"notificationToggleLabel": "Yeni bir olay meydana geldiğinde e-posta bildirimi gönder"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Önizleme"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Ласкаво просимо до neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Будь ласка, введіть дійсну адресу електронної пошти",
|
|
6
|
+
"sendFromRequired": "Адреса електронної пошти 'Від кого' є обов'язковою",
|
|
7
|
+
"sendToRequired": "Адреса електронної пошти 'Кому' є обов'язковою",
|
|
8
|
+
"subjectRequired": "Тема є обов'язковою",
|
|
9
|
+
"messageRequired": "Повідомлення є обов'язковим"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Сповіщення електронною поштою",
|
|
13
|
+
"notificationToggleLabel": "Надіслати сповіщення електронною поштою, коли відбудеться нова подія"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Попередній перегляд"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "Chào mừng bạn đến với neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "Vui lòng nhập địa chỉ email hợp lệ",
|
|
6
|
+
"sendFromRequired": "Địa chỉ email 'Gửi từ' là bắt buộc",
|
|
7
|
+
"sendToRequired": "Địa chỉ email 'Gửi đến' là bắt buộc",
|
|
8
|
+
"subjectRequired": "Chủ đề là bắt buộc",
|
|
9
|
+
"messageRequired": "Tin nhắn là bắt buộc"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "Thông báo qua email",
|
|
13
|
+
"notificationToggleLabel": "Gửi thông báo qua email khi có sự kiện mới xảy ra"
|
|
14
|
+
},
|
|
15
|
+
"preview": "Xem trước"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "欢迎使用neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "请输入有效的电子邮件地址",
|
|
6
|
+
"sendFromRequired": "'发件人'电子邮件地址是必需的",
|
|
7
|
+
"sendToRequired": "'收件人'电子邮件地址是必需的",
|
|
8
|
+
"subjectRequired": "主题是必需的",
|
|
9
|
+
"messageRequired": "消息是必需的"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "电子邮件通知",
|
|
13
|
+
"notificationToggleLabel": "当发生新事件时发送电子邮件通知"
|
|
14
|
+
},
|
|
15
|
+
"preview": "预览"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neetoEmailNotifications": {
|
|
3
|
+
"welcomeScreen": "歡迎使用 neeto wheel nano",
|
|
4
|
+
"errors": {
|
|
5
|
+
"invalidEmailAddress": "請輸入有效的電子郵件地址",
|
|
6
|
+
"sendFromRequired": "'發件人' 電子郵件地址是必需的",
|
|
7
|
+
"sendToRequired": "'收件人' 電子郵件地址是必需的",
|
|
8
|
+
"subjectRequired": "主旨是必需的",
|
|
9
|
+
"messageRequired": "訊息是必需的"
|
|
10
|
+
},
|
|
11
|
+
"emailNotification": {
|
|
12
|
+
"title": "電子郵件通知",
|
|
13
|
+
"notificationToggleLabel": "當有新事件發生時發送電子郵件通知"
|
|
14
|
+
},
|
|
15
|
+
"preview": "預覽"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -4,7 +4,7 @@ import { useRef } from 'react';
|
|
|
4
4
|
import { isNotEmpty, isNotPresent, noop } from '@bigbinary/neeto-cist';
|
|
5
5
|
import EmailForm from '@bigbinary/neeto-molecules/EmailForm';
|
|
6
6
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
7
|
-
import { prop, isEmpty, mergeLeft, mergeDeepLeft } from 'ramda';
|
|
7
|
+
import { prop, isEmpty, pick, mergeLeft, mergeDeepLeft } from 'ramda';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
9
|
import { useQuery } from '@tanstack/react-query';
|
|
10
10
|
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
@@ -165,12 +165,24 @@ var packEmailPayload = function packEmailPayload(values, isReplyToDropdownField,
|
|
|
165
165
|
var renderText = function renderText(text, fallbackTranslation) {
|
|
166
166
|
return isEmpty(text) ? fallbackTranslation : text;
|
|
167
167
|
};
|
|
168
|
+
var generateDefaultValues = function generateDefaultValues(data) {
|
|
169
|
+
var _data$defaultAttribut, _data$defaultAttribut2;
|
|
170
|
+
if (!(data !== null && data !== void 0 && data.defaultAttributes)) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
var currentDataFields = ["id", "customFields", "notifyCcEmails", "notifyBccEmails", "replyToId"];
|
|
174
|
+
var currentDataOverlay = pick(currentDataFields, data);
|
|
175
|
+
var normalizedDefaults = _objectSpread$1(_objectSpread$1({}, data.defaultAttributes), {}, {
|
|
176
|
+
message: ((_data$defaultAttribut = data.defaultAttributes.message) === null || _data$defaultAttribut === void 0 || (_data$defaultAttribut2 = _data$defaultAttribut.replaceAll) === null || _data$defaultAttribut2 === void 0 ? void 0 : _data$defaultAttribut2.call(_data$defaultAttribut, "<br />", "<br>")) || data.defaultAttributes.message
|
|
177
|
+
});
|
|
178
|
+
return mergeLeft(currentDataOverlay, normalizedDefaults);
|
|
179
|
+
};
|
|
168
180
|
|
|
169
181
|
var _excluded = ["validationSchema"];
|
|
170
182
|
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; }
|
|
171
183
|
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; }
|
|
172
184
|
var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
173
|
-
var _emailFormProps$sendT;
|
|
185
|
+
var _emailFormProps$sendT, _emailFormProps$sendT2;
|
|
174
186
|
var _ref$emailNotificatio = _ref.emailNotificationParams,
|
|
175
187
|
emailNotificationParams = _ref$emailNotificatio === void 0 ? {} : _ref$emailNotificatio,
|
|
176
188
|
_ref$emailPreviewProp = _ref.emailPreviewProps,
|
|
@@ -226,6 +238,9 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
226
238
|
children: /*#__PURE__*/jsx(Spinner, {})
|
|
227
239
|
});
|
|
228
240
|
}
|
|
241
|
+
var newDefaultAttributes = generateDefaultValues(data);
|
|
242
|
+
var defaultValues = parseEmailNotificationData(newDefaultAttributes, emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$sendT = emailFormProps.sendToFieldProps) === null || _emailFormProps$sendT === void 0 ? void 0 : _emailFormProps$sendT.options);
|
|
243
|
+
defaultValues.defaultAttributes = data.defaultAttributes;
|
|
229
244
|
var formattedTitle = renderText(title, t("neetoEmailNotifications.emailNotification.title"));
|
|
230
245
|
var formattedNotificationToggleLabel = renderText(notificationToggleLabel, t("neetoEmailNotifications.emailNotification.notificationToggleLabel"));
|
|
231
246
|
var customValidationSchema = emailFormikProps.validationSchema,
|
|
@@ -247,18 +262,20 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
247
262
|
formikProps: formikProps,
|
|
248
263
|
tooltipProps: tooltipProps
|
|
249
264
|
}, mergeLeft(fieldsVisibility, DEFAULT_FIELDS_VISIBILITY))), {}, {
|
|
250
|
-
isLoading: isSubmitting
|
|
265
|
+
isLoading: isSubmitting,
|
|
251
266
|
validationSchema: customValidationSchema || FORM_VALIDATION_SCHEMA,
|
|
252
267
|
emailFormProps: _objectSpread({
|
|
253
268
|
editorRef: editorRef,
|
|
254
|
-
handleResetToDefault: handleResetToDefault
|
|
269
|
+
handleResetToDefault: handleResetToDefault,
|
|
270
|
+
isResetting: isResetting,
|
|
271
|
+
defaultValues: defaultValues
|
|
255
272
|
}, emailFormProps),
|
|
256
273
|
headerProps: {
|
|
257
274
|
title: formattedTitle,
|
|
258
275
|
titleHelpPopoverProps: helpPopoverProps,
|
|
259
276
|
breadcrumbs: breadcrumbs
|
|
260
277
|
},
|
|
261
|
-
initialValues: parseEmailNotificationData(data, emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$
|
|
278
|
+
initialValues: parseEmailNotificationData(data, emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$sendT2 = emailFormProps.sendToFieldProps) === null || _emailFormProps$sendT2 === void 0 ? void 0 : _emailFormProps$sendT2.options),
|
|
262
279
|
switchProps: {
|
|
263
280
|
label: formattedNotificationToggleLabel,
|
|
264
281
|
disabled: disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeetoEmailNotificationForm.js","sources":["../app/javascript/src/constants/index.js","../app/javascript/src/apis/email_notifications.js","../app/javascript/src/constants/query.js","../app/javascript/src/hooks/reactQuery/emailNotificationApi.js","../app/javascript/src/components/EmailNotificationForm/constants.js","../app/javascript/src/components/EmailNotificationForm/utils.js","../app/javascript/src/components/EmailNotificationForm/index.jsx"],"sourcesContent":["export const EMAIL_NOTIFICATIONS_BASE_URL =\n \"neeto_email_notifications/email_notification\";\n\nexport const RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL = `${EMAIL_NOTIFICATIONS_BASE_URL}/reset_to_default`;\n","import axios from \"axios\";\n\nimport {\n RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL,\n EMAIL_NOTIFICATIONS_BASE_URL,\n} from \"src/constants\";\n\nconst fetch = params => axios.get(EMAIL_NOTIFICATIONS_BASE_URL, { params });\n\nconst update = payload => axios.put(EMAIL_NOTIFICATIONS_BASE_URL, payload);\n\nconst resetToDefault = params =>\n axios.post(RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL, params);\n\nconst emailNotificationsApi = { fetch, update, resetToDefault };\n\nexport default emailNotificationsApi;\n","export const QUERY_KEYS = {\n NEETO_EMAIL_NOTIFICATIONS: \"neeto-email-notifications\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { isNotEmpty } from \"neetocist\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { prop } from \"ramda\";\n\nimport emailNotificationsApi from \"src/apis/email_notifications\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchEmailNotifications = params =>\n useQuery({\n queryKey: [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n params[\"notificationHolderId\"],\n params[\"customFields\"],\n ],\n queryFn: () => emailNotificationsApi.fetch(params),\n staleTime: DEFAULT_STALE_TIME,\n select: prop(\"emailNotification\"),\n enabled: isNotEmpty(params),\n });\n\nexport const useUpdateEmailNotification = () =>\n useMutationWithInvalidation(params => emailNotificationsApi.update(params), {\n keysToInvalidate: [\n (_, { notificationHolderId }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n ],\n ],\n });\n\nexport const useResetEmailNotificationToDefault = () =>\n useMutationWithInvalidation(emailNotificationsApi.resetToDefault, {\n keysToInvalidate: [\n (_, { notificationHolderId, customFields }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n customFields,\n ],\n ],\n });\n","import * as yup from \"yup\";\n\nexport const FORM_VALIDATION_SCHEMA = { isEnabled: yup.boolean() };\n\nexport const DEFAULT_FIELDS_VISIBILITY = {\n showSendToField: true,\n showReplyToField: false,\n showSendToAsRadio: false,\n showBccField: false,\n showCcField: false,\n};\n","import { isNotEmpty } from \"neetocist\";\nimport { isEmpty, mergeLeft, prop } from \"ramda\";\nimport { string } from \"yup\";\n\nconst isValidEmail = email => string().email().isValidSync(email);\n\nconst createEmailOptions = (emails = []) =>\n emails.map(email => ({\n label: email,\n value: email,\n valid: isValidEmail(email),\n }));\n\nexport const parseEmailsOptions = (emailOptions = []) =>\n emailOptions.map(prop(\"label\"));\n\nexport const parseEmailNotificationData = (data, sendToOptions) => {\n const {\n notifyEmails,\n notifyCcEmails,\n notifyBccEmails,\n replyToId,\n customFields,\n ...rest\n } = data;\n\n const parsed = { ...customFields, ...rest };\n parsed.sendTo = notifyEmails ? createEmailOptions(notifyEmails) : [];\n parsed.sendToCc = notifyCcEmails ? createEmailOptions(notifyCcEmails) : [];\n parsed.sendToBcc = notifyCcEmails ? createEmailOptions(notifyBccEmails) : [];\n parsed.replyTo = replyToId || customFields[\"replyTo\"];\n parsed.sendToId = customFields[\"sendToId\"] || sendToOptions?.[0]?.value || \"\";\n parsed.showCopyEmails = !!(notifyCcEmails?.length || notifyBccEmails?.length);\n\n return parsed;\n};\n\nexport const packEmailPayload = (\n values,\n isReplyToDropdownField,\n isDisabledByUser\n) => {\n const {\n // eslint-disable-next-line no-unused-vars\n id: _,\n isEnabled,\n sendTo,\n sendToCc,\n sendToBcc,\n showCopyEmails,\n replyTo,\n message,\n subject,\n sendFrom,\n sendToId,\n ...rest\n } = values;\n let payload = { isEnabled };\n\n if (isEnabled) {\n payload = { ...payload };\n payload.notifyEmails = parseEmailsOptions(sendTo);\n payload.notifyBccEmails = showCopyEmails\n ? parseEmailsOptions(sendToBcc)\n : [];\n\n payload.notifyCcEmails = showCopyEmails ? parseEmailsOptions(sendToCc) : [];\n if (isReplyToDropdownField) {\n payload.replyToId = replyTo;\n } else {\n rest.replyTo = replyTo;\n }\n payload.message = message;\n payload.subject = subject;\n payload.customFields = { ...rest, disabledByUser: false };\n\n if (isNotEmpty(sendToId)) {\n payload.customFields = mergeLeft(payload.customFields, { sendToId });\n }\n payload.sendFrom = sendFrom;\n } else {\n payload.customFields = { disabledByUser: isDisabledByUser };\n }\n\n return payload;\n};\n\nexport const renderText = (text, fallbackTranslation) =>\n isEmpty(text) ? fallbackTranslation : text;\n","import { useRef } from \"react\";\n\nimport { isNotPresent, noop } from \"neetocist\";\nimport EmailForm from \"neetomolecules/EmailForm\";\nimport { Spinner } from \"neetoui\";\nimport { mergeDeepLeft, mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useFetchEmailNotifications,\n useUpdateEmailNotification,\n useResetEmailNotificationToDefault,\n} from \"src/hooks/reactQuery/emailNotificationApi\";\n\nimport { DEFAULT_FIELDS_VISIBILITY, FORM_VALIDATION_SCHEMA } from \"./constants\";\nimport {\n packEmailPayload,\n parseEmailNotificationData,\n renderText,\n} from \"./utils\";\n\nconst NeetoEmailNotificationForm = ({\n emailNotificationParams = {},\n emailPreviewProps = {},\n emailFormProps = {},\n emailFormikProps = {},\n title = \"\",\n notificationToggleLabel = \"\",\n breadcrumbs = [],\n helpPopoverProps = {},\n tooltipProps = {},\n disabled = false,\n fieldsVisibility = {},\n blockNavigation = false,\n onSuccess = noop,\n children,\n}) => {\n const editorRef = useRef();\n\n const { t } = useTranslation();\n\n const { data = {}, isLoading } = useFetchEmailNotifications(\n emailNotificationParams\n );\n\n const { mutate: updateEmailNotification, isPending: isSubmitting } =\n useUpdateEmailNotification();\n\n const { mutate: resetToDefault, isPending: isResetting } =\n useResetEmailNotificationToDefault();\n\n const handleSubmit = values => {\n const isDisabledByUser = data.isEnabled && !values.isEnabled;\n const isReplyToDropdownField =\n emailFormProps?.replyToFieldProps?.options !== undefined;\n\n const body = mergeDeepLeft(\n packEmailPayload(values, isReplyToDropdownField, isDisabledByUser),\n emailNotificationParams\n );\n updateEmailNotification(body, { onSuccess });\n };\n\n if (isLoading || isNotPresent(data)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n const formattedTitle = renderText(\n title,\n t(\"neetoEmailNotifications.emailNotification.title\")\n );\n\n const formattedNotificationToggleLabel = renderText(\n notificationToggleLabel,\n t(\"neetoEmailNotifications.emailNotification.notificationToggleLabel\")\n );\n\n const { validationSchema: customValidationSchema, ...formikProps } =\n emailFormikProps;\n\n const handleResetToDefault = () => {\n resetToDefault(emailNotificationParams, {\n onSuccess: ({ emailNotification }) =>\n editorRef?.current?.editor?.commands?.setContent(\n emailNotification.message\n ),\n });\n };\n\n return (\n <div className=\"min-w-0 flex-grow overflow-y-auto\">\n <EmailForm\n {...{\n blockNavigation,\n emailPreviewProps,\n formikProps,\n tooltipProps,\n ...mergeLeft(fieldsVisibility, DEFAULT_FIELDS_VISIBILITY),\n }}\n isLoading={isSubmitting || isResetting}\n validationSchema={customValidationSchema || FORM_VALIDATION_SCHEMA}\n emailFormProps={{\n editorRef,\n handleResetToDefault,\n ...emailFormProps,\n }}\n headerProps={{\n title: formattedTitle,\n titleHelpPopoverProps: helpPopoverProps,\n breadcrumbs,\n }}\n initialValues={parseEmailNotificationData(\n data,\n emailFormProps?.sendToFieldProps?.options\n )}\n switchProps={{\n label: formattedNotificationToggleLabel,\n disabled,\n \"data-cy\": \"receive-email-notification-switch\",\n }}\n onSubmit={handleSubmit}\n >\n {children}\n </EmailForm>\n </div>\n );\n};\n\nexport default NeetoEmailNotificationForm;\n"],"names":["EMAIL_NOTIFICATIONS_BASE_URL","RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL","concat","fetch","params","axios","get","update","payload","put","resetToDefault","post","emailNotificationsApi","QUERY_KEYS","NEETO_EMAIL_NOTIFICATIONS","useFetchEmailNotifications","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","select","prop","enabled","isNotEmpty","useUpdateEmailNotification","useMutationWithInvalidation","keysToInvalidate","_","_ref","notificationHolderId","useResetEmailNotificationToDefault","_ref2","customFields","FORM_VALIDATION_SCHEMA","isEnabled","yup","DEFAULT_FIELDS_VISIBILITY","showSendToField","showReplyToField","showSendToAsRadio","showBccField","showCcField","isValidEmail","email","string","isValidSync","createEmailOptions","emails","arguments","length","undefined","map","label","value","valid","parseEmailsOptions","emailOptions","parseEmailNotificationData","data","sendToOptions","_sendToOptions$","notifyEmails","notifyCcEmails","notifyBccEmails","replyToId","rest","_objectWithoutProperties","_excluded","parsed","_objectSpread","sendTo","sendToCc","sendToBcc","replyTo","sendToId","showCopyEmails","packEmailPayload","values","isReplyToDropdownField","isDisabledByUser","id","message","subject","sendFrom","_excluded2","disabledByUser","mergeLeft","renderText","text","fallbackTranslation","isEmpty","NeetoEmailNotificationForm","_emailFormProps$sendT","_ref$emailNotificatio","emailNotificationParams","_ref$emailPreviewProp","emailPreviewProps","_ref$emailFormProps","emailFormProps","_ref$emailFormikProps","emailFormikProps","_ref$title","title","_ref$notificationTogg","notificationToggleLabel","_ref$breadcrumbs","breadcrumbs","_ref$helpPopoverProps","helpPopoverProps","_ref$tooltipProps","tooltipProps","_ref$disabled","disabled","_ref$fieldsVisibility","fieldsVisibility","_ref$blockNavigation","blockNavigation","_ref$onSuccess","onSuccess","noop","children","editorRef","useRef","_useTranslation","useTranslation","t","_useFetchEmailNotific","_useFetchEmailNotific2","isLoading","_useUpdateEmailNotifi","updateEmailNotification","mutate","isSubmitting","isPending","_useResetEmailNotific","isResetting","handleSubmit","_emailFormProps$reply","replyToFieldProps","options","body","mergeDeepLeft","isNotPresent","_jsx","className","Spinner","formattedTitle","formattedNotificationToggleLabel","customValidationSchema","validationSchema","formikProps","handleResetToDefault","_editorRef$current","emailNotification","current","editor","commands","setContent","EmailForm","headerProps","titleHelpPopoverProps","initialValues","sendToFieldProps","switchProps","onSubmit"],"mappings":";;;;;;;;;;;;;;;;AAAO,IAAMA,4BAA4B,GACvC,8CAA8C;AAEzC,IAAMC,wCAAwC,GAAA,EAAA,CAAAC,MAAA,CAAMF,4BAA4B,EAAmB,mBAAA,CAAA;;ACI1G,IAAMG,KAAK,GAAG,SAARA,KAAKA,CAAGC,MAAM,EAAA;AAAA,EAAA,OAAIC,KAAK,CAACC,GAAG,CAACN,4BAA4B,EAAE;AAAEI,IAAAA,MAAM,EAANA;AAAO,GAAC,CAAC;AAAA,CAAA;AAE3E,IAAMG,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OAAIH,KAAK,CAACI,GAAG,CAACT,4BAA4B,EAAEQ,OAAO,CAAC;AAAA,CAAA;AAE1E,IAAME,cAAc,GAAG,SAAjBA,cAAcA,CAAGN,MAAM,EAAA;AAAA,EAAA,OAC3BC,KAAK,CAACM,IAAI,CAACV,wCAAwC,EAAEG,MAAM,CAAC;AAAA,CAAA;AAE9D,IAAMQ,qBAAqB,GAAG;AAAET,EAAAA,KAAK,EAALA,KAAK;AAAEI,EAAAA,MAAM,EAANA,MAAM;AAAEG,EAAAA,cAAc,EAAdA;AAAe,CAAC;;ACdxD,IAAMG,UAAU,GAAG;AACxBC,EAAAA,yBAAyB,EAAE;AAC7B,CAAC;;ACOM,IAAMC,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAAGX,MAAM,EAAA;AAAA,EAAA,OAC9CY,QAAQ,CAAC;AACPC,IAAAA,QAAQ,EAAE,CACRJ,UAAU,CAACC,yBAAyB,EACpCV,MAAM,CAAC,sBAAsB,CAAC,EAC9BA,MAAM,CAAC,cAAc,CAAC,CACvB;IACDc,OAAO,EAAE,SAATA,OAAOA,GAAA;AAAA,MAAA,OAAQN,qBAAqB,CAACT,KAAK,CAACC,MAAM,CA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AA,WAAW,EAAXA,WAAW;AACXxC,MAAAA,YAAY,EAAZA;AAAY,KAAA,EACTxB,SAAS,CAAC4B,gBAAgB,EAAE9E,yBAAyB,CAAC,CAAA,CAAA,EAAA,EAAA,EAAA;MAE3D4F,SAAS,EAAEI,YAAY,IAAIG,WAAY;MACvCc,gBAAgB,EAAED,sBAAsB,IAAInH,sBAAuB;AACnEiE,MAAAA,cAAc,EAAA7B,aAAA,CAAA;AACZoD,QAAAA,SAAS,EAATA,SAAS;AACT8B,QAAAA,oBAAoB,EAApBA;AAAoB,OAAA,EACjBrD,cAAc,CACjB;AACF6D,MAAAA,WAAW,EAAE;AACXzD,QAAAA,KAAK,EAAE4C,cAAc;AACrBc,QAAAA,qBAAqB,EAAEpD,gBAAgB;AACvCF,QAAAA,WAAW,EAAXA;OACA;MACFuD,aAAa,EAAExG,0BAA0B,CACvCC,IAAI,EACJwC,cAAc,KAAA,IAAA,IAAdA,cAAc,KAAAN,KAAAA,CAAAA,IAAAA,CAAAA,qBAAA,GAAdM,cAAc,CAAEgE,gBAAgB,MAAAtE,IAAAA,IAAAA,qBAAA,uBAAhCA,qBAAA,CAAkC+C,OACpC,CAAE;AACFwB,MAAAA,WAAW,EAAE;AACX/G,QAAAA,KAAK,EAAE+F,gCAAgC;AACvCnC,QAAAA,QAAQ,EAARA,QAAQ;AACR,QAAA,SAAS,EAAE;OACX;AACFoD,MAAAA,QAAQ,EAAE5B,YAAa;AAAAhB,MAAAA,QAAA,EAEtBA;KACQ,CAAA;AAAC,GACT,CAAC;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"NeetoEmailNotificationForm.js","sources":["../app/javascript/src/constants/index.js","../app/javascript/src/apis/email_notifications.js","../app/javascript/src/constants/query.js","../app/javascript/src/hooks/reactQuery/emailNotificationApi.js","../app/javascript/src/components/EmailNotificationForm/constants.js","../app/javascript/src/components/EmailNotificationForm/utils.js","../app/javascript/src/components/EmailNotificationForm/index.jsx"],"sourcesContent":["export const EMAIL_NOTIFICATIONS_BASE_URL =\n \"neeto_email_notifications/email_notification\";\n\nexport const RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL = `${EMAIL_NOTIFICATIONS_BASE_URL}/reset_to_default`;\n","import axios from \"axios\";\n\nimport {\n RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL,\n EMAIL_NOTIFICATIONS_BASE_URL,\n} from \"src/constants\";\n\nconst fetch = params => axios.get(EMAIL_NOTIFICATIONS_BASE_URL, { params });\n\nconst update = payload => axios.put(EMAIL_NOTIFICATIONS_BASE_URL, payload);\n\nconst resetToDefault = params =>\n axios.post(RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL, params);\n\nconst emailNotificationsApi = { fetch, update, resetToDefault };\n\nexport default emailNotificationsApi;\n","export const QUERY_KEYS = {\n NEETO_EMAIL_NOTIFICATIONS: \"neeto-email-notifications\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { isNotEmpty } from \"neetocist\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { prop } from \"ramda\";\n\nimport emailNotificationsApi from \"src/apis/email_notifications\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchEmailNotifications = params =>\n useQuery({\n queryKey: [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n params[\"notificationHolderId\"],\n params[\"customFields\"],\n ],\n queryFn: () => emailNotificationsApi.fetch(params),\n staleTime: DEFAULT_STALE_TIME,\n select: prop(\"emailNotification\"),\n enabled: isNotEmpty(params),\n });\n\nexport const useUpdateEmailNotification = () =>\n useMutationWithInvalidation(params => emailNotificationsApi.update(params), {\n keysToInvalidate: [\n (_, { notificationHolderId }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n ],\n ],\n });\n\nexport const useResetEmailNotificationToDefault = () =>\n useMutationWithInvalidation(emailNotificationsApi.resetToDefault, {\n keysToInvalidate: [\n (_, { notificationHolderId, customFields }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n customFields,\n ],\n ],\n });\n","import * as yup from \"yup\";\n\nexport const FORM_VALIDATION_SCHEMA = { isEnabled: yup.boolean() };\n\nexport const DEFAULT_FIELDS_VISIBILITY = {\n showSendToField: true,\n showReplyToField: false,\n showSendToAsRadio: false,\n showBccField: false,\n showCcField: false,\n};\n","import { isNotEmpty } from \"neetocist\";\nimport { isEmpty, mergeLeft, prop, pick } from \"ramda\";\nimport { string } from \"yup\";\n\nconst isValidEmail = email => string().email().isValidSync(email);\n\nconst createEmailOptions = (emails = []) =>\n emails.map(email => ({\n label: email,\n value: email,\n valid: isValidEmail(email),\n }));\n\nexport const parseEmailsOptions = (emailOptions = []) =>\n emailOptions.map(prop(\"label\"));\n\nexport const parseEmailNotificationData = (data, sendToOptions) => {\n const {\n notifyEmails,\n notifyCcEmails,\n notifyBccEmails,\n replyToId,\n customFields,\n ...rest\n } = data;\n\n const parsed = { ...customFields, ...rest };\n parsed.sendTo = notifyEmails ? createEmailOptions(notifyEmails) : [];\n parsed.sendToCc = notifyCcEmails ? createEmailOptions(notifyCcEmails) : [];\n parsed.sendToBcc = notifyCcEmails ? createEmailOptions(notifyBccEmails) : [];\n parsed.replyTo = replyToId || customFields[\"replyTo\"];\n parsed.sendToId = customFields[\"sendToId\"] || sendToOptions?.[0]?.value || \"\";\n parsed.showCopyEmails = !!(notifyCcEmails?.length || notifyBccEmails?.length);\n\n return parsed;\n};\n\nexport const packEmailPayload = (\n values,\n isReplyToDropdownField,\n isDisabledByUser\n) => {\n const {\n // eslint-disable-next-line no-unused-vars\n id: _,\n isEnabled,\n sendTo,\n sendToCc,\n sendToBcc,\n showCopyEmails,\n replyTo,\n message,\n subject,\n sendFrom,\n sendToId,\n ...rest\n } = values;\n let payload = { isEnabled };\n\n if (isEnabled) {\n payload = { ...payload };\n payload.notifyEmails = parseEmailsOptions(sendTo);\n payload.notifyBccEmails = showCopyEmails\n ? parseEmailsOptions(sendToBcc)\n : [];\n\n payload.notifyCcEmails = showCopyEmails ? parseEmailsOptions(sendToCc) : [];\n if (isReplyToDropdownField) {\n payload.replyToId = replyTo;\n } else {\n rest.replyTo = replyTo;\n }\n payload.message = message;\n payload.subject = subject;\n payload.customFields = { ...rest, disabledByUser: false };\n\n if (isNotEmpty(sendToId)) {\n payload.customFields = mergeLeft(payload.customFields, { sendToId });\n }\n payload.sendFrom = sendFrom;\n } else {\n payload.customFields = { disabledByUser: isDisabledByUser };\n }\n\n return payload;\n};\n\nexport const renderText = (text, fallbackTranslation) =>\n isEmpty(text) ? fallbackTranslation : text;\n\nexport const generateDefaultValues = data => {\n if (!data?.defaultAttributes) {\n return null;\n }\n\n const currentDataFields = [\n \"id\",\n \"customFields\",\n \"notifyCcEmails\",\n \"notifyBccEmails\",\n \"replyToId\",\n ];\n\n const currentDataOverlay = pick(currentDataFields, data);\n\n const normalizedDefaults = {\n ...data.defaultAttributes,\n message:\n data.defaultAttributes.message?.replaceAll?.(\"<br />\", \"<br>\") ||\n data.defaultAttributes.message,\n };\n\n return mergeLeft(currentDataOverlay, normalizedDefaults);\n};\n","import { useRef } from \"react\";\n\nimport { isNotPresent, noop } from \"neetocist\";\nimport EmailForm from \"neetomolecules/EmailForm\";\nimport { Spinner } from \"neetoui\";\nimport { mergeDeepLeft, mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useFetchEmailNotifications,\n useUpdateEmailNotification,\n useResetEmailNotificationToDefault,\n} from \"src/hooks/reactQuery/emailNotificationApi\";\n\nimport { DEFAULT_FIELDS_VISIBILITY, FORM_VALIDATION_SCHEMA } from \"./constants\";\nimport {\n packEmailPayload,\n parseEmailNotificationData,\n renderText,\n generateDefaultValues,\n} from \"./utils\";\n\nconst NeetoEmailNotificationForm = ({\n emailNotificationParams = {},\n emailPreviewProps = {},\n emailFormProps = {},\n emailFormikProps = {},\n title = \"\",\n notificationToggleLabel = \"\",\n breadcrumbs = [],\n helpPopoverProps = {},\n tooltipProps = {},\n disabled = false,\n fieldsVisibility = {},\n blockNavigation = false,\n onSuccess = noop,\n children,\n}) => {\n const editorRef = useRef();\n\n const { t } = useTranslation();\n\n const { data = {}, isLoading } = useFetchEmailNotifications(\n emailNotificationParams\n );\n\n const { mutate: updateEmailNotification, isPending: isSubmitting } =\n useUpdateEmailNotification();\n\n const { mutate: resetToDefault, isPending: isResetting } =\n useResetEmailNotificationToDefault();\n\n const handleSubmit = values => {\n const isDisabledByUser = data.isEnabled && !values.isEnabled;\n const isReplyToDropdownField =\n emailFormProps?.replyToFieldProps?.options !== undefined;\n\n const body = mergeDeepLeft(\n packEmailPayload(values, isReplyToDropdownField, isDisabledByUser),\n emailNotificationParams\n );\n updateEmailNotification(body, { onSuccess });\n };\n\n if (isLoading || isNotPresent(data)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n const newDefaultAttributes = generateDefaultValues(data);\n\n const defaultValues = parseEmailNotificationData(\n newDefaultAttributes,\n emailFormProps?.sendToFieldProps?.options\n );\n\n defaultValues.defaultAttributes = data.defaultAttributes;\n\n const formattedTitle = renderText(\n title,\n t(\"neetoEmailNotifications.emailNotification.title\")\n );\n\n const formattedNotificationToggleLabel = renderText(\n notificationToggleLabel,\n t(\"neetoEmailNotifications.emailNotification.notificationToggleLabel\")\n );\n\n const { validationSchema: customValidationSchema, ...formikProps } =\n emailFormikProps;\n\n const handleResetToDefault = () => {\n resetToDefault(emailNotificationParams, {\n onSuccess: ({ emailNotification }) =>\n editorRef?.current?.editor?.commands?.setContent(\n emailNotification.message\n ),\n });\n };\n\n return (\n <div className=\"min-w-0 flex-grow overflow-y-auto\">\n <EmailForm\n {...{\n blockNavigation,\n emailPreviewProps,\n formikProps,\n tooltipProps,\n ...mergeLeft(fieldsVisibility, DEFAULT_FIELDS_VISIBILITY),\n }}\n isLoading={isSubmitting}\n validationSchema={customValidationSchema || FORM_VALIDATION_SCHEMA}\n emailFormProps={{\n editorRef,\n handleResetToDefault,\n isResetting,\n defaultValues,\n ...emailFormProps,\n }}\n headerProps={{\n title: formattedTitle,\n titleHelpPopoverProps: helpPopoverProps,\n breadcrumbs,\n }}\n initialValues={parseEmailNotificationData(\n data,\n emailFormProps?.sendToFieldProps?.options\n )}\n switchProps={{\n label: formattedNotificationToggleLabel,\n disabled,\n \"data-cy\": \"receive-email-notification-switch\",\n }}\n onSubmit={handleSubmit}\n >\n {children}\n </EmailForm>\n </div>\n );\n};\n\nexport default NeetoEmailNotificationForm;\n"],"names":["EMAIL_NOTIFICATIONS_BASE_URL","RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL","concat","fetch","params","axios","get","update","payload","put","resetToDefault","post","emailNotificationsApi","QUERY_KEYS","NEETO_EMAIL_NOTIFICATIONS","useFetchEmailNotifications","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","select","prop","enabled","isNotEmpty","useUpdateEmailNotification","useMutationWithInvalidation","keysToInvalidate","_","_ref","notificationHolderId","useResetEmailNotificationToDefault","_ref2","customFields","FORM_VALIDATION_SCHEMA","isEnabled","yup","DEFAULT_FIELDS_VISIBILITY","showSendToField","showReplyToField","showSendToAsRadio","showBccField","showCcField","isValidEmail","email","string","isValidSync","createEmailOptions","emails","arguments","length","undefined","map","label","value","valid","parseEmailsOptions","emailOptions","parseEmailNotificationData","data","sendToOptions","_sendToOptions$","notifyEmails","notifyCcEmails","notifyBccEmails","replyToId","rest","_objectWithoutProperties","_excluded","parsed","_objectSpread","sendTo","sendToCc","sendToBcc","replyTo","sendToId","showCopyEmails","packEmailPayload","values","isReplyToDropdownField","isDisabledByUser","id","message","subject","sendFrom","_excluded2","disabledByUser","mergeLeft","renderText","text","fallbackTranslation","isEmpty","generateDefaultValues","_data$defaultAttribut","_data$defaultAttribut2","defaultAttributes","currentDataFields","currentDataOverlay","pick","normalizedDefaults","replaceAll","call","NeetoEmailNotificationForm","_emailFormProps$sendT","_emailFormProps$sendT2","_ref$emailNotificatio","emailNotificationParams","_ref$emailPreviewProp","emailPreviewProps","_ref$emailFormProps","emailFormProps","_ref$emailFormikProps","emailFormikProps","_ref$title","title","_ref$notificationTogg","notificationToggleLabel","_ref$breadcrumbs","breadcrumbs","_ref$helpPopoverProps","helpPopoverProps","_ref$tooltipProps","tooltipProps","_ref$disabled","disabled","_ref$fieldsVisibility","fieldsVisibility","_ref$blockNavigation","blockNavigation","_ref$onSuccess","onSuccess","noop","children","editorRef","useRef","_useTranslation","useTranslation","t","_useFetchEmailNotific","_useFetchEmailNotific2","isLoading","_useUpdateEmailNotifi","updateEmailNotification","mutate","isSubmitting","isPending","_useResetEmailNotific","isResetting","handleSubmit","_emailFormProps$reply","replyToFieldProps","options","body","mergeDeepLeft","isNotPresent","_jsx","className","Spinner","newDefaultAttributes","defaultValues","sendToFieldProps","formattedTitle","formattedNotificationToggleLabel","customValidationSchema","validationSchema","formikProps","handleResetToDefault","_editorRef$current","emailNotification","current","editor","commands","setContent","EmailForm","headerProps","titleHelpPopoverProps","initialValues","switchProps","onSubmit"],"mappings":";;;;;;;;;;;;;;;;AAAO,IAAMA,4BAA4B,GACvC,8CAA8C;AAEzC,IAAMC,wCAAwC,GAAA,EAAA,CAAAC,MAAA,CAAMF,4BAA4B,EAAmB,mBAAA,CAAA;;ACI1G,IAAMG,KAAK,GAAG,SAARA,KAAKA,CAAGC,MAAM,EAAA;AAAA,EAAA,OAAIC,KAAK,CAACC,GAAG,CAACN,4BAA4B,EAAE;AAAEI,IAAAA,MAAM,EAANA;AAAO,GAAC,CAAC;AAAA,CAAA;AAE3E,IAAMG,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OAAIH,KAAK,CAACI,GAAG,CAACT,4BAA4B,EAAEQ,OAAO,CAAC;AAAA,CAAA;AAE1E,IAAME,cAAc,GAAG,SAAjBA,cAAcA,CAAGN,MAAM,EAAA;AAAA,EAAA,OAC3BC,KAAK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qBAAqB,EAAEvD,gBAAgB;AACvCF,QAAAA,WAAW,EAAXA;OACA;MACF0D,aAAa,EAAEtH,0BAA0B,CACvCC,IAAI,EACJmD,cAAc,KAAA,IAAA,IAAdA,cAAc,KAAAN,KAAAA,CAAAA,IAAAA,CAAAA,sBAAA,GAAdM,cAAc,CAAEkD,gBAAgB,MAAAxD,IAAAA,IAAAA,sBAAA,uBAAhCA,sBAAA,CAAkC+C,OACpC,CAAE;AACF0B,MAAAA,WAAW,EAAE;AACX5H,QAAAA,KAAK,EAAE6G,gCAAgC;AACvCtC,QAAAA,QAAQ,EAARA,QAAQ;AACR,QAAA,SAAS,EAAE;OACX;AACFsD,MAAAA,QAAQ,EAAE9B,YAAa;AAAAhB,MAAAA,QAAA,EAEtBA;KACQ,CAAA;AAAC,GACT,CAAC;AAEV;;;;"}
|
|
@@ -185,12 +185,24 @@ var packEmailPayload = function packEmailPayload(values, isReplyToDropdownField,
|
|
|
185
185
|
var renderText = function renderText(text, fallbackTranslation) {
|
|
186
186
|
return ramda.isEmpty(text) ? fallbackTranslation : text;
|
|
187
187
|
};
|
|
188
|
+
var generateDefaultValues = function generateDefaultValues(data) {
|
|
189
|
+
var _data$defaultAttribut, _data$defaultAttribut2;
|
|
190
|
+
if (!(data !== null && data !== void 0 && data.defaultAttributes)) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
var currentDataFields = ["id", "customFields", "notifyCcEmails", "notifyBccEmails", "replyToId"];
|
|
194
|
+
var currentDataOverlay = ramda.pick(currentDataFields, data);
|
|
195
|
+
var normalizedDefaults = _objectSpread$1(_objectSpread$1({}, data.defaultAttributes), {}, {
|
|
196
|
+
message: ((_data$defaultAttribut = data.defaultAttributes.message) === null || _data$defaultAttribut === void 0 || (_data$defaultAttribut2 = _data$defaultAttribut.replaceAll) === null || _data$defaultAttribut2 === void 0 ? void 0 : _data$defaultAttribut2.call(_data$defaultAttribut, "<br />", "<br>")) || data.defaultAttributes.message
|
|
197
|
+
});
|
|
198
|
+
return ramda.mergeLeft(currentDataOverlay, normalizedDefaults);
|
|
199
|
+
};
|
|
188
200
|
|
|
189
201
|
var _excluded = ["validationSchema"];
|
|
190
202
|
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; }
|
|
191
203
|
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; }
|
|
192
204
|
var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
193
|
-
var _emailFormProps$sendT;
|
|
205
|
+
var _emailFormProps$sendT, _emailFormProps$sendT2;
|
|
194
206
|
var _ref$emailNotificatio = _ref.emailNotificationParams,
|
|
195
207
|
emailNotificationParams = _ref$emailNotificatio === void 0 ? {} : _ref$emailNotificatio,
|
|
196
208
|
_ref$emailPreviewProp = _ref.emailPreviewProps,
|
|
@@ -246,6 +258,9 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
246
258
|
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
247
259
|
});
|
|
248
260
|
}
|
|
261
|
+
var newDefaultAttributes = generateDefaultValues(data);
|
|
262
|
+
var defaultValues = parseEmailNotificationData(newDefaultAttributes, emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$sendT = emailFormProps.sendToFieldProps) === null || _emailFormProps$sendT === void 0 ? void 0 : _emailFormProps$sendT.options);
|
|
263
|
+
defaultValues.defaultAttributes = data.defaultAttributes;
|
|
249
264
|
var formattedTitle = renderText(title, t("neetoEmailNotifications.emailNotification.title"));
|
|
250
265
|
var formattedNotificationToggleLabel = renderText(notificationToggleLabel, t("neetoEmailNotifications.emailNotification.notificationToggleLabel"));
|
|
251
266
|
var customValidationSchema = emailFormikProps.validationSchema,
|
|
@@ -267,18 +282,20 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
267
282
|
formikProps: formikProps,
|
|
268
283
|
tooltipProps: tooltipProps
|
|
269
284
|
}, ramda.mergeLeft(fieldsVisibility, DEFAULT_FIELDS_VISIBILITY))), {}, {
|
|
270
|
-
isLoading: isSubmitting
|
|
285
|
+
isLoading: isSubmitting,
|
|
271
286
|
validationSchema: customValidationSchema || FORM_VALIDATION_SCHEMA,
|
|
272
287
|
emailFormProps: _objectSpread({
|
|
273
288
|
editorRef: editorRef,
|
|
274
|
-
handleResetToDefault: handleResetToDefault
|
|
289
|
+
handleResetToDefault: handleResetToDefault,
|
|
290
|
+
isResetting: isResetting,
|
|
291
|
+
defaultValues: defaultValues
|
|
275
292
|
}, emailFormProps),
|
|
276
293
|
headerProps: {
|
|
277
294
|
title: formattedTitle,
|
|
278
295
|
titleHelpPopoverProps: helpPopoverProps,
|
|
279
296
|
breadcrumbs: breadcrumbs
|
|
280
297
|
},
|
|
281
|
-
initialValues: parseEmailNotificationData(data, emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$
|
|
298
|
+
initialValues: parseEmailNotificationData(data, emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$sendT2 = emailFormProps.sendToFieldProps) === null || _emailFormProps$sendT2 === void 0 ? void 0 : _emailFormProps$sendT2.options),
|
|
282
299
|
switchProps: {
|
|
283
300
|
label: formattedNotificationToggleLabel,
|
|
284
301
|
disabled: disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeetoEmailNotificationForm.js","sources":["../../app/javascript/src/constants/index.js","../../app/javascript/src/apis/email_notifications.js","../../app/javascript/src/constants/query.js","../../app/javascript/src/hooks/reactQuery/emailNotificationApi.js","../../app/javascript/src/components/EmailNotificationForm/constants.js","../../app/javascript/src/components/EmailNotificationForm/utils.js","../../app/javascript/src/components/EmailNotificationForm/index.jsx"],"sourcesContent":["export const EMAIL_NOTIFICATIONS_BASE_URL =\n \"neeto_email_notifications/email_notification\";\n\nexport const RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL = `${EMAIL_NOTIFICATIONS_BASE_URL}/reset_to_default`;\n","import axios from \"axios\";\n\nimport {\n RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL,\n EMAIL_NOTIFICATIONS_BASE_URL,\n} from \"src/constants\";\n\nconst fetch = params => axios.get(EMAIL_NOTIFICATIONS_BASE_URL, { params });\n\nconst update = payload => axios.put(EMAIL_NOTIFICATIONS_BASE_URL, payload);\n\nconst resetToDefault = params =>\n axios.post(RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL, params);\n\nconst emailNotificationsApi = { fetch, update, resetToDefault };\n\nexport default emailNotificationsApi;\n","export const QUERY_KEYS = {\n NEETO_EMAIL_NOTIFICATIONS: \"neeto-email-notifications\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { isNotEmpty } from \"neetocist\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { prop } from \"ramda\";\n\nimport emailNotificationsApi from \"src/apis/email_notifications\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchEmailNotifications = params =>\n useQuery({\n queryKey: [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n params[\"notificationHolderId\"],\n params[\"customFields\"],\n ],\n queryFn: () => emailNotificationsApi.fetch(params),\n staleTime: DEFAULT_STALE_TIME,\n select: prop(\"emailNotification\"),\n enabled: isNotEmpty(params),\n });\n\nexport const useUpdateEmailNotification = () =>\n useMutationWithInvalidation(params => emailNotificationsApi.update(params), {\n keysToInvalidate: [\n (_, { notificationHolderId }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n ],\n ],\n });\n\nexport const useResetEmailNotificationToDefault = () =>\n useMutationWithInvalidation(emailNotificationsApi.resetToDefault, {\n keysToInvalidate: [\n (_, { notificationHolderId, customFields }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n customFields,\n ],\n ],\n });\n","import * as yup from \"yup\";\n\nexport const FORM_VALIDATION_SCHEMA = { isEnabled: yup.boolean() };\n\nexport const DEFAULT_FIELDS_VISIBILITY = {\n showSendToField: true,\n showReplyToField: false,\n showSendToAsRadio: false,\n showBccField: false,\n showCcField: false,\n};\n","import { isNotEmpty } from \"neetocist\";\nimport { isEmpty, mergeLeft, prop } from \"ramda\";\nimport { string } from \"yup\";\n\nconst isValidEmail = email => string().email().isValidSync(email);\n\nconst createEmailOptions = (emails = []) =>\n emails.map(email => ({\n label: email,\n value: email,\n valid: isValidEmail(email),\n }));\n\nexport const parseEmailsOptions = (emailOptions = []) =>\n emailOptions.map(prop(\"label\"));\n\nexport const parseEmailNotificationData = (data, sendToOptions) => {\n const {\n notifyEmails,\n notifyCcEmails,\n notifyBccEmails,\n replyToId,\n customFields,\n ...rest\n } = data;\n\n const parsed = { ...customFields, ...rest };\n parsed.sendTo = notifyEmails ? createEmailOptions(notifyEmails) : [];\n parsed.sendToCc = notifyCcEmails ? createEmailOptions(notifyCcEmails) : [];\n parsed.sendToBcc = notifyCcEmails ? createEmailOptions(notifyBccEmails) : [];\n parsed.replyTo = replyToId || customFields[\"replyTo\"];\n parsed.sendToId = customFields[\"sendToId\"] || sendToOptions?.[0]?.value || \"\";\n parsed.showCopyEmails = !!(notifyCcEmails?.length || notifyBccEmails?.length);\n\n return parsed;\n};\n\nexport const packEmailPayload = (\n values,\n isReplyToDropdownField,\n isDisabledByUser\n) => {\n const {\n // eslint-disable-next-line no-unused-vars\n id: _,\n isEnabled,\n sendTo,\n sendToCc,\n sendToBcc,\n showCopyEmails,\n replyTo,\n message,\n subject,\n sendFrom,\n sendToId,\n ...rest\n } = values;\n let payload = { isEnabled };\n\n if (isEnabled) {\n payload = { ...payload };\n payload.notifyEmails = parseEmailsOptions(sendTo);\n payload.notifyBccEmails = showCopyEmails\n ? parseEmailsOptions(sendToBcc)\n : [];\n\n payload.notifyCcEmails = showCopyEmails ? parseEmailsOptions(sendToCc) : [];\n if (isReplyToDropdownField) {\n payload.replyToId = replyTo;\n } else {\n rest.replyTo = replyTo;\n }\n payload.message = message;\n payload.subject = subject;\n payload.customFields = { ...rest, disabledByUser: false };\n\n if (isNotEmpty(sendToId)) {\n payload.customFields = mergeLeft(payload.customFields, { sendToId });\n }\n payload.sendFrom = sendFrom;\n } else {\n payload.customFields = { disabledByUser: isDisabledByUser };\n }\n\n return payload;\n};\n\nexport const renderText = (text, fallbackTranslation) =>\n isEmpty(text) ? fallbackTranslation : text;\n","import { useRef } from \"react\";\n\nimport { isNotPresent, noop } from \"neetocist\";\nimport EmailForm from \"neetomolecules/EmailForm\";\nimport { Spinner } from \"neetoui\";\nimport { mergeDeepLeft, mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useFetchEmailNotifications,\n useUpdateEmailNotification,\n useResetEmailNotificationToDefault,\n} from \"src/hooks/reactQuery/emailNotificationApi\";\n\nimport { DEFAULT_FIELDS_VISIBILITY, FORM_VALIDATION_SCHEMA } from \"./constants\";\nimport {\n packEmailPayload,\n parseEmailNotificationData,\n renderText,\n} from \"./utils\";\n\nconst NeetoEmailNotificationForm = ({\n emailNotificationParams = {},\n emailPreviewProps = {},\n emailFormProps = {},\n emailFormikProps = {},\n title = \"\",\n notificationToggleLabel = \"\",\n breadcrumbs = [],\n helpPopoverProps = {},\n tooltipProps = {},\n disabled = false,\n fieldsVisibility = {},\n blockNavigation = false,\n onSuccess = noop,\n children,\n}) => {\n const editorRef = useRef();\n\n const { t } = useTranslation();\n\n const { data = {}, isLoading } = useFetchEmailNotifications(\n emailNotificationParams\n );\n\n const { mutate: updateEmailNotification, isPending: isSubmitting } =\n useUpdateEmailNotification();\n\n const { mutate: resetToDefault, isPending: isResetting } =\n useResetEmailNotificationToDefault();\n\n const handleSubmit = values => {\n const isDisabledByUser = data.isEnabled && !values.isEnabled;\n const isReplyToDropdownField =\n emailFormProps?.replyToFieldProps?.options !== undefined;\n\n const body = mergeDeepLeft(\n packEmailPayload(values, isReplyToDropdownField, isDisabledByUser),\n emailNotificationParams\n );\n updateEmailNotification(body, { onSuccess });\n };\n\n if (isLoading || isNotPresent(data)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n const formattedTitle = renderText(\n title,\n t(\"neetoEmailNotifications.emailNotification.title\")\n );\n\n const formattedNotificationToggleLabel = renderText(\n notificationToggleLabel,\n t(\"neetoEmailNotifications.emailNotification.notificationToggleLabel\")\n );\n\n const { validationSchema: customValidationSchema, ...formikProps } =\n emailFormikProps;\n\n const handleResetToDefault = () => {\n resetToDefault(emailNotificationParams, {\n onSuccess: ({ emailNotification }) =>\n editorRef?.current?.editor?.commands?.setContent(\n emailNotification.message\n ),\n });\n };\n\n return (\n <div className=\"min-w-0 flex-grow overflow-y-auto\">\n <EmailForm\n {...{\n blockNavigation,\n emailPreviewProps,\n formikProps,\n tooltipProps,\n ...mergeLeft(fieldsVisibility, DEFAULT_FIELDS_VISIBILITY),\n }}\n isLoading={isSubmitting || isResetting}\n validationSchema={customValidationSchema || FORM_VALIDATION_SCHEMA}\n emailFormProps={{\n editorRef,\n handleResetToDefault,\n ...emailFormProps,\n }}\n headerProps={{\n title: formattedTitle,\n titleHelpPopoverProps: helpPopoverProps,\n breadcrumbs,\n }}\n initialValues={parseEmailNotificationData(\n data,\n emailFormProps?.sendToFieldProps?.options\n )}\n switchProps={{\n label: formattedNotificationToggleLabel,\n disabled,\n \"data-cy\": \"receive-email-notification-switch\",\n }}\n onSubmit={handleSubmit}\n >\n {children}\n </EmailForm>\n </div>\n );\n};\n\nexport default NeetoEmailNotificationForm;\n"],"names":["EMAIL_NOTIFICATIONS_BASE_URL","RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL","concat","fetch","params","axios","get","update","payload","put","resetToDefault","post","emailNotificationsApi","QUERY_KEYS","NEETO_EMAIL_NOTIFICATIONS","useFetchEmailNotifications","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","select","prop","enabled","isNotEmpty","useUpdateEmailNotification","useMutationWithInvalidation","keysToInvalidate","_","_ref","notificationHolderId","useResetEmailNotificationToDefault","_ref2","customFields","FORM_VALIDATION_SCHEMA","isEnabled","yup","DEFAULT_FIELDS_VISIBILITY","showSendToField","showReplyToField","showSendToAsRadio","showBccField","showCcField","isValidEmail","email","string","isValidSync","createEmailOptions","emails","arguments","length","undefined","map","label","value","valid","parseEmailsOptions","emailOptions","parseEmailNotificationData","data","sendToOptions","_sendToOptions$","notifyEmails","notifyCcEmails","notifyBccEmails","replyToId","rest","_objectWithoutProperties","_excluded","parsed","_objectSpread","sendTo","sendToCc","sendToBcc","replyTo","sendToId","showCopyEmails","packEmailPayload","values","isReplyToDropdownField","isDisabledByUser","id","message","subject","sendFrom","_excluded2","disabledByUser","mergeLeft","renderText","text","fallbackTranslation","isEmpty","NeetoEmailNotificationForm","_emailFormProps$sendT","_ref$emailNotificatio","emailNotificationParams","_ref$emailPreviewProp","emailPreviewProps","_ref$emailFormProps","emailFormProps","_ref$emailFormikProps","emailFormikProps","_ref$title","title","_ref$notificationTogg","notificationToggleLabel","_ref$breadcrumbs","breadcrumbs","_ref$helpPopoverProps","helpPopoverProps","_ref$tooltipProps","tooltipProps","_ref$disabled","disabled","_ref$fieldsVisibility","fieldsVisibility","_ref$blockNavigation","blockNavigation","_ref$onSuccess","onSuccess","noop","children","editorRef","useRef","_useTranslation","useTranslation","t","_useFetchEmailNotific","_useFetchEmailNotific2","isLoading","_useUpdateEmailNotifi","updateEmailNotification","mutate","isSubmitting","isPending","_useResetEmailNotific","isResetting","handleSubmit","_emailFormProps$reply","replyToFieldProps","options","body","mergeDeepLeft","isNotPresent","_jsx","className","Spinner","formattedTitle","formattedNotificationToggleLabel","customValidationSchema","validationSchema","formikProps","handleResetToDefault","_editorRef$current","emailNotification","current","editor","commands","setContent","EmailForm","headerProps","titleHelpPopoverProps","initialValues","sendToFieldProps","switchProps","onSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,4BAA4B,GACvC,8CAA8C;AAEzC,IAAMC,wCAAwC,GAAA,EAAA,CAAAC,MAAA,CAAMF,4BAA4B,EAAmB,mBAAA,CAAA;;ACI1G,IAAMG,KAAK,GAAG,SAARA,KAAKA,CAAGC,MAAM,EAAA;AAAA,EAAA,OAAIC,KAAK,CAACC,GAAG,CAACN,4BAA4B,EAAE;AAAEI,IAAAA,MAAM,EAANA;AAAO,GAAC,CAAC;AAAA,CAAA;AAE3E,IAAMG,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OAAIH,KAAK,CAACI,GAAG,CAACT,4BAA4B,EAAEQ,OAAO,CAAC;AAAA,CAAA;AAE1E,IAAME,cAAc,GAAG,SAAjBA,cAAcA,CAAGN,MAAM,EAAA;AAAA,EAAA,OAC3BC,KAAK,CAACM,IAAI,CAACV,wCAAwC,EAAEG,MAAM,CAAC;AAAA,CAAA;AAE9D,IAAMQ,qBAAqB,GAAG;AAAET,EAAAA,KAAK,EAALA,KAAK;AAAEI,EAAAA,MAAM,EAANA,MAAM;AAAEG,EAAAA,cAAc,EAAdA;AAAe,CAAC;;ACdxD,IAAMG,UAAU,GAAG;AACxBC,EAAAA,yBAAyB,EAAE;AAC7B,CAAC;;ACOM,IAAMC,0BAA0B,GAAG,SAA7BA,0BAA0BA,CAAGX,MAAM,EAAA;AAAA,EAAA,OAC9CY,mBAAQ,CAAC;AACPC,IAAAA,QAAQ,EAAE,CACRJ,UAAU,CAACC,yBAAyB,EACpCV,MAAM,CAAC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SAAS,EAAAzF,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAAA,aAAA,CAAA;AAEN+C,MAAAA,eAAe,EAAfA,eAAe;AACfpB,MAAAA,iBAAiB,EAAjBA,iBAAiB;AACjBsD,MAAAA,WAAW,EAAXA,WAAW;AACXxC,MAAAA,YAAY,EAAZA;AAAY,KAAA,EACTxB,eAAS,CAAC4B,gBAAgB,EAAE9E,yBAAyB,CAAC,CAAA,CAAA,EAAA,EAAA,EAAA;MAE3D4F,SAAS,EAAEI,YAAY,IAAIG,WAAY;MACvCc,gBAAgB,EAAED,sBAAsB,IAAInH,sBAAuB;AACnEiE,MAAAA,cAAc,EAAA7B,aAAA,CAAA;AACZoD,QAAAA,SAAS,EAATA,SAAS;AACT8B,QAAAA,oBAAoB,EAApBA;AAAoB,OAAA,EACjBrD,cAAc,CACjB;AACF6D,MAAAA,WAAW,EAAE;AACXzD,QAAAA,KAAK,EAAE4C,cAAc;AACrBc,QAAAA,qBAAqB,EAAEpD,gBAAgB;AACvCF,QAAAA,WAAW,EAAXA;OACA;MACFuD,aAAa,EAAExG,0BAA0B,CACvCC,IAAI,EACJwC,cAAc,KAAA,IAAA,IAAdA,cAAc,KAAAN,KAAAA,CAAAA,IAAAA,CAAAA,qBAAA,GAAdM,cAAc,CAAEgE,gBAAgB,MAAAtE,IAAAA,IAAAA,qBAAA,uBAAhCA,qBAAA,CAAkC+C,OACpC,CAAE;AACFwB,MAAAA,WAAW,EAAE;AACX/G,QAAAA,KAAK,EAAE+F,gCAAgC;AACvCnC,QAAAA,QAAQ,EAARA,QAAQ;AACR,QAAA,SAAS,EAAE;OACX;AACFoD,MAAAA,QAAQ,EAAE5B,YAAa;AAAAhB,MAAAA,QAAA,EAEtBA;KACQ,CAAA;AAAC,GACT,CAAC;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"NeetoEmailNotificationForm.js","sources":["../../app/javascript/src/constants/index.js","../../app/javascript/src/apis/email_notifications.js","../../app/javascript/src/constants/query.js","../../app/javascript/src/hooks/reactQuery/emailNotificationApi.js","../../app/javascript/src/components/EmailNotificationForm/constants.js","../../app/javascript/src/components/EmailNotificationForm/utils.js","../../app/javascript/src/components/EmailNotificationForm/index.jsx"],"sourcesContent":["export const EMAIL_NOTIFICATIONS_BASE_URL =\n \"neeto_email_notifications/email_notification\";\n\nexport const RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL = `${EMAIL_NOTIFICATIONS_BASE_URL}/reset_to_default`;\n","import axios from \"axios\";\n\nimport {\n RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL,\n EMAIL_NOTIFICATIONS_BASE_URL,\n} from \"src/constants\";\n\nconst fetch = params => axios.get(EMAIL_NOTIFICATIONS_BASE_URL, { params });\n\nconst update = payload => axios.put(EMAIL_NOTIFICATIONS_BASE_URL, payload);\n\nconst resetToDefault = params =>\n axios.post(RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL, params);\n\nconst emailNotificationsApi = { fetch, update, resetToDefault };\n\nexport default emailNotificationsApi;\n","export const QUERY_KEYS = {\n NEETO_EMAIL_NOTIFICATIONS: \"neeto-email-notifications\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { isNotEmpty } from \"neetocist\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { prop } from \"ramda\";\n\nimport emailNotificationsApi from \"src/apis/email_notifications\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchEmailNotifications = params =>\n useQuery({\n queryKey: [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n params[\"notificationHolderId\"],\n params[\"customFields\"],\n ],\n queryFn: () => emailNotificationsApi.fetch(params),\n staleTime: DEFAULT_STALE_TIME,\n select: prop(\"emailNotification\"),\n enabled: isNotEmpty(params),\n });\n\nexport const useUpdateEmailNotification = () =>\n useMutationWithInvalidation(params => emailNotificationsApi.update(params), {\n keysToInvalidate: [\n (_, { notificationHolderId }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n ],\n ],\n });\n\nexport const useResetEmailNotificationToDefault = () =>\n useMutationWithInvalidation(emailNotificationsApi.resetToDefault, {\n keysToInvalidate: [\n (_, { notificationHolderId, customFields }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n customFields,\n ],\n ],\n });\n","import * as yup from \"yup\";\n\nexport const FORM_VALIDATION_SCHEMA = { isEnabled: yup.boolean() };\n\nexport const DEFAULT_FIELDS_VISIBILITY = {\n showSendToField: true,\n showReplyToField: false,\n showSendToAsRadio: false,\n showBccField: false,\n showCcField: false,\n};\n","import { isNotEmpty } from \"neetocist\";\nimport { isEmpty, mergeLeft, prop, pick } from \"ramda\";\nimport { string } from \"yup\";\n\nconst isValidEmail = email => string().email().isValidSync(email);\n\nconst createEmailOptions = (emails = []) =>\n emails.map(email => ({\n label: email,\n value: email,\n valid: isValidEmail(email),\n }));\n\nexport const parseEmailsOptions = (emailOptions = []) =>\n emailOptions.map(prop(\"label\"));\n\nexport const parseEmailNotificationData = (data, sendToOptions) => {\n const {\n notifyEmails,\n notifyCcEmails,\n notifyBccEmails,\n replyToId,\n customFields,\n ...rest\n } = data;\n\n const parsed = { ...customFields, ...rest };\n parsed.sendTo = notifyEmails ? createEmailOptions(notifyEmails) : [];\n parsed.sendToCc = notifyCcEmails ? createEmailOptions(notifyCcEmails) : [];\n parsed.sendToBcc = notifyCcEmails ? createEmailOptions(notifyBccEmails) : [];\n parsed.replyTo = replyToId || customFields[\"replyTo\"];\n parsed.sendToId = customFields[\"sendToId\"] || sendToOptions?.[0]?.value || \"\";\n parsed.showCopyEmails = !!(notifyCcEmails?.length || notifyBccEmails?.length);\n\n return parsed;\n};\n\nexport const packEmailPayload = (\n values,\n isReplyToDropdownField,\n isDisabledByUser\n) => {\n const {\n // eslint-disable-next-line no-unused-vars\n id: _,\n isEnabled,\n sendTo,\n sendToCc,\n sendToBcc,\n showCopyEmails,\n replyTo,\n message,\n subject,\n sendFrom,\n sendToId,\n ...rest\n } = values;\n let payload = { isEnabled };\n\n if (isEnabled) {\n payload = { ...payload };\n payload.notifyEmails = parseEmailsOptions(sendTo);\n payload.notifyBccEmails = showCopyEmails\n ? parseEmailsOptions(sendToBcc)\n : [];\n\n payload.notifyCcEmails = showCopyEmails ? parseEmailsOptions(sendToCc) : [];\n if (isReplyToDropdownField) {\n payload.replyToId = replyTo;\n } else {\n rest.replyTo = replyTo;\n }\n payload.message = message;\n payload.subject = subject;\n payload.customFields = { ...rest, disabledByUser: false };\n\n if (isNotEmpty(sendToId)) {\n payload.customFields = mergeLeft(payload.customFields, { sendToId });\n }\n payload.sendFrom = sendFrom;\n } else {\n payload.customFields = { disabledByUser: isDisabledByUser };\n }\n\n return payload;\n};\n\nexport const renderText = (text, fallbackTranslation) =>\n isEmpty(text) ? fallbackTranslation : text;\n\nexport const generateDefaultValues = data => {\n if (!data?.defaultAttributes) {\n return null;\n }\n\n const currentDataFields = [\n \"id\",\n \"customFields\",\n \"notifyCcEmails\",\n \"notifyBccEmails\",\n \"replyToId\",\n ];\n\n const currentDataOverlay = pick(currentDataFields, data);\n\n const normalizedDefaults = {\n ...data.defaultAttributes,\n message:\n data.defaultAttributes.message?.replaceAll?.(\"<br />\", \"<br>\") ||\n data.defaultAttributes.message,\n };\n\n return mergeLeft(currentDataOverlay, normalizedDefaults);\n};\n","import { useRef } from \"react\";\n\nimport { isNotPresent, noop } from \"neetocist\";\nimport EmailForm from \"neetomolecules/EmailForm\";\nimport { Spinner } from \"neetoui\";\nimport { mergeDeepLeft, mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useFetchEmailNotifications,\n useUpdateEmailNotification,\n useResetEmailNotificationToDefault,\n} from \"src/hooks/reactQuery/emailNotificationApi\";\n\nimport { DEFAULT_FIELDS_VISIBILITY, FORM_VALIDATION_SCHEMA } from \"./constants\";\nimport {\n packEmailPayload,\n parseEmailNotificationData,\n renderText,\n generateDefaultValues,\n} from \"./utils\";\n\nconst NeetoEmailNotificationForm = ({\n emailNotificationParams = {},\n emailPreviewProps = {},\n emailFormProps = {},\n emailFormikProps = {},\n title = \"\",\n notificationToggleLabel = \"\",\n breadcrumbs = [],\n helpPopoverProps = {},\n tooltipProps = {},\n disabled = false,\n fieldsVisibility = {},\n blockNavigation = false,\n onSuccess = noop,\n children,\n}) => {\n const editorRef = useRef();\n\n const { t } = useTranslation();\n\n const { data = {}, isLoading } = useFetchEmailNotifications(\n emailNotificationParams\n );\n\n const { mutate: updateEmailNotification, isPending: isSubmitting } =\n useUpdateEmailNotification();\n\n const { mutate: resetToDefault, isPending: isResetting } =\n useResetEmailNotificationToDefault();\n\n const handleSubmit = values => {\n const isDisabledByUser = data.isEnabled && !values.isEnabled;\n const isReplyToDropdownField =\n emailFormProps?.replyToFieldProps?.options !== undefined;\n\n const body = mergeDeepLeft(\n packEmailPayload(values, isReplyToDropdownField, isDisabledByUser),\n emailNotificationParams\n );\n updateEmailNotification(body, { onSuccess });\n };\n\n if (isLoading || isNotPresent(data)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n const newDefaultAttributes = generateDefaultValues(data);\n\n const defaultValues = parseEmailNotificationData(\n newDefaultAttributes,\n emailFormProps?.sendToFieldProps?.options\n );\n\n defaultValues.defaultAttributes = data.defaultAttributes;\n\n const formattedTitle = renderText(\n title,\n t(\"neetoEmailNotifications.emailNotification.title\")\n );\n\n const formattedNotificationToggleLabel = renderText(\n notificationToggleLabel,\n t(\"neetoEmailNotifications.emailNotification.notificationToggleLabel\")\n );\n\n const { validationSchema: customValidationSchema, ...formikProps } =\n emailFormikProps;\n\n const handleResetToDefault = () => {\n resetToDefault(emailNotificationParams, {\n onSuccess: ({ emailNotification }) =>\n editorRef?.current?.editor?.commands?.setContent(\n emailNotification.message\n ),\n });\n };\n\n return (\n <div className=\"min-w-0 flex-grow overflow-y-auto\">\n <EmailForm\n {...{\n blockNavigation,\n emailPreviewProps,\n formikProps,\n tooltipProps,\n ...mergeLeft(fieldsVisibility, DEFAULT_FIELDS_VISIBILITY),\n }}\n isLoading={isSubmitting}\n validationSchema={customValidationSchema || FORM_VALIDATION_SCHEMA}\n emailFormProps={{\n editorRef,\n handleResetToDefault,\n isResetting,\n defaultValues,\n ...emailFormProps,\n }}\n headerProps={{\n title: formattedTitle,\n titleHelpPopoverProps: helpPopoverProps,\n breadcrumbs,\n }}\n initialValues={parseEmailNotificationData(\n data,\n emailFormProps?.sendToFieldProps?.options\n )}\n switchProps={{\n label: formattedNotificationToggleLabel,\n disabled,\n \"data-cy\": \"receive-email-notification-switch\",\n }}\n onSubmit={handleSubmit}\n >\n {children}\n </EmailForm>\n </div>\n );\n};\n\nexport default NeetoEmailNotificationForm;\n"],"names":["EMAIL_NOTIFICATIONS_BASE_URL","RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL","concat","fetch","params","axios","get","update","payload","put","resetToDefault","post","emailNotificationsApi","QUERY_KEYS","NEETO_EMAIL_NOTIFICATIONS","useFetchEmailNotifications","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","select","prop","enabled","isNotEmpty","useUpdateEmailNotification","useMutationWithInvalidation","keysToInvalidate","_","_ref","notificationHolderId","useResetEmailNotificationToDefault","_ref2","customFields","FORM_VALIDATION_SCHEMA","isEnabled","yup","DEFAULT_FIELDS_VISIBILITY","showSendToField","showReplyToField","showSendToAsRadio","showBccField","showCcField","isValidEmail","email","string","isValidSync","createEmailOptions","emails","arguments","length","undefined","map","label","value","valid","parseEmailsOptions","emailOptions","parseEmailNotificationData","data","sendToOptions","_sendToOptions$","notifyEmails","notifyCcEmails","notifyBccEmails","replyToId","rest","_objectWithoutProperties","_excluded","parsed","_objectSpread","sendTo","sendToCc","sendToBcc","replyTo","sendToId","showCopyEmails","packEmailPayload","values","isReplyToDropdownField","isDisabledByUser","id","message","subject","sendFrom","_excluded2","disabledByUser","mergeLeft","renderText","text","fallbackTranslation","isEmpty","generateDefaultValues","_data$defaultAttribut","_data$defaultAttribut2","defaultAttributes","currentDataFields","currentDataOverlay","pick","normalizedDefaults","replaceAll","call","NeetoEmailNotificationForm","_emailFormProps$sendT","_emailFormProps$sendT2","_ref$emailNotificatio","emailNotificationParams","_ref$emailPreviewProp","emailPreviewProps","_ref$emailFormProps","emailFormProps","_ref$emailFormikProps","emailFormikProps","_ref$title","title","_ref$notificationTogg","notificationToggleLabel","_ref$breadcrumbs","breadcrumbs","_ref$helpPopoverProps","helpPopoverProps","_ref$tooltipProps","tooltipProps","_ref$disabled","disabled","_ref$fieldsVisibility","fieldsVisibility","_ref$blockNavigation","blockNavigation","_ref$onSuccess","onSuccess","noop","children","editorRef","useRef","_useTranslation","useTranslation","t","_useFetchEmailNotific","_useFetchEmailNotific2","isLoading","_useUpdateEmailNotifi","updateEmailNotification","mutate","isSubmitting","isPending","_useResetEmailNotific","isResetting","handleSubmit","_emailFormProps$reply","replyToFieldProps","options","body","mergeDeepLeft","isNotPresent","_jsx","className","Spinner","newDefaultAttributes","defaultValues","sendToFieldProps","formattedTitle","formattedNotificationToggleLabel","customValidationSchema","validationSchema","formikProps","handleResetToDefault","_editorRef$current","emailNotification","current","editor","commands","setContent","EmailForm","headerProps","titleHelpPopoverProps","initialValues","switchProps","onSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,4BAA4B,GACvC,8CAA8C;AAEzC,IAAMC,wCAAwC,GAAA,EAAA,CAAAC,MAAA,CAAMF,4BAA4B,EAAmB,mBAAA,CAAA;;ACI1G,IAAMG,KAAK,GAAG,SAARA,KAAKA,CAAGC,MAAM,EAAA;AAAA,EAAA,OAAIC,KAAK,CAACC,GAAG,CAACN,4BAA4B,EAAE;AAAEI,IAAAA,MAAM,EAANA;AAAO,GAAC,CAAC;AAAA,CAAA;AAE3E,IAAMG,MAAM,GAAG,SAATA,MAAMA,CAAG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BAAoB,EAApBA,oBAAoB;AACpBnB,QAAAA,WAAW,EAAXA,WAAW;AACXY,QAAAA,aAAa,EAAbA;AAAa,OAAA,EACVjD,cAAc,CACjB;AACFgE,MAAAA,WAAW,EAAE;AACX5D,QAAAA,KAAK,EAAE+C,cAAc;AACrBc,QAAAA,qBAAqB,EAAEvD,gBAAgB;AACvCF,QAAAA,WAAW,EAAXA;OACA;MACF0D,aAAa,EAAEtH,0BAA0B,CACvCC,IAAI,EACJmD,cAAc,KAAA,IAAA,IAAdA,cAAc,KAAAN,KAAAA,CAAAA,IAAAA,CAAAA,sBAAA,GAAdM,cAAc,CAAEkD,gBAAgB,MAAAxD,IAAAA,IAAAA,sBAAA,uBAAhCA,sBAAA,CAAkC+C,OACpC,CAAE;AACF0B,MAAAA,WAAW,EAAE;AACX5H,QAAAA,KAAK,EAAE6G,gCAAgC;AACvCtC,QAAAA,QAAQ,EAARA,QAAQ;AACR,QAAA,SAAS,EAAE;OACX;AACFsD,MAAAA,QAAQ,EAAE9B,YAAa;AAAAhB,MAAAA,QAAA,EAEtBA;KACQ,CAAA;AAAC,GACT,CAAC;AAEV;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-email-notifications-frontend",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.17",
|
|
4
4
|
"description": "A repo acts as the source of truth for the new nano's structure, configs, data etc.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-email-notifications-nano",
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
"@babel/preset-typescript": "7.26.0",
|
|
62
62
|
"@babel/runtime": "7.26.10",
|
|
63
63
|
"@bigbinary/babel-preset-neeto": "^1.0.3",
|
|
64
|
-
"@bigbinary/eslint-plugin-neeto": "1.
|
|
64
|
+
"@bigbinary/eslint-plugin-neeto": "1.8.0",
|
|
65
65
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
66
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
67
|
-
"@bigbinary/neeto-editor": "1.47.
|
|
68
|
-
"@bigbinary/neeto-filters-frontend": "4.3.
|
|
69
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
70
|
-
"@bigbinary/neeto-molecules": "
|
|
71
|
-
"@bigbinary/neetoui": "8.3.
|
|
66
|
+
"@bigbinary/neeto-commons-frontend": "4.13.85",
|
|
67
|
+
"@bigbinary/neeto-editor": "1.47.70",
|
|
68
|
+
"@bigbinary/neeto-filters-frontend": "4.3.24",
|
|
69
|
+
"@bigbinary/neeto-icons": "1.20.64",
|
|
70
|
+
"@bigbinary/neeto-molecules": "4.0.96",
|
|
71
|
+
"@bigbinary/neetoui": "8.3.45",
|
|
72
72
|
"@emotion/is-prop-valid": "1.2.0",
|
|
73
73
|
"@faker-js/faker": "8.2.0",
|
|
74
74
|
"@honeybadger-io/js": "6.10.1",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"antd": "5.22.0",
|
|
88
88
|
"assert": "^2.1.0",
|
|
89
89
|
"autoprefixer": "^10.4.5",
|
|
90
|
-
"axios": "1.
|
|
90
|
+
"axios": "1.12.0",
|
|
91
91
|
"babel-loader": "^8.2.5",
|
|
92
92
|
"babel-plugin-istanbul": "^6.1.1",
|
|
93
93
|
"babel-plugin-js-logger": "1.0.17",
|
|
@@ -121,6 +121,7 @@
|
|
|
121
121
|
"eslint-plugin-xss": "^0.1.12",
|
|
122
122
|
"formik": "2.4.6",
|
|
123
123
|
"globals": "16.0.0",
|
|
124
|
+
"globby": "^14.1.0",
|
|
124
125
|
"html-webpack-plugin": "5.5.3",
|
|
125
126
|
"https-browserify": "1.0.0",
|
|
126
127
|
"husky": "7.0.4",
|
|
@@ -137,7 +138,7 @@
|
|
|
137
138
|
"postcss-loader": "^7.0.1",
|
|
138
139
|
"postcss-preset-env": "7.8.2",
|
|
139
140
|
"prettier": "3",
|
|
140
|
-
"prettier-plugin-tailwindcss": "0.
|
|
141
|
+
"prettier-plugin-tailwindcss": "0.6.14",
|
|
141
142
|
"process": "0.11.10",
|
|
142
143
|
"qs": "^6.11.2",
|
|
143
144
|
"ramda": "0.29.0",
|
|
@@ -177,19 +178,19 @@
|
|
|
177
178
|
"peerDependencies": {
|
|
178
179
|
"@babel/runtime": "7.26.10",
|
|
179
180
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
180
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
181
|
-
"@bigbinary/neeto-editor": "1.47.
|
|
182
|
-
"@bigbinary/neeto-filters-frontend": "4.3.
|
|
183
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
184
|
-
"@bigbinary/neeto-molecules": "
|
|
185
|
-
"@bigbinary/neetoui": "8.3.
|
|
181
|
+
"@bigbinary/neeto-commons-frontend": "4.13.85",
|
|
182
|
+
"@bigbinary/neeto-editor": "1.47.70",
|
|
183
|
+
"@bigbinary/neeto-filters-frontend": "4.3.24",
|
|
184
|
+
"@bigbinary/neeto-icons": "1.20.64",
|
|
185
|
+
"@bigbinary/neeto-molecules": "4.0.96",
|
|
186
|
+
"@bigbinary/neetoui": "8.3.45",
|
|
186
187
|
"@honeybadger-io/js": "6.10.1",
|
|
187
188
|
"@honeybadger-io/react": "6.1.25",
|
|
188
189
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
189
190
|
"@tanstack/react-query": "5.59.20",
|
|
190
191
|
"@tanstack/react-query-devtools": "5.59.20",
|
|
191
192
|
"antd": "5.22.0",
|
|
192
|
-
"axios": "1.
|
|
193
|
+
"axios": "1.12.0",
|
|
193
194
|
"buffer": "^6.0.3",
|
|
194
195
|
"classnames": "2.5.1",
|
|
195
196
|
"crypto-browserify": "3.12.1",
|
package/types.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ type EmailFormProps = {
|
|
|
34
34
|
handleResetToDefault?: () => void;
|
|
35
35
|
isLoading?: boolean;
|
|
36
36
|
isUpdating?: boolean;
|
|
37
|
+
isResetting?: boolean;
|
|
37
38
|
showFields?: boolean;
|
|
38
39
|
className?: string;
|
|
39
40
|
sendToFieldProps?: SendToFieldPropsType;
|
|
@@ -41,6 +42,7 @@ type EmailFormProps = {
|
|
|
41
42
|
showResetToDefaultButton?: boolean;
|
|
42
43
|
editorRef?: any;
|
|
43
44
|
editorAddons?: any[];
|
|
45
|
+
defaultValues?: any;
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
type EmailFormikProps = {
|