Compare commits

..

No commits in common. "a480eb930ea232f717c7fabca46c9107691db4e5" and "32b31f9df3471e0ea30d236c14ada5b2a903922f" have entirely different histories.

40 changed files with 242 additions and 967 deletions

View File

@ -1,76 +0,0 @@
"use client";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { useRouter } from "next/navigation";
export default function Login() {
const router = useRouter();
return (
<div className="w-screen h-screen grid place-items-center">
<Card className="w-[400px]">
<CardHeader className="space-y-1">
<CardTitle className="text-2xl">Login</CardTitle>
<CardDescription>
Enter your email and password below to login
</CardDescription>
</CardHeader>
<CardContent className="grid gap-4">
{/* <div className="grid grid-cols-2 gap-6">
<Button variant="outline">
<Icons.gitHub className="mr-2 h-4 w-4" />
Github
</Button>
<Button variant="outline">
<Icons.google className="mr-2 h-4 w-4" />
Google
</Button>
</div> */}
{/* <div className="relative">
<div className="absolute inset-0 flex items-center">
<span className="w-full border-t" />
</div>
<div className="relative flex justify-center text-xs uppercase">
<span className="bg-background px-2 text-muted-foreground">
Or continue with
</span>
</div>
</div> */}
<div className="grid gap-2">
<Label htmlFor="email">Email</Label>
<Input
id="email"
type="email"
placeholder="Enter your email..."
defaultValue="johndoe@gmail.com"
/>
</div>
<div className="grid gap-2">
<Label htmlFor="password">Password</Label>
<Input
id="password"
type="password"
placeholder="Enter your password..."
defaultValue="123456"
/>
</div>
</CardContent>
<CardFooter>
<Button className="w-full" onClick={() => router.push("/dashboard")}>
Login
</Button>
</CardFooter>
</Card>
</div>
);
}

View File

@ -1,6 +1,4 @@
"use client"
import AccountForm from "@/components/account-form";
import AddAccountForm from "@/components/add-account-form";
import Breadcrumb from "@/components/breadcrumb";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
@ -12,7 +10,7 @@ const breadcrumbItems = [
{ title: "Add" },
];
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
@ -27,11 +25,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<AccountForm
onSubmit={() => {}}
btn1_content="Create"
btn2_content="Create and add another"
/>
<AddAccountForm />
</CardContent>
</Card>
</div>

View File

@ -1,48 +0,0 @@
"use client";
import AccountForm from "@/components/account-form";
import Breadcrumb from "@/components/breadcrumb";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import { dummyAccounts } from "@/constants/data";
import { Account } from "@/types/account";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Accounts", link: "/dashboard/accounts" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const account = dummyAccounts.find((account) => account.id === +params.id);
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit Account
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<AccountForm
account={account as Account}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
</CardContent>
</Card>
</div>
</div>
<ScrollBar />
</ScrollArea>
);
}

View File

@ -1,6 +1,4 @@
"use client";
import AddAPICommunicationForm from "@/components/api-communication-form";
import AddAPICommunicationForm from "@/components/add-api-communication-form";
import Breadcrumb from "@/components/breadcrumb";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
@ -12,7 +10,7 @@ const breadcrumbItems = [
{ title: "Add" },
];
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
@ -27,11 +25,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<AddAPICommunicationForm
onSubmit={() => {}}
btn1_content="Create"
btn2_content="Create and add another"
/>
<AddAPICommunicationForm />
</CardContent>
</Card>
</div>

View File

@ -1,49 +0,0 @@
"use client";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import Breadcrumb from "@/components/breadcrumb";
import { dummyApiCommunications } from "@/constants/data";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import APICommunicationForm from "@/components/api-communication-form";
import { ApiCommunication } from "@/types/api-communication";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Api Communications", link: "/dashboard/api-communications" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const apiCommunication = dummyApiCommunications.find(
(apiCommunication) => apiCommunication.id === +params.id
);
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full mb-8">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit Api Communication
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<APICommunicationForm
apiCommunication={apiCommunication as ApiCommunication}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
</CardContent>
</Card>
</div>
</div>
<ScrollBar />
</ScrollArea>
);
}

