Simplify Gitea authorization flow with shared utilities

This commit is contained in:
Jason Parks
2025-03-20 16:48:59 -06:00
parent a4e4d1c467
commit 530ad31aaa
9 changed files with 558 additions and 388 deletions
@@ -39,6 +39,7 @@ import {
} from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import type { Branch, Repository } from "@/utils/gitea-utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
import Link from "next/link";
@@ -47,31 +48,6 @@ import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
interface Repository {
name: string;
url: string;
id: number;
owner: {
username: string;
};
}
interface Branch {
name: string;
}
interface GiteaProviderType {
giteaId: string;
gitProvider: {
name: string;
gitProviderId: string;
providerType: "github" | "gitlab" | "bitbucket" | "gitea";
createdAt: string;
organizationId: string;
};
name: string;
}
const GiteaProviderSchema = z.object({
composePath: z.string().min(1),
repository: z