diff --git a/src/frontend/src/pages/AdminPage/LoginPage/index.tsx b/src/frontend/src/pages/AdminPage/LoginPage/index.tsx
index 6109278c4..74cc75d07 100644
--- a/src/frontend/src/pages/AdminPage/LoginPage/index.tsx
+++ b/src/frontend/src/pages/AdminPage/LoginPage/index.tsx
@@ -1,29 +1,28 @@
-import { FaApple, FaGithub } from "react-icons/fa";
+import { useNavigate } from "react-router-dom";
import { Button } from "../../../components/ui/button";
import { Input } from "../../../components/ui/input";
-import { GoogleIcon } from "../../../icons/Google";
-import { useNavigate } from "react-router-dom";
export default function LoginAdminPage() {
-
const navigate = useNavigate();
function loginAdmin() {
navigate("/admin/");
}
-
+
return (
⛓️
-
- Admin
-
+ Admin
-
diff --git a/src/frontend/src/pages/AdminPage/index.tsx b/src/frontend/src/pages/AdminPage/index.tsx
index 6f1c8fea1..e598af8b4 100644
--- a/src/frontend/src/pages/AdminPage/index.tsx
+++ b/src/frontend/src/pages/AdminPage/index.tsx
@@ -1,8 +1,9 @@
import _ from "lodash";
-import { Pencil, Trash2, X } from "lucide-react";
+import { X } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import PaginatorComponent from "../../components/PaginatorComponent";
import ShadTooltip from "../../components/ShadTooltipComponent";
+import IconComponent from "../../components/genericIconComponent";
import { Button } from "../../components/ui/button";
import { Input } from "../../components/ui/input";
import {
@@ -15,7 +16,6 @@ import {
} from "../../components/ui/table";
import ConfirmationModal from "../../modals/ConfirmationModal";
import UserManagementModal from "../../modals/UserManagementModal";
-import IconComponent from "../../components/genericIconComponent";
export default function AdminPage() {
const [inputValue, setInputValue] = useState("");
@@ -249,154 +249,153 @@ export default function AdminPage() {
return (
<>
-
-
-
-
-
-
-
- Welcome back!
-
-
- Here's a list of all users!
-
+
+
+
+
+
+
+
+ Welcome back!
+
+
+ Here's a list of all users!
+
+
+
-
-
- {userList.current.length === 0 && (
- <>
-
-
There's no users left :)
-
- >
- )}
- {userList.current.length > 0 && (
- <>
-
-
-
handleFilterUsers(e.target.value)}
- />
- {inputValue.length > 0 && (
-
{
- resetFilter();
- setInputValue("");
+ {userList.current.length === 0 && (
+ <>
+
+
There's no users left :)
+
+ >
+ )}
+ {userList.current.length > 0 && (
+ <>
+
+
+ handleFilterUsers(e.target.value)}
+ />
+ {inputValue.length > 0 && (
+ {
+ resetFilter();
+ setInputValue("");
+ }}
+ variant="ghost"
+ className="h-8 px-2 lg:px-3"
+ >
+ Reset
+
+
+ )}
+
+
+ {
+ handleNewUser(user);
}}
- variant="ghost"
- className="h-8 px-2 lg:px-3"
>
- Reset
-
-
- )}
+ New User
+
+
-
- {
- handleNewUser(user);
- }}
- >
- New User
-
-
-
-
-
-
-
- User
- Password
-
-
-
-
- {filterUserList.map((user, index) => (
-
-
- {user.user}
-
-
- {user.password}
-
-
-
- {
- handleEditUser(index, user);
- }}
- >
-
-
-
-
-
- {
- handleDeleteUser(index);
- }}
- >
-
-
-
-
-
-
+ >
+
+
+
+ User
+ Password
+
- ))}
-
-
-
- {
- handleChangePagination(pageSize, pageIndex);
- }}
- >
- >
- )}
+
+
+ {filterUserList.map((user, index) => (
+
+
+ {user.user}
+
+
+ {user.password}
+
+
+
+ {
+ handleEditUser(index, user);
+ }}
+ >
+
+
+
+
+
+ {
+ handleDeleteUser(index);
+ }}
+ >
+
+
+
+
+
+
+
+ ))}
+
+
+
+
{
+ handleChangePagination(pageSize, pageIndex);
+ }}
+ >
+ >
+ )}
+
-
-
-
-
>
);
}
diff --git a/src/frontend/src/pages/signUpPage/index.tsx b/src/frontend/src/pages/signUpPage/index.tsx
index 444c31bc8..797ef62b6 100644
--- a/src/frontend/src/pages/signUpPage/index.tsx
+++ b/src/frontend/src/pages/signUpPage/index.tsx
@@ -1,104 +1,157 @@
-import _ from "lodash";
+import * as Form from "@radix-ui/react-form";
+import { useState } from "react";
import { FaApple, FaGithub } from "react-icons/fa";
+import InputComponent from "../../components/inputComponent";
import { Button } from "../../components/ui/button";
import { Input } from "../../components/ui/input";
-import { GoogleIcon } from "../../icons/Google";
-import { useContext, useState } from "react";
import { CONTROL_INPUT_STATE } from "../../constants/constants";
+import { GoogleIcon } from "../../icons/Google";
import { inputHandlerEventType, inputStateType } from "../../types/components";
-import { alertContext } from "../../contexts/alertContext";
import { Link } from "react-router-dom";
-import InputComponent from "../../components/inputComponent";
+import IconComponent from "../../components/genericIconComponent";
export default function SignUp(): JSX.Element {
- const [inputState, setInputState] = useState
(CONTROL_INPUT_STATE);
-
- const {
- setErrorData,
- errorOpen,
- } = useContext(alertContext);
+ const [inputState, setInputState] =
+ useState(CONTROL_INPUT_STATE);
const { password, cnfPassword, username } = inputState;
- function handleInput({ target: { name, value } }: inputHandlerEventType): void {
- setInputState((prev) => ({ ...prev, [name]: value }));
- };
-
- function handleSignUpPass() {
- if (password !== cnfPassword) {
- const errorDat = {
- title: "Passwords are not equal",
- };
- return setErrorData(errorDat);
- }
- let err = [];
- Object.keys(inputState)
- .forEach((key) => {
- if (inputState[key] === '') {
- err.push(key);
- }
- });
- setErrorData({
- title: "Mandatory fields are empty",
- list: err,
- });
- }
+ function handleInput({
+ target: { name, value },
+ }: inputHandlerEventType): void {
+ setInputState((prev) => ({ ...prev, [name]: value }));
+ }
return (
-
-
-
⛓️
-
- Sign up to LangFlow
-
-
-
or
-
-
handleInput({ target: { name: 'password', value } })}
- password={true}
- placeholder="Password"
- />
- handleInput({ target: { name: 'cnfPassword', value } })}
- password={true}
- placeholder="Confirm your password"
- />
- {
- handleSignUpPass();
- }}
- >
- Sign up
-
-
-
- Already have an account? Sign in
-
-
-
-
+ {
+ if (password !== cnfPassword) {
+ event.preventDefault();
+ return;
+ }
+
+ const data = Object.fromEntries(new FormData(event.currentTarget));
+ event.preventDefault();
+ }}
+ className="w-full h-full"
+ >
+
+
+
⛓️
+
+ Sign up to LangFlow
+
+
+
+
+
+
+
+
+
+
+
+
+
or
+
+
+
+ Username *
+
+
+
+ {
+ handleInput({ target: { name: "username", value } });
+ }}
+ value={username}
+ className="w-full"
+ required
+ placeholder="Username"
+ />
+
+
+
+ Please enter your username
+
+
+
+
+
+
+ Password *
+
+
+
+ {
+ handleInput({ target: { name: "password", value } });
+ }}
+ value={password}
+ password={true}
+ placeholder="Password"
+ className="w-full"
+ />
+
+
+
+ Please enter a password
+
+
+ {password != cnfPassword && (
+
+ Passwords do not match
+
+ )}
+
+
+
+
+
+ Confirm your password{" "}
+ *
+
+
+
+ {
+ handleInput({ target: { name: "cnfPassword", value } });
+ }}
+ value={cnfPassword}
+ password={true}
+ />
+
+
+
+ Please confirm your password
+
+
+
+
+
+ Sign up
+
+
+
+
+
+ Already have an account? Sign in
+
+
+
+
+
+
);
}
diff --git a/src/frontend/src/routes.tsx b/src/frontend/src/routes.tsx
index c30ecef70..8466f9b57 100644
--- a/src/frontend/src/routes.tsx
+++ b/src/frontend/src/routes.tsx
@@ -1,12 +1,12 @@
import { Route, Routes } from "react-router-dom";
+import AdminPage from "./pages/AdminPage";
+import LoginAdminPage from "./pages/AdminPage/LoginPage";
import CommunityPage from "./pages/CommunityPage";
import FlowPage from "./pages/FlowPage";
import HomePage from "./pages/MainPage";
import DeleteAccountPage from "./pages/deleteAccountPage";
import LoginPage from "./pages/loginPage";
import SignUp from "./pages/signUpPage";
-import LoginAdminPage from "./pages/AdminPage/LoginPage";
-import AdminPage from "./pages/AdminPage";
const Router = () => {
return (
@@ -17,13 +17,13 @@ const Router = () => {
} />
} />
-
+
} />
- } />
+ } />
} />
} />
-
+
}>
diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts
index 07d1c3d97..70c19aa1a 100644
--- a/src/frontend/src/types/components/index.ts
+++ b/src/frontend/src/types/components/index.ts
@@ -11,6 +11,7 @@ export type InputComponentType = {
onChangePass?: (value: boolean | boolean) => void;
showPass?: boolean;
placeholder?: string;
+ className?: string;
};
export type ToggleComponentType = {
enabled: boolean;
@@ -82,13 +83,13 @@ export type DisclosureComponentType = {
children: ReactNode;
openDisc: boolean;
button: {
- title: string;
- Icon: any;
- buttons?: {
- Icon: ReactElement;
- title: string;
- onClick: (event?: React.MouseEvent) => void;
- }[];
+ title: string;
+ Icon: any;
+ buttons?: {
+ Icon: ReactElement;
+ title: string;
+ onClick: (event?: React.MouseEvent) => void;
+ }[];
};
};
export type FloatComponentType = {
@@ -102,18 +103,18 @@ export type TooltipComponentType = {
children: ReactElement;
title: string | ReactElement;
placement?:
- | "bottom-end"
- | "bottom-start"
- | "bottom"
- | "left-end"
- | "left-start"
- | "left"
- | "right-end"
- | "right-start"
- | "right"
- | "top-end"
- | "top-start"
- | "top";
+ | "bottom-end"
+ | "bottom-start"
+ | "bottom"
+ | "left-end"
+ | "left-start"
+ | "left"
+ | "right-end"
+ | "right-start"
+ | "right"
+ | "top-end"
+ | "top-start"
+ | "top";
};
export type ProgressBarType = {
@@ -165,7 +166,7 @@ export interface IVarHighlightType {
export type IconComponentProps = {
name: string;
- className: string;
+ className?: string;
iconColor?: string;
};
@@ -181,8 +182,8 @@ export type inputStateType = {
export type inputHandlerEventType = {
target: {
- value: string;
- name: string;
+ value: string;
+ name: string;
};
};
export type PaginatorComponentType = {
@@ -205,7 +206,7 @@ export type ConfirmationModalType = {
data: any;
index: number;
onConfirm: (index, data) => void;
-}
+};
export type UserManagementType = {
title: string;
@@ -217,4 +218,4 @@ export type UserManagementType = {
data?: any;
index?: number;
onConfirm: (index, data) => void;
-}
+};
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts
index 3896c2de9..4ffba0c21 100644
--- a/src/frontend/src/utils/styleUtils.ts
+++ b/src/frontend/src/utils/styleUtils.ts
@@ -5,6 +5,8 @@ import {
ChevronDown,
ChevronLeft,
ChevronRight,
+ ChevronsLeft,
+ ChevronsRight,
ChevronsUpDown,
Circle,
Clipboard,
@@ -44,6 +46,7 @@ import {
MoonIcon,
MoreHorizontal,
Paperclip,
+ Pencil,
Plus,
Redo,
Rocket,
@@ -66,9 +69,6 @@ import {
X,
XCircle,
Zap,
- Pencil,
- ChevronsRight,
- ChevronsLeft
} from "lucide-react";
import { AirbyteIcon } from "../icons/Airbyte";
import { AnthropicIcon } from "../icons/Anthropic";
@@ -96,6 +96,7 @@ import SvgWikipedia from "../icons/Wikipedia/Wikipedia";
import SvgWolfram from "../icons/Wolfram/Wolfram";
import { HackerNewsIcon } from "../icons/hackerNews";
import { SupabaseIcon } from "../icons/supabase";
+import { FaApple, FaGithub } from "react-icons/fa";
export const gradients = [
"bg-gradient-to-br from-gray-800 via-rose-700 to-violet-900",
@@ -284,5 +285,7 @@ export const nodeIconsLucide = {
UserPlus2,
Pencil,
ChevronsRight,
- ChevronsLeft
+ ChevronsLeft,
+ FaGithub,
+ FaApple,
};