required in advanced icon and items, need new variable from backend

This commit is contained in:
anovazzi1 2023-04-13 01:10:13 -03:00
commit a78a71c997
3 changed files with 24 additions and 3 deletions

View file

@ -12,6 +12,7 @@ import { NodeDataType } from "../../types/flow";
import { alertContext } from "../../contexts/alertContext";
import { PopUpContext } from "../../contexts/popUpContext";
import NodeModal from "../../modals/NodeModal";
import { relative } from "path";
export default function GenericNode({
data,
@ -56,11 +57,21 @@ export default function GenericNode({
</div>
<div className="flex gap-3">
<button
className="relative"
onClick={(event) => {
event.preventDefault();
openPopUp(<NodeModal data={data} />);
}}
>
<div className=" absolute text-red-600 -top-2 -right-1">
{Object.keys(data.node.template).some(
(t) =>
// data.node.template[t].advanced &&
data.node.template[t].required
)
? " *"
: ""}
</div>
<Cog6ToothIcon
className={classNames(
Object.keys(data.node.template).length < 1 ? "hidden" : "",

View file

@ -27,8 +27,19 @@ export default function ModalField({ data, title, required, id, name, type }) {
type === "code";
return (
<div className={classNames("flex flex-row w-full items-center justify-between",display?"":"hidden")}>
{display && <span className="mx-2">{title}</span>}
<div
className={classNames(
"flex flex-row w-full items-center justify-between",
display ? "" : "hidden"
)}
>
{display && (
<div>
<span className="mx-2">{title}</span>
<span className="text-red-600">{required ? " *" : ""}</span>
</div>
)}
{type === "str" && !data.node.template[name].options ? (
<div className="w-1/2">
{data.node.template[name].list ? (

View file

@ -1 +0,0 @@
export const value=0