refactor[src/pages]: Add types to pages functions that didnt have it
This commit is contained in:
parent
54f1f5c504
commit
fff6e494db
9 changed files with 27 additions and 8 deletions
|
|
@ -8,7 +8,7 @@ import { CardComponent } from "../../components/cardComponent";
|
||||||
import IconComponent from "../../components/genericIconComponent";
|
import IconComponent from "../../components/genericIconComponent";
|
||||||
import { getExamples } from "../../controllers/API";
|
import { getExamples } from "../../controllers/API";
|
||||||
import { FlowType } from "../../types/flow";
|
import { FlowType } from "../../types/flow";
|
||||||
export default function CommunityPage() {
|
export default function CommunityPage(): JSX.Element {
|
||||||
const { flows, setTabId, downloadFlows, uploadFlows, addFlow } =
|
const { flows, setTabId, downloadFlows, uploadFlows, addFlow } =
|
||||||
useContext(TabsContext);
|
useContext(TabsContext);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const ConnectionLineComponent = ({
|
||||||
toX,
|
toX,
|
||||||
toY,
|
toY,
|
||||||
connectionLineStyle = {}, // provide a default value for connectionLineStyle
|
connectionLineStyle = {}, // provide a default value for connectionLineStyle
|
||||||
}: ConnectionLineComponentProps) => {
|
}: ConnectionLineComponentProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<g>
|
<g>
|
||||||
<path
|
<path
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export default function DisclosureComponent({
|
||||||
button: { title, Icon, buttons = [] },
|
button: { title, Icon, buttons = [] },
|
||||||
children,
|
children,
|
||||||
openDisc,
|
openDisc,
|
||||||
}: DisclosureComponentType) {
|
}: DisclosureComponentType): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<Disclosure as="div" key={title}>
|
<Disclosure as="div" key={title}>
|
||||||
{({ open }) => (
|
{({ open }) => (
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ const nodeTypes = {
|
||||||
genericNode: GenericNode,
|
genericNode: GenericNode,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Page({ flow }: { flow: FlowType }) {
|
export default function Page({ flow }: { flow: FlowType }): JSX.Element {
|
||||||
let {
|
let {
|
||||||
updateFlow,
|
updateFlow,
|
||||||
uploadFlow,
|
uploadFlow,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {
|
||||||
import { classNames } from "../../../../utils/utils";
|
import { classNames } from "../../../../utils/utils";
|
||||||
import DisclosureComponent from "../DisclosureComponent";
|
import DisclosureComponent from "../DisclosureComponent";
|
||||||
|
|
||||||
export default function ExtraSidebar() {
|
export default function ExtraSidebar(): JSX.Element {
|
||||||
const { data } = useContext(typesContext);
|
const { data } = useContext(typesContext);
|
||||||
const { openPopUp } = useContext(PopUpContext);
|
const { openPopUp } = useContext(PopUpContext);
|
||||||
const { flows, tabId, uploadFlow, tabsState, saveFlow } =
|
const { flows, tabId, uploadFlow, tabsState, saveFlow } =
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ import IconComponent from "../../../../components/genericIconComponent";
|
||||||
import { TabsContext } from "../../../../contexts/tabsContext";
|
import { TabsContext } from "../../../../contexts/tabsContext";
|
||||||
import EditNodeModal from "../../../../modals/EditNodeModal";
|
import EditNodeModal from "../../../../modals/EditNodeModal";
|
||||||
import { classNames } from "../../../../utils/utils";
|
import { classNames } from "../../../../utils/utils";
|
||||||
|
import { nodeToolbarType } from "../../../../types/components";
|
||||||
|
|
||||||
const NodeToolbarComponent = (props) => {
|
const NodeToolbarComponent = (props): JSX.Element => {
|
||||||
|
console.log(props);
|
||||||
const [nodeLength, setNodeLength] = useState(
|
const [nodeLength, setNodeLength] = useState(
|
||||||
Object.keys(props.data.node.template).filter(
|
Object.keys(props.data.node.template).filter(
|
||||||
(t) =>
|
(t) =>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { TabsContext } from "../../contexts/tabsContext";
|
||||||
import { getVersion } from "../../controllers/API";
|
import { getVersion } from "../../controllers/API";
|
||||||
import Page from "./components/PageComponent";
|
import Page from "./components/PageComponent";
|
||||||
|
|
||||||
export default function FlowPage() {
|
export default function FlowPage(): JSX.Element {
|
||||||
const { flows, tabId, setTabId } = useContext(TabsContext);
|
const { flows, tabId, setTabId } = useContext(TabsContext);
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import IconComponent from "../../components/genericIconComponent";
|
||||||
import { Button } from "../../components/ui/button";
|
import { Button } from "../../components/ui/button";
|
||||||
import { USER_PROJECTS_HEADER } from "../../constants/constants";
|
import { USER_PROJECTS_HEADER } from "../../constants/constants";
|
||||||
import { TabsContext } from "../../contexts/tabsContext";
|
import { TabsContext } from "../../contexts/tabsContext";
|
||||||
export default function HomePage() {
|
export default function HomePage(): JSX.Element {
|
||||||
const { flows, setTabId, downloadFlows, uploadFlows, addFlow, removeFlow } =
|
const { flows, setTabId, downloadFlows, uploadFlows, addFlow, removeFlow } =
|
||||||
useContext(TabsContext);
|
useContext(TabsContext);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -415,3 +415,20 @@ export type tweakType = {
|
||||||
"PromptTemplate-iNj5W": object;
|
"PromptTemplate-iNj5W": object;
|
||||||
"ConversationBufferMemory-JnodM": object;
|
"ConversationBufferMemory-JnodM": object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type nodeToolbarType = {
|
||||||
|
data: {
|
||||||
|
id: string;
|
||||||
|
type: string;
|
||||||
|
node: {
|
||||||
|
base_classes: string[];
|
||||||
|
description: string;
|
||||||
|
display_name: string;
|
||||||
|
documentation: string;
|
||||||
|
template: object;
|
||||||
|
};
|
||||||
|
value: void;
|
||||||
|
};
|
||||||
|
deleteNode: (idx: string) => void;
|
||||||
|
openPopUp: (element: any) => void;
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue