required in advanced icon and items, need new variable from backend
This commit is contained in:
parent
040695dfa6
commit
a78a71c997
3 changed files with 24 additions and 3 deletions
|
|
@ -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" : "",
|
||||
|
|
|
|||
|
|
@ -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 ? (
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export const value=0
|
||||
Loading…
Add table
Add a link
Reference in a new issue