Add comments to Otávio help

This commit is contained in:
Igor Carvalho 2023-07-24 16:47:50 -03:00
commit af66bc6927
4 changed files with 12 additions and 7 deletions

View file

@ -26,6 +26,7 @@ export default function GenericNode({
const { closePopUp, openPopUp } = useContext(PopUpContext); const { closePopUp, openPopUp } = useContext(PopUpContext);
// any to avoid type conflict // any to avoid type conflict
// PROBLEM HERE OTAVIO
const Icon: any = const Icon: any =
nodeIconsLucide[data.type] || nodeIconsLucide[types[data.type]]; nodeIconsLucide[data.type] || nodeIconsLucide[types[data.type]];
const name = nodeIconsLucide[data.type] ? data.type : types[data.type]; const name = nodeIconsLucide[data.type] ? data.type : types[data.type];

View file

@ -6,6 +6,7 @@ export default function IconComponent({
className, className,
iconColor, iconColor,
}: IconComponentProps): JSX.Element { }: IconComponentProps): JSX.Element {
// MAYBE PROBLEM HERE?
const TargetIcon = nodeIconsLucide[name] ?? nodeIconsLucide["unknown"]; const TargetIcon = nodeIconsLucide[name] ?? nodeIconsLucide["unknown"];
return <TargetIcon className={className} style={{ color: iconColor }} />; return <TargetIcon className={className} style={{ color: iconColor }} />;
} }

View file

@ -45,7 +45,7 @@ import { EXPORT_CODE_DIALOG } from "../../constants/constants";
import { darkContext } from "../../contexts/darkContext"; import { darkContext } from "../../contexts/darkContext";
import { PopUpContext } from "../../contexts/popUpContext"; import { PopUpContext } from "../../contexts/popUpContext";
import { TabsContext } from "../../contexts/tabsContext"; import { TabsContext } from "../../contexts/tabsContext";
import { FlowType } from "../../types/flow/index"; import { FlowType, NodeDataType } from "../../types/flow/index";
import { buildTweaks } from "../../utils/reactflowUtils"; import { buildTweaks } from "../../utils/reactflowUtils";
import { import {
classNames, classNames,
@ -173,7 +173,8 @@ export default function ApiModal({ flow }: { flow: FlowType }): JSX.Element {
}); });
} }
function buildTweakObject(tw, changes, template) { // DIFICULT IN FIND WHERE TW,CHANGES AND TEMPLATE ARE USED
function buildTweakObject(tw, changes, template): void {
if (template.type === "float") { if (template.type === "float") {
changes = parseFloat(changes); changes = parseFloat(changes);
} }
@ -221,7 +222,7 @@ export default function ApiModal({ flow }: { flow: FlowType }): JSX.Element {
setTweak(tweak.current); setTweak(tweak.current);
} }
function buildContent(value) { function buildContent(value: string): JSX.Element {
const htmlContent = ( const htmlContent = (
<div className="w-[200px]"> <div className="w-[200px]">
<span>{value != null && value != "" ? value : "None"}</span> <span>{value != null && value != "" ? value : "None"}</span>
@ -230,7 +231,8 @@ export default function ApiModal({ flow }: { flow: FlowType }): JSX.Element {
return htmlContent; return htmlContent;
} }
function getValue(value, node, template) { // DIFICULT FINDIND WHERE TEMPLATE IS USED
function getValue(value: string, node: NodeDataType, template): string {
let returnValue = value ?? ""; let returnValue = value ?? "";
if (getTweak.length > 0) { if (getTweak.length > 0) {
@ -252,7 +254,7 @@ export default function ApiModal({ flow }: { flow: FlowType }): JSX.Element {
return returnValue; return returnValue;
} }
function openAccordions() { function openAccordions(): void {
let accordionsToOpen = []; let accordionsToOpen = [];
tweak.current.forEach((el) => { tweak.current.forEach((el) => {
Object.keys(el).forEach((key) => { Object.keys(el).forEach((key) => {

View file

@ -324,7 +324,8 @@ export default function Page({ flow }: { flow: FlowType }): JSX.Element {
[reactFlowInstance, setEdges] [reactFlowInstance, setEdges]
); );
const onEdgeUpdateEnd = useCallback((_, edge) => { // IS THIS RIGHT?
const onEdgeUpdateEnd = useCallback((_, edge: { id: string }): void => {
if (!edgeUpdateSuccessful.current) { if (!edgeUpdateSuccessful.current) {
setEdges((eds) => eds.filter((e) => e.id !== edge.id)); setEdges((eds) => eds.filter((e) => e.id !== edge.id));
} }
@ -351,7 +352,7 @@ export default function Page({ flow }: { flow: FlowType }): JSX.Element {
} }
}, [selectionEnded, lastSelection]); }, [selectionEnded, lastSelection]);
const onSelectionChange = useCallback((flow) => { const onSelectionChange = useCallback((flow): void => {
setLastSelection(flow); setLastSelection(flow);
}, []); }, []);