From 228508dea7ad78a69d34cd00e0f83830dfec7c83 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Wed, 27 Nov 2024 19:15:43 +0100 Subject: [PATCH] fix: update translations --- frontend/public/locales/en/translation.json | 1 + frontend/public/locales/fr/translation.json | 1 + .../form/inputs/triggers/PostbackInput.tsx | 21 ++++++++++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/frontend/public/locales/en/translation.json b/frontend/public/locales/en/translation.json index 26366b6..96af5d5 100644 --- a/frontend/public/locales/en/translation.json +++ b/frontend/public/locales/en/translation.json @@ -300,6 +300,7 @@ "from_channels": "Target channels", "simple_text": "Simple Text", "quick_replies": "Quick Replies", + "button": "Button", "buttons": "Buttons", "web_url": "Web URL", "payload": "Payload", diff --git a/frontend/public/locales/fr/translation.json b/frontend/public/locales/fr/translation.json index cffef81..ab90512 100644 --- a/frontend/public/locales/fr/translation.json +++ b/frontend/public/locales/fr/translation.json @@ -300,6 +300,7 @@ "from_channels": "Cibler les canaux", "simple_text": "Texte simple", "quick_replies": "RĂ©ponses rapides", + "button": "Boutton", "buttons": "Boutons", "web_url": "URL Web", "payload": "Payload", diff --git a/frontend/src/components/visual-editor/form/inputs/triggers/PostbackInput.tsx b/frontend/src/components/visual-editor/form/inputs/triggers/PostbackInput.tsx index fd65fe1..9b8154d 100644 --- a/frontend/src/components/visual-editor/form/inputs/triggers/PostbackInput.tsx +++ b/frontend/src/components/visual-editor/form/inputs/triggers/PostbackInput.tsx @@ -71,12 +71,14 @@ export const PostbackInput = ({ { label: t("label.get_started"), value: "GET_STARTED", + type: PayloadType.button, group: "general", }, { label: t("label.view_more"), value: "VIEW_MORE", + type: PayloadType.button, group: "general", }, { @@ -107,7 +109,8 @@ export const PostbackInput = ({ .map((btn) => ({ label: btn.title, value: btn.payload, - group: "buttons", + type: PayloadType.button, + group: "button", })), [block?.previousBlocks, getBlockFromCache], ); @@ -134,8 +137,8 @@ export const PostbackInput = ({ id: btn.payload as string, label: btn.title as string, value: btn.payload as string, - type: PayloadType.menu, - group: "quick_replies", + type: PayloadType.quick_reply, + group: "quick_reply", })), [block?.previousBlocks], ); @@ -199,7 +202,7 @@ export const PostbackInput = ({ const isOptionsReady = !defaultValue || options.find((o) => isSamePostback(o, defaultValue)); - if (!isOptionsReady) { + if (!isOptionsReady || isLoadingContent || isLoadingMenu) { return ( ); @@ -212,6 +215,7 @@ export const PostbackInput = ({ { @@ -244,18 +248,19 @@ export const PostbackInput = ({