View File

@ -1,5 +1,3 @@
"use client"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
@ -12,7 +10,7 @@ const breadcrumbItems = [
{ title: "Create Commit" },
];
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
@ -27,11 +25,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<CommitForm
onSubmit={() => {}}
btn1_content="Create"
btn2_content="Create and add another"
/>
<CommitForm />
</CardContent>
</Card>
</div>

View File

@ -1,48 +0,0 @@
"use client";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import Breadcrumb from "@/components/breadcrumb";
import { dummyCommits } from "@/constants/data";
import { Commit } from "@/types/commit";
import CommitForm from "@/components/commit-form";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Commits", link: "/dashboard/commits" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const commit = dummyCommits.find((commit) => commit.id === params.id);
console.log(commit)
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit Commit
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<CommitForm
commit={commit as Commit}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
</CardContent>
</Card>
</div>
</div>
<ScrollBar />
</ScrollArea>
);
}

View File

@ -1,9 +1,7 @@
"use client"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import ConfigurationForm from "@/components/configuration-form";
import AddConfigurationForm from "@/components/add-configuration-form";
import Breadcrumb from "@/components/breadcrumb";
const breadcrumbItems = [
@ -12,7 +10,7 @@ const breadcrumbItems = [
{ title: "Add" },
];
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
@ -27,11 +25,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<ConfigurationForm
onSubmit={() => {}}
btn1_content="Create"
btn2_content="Create and add another"
/>
<AddConfigurationForm />
</CardContent>
</Card>
</div>

View File

@ -1,47 +0,0 @@
"use client";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import ConfigurationForm from "@/components/configuration-form";
import Breadcrumb from "@/components/breadcrumb";
import { dummyConfigurations } from "@/constants/data";
import { Configuration } from "@/types/configuration";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Configurations", link: "/dashboard/configurations" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const configuration = dummyConfigurations.find((configuration) => configuration.id === +params.id);
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit Configuration
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<ConfigurationForm
configuration={configuration as Configuration}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
</CardContent>
</Card>
</div>
</div>
<ScrollBar />
</ScrollArea>
);
}

View File

@ -1,11 +1,9 @@
"use client";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import AddCriteriaForm from "@/components/criteria-form";
import AddCriteriaForm from "@/components/add-criteria-form";
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6 w-full h-full flex justify-center items-center">
@ -18,11 +16,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<AddCriteriaForm
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
<AddCriteriaForm />
</CardContent>
</Card>
</div>

View File

@ -1,55 +0,0 @@
"use client";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import ConfigurationForm from "@/components/configuration-form";
import Breadcrumb from "@/components/breadcrumb";
import {
dummyApiCommunications,
dummyConfigurations,
dummyCriteria,
} from "@/constants/data";
import { Configuration } from "@/types/configuration";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import APICommunicationForm from "@/components/api-communication-form";
import { ApiCommunication } from "@/types/api-communication";
import CriteriaForm from "@/components/criteria-form";
import { Criteria } from "@/types/criteria";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Api Communications", link: "/dashboard/api-communications" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const criteria = dummyCriteria.find((criteria) => criteria.id === +params.id);
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full mb-8">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit Criteria
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<CriteriaForm
criteria={criteria as Criteria}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
</CardContent>
</Card>
</div>
</div>
<ScrollBar />
</ScrollArea>
);
}

View File

@ -1,10 +1,8 @@
"use client"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import Breadcrumb from "@/components/breadcrumb";
import EvaluationForm from "@/components/evaluation-form";
import AddEvaluationForm from "@/components/evaluation-form";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
@ -12,7 +10,7 @@ const breadcrumbItems = [
{ title: "Add" },
];
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
@ -27,11 +25,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<EvaluationForm
onSubmit={() => {}}
btn1_content="Create"
btn2_content="Create and add another"
/>
<AddEvaluationForm/>
</CardContent>
</Card>
</div>

