Formattef code

This commit is contained in:
Lucas Oliveira 2023-07-31 10:53:42 -03:00
commit ac46fff761
4 changed files with 14 additions and 23 deletions

View file

@ -13,7 +13,7 @@ import IntComponent from "../../../../components/intComponent";
import PromptAreaComponent from "../../../../components/promptComponent";
import TextAreaComponent from "../../../../components/textAreaComponent";
import ToggleShadComponent from "../../../../components/toggleShadComponent";
import { MAX_LENGTH_TO_SCROLL_TOOLTIP, TOOLTIP_EMPTY } from "../../../../constants/constants";
import { TOOLTIP_EMPTY } from "../../../../constants/constants";
import { TabsContext } from "../../../../contexts/tabsContext";
import { typesContext } from "../../../../contexts/typesContext";
import { ParameterComponentType } from "../../../../types/components";
@ -23,10 +23,7 @@ import {
nodeIconsLucide,
nodeNames,
} from "../../../../utils/styleUtils";
import {
classNames,
groupByFamily,
} from "../../../../utils/utils";
import { classNames, groupByFamily } from "../../../../utils/utils";
export default function ParameterComponent({
left,
@ -151,9 +148,7 @@ export default function ParameterComponent({
);
});
} else {
refHtml.current = <span>
{TOOLTIP_EMPTY}
</span>
refHtml.current = <span>{TOOLTIP_EMPTY}</span>;
}
}
@ -202,9 +197,7 @@ export default function ParameterComponent({
<></>
) : (
<ShadTooltip
styleClasses={
"tooltip-fixed-width custom-scroll nowheel"
}
styleClasses={"tooltip-fixed-width custom-scroll nowheel"}
delayDuration={0}
content={refHtml.current}
side={left ? "left" : "right"}

View file

@ -1,11 +1,10 @@
import { cloneDeep } from "lodash";
import { useContext, useEffect, useRef, useState } from "react";
import { useContext, useEffect, useState } from "react";
import { NodeToolbar, useUpdateNodeInternals } from "reactflow";
import ShadTooltip from "../../components/ShadTooltipComponent";
import Tooltip from "../../components/TooltipComponent";
import IconComponent from "../../components/genericIconComponent";
import { useSSE } from "../../contexts/SSEContext";
import { alertContext } from "../../contexts/alertContext";
import { TabsContext } from "../../contexts/tabsContext";
import { typesContext } from "../../contexts/typesContext";
import NodeToolbarComponent from "../../pages/FlowPage/components/nodeToolbarComponent";

View file

@ -147,8 +147,7 @@ export const IMPORT_DIALOG_SUBTITLE =
* The text that shows when a tooltip is empty
* @constant
*/
export const TOOLTIP_EMPTY =
"No compatible components found.";
export const TOOLTIP_EMPTY = "No compatible components found.";
/**
* The base text for subtitle of code dialog

View file

@ -113,14 +113,14 @@ export function groupByFamily(data, baseClasses, left, flow?: NodeType[]) {
for (const node of flow) {
const nodeData = node.data;
const foundNode = checkedNodes.get(nodeData.type);
checkedNodes.set(nodeData.type, {
hasBaseClassInTemplate: checkedNodes.get(nodeData.type)?.hasBaseClassInTemplate || Object.values(nodeData.node.template).some(
checkBaseClass
),
hasBaseClassInBaseClasses: checkedNodes.get(nodeData.type)?.hasBaseClassInBaseClasses || nodeData.node.base_classes.some((t) =>
baseClassesSet.has(t)
),
});
checkedNodes.set(nodeData.type, {
hasBaseClassInTemplate:
checkedNodes.get(nodeData.type)?.hasBaseClassInTemplate ||
Object.values(nodeData.node.template).some(checkBaseClass),
hasBaseClassInBaseClasses:
checkedNodes.get(nodeData.type)?.hasBaseClassInBaseClasses ||
nodeData.node.base_classes.some((t) => baseClassesSet.has(t)),
});
}
}