From 5de0532a52b031d80730140d891221988c02c2ef Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Sun, 20 Oct 2024 07:13:00 +0100 Subject: [PATCH] fix: remove effects from UI --- frontend/public/locales/en/translation.json | 1 - frontend/public/locales/fr/translation.json | 1 - .../src/components/visual-editor/constants.ts | 6 - .../visual-editor/form/OptionsForm.tsx | 34 +----- frontend/src/types/block.types.ts | 1 - package-lock.json | 105 ++++++++++++++++++ 6 files changed, 106 insertions(+), 42 deletions(-) diff --git a/frontend/public/locales/en/translation.json b/frontend/public/locales/en/translation.json index 37b15c0e..804ec95c 100644 --- a/frontend/public/locales/en/translation.json +++ b/frontend/public/locales/en/translation.json @@ -278,7 +278,6 @@ "options": "Options", "seconds": "Seconds", "typing_indicator": "Typing indicator", - "effects": "Apply plugin effects", "enable_fallback": "Enable Fallback?", "max_fallback_attempts": "Max Fallback Attempts", "fallback_message": "Fallback Message", diff --git a/frontend/public/locales/fr/translation.json b/frontend/public/locales/fr/translation.json index 6018897a..1b85dbfc 100644 --- a/frontend/public/locales/fr/translation.json +++ b/frontend/public/locales/fr/translation.json @@ -278,7 +278,6 @@ "options": "Options", "seconds": "Secondes", "typing_indicator": "Indicateur de frappe", - "effects": "Appliquer les effets des plugins", "enable_fallback": "Activer le message de secours?", "max_fallback_attempts": "Nombre maximum de tentatives de secours", "fallback_message": "Message de secours", diff --git a/frontend/src/components/visual-editor/constants.ts b/frontend/src/components/visual-editor/constants.ts index 20d3f532..380ad827 100644 --- a/frontend/src/components/visual-editor/constants.ts +++ b/frontend/src/components/visual-editor/constants.ts @@ -21,7 +21,6 @@ export const SIMPLE_TEXT_BLOCK_TEMPLATE: Partial = { options: { typing: 0, fallback: { active: false, max_attempts: 1, message: [] }, - effects: [], }, message: ["Hi back !"], starts_conversation: false, @@ -32,7 +31,6 @@ export const ATTACHMENT_BLOCK_TEMPLATE: Partial = { options: { typing: 0, fallback: { active: false, max_attempts: 1, message: [] }, - effects: [], }, message: { attachment: { @@ -49,7 +47,6 @@ export const QUICK_REPLIES_BLOCK_TEMPLATE: Partial = { options: { typing: 0, fallback: { active: false, max_attempts: 1, message: [] }, - effects: [], }, message: { text: "What's your favorite color?", @@ -75,7 +72,6 @@ export const BUTTONS_BLOCK_TEMPLATE: Partial = { options: { typing: 0, fallback: { active: false, max_attempts: 1, message: [] }, - effects: [], }, message: { text: "What would you like to know about us?", @@ -119,7 +115,6 @@ export const LIST_BLOCK_TEMPLATE: Partial = { }, ], }, - effects: [], }, message: { elements: true } as unknown as StdOutgoingListMessage, starts_conversation: false, @@ -137,7 +132,6 @@ export const CUSTOM_BLOCK_TEMPLATE: Partial = { options: { typing: 0, fallback: { active: false, max_attempts: 1, message: [] }, - effects: [], }, starts_conversation: false, message: { diff --git a/frontend/src/components/visual-editor/form/OptionsForm.tsx b/frontend/src/components/visual-editor/form/OptionsForm.tsx index 524bbb4c..3b59081a 100644 --- a/frontend/src/components/visual-editor/form/OptionsForm.tsx +++ b/frontend/src/components/visual-editor/form/OptionsForm.tsx @@ -15,7 +15,7 @@ import AutoCompleteEntitySelect from "@/app-components/inputs/AutoCompleteEntity import { Input } from "@/app-components/inputs/Input"; import { useTranslate } from "@/hooks/useTranslate"; import { EntityType, Format } from "@/services/types"; -import { IBlockAttributes, ICustomBlockTemplate } from "@/types/block.types"; +import { IBlockAttributes } from "@/types/block.types"; import { ILabelFull } from "@/types/label.types"; import { IUser } from "@/types/user.types"; @@ -100,38 +100,6 @@ export const OptionsForm = () => { }} /> - - { - const { onChange, ...rest } = field; - - return ( - - searchFields={["id"]} - entity={EntityType.CUSTOM_BLOCK} - format={Format.BASIC} - idKey="id" - labelKey="id" - label={t("label.effects")} - multiple={true} - getOptionLabel={(option) => { - return t(`title.${option.id}`, { ns: option.id }); - }} - onChange={(_e, selected) => - onChange(selected.map(({ id }) => id)) - } - preprocess={(options) => { - return options.filter(({ effects }) => effects.length > 0); - }} - {...rest} - /> - ); - }} - /> - = 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.13.tgz", + "integrity": "sha512-Dv1RBGs2TTjkwEnFMVL5XIfJEavnLqqwYSD6LXgTPdEy/u6FlSrLBSSfe1pcfqhFEXRAgVL3Wpjibe5wXJzWog==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.13.tgz", + "integrity": "sha512-yB1tYEFFqo4ZNWkwrJultbsw7NPAAxlPXURXioRl9SdW6aIefOLS+0TEsKrWBtbJ9moTDgU3HRILL6QBQnMevg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.13.tgz", + "integrity": "sha512-v5jZ/FV/eHGoWhMKYrsAweQ7CWb8xsWGM/8m1mwwZQ/sutJjoFaXchwK4pX8NqwImILEvQmZWyb8pPTcP7htWg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@next/swc-linux-x64-gnu": { "version": "14.2.13", "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.13.tgz", @@ -2203,6 +2263,51 @@ "node": ">= 10" } }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.13.tgz", + "integrity": "sha512-uP1XkqCqV2NVH9+g2sC7qIw+w2tRbcMiXFEbMihkQ8B1+V6m28sshBwAB0SDmOe0u44ne1vFU66+gx/28RsBVQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.13.tgz", + "integrity": "sha512-V26ezyjPqQpDBV4lcWIh8B/QICQ4v+M5Bo9ykLN+sqeKKBxJVDpEc6biDVyluTXTC40f5IqCU0ttth7Es2ZuMw==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.13.tgz", + "integrity": "sha512-WwzOEAFBGhlDHE5Z73mNU8CO8mqMNLqaG+AO9ETmzdCQlJhVtWZnOl2+rqgVQS+YHunjOWptdFmNfbpwcUuEsw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",