View File

@ -1,49 +0,0 @@
"use client";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import Breadcrumb from "@/components/breadcrumb";
import EvaluationForm from "@/components/evaluation-form";
import { Evaluation } from "@/types/evaluation";
import { dummyEvaluations } from "@/constants/data";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Evaluation", link: "/dashboard/evaluations" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const evaluation = dummyEvaluations.find(
(evaluation) => evaluation.id === +params.id
);
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit Evaluation
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<EvaluationForm
evaluation={evaluation as Evaluation}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
</CardContent>
</Card>
</div>
<ScrollBar />
</div>
</ScrollArea>
);
}

View File

@ -1,9 +1,7 @@
"use client";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import OrganizationForm from "@/components/organization-form";
import AddOrganizationForm from "@/components/add-organization-form";
import Breadcrumb from "@/components/breadcrumb";
const breadcrumbItems = [
@ -12,7 +10,7 @@ const breadcrumbItems = [
{ title: "Add" },
];
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
@ -27,11 +25,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<OrganizationForm
onSubmit={() => {}}
btn1_content="Create"
btn2_content="Create and add another"
/>
<AddOrganizationForm />
</CardContent>
</Card>
</div>

View File

@ -1,46 +0,0 @@
"use client"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import OrganizationForm from "@/components/organization-form";
import Breadcrumb from "@/components/breadcrumb";
import { dummyOrganizations } from "@/constants/data";
import { Organization } from "@/types/organization";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Organizations", link: "/dashboard/organizations" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const organization = dummyOrganizations.find((organization) => organization.id === +params.id);
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit Organization
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<OrganizationForm organization={organization as Organization}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes" />
</CardContent>
</Card>
</div>
</div>
<ScrollBar />
</ScrollArea>
);
}

View File

@ -1,9 +1,7 @@
"use client";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import SkillForm from "@/components/skill-form";
import AddSkillForm from "@/components/add-skill-form";
import Breadcrumb from "@/components/breadcrumb";
const breadcrumbItems = [
@ -12,7 +10,7 @@ const breadcrumbItems = [
{ title: "Add" },
];
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
@ -27,11 +25,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<SkillForm
onSubmit={() => {}}
btn1_content="Create"
btn2_content="Create and add another"
/>
<AddSkillForm />
</CardContent>
</Card>
</div>

View File

@ -1,47 +0,0 @@
"use client";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import SkillForm from "@/components/skill-form";
import Breadcrumb from "@/components/breadcrumb";
import { dummySkills } from "@/constants/data";
import { Skill } from "@/types/skill";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Skills", link: "/dashboard/skills" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const skill = dummySkills.find((skill) => skill.id === +params.id);
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit Skill
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<SkillForm
skill={skill as Skill}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
</CardContent>
</Card>
</div>
<ScrollBar />
</div>
</ScrollArea>
);
}

View File

@ -1,8 +1,13 @@
"use client";
import UserForm from "@/components/user-form";
import AddUserForm from "@/components/add-user-form";
import Breadcrumb from "@/components/breadcrumb";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
@ -12,7 +17,7 @@ const breadcrumbItems = [
{ title: "Add" },
];
export default function Page() {
export default function SettingsDisplayPage() {
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
@ -27,11 +32,7 @@ export default function Page() {
</CardHeader>
<CardContent>
<UserForm
onSubmit={() => {}}
btn1_content="Create"
btn2_content="Create and add another"
/>
<AddUserForm />
</CardContent>
</Card>
</div>

View File

@ -1,49 +0,0 @@
"use client";
import UserForm from "@/components/user-form";
import Breadcrumb from "@/components/breadcrumb";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import { dummyUsers } from "@/constants/data";
import { User } from "@/types/user";
const breadcrumbItems = [
{ title: "Dashboard", link: "/dashboard" },
{ title: "Users", link: "/dashboard/users" },
{ title: "Edit" },
];
export default function Page({ params }: { params: { id: string } }) {
const user = dummyUsers.find((user) => user.id === +params.id);
return (
<ScrollArea className="h-[calc(100vh-53px)]">
<div className="flex-1 space-y-4 p-4 md:p-8 pt-6">
<Breadcrumb items={breadcrumbItems} />
<div className="w-full h-full flex justify-center items-center">
<Card className="max-w-[700px] w-full mb-8">
<CardHeader>
<CardTitle className="mb-4 font-bold text-xl">
Edit User
</CardTitle>
<Separator />
</CardHeader>
<CardContent>
<UserForm
user={user as User}
onSubmit={() => {}}
btn1_content="Save and continue editing"
btn2_content="Save changes"
/>
</CardContent>
</Card>
</div>
</div>
<ScrollBar />
</ScrollArea>
);
}

View File

@ -14,7 +14,6 @@ import { Organization } from "@/types/organization";
import { User } from "@/types/user";
import { BookCheck, Edit, MoreHorizontal, Trash } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -50,15 +49,14 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/accounts/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Update
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"
onClick={() => setIsDeleteModalOpen(true)}

View File

@ -22,15 +22,20 @@ import {
SelectTrigger,
SelectValue,
} from "./ui/select";
import { Account } from "@/types/account";
const displayFormSchema = z.object({
email: z.string().trim().min(1, { message: "Please select a user." }).email(),
email: z
.string({
required_error: "Please select a user.",
})
.trim()
.email(),
balance: z.string().trim().min(1, "Balance is required."),
organization: z
.string()
.trim()
.min(1, { message: "Please select an organization." }),
.string({
required_error: "Please select an organization.",
})
.trim(),
});
type DisplayFormValues = z.infer<typeof displayFormSchema>;
@ -42,26 +47,10 @@ const defaultValues: Partial<DisplayFormValues> = {
organization: "",
};
type Props = {
account?: Account;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
};
export default function AccountForm({
account,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function AddAccountForm() {
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
balance: account?.balance ? String(account?.balance) : "",
email: account?.email || "",
organization: account?.organization || "",
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -84,19 +73,21 @@ export default function AccountForm({
render={({ field }) => (
<FormItem>
<FormLabel>User</FormLabel>
<Select onValueChange={field.onChange} value={field.value}>
<Select onValueChange={field.onChange} defaultValue={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a user" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="john@gmail.com">john@gmail.com</SelectItem>
<SelectItem value="sarah@example.com">
sarah@example.com
<SelectItem value="johndoe@gmail.com">
johndoe@gmail.com
</SelectItem>
<SelectItem value="michael@example.com">
michael@example.com
<SelectItem value="adramov@gmail.com">
adramov@gmail.com
</SelectItem>
<SelectItem value="hello@gmail.com">
hello@gmail.com
</SelectItem>
</SelectContent>
</Select>
@ -132,11 +123,8 @@ export default function AccountForm({
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="XYZ Tech Inc.">XYZ Tech Inc.</SelectItem>
<SelectItem value="ABC Solutions">ABC Solutions</SelectItem>
<SelectItem value="Acme Corporation">
Acme Corporation
</SelectItem>
<SelectItem value="Skilld">Skilld</SelectItem>
<SelectItem value="Ecareers">Ecareers</SelectItem>
</SelectContent>
</Select>
<FormMessage />
@ -146,10 +134,10 @@ export default function AccountForm({
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -23,7 +23,6 @@ import {
SelectValue,
} from "./ui/select";
import { Textarea } from "./ui/textarea";
import { ApiCommunication } from "@/types/api-communication";
const displayFormSchema = z.object({
pt: z
@ -78,43 +77,22 @@ const displayFormSchema = z.object({
type DisplayFormValues = z.infer<typeof displayFormSchema>;
// // This can come from your database or API.
// const defaultValues: Partial<DisplayFormValues> = {
// pt: "",
// messages: "",
// completion: "",
// ct: "",
// tt: "",
// status: "",
// type: "",
// evaluation: "",
// };
type Props = {
apiCommunication?: ApiCommunication;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
// This can come from your database or API.
const defaultValues: Partial<DisplayFormValues> = {
pt: "",
messages: "",
completion: "",
ct: "",
tt: "",
status: "",
type: "",
evaluation: "",
};
export default function APICommunicationForm({
apiCommunication,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function AddAPICommunicationForm() {
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
pt: apiCommunication?.pt ? String(apiCommunication.pt) : "",
messages: apiCommunication?.messages || "",
completion: apiCommunication?.completion || "",
ct: apiCommunication?.ct ? String(apiCommunication.ct) : "",
tt: apiCommunication?.tt ? String(apiCommunication.tt) : "",
status: apiCommunication?.status || "",
type: apiCommunication?.type || "",
evaluation: apiCommunication?.evaluation || "",
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -126,8 +104,6 @@ export default function APICommunicationForm({
</pre>
),
});
onFormSubmit();
}
return (
@ -239,12 +215,11 @@ export default function APICommunicationForm({
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem className="truncate" value="Uploaded at: 2023-09-20 00:00:00 - Uploader: jschultz@php.net - Developer: fabien@potencier.org - Status: finished">
<SelectItem value="Uploaded at: 2023-09-20 00:00:00 - Uploader: jschultz@php.net - Developer: fabien@potencier.org - Status: finished">
Uploaded at: 2023-09-20 00:00:00 - Uploader:
jschultz@php.net - Developer: fabien@potencier.org - Status:
finished
</SelectItem>
</SelectContent>
</Select>
<FormMessage />
@ -254,10 +229,10 @@ export default function APICommunicationForm({
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -15,7 +15,6 @@ import {
} from "@/components/ui/form";
import { toast } from "@/components/ui/use-toast";
import { Input } from "./ui/input";
import { Configuration } from "@/types/configuration";
const displayFormSchema = z.object({
name: z.string().trim().min(1, "Name is required."),
@ -24,25 +23,16 @@ const displayFormSchema = z.object({
type DisplayFormValues = z.infer<typeof displayFormSchema>;
type Props = {
configuration?: Configuration;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
// This can come from your database or API.
const defaultValues: Partial<DisplayFormValues> = {
name: "",
value: "",
};
export default function ConfigurationForm({
configuration,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function AddConfigurationForm() {
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
name: configuration?.name || "",
value: configuration?.value || "",
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -88,10 +78,10 @@ export default function ConfigurationForm({
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -16,7 +16,6 @@ import {
import { toast } from "@/components/ui/use-toast";
import { Input } from "./ui/input";
import { Textarea } from "./ui/textarea";
import { Criteria } from "@/types/criteria";
const displayFormSchema = z.object({
name: z.string().trim().min(1, "Name is required."),
@ -26,33 +25,17 @@ const displayFormSchema = z.object({
type DisplayFormValues = z.infer<typeof displayFormSchema>;
// // This can come from your database or API.
// const defaultValues: Partial<DisplayFormValues> = {
// name: "",
// description: "",
// prompt: "",
// };
type Props = {
criteria?: Criteria;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
// This can come from your database or API.
const defaultValues: Partial<DisplayFormValues> = {
name: "",
description: "",
prompt: "",
};
export default function CriteriaForm({
criteria,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function AddCriteriaForm() {
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
name: criteria?.name || "",
description: criteria?.description || "",
prompt: criteria?.prompt || "",
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -64,8 +47,6 @@ export default function CriteriaForm({
</pre>
),
});
onFormSubmit();
}
return (
@ -113,10 +94,10 @@ export default function CriteriaForm({
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -15,7 +15,6 @@ import {
} from "@/components/ui/form";
import { toast } from "@/components/ui/use-toast";
import { Input } from "./ui/input";
import { Organization } from "@/types/organization";
const displayFormSchema = z.object({
name: z.string().trim().min(1, "Name is required."),
@ -28,23 +27,10 @@ const defaultValues: Partial<DisplayFormValues> = {
name: "",
};
type Props = {
organization?: Organization;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
};
export default function OrganizationForm({
organization,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function AddOrganizationForm() {
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
name: organization?.name || "",
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -56,8 +42,6 @@ export default function OrganizationForm({
</pre>
),
});
onFormSubmit();
}
return (
@ -79,10 +63,10 @@ export default function OrganizationForm({
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -15,7 +15,6 @@ import {
} from "@/components/ui/form";
import { toast } from "@/components/ui/use-toast";
import { Input } from "./ui/input";
import { Skill } from "@/types/skill";
const displayFormSchema = z.object({
name: z.string().trim().min(1, "Name is required."),
@ -23,28 +22,15 @@ const displayFormSchema = z.object({
type DisplayFormValues = z.infer<typeof displayFormSchema>;
// const defaultValues: Partial<DisplayFormValues> = {
// name: "",
// };
type Props = {
skill?: Skill;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
// This can come from your database or API.
const defaultValues: Partial<DisplayFormValues> = {
name: "",
};
export default function SkillForm({
skill,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function AddSkillForm() {
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
name: skill?.name || "",
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -77,10 +63,10 @@ export default function SkillForm({
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -17,7 +17,6 @@ import {
} from "@/components/ui/form";
import { toast } from "@/components/ui/use-toast";
import { Input } from "./ui/input";
import { User } from "@/types/user";
const roles = [
{
@ -62,26 +61,17 @@ const displayFormSchema = z.object({
type DisplayFormValues = z.infer<typeof displayFormSchema>;
type Props = {
user?: User;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
// This can come from your database or API.
const defaultValues: Partial<DisplayFormValues> = {
fullName: "",
email: "",
roles: ["ROLE_USER"],
};
export default function UserForm({
user,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function AddUserForm() {
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
fullName: user?.fullName || "",
email: user?.email || "",
roles: [user?.role || "ROLE_USER"],
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -101,8 +91,6 @@ export default function UserForm({
</pre>
),
});
onFormSubmit();
}
return (
@ -223,10 +211,10 @@ export default function UserForm({
/>
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -12,7 +12,6 @@ import { useToast } from "@/components/ui/use-toast";
import { ApiCommunication } from "@/types/api-communication";
import { Edit, MoreHorizontal, Trash } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -48,13 +47,13 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/api-communications/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Update
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"

View File

@ -27,7 +27,6 @@ import {
import { cn } from "@/lib/utils";
import { CommandList } from "cmdk";
import { useState } from "react";
import { Commit } from "@/types/commit";
const statuses = [
"new",
@ -70,34 +69,14 @@ const defaultValues: Partial<DisplayFormValues> = {
commitDate: "",
};
type Props = {
commit?: Commit;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
};
export default function CommitForm({
commit,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function CommitForm() {
const [isStatusPopoverOpen, setIsStatusPopoverOpen] = useState(false);
const [isTypePopoverOpen, setIsTypePopoverOpen] = useState(false);
const [isEvaluationPopoverOpen, setIsEvaluationPopoverOpen] = useState(false);
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
id: commit?.id || "",
hash: commit?.hash || "",
status: commit?.status || "",
retryCount: commit?.retryCount || "",
type: commit?.type || "",
evaluation: commit?.evaluation || "",
commitDate: commit?.commitDate || "",
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -109,8 +88,6 @@ export default function CommitForm({
</pre>
),
});
onFormSubmit();
}
return (
@ -371,10 +348,10 @@ export default function CommitForm({
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -16,7 +16,6 @@ import { EvaluationStart } from "@/types/evaluation-start";
import { Skill } from "@/types/skill";
import { Edit, GitCommit, MoreHorizontal, Trash } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -52,13 +51,13 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/commits/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Edit
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"

View File

@ -12,7 +12,6 @@ import { useToast } from "@/components/ui/use-toast";
import { Configuration } from "@/types/configuration";
import { BookCheck, Edit, MoreHorizontal, Trash } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -48,13 +47,13 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/configurations/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Update
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"

View File

@ -13,7 +13,6 @@ import { Criteria } from "@/types/criteria";
import { EvaluationStart } from "@/types/evaluation-start";
import { Edit, GitCommit, MoreHorizontal, Trash } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -49,13 +48,13 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/criteria/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Edit
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"

View File

@ -27,7 +27,6 @@ import {
import { cn } from "@/lib/utils";
import { CommandList } from "cmdk";
import { useState } from "react";
import { Evaluation } from "@/types/evaluation";
const statuses = [
"uploading",
@ -44,8 +43,8 @@ const statuses = [
"evaluation_failed",
] as const;
const uploaders = ["johndoe@gmail.com", "danabramov@gmail.com"] as const;
const developers = ["danabramov@gmail.com", "johndoe@gmail.com"] as const;
const uploaders = ["hello@skilld.team", "johndoe@gmail.com"] as const;
const developers = ["hello@skilld.team", "johndoe@gmail.com"] as const;
const displayFormSchema = z.object({
status: z.string().trim().min(1, "Status is required"),
@ -66,38 +65,22 @@ const displayFormSchema = z.object({
type DisplayFormValues = z.infer<typeof displayFormSchema>;
// const defaultValues: Partial<DisplayFormValues> = {
// status: "",
// uploadTime: "",
// uploaderAccount: "",
// developerUser: "",
// };
type Props = {
evaluation?: Evaluation;
onSubmit: () => void;
btn1_content: string;
btn2_content: string;
// This can come from your database or API.
const defaultValues: Partial<DisplayFormValues> = {
status: "",
uploadTime: "",
uploaderAccount: "",
developerUser: "",
};
export default function EvaluationForm({
evaluation,
onSubmit: onFormSubmit,
btn1_content,
btn2_content,
}: Props) {
export default function AddEvaluationForm() {
const [isStatusPopoverOpen, setIsStatusPopoverOpen] = useState(false);
const [isUploaderPopoverOpen, setIsUploaderPopoverOpen] = useState(false);
const [isDeveloperPopoverOpen, setIsDeveloperPopoverOpen] = useState(false);
const form = useForm<DisplayFormValues>({
resolver: zodResolver(displayFormSchema),
defaultValues: {
status: evaluation?.status || "",
uploadTime: evaluation?.uploadTime || "",
uploaderAccount: evaluation?.uploaderAccount || "",
developerUser: evaluation?.developerUser || "",
},
defaultValues,
});
function onSubmit(data: DisplayFormValues) {
@ -109,8 +92,6 @@ export default function EvaluationForm({
</pre>
),
});
onFormSubmit();
}
return (
@ -331,10 +312,10 @@ export default function EvaluationForm({
<div className="flex items-center gap-4 flex-col sm:flex-row">
<Button className="w-full" size="lg">
{btn1_content}
Create
</Button>
<Button variant="secondary" className="w-full" size="lg">
{btn2_content}
Create and add another
</Button>
</div>
</form>

View File

@ -15,7 +15,6 @@ import { EvaluationStart } from "@/types/evaluation-start";
import { Skill } from "@/types/skill";
import { Edit, GitCommit, MoreHorizontal, Trash } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -51,13 +50,13 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/evaluations/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Edit
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"

View File

@ -13,7 +13,6 @@ import { Organization } from "@/types/organization";
import { User } from "@/types/user";
import { BookCheck, Edit, MoreHorizontal, Trash } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -49,13 +48,13 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/organizations/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Update
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"

View File

@ -14,7 +14,6 @@ import { EvaluationStart } from "@/types/evaluation-start";
import { Skill } from "@/types/skill";
import { Edit, GitCommit, MoreHorizontal, Trash } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -50,13 +49,13 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/skills/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Edit
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"

View File

@ -11,8 +11,7 @@ import {
import { useToast } from "@/components/ui/use-toast";
import { User } from "@/types/user";
import { Edit, MoreHorizontal, Trash, UserCheck } from "lucide-react";
import Link from "next/link";
import { BookCheck, Edit, MoreHorizontal, Trash } from "lucide-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
@ -28,8 +27,7 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
const onDeleteConfirm = async () => {};
console.log(data)
const handleUpdateStatus = async () => {};
return (
<>
@ -49,17 +47,13 @@ export const CellAction: React.FC<CellActionProps> = ({ data }) => {
<DropdownMenuContent align="end">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem className="cursor-pointer">
<UserCheck className="mr-2 h-4 w-4" /> Approve User
</DropdownMenuItem>
<DropdownMenuItem className="cursor-pointer p-0">
<Link
href={`/dashboard/users/edit/${data.id}`}
className="flex items-center gap-2 px-2 py-1.5 w-full"
<DropdownMenuItem
className="cursor-pointer"
// onClick={() =>
// router.push(`#`)
// }
>
<Edit className="h-4 w-4" /> Edit
</Link>
<Edit className="mr-2 h-4 w-4" /> Update
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"

View File

@ -9,27 +9,28 @@ import { Organization } from "@/types/organization";
import { Skill } from "@/types/skill";
import { User } from "@/types/user";
import { UserRound, UserRoundCheck } from "lucide-react";
import { number } from "zod";
export const dummyUsers: User[] = [
{
id: 1,
email: "john@gmail.com",
fullName: "John Doe",
role: "ROLE_ADMIN",
role: "ADMIN",
created_at: new Date().toISOString(),
},
{
id: 2,
email: "linustorvalds@gmail.com",
fullName: "Linus Torvalds",
role: "ROLE_USER",
role: "USER",
created_at: new Date().toISOString(),
},
{
id: 3,
email: "ryandahl@gmail.com",
fullName: "Ryan Dahl",
role: "ROLE_ADMIN",
role: "ADMIN",
created_at: new Date().toISOString(),
},
];
@ -89,7 +90,7 @@ export const dummyAccounts: Account[] = [
{
id: 2,
email: "sarah@example.com",
balance: 2000,
balance: 0,
organization: "ABC Solutions",
accountHistory: "None",
created_at: new Date().toISOString(),
@ -108,31 +109,31 @@ export const dummyConfigurations: Configuration[] = [
{
id: 1,
name: "process_limit",
value: "20",
value: 20,
created_at: new Date().toISOString(),
},
{
id: 2,
name: "process_timeout",
value: "600",
value: 600,
created_at: new Date().toISOString(),
},
{
id: 3,
name: "number_of_courses_to_create",
value: "5",
value: 5,
created_at: new Date().toISOString(),
},
{
id: 4,
name: "max_retries",
value: "2",
value: 2,
created_at: new Date().toISOString(),
},
{
id: 5,
name: "max_token_per_evaluation",
value: "1000000",
value: 1000000,
created_at: new Date().toISOString(),
},
];
@ -299,10 +300,10 @@ export const dummyEvaluations: Evaluation[] = [
export const dummyCommits: Commit[] = [
{
id: "1",
id: 1,
hash: "9998211595b05c7f8555e4a129d7792bce7a8dd6_1",
status: "skills_extracted",
retryCount: "0",
retryCount: 0,
type: "code",
evaluation:
"Uploaded at: 2023-09-20 00:00:00 - Uploader: jschultz@php.net - Developer: fabien@potencier.org - Status: finished",

View File

@ -1,8 +1,8 @@
export interface Commit {
id: string;
id: number;
hash: string;
status: string;
retryCount: string;
retryCount: number;
type: string;
evaluation: string;
commitDate: string;

View File

@ -1,6 +1,6 @@
export interface Configuration {
id: number;
name: string;
value: string;
value: number;
created_at: string;
}