mirror of
https://github.com/hexastack/hexabot
synced 2024-12-29 15:31:04 +00:00
Merge pull request #396 from Hexastack/385-issue-remove-block-form-effects-input-ui-only
fix: remove effects from UI
This commit is contained in:
commit
e5b3da9f19
@ -278,7 +278,6 @@
|
|||||||
"options": "Options",
|
"options": "Options",
|
||||||
"seconds": "Seconds",
|
"seconds": "Seconds",
|
||||||
"typing_indicator": "Typing indicator",
|
"typing_indicator": "Typing indicator",
|
||||||
"effects": "Apply plugin effects",
|
|
||||||
"enable_fallback": "Enable Fallback?",
|
"enable_fallback": "Enable Fallback?",
|
||||||
"max_fallback_attempts": "Max Fallback Attempts",
|
"max_fallback_attempts": "Max Fallback Attempts",
|
||||||
"fallback_message": "Fallback Message",
|
"fallback_message": "Fallback Message",
|
||||||
|
@ -278,7 +278,6 @@
|
|||||||
"options": "Options",
|
"options": "Options",
|
||||||
"seconds": "Secondes",
|
"seconds": "Secondes",
|
||||||
"typing_indicator": "Indicateur de frappe",
|
"typing_indicator": "Indicateur de frappe",
|
||||||
"effects": "Appliquer les effets des plugins",
|
|
||||||
"enable_fallback": "Activer le message de secours?",
|
"enable_fallback": "Activer le message de secours?",
|
||||||
"max_fallback_attempts": "Nombre maximum de tentatives de secours",
|
"max_fallback_attempts": "Nombre maximum de tentatives de secours",
|
||||||
"fallback_message": "Message de secours",
|
"fallback_message": "Message de secours",
|
||||||
|
@ -21,7 +21,6 @@ export const SIMPLE_TEXT_BLOCK_TEMPLATE: Partial<IBlockAttributes> = {
|
|||||||
options: {
|
options: {
|
||||||
typing: 0,
|
typing: 0,
|
||||||
fallback: { active: false, max_attempts: 1, message: [] },
|
fallback: { active: false, max_attempts: 1, message: [] },
|
||||||
effects: [],
|
|
||||||
},
|
},
|
||||||
message: ["Hi back !"],
|
message: ["Hi back !"],
|
||||||
starts_conversation: false,
|
starts_conversation: false,
|
||||||
@ -32,7 +31,6 @@ export const ATTACHMENT_BLOCK_TEMPLATE: Partial<IBlockAttributes> = {
|
|||||||
options: {
|
options: {
|
||||||
typing: 0,
|
typing: 0,
|
||||||
fallback: { active: false, max_attempts: 1, message: [] },
|
fallback: { active: false, max_attempts: 1, message: [] },
|
||||||
effects: [],
|
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
attachment: {
|
attachment: {
|
||||||
@ -49,7 +47,6 @@ export const QUICK_REPLIES_BLOCK_TEMPLATE: Partial<IBlockAttributes> = {
|
|||||||
options: {
|
options: {
|
||||||
typing: 0,
|
typing: 0,
|
||||||
fallback: { active: false, max_attempts: 1, message: [] },
|
fallback: { active: false, max_attempts: 1, message: [] },
|
||||||
effects: [],
|
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
text: "What's your favorite color?",
|
text: "What's your favorite color?",
|
||||||
@ -75,7 +72,6 @@ export const BUTTONS_BLOCK_TEMPLATE: Partial<IBlockAttributes> = {
|
|||||||
options: {
|
options: {
|
||||||
typing: 0,
|
typing: 0,
|
||||||
fallback: { active: false, max_attempts: 1, message: [] },
|
fallback: { active: false, max_attempts: 1, message: [] },
|
||||||
effects: [],
|
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
text: "What would you like to know about us?",
|
text: "What would you like to know about us?",
|
||||||
@ -119,7 +115,6 @@ export const LIST_BLOCK_TEMPLATE: Partial<IBlockAttributes> = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
effects: [],
|
|
||||||
},
|
},
|
||||||
message: { elements: true } as unknown as StdOutgoingListMessage,
|
message: { elements: true } as unknown as StdOutgoingListMessage,
|
||||||
starts_conversation: false,
|
starts_conversation: false,
|
||||||
@ -137,7 +132,6 @@ export const CUSTOM_BLOCK_TEMPLATE: Partial<IBlockAttributes> = {
|
|||||||
options: {
|
options: {
|
||||||
typing: 0,
|
typing: 0,
|
||||||
fallback: { active: false, max_attempts: 1, message: [] },
|
fallback: { active: false, max_attempts: 1, message: [] },
|
||||||
effects: [],
|
|
||||||
},
|
},
|
||||||
starts_conversation: false,
|
starts_conversation: false,
|
||||||
message: {
|
message: {
|
||||||
|
@ -15,7 +15,7 @@ import AutoCompleteEntitySelect from "@/app-components/inputs/AutoCompleteEntity
|
|||||||
import { Input } from "@/app-components/inputs/Input";
|
import { Input } from "@/app-components/inputs/Input";
|
||||||
import { useTranslate } from "@/hooks/useTranslate";
|
import { useTranslate } from "@/hooks/useTranslate";
|
||||||
import { EntityType, Format } from "@/services/types";
|
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 { ILabelFull } from "@/types/label.types";
|
||||||
import { IUser } from "@/types/user.types";
|
import { IUser } from "@/types/user.types";
|
||||||
|
|
||||||
@ -100,38 +100,6 @@ export const OptionsForm = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ContentItem>
|
</ContentItem>
|
||||||
<ContentItem>
|
|
||||||
<Controller
|
|
||||||
name="options.effects"
|
|
||||||
control={control}
|
|
||||||
defaultValue={block?.options?.effects || []}
|
|
||||||
render={({ field }) => {
|
|
||||||
const { onChange, ...rest } = field;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<AutoCompleteEntitySelect<ICustomBlockTemplate, "id">
|
|
||||||
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}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ContentItem>
|
|
||||||
<ContentItem>
|
<ContentItem>
|
||||||
<Controller
|
<Controller
|
||||||
name="options.fallback"
|
name="options.fallback"
|
||||||
|
@ -49,8 +49,6 @@ export interface BlockOptions {
|
|||||||
// Only if the block has next blocks
|
// Only if the block has next blocks
|
||||||
fallback?: BlockFallbackOptions;
|
fallback?: BlockFallbackOptions;
|
||||||
assignTo?: string;
|
assignTo?: string;
|
||||||
// plugins effects
|
|
||||||
effects?: string[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BlockMessage =
|
export type BlockMessage =
|
||||||
|
Loading…
Reference in New Issue
Block a user