After saving, the custom traits do not appear. #5481
-
Hello everything is fine? I created a plugin for grapes that has a form, this form has special traits (where it will redirect to etc.), when I drag the form and go to configs it shows the traits, however when saving in the bank (saved in json, I will leave an example is attached) and refreshing the page renders the form correctly, but the custom traits no longer appear. In the component definition: defaults: {
tagName: "form",
droppable: false,
attributes: { method: "POST" },
traits: [
{
label: "Api key",
type: "text",
name: "keycubo",
changeProp: true,
required: true,
},
{
label: "Funíl",
type: "select",
name: "pipe",
changeProp: true,
options: pipes,
required: true,
},
{
label: "Redirecionar para",
type: "text",
name: "redirect",
changeProp: true,
},
{
label: "Adicionar na fila",
type: "select",
name: "queue",
changeProp: true,
options: [
{ value: "true", name: "Sim" },
{ value: "false", name: "Não" },
],
default: "false",
required: true,
},
],
...
} In the block definition: {
label: "Formulário Criação Cubo",
content: { type: "cubosuite-form" },
category: "Formulários",
...
} video of the problem: part of the json (components) that I save and then load into the project: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@capoia What do you have in "isComponent" part? You should have something like this: isComponent(el) {
if (el?.tagName === "form" && el?.classList?.contains('cubosuite-form')) {
return { type: "cubosuite-form" };
}
}, |
Beta Was this translation helpful? Give feedback.
-
@mosh-tudor In reality it seemed like it had worked, but it didn't, for some reason sometimes it recognizes the component and other times it gives a warning on the console saying that the component was not found (as you can see in the video). CleanShot.2023-10-25.at.16.53.09.mp4I put a console.log in the isComponent function, and I notice that every time I get an error it is not executed. Below is a print of the construction of the component/blocks |
Beta Was this translation helpful? Give feedback.
@capoia What do you have in "isComponent" part?
You should have something like this: