From 899641ff0dd3029653df1b7303e3dd844d08c083 Mon Sep 17 00:00:00 2001 From: awtkns <32209255+awtkns@users.noreply.github.com> Date: Sat, 2 Dec 2023 18:32:12 -0800 Subject: [PATCH] scaffold --- next/src/app/api/rest/upload/route.ts | 5 ++-- next/src/app/layout.tsx | 8 ++--- next/src/app/page.tsx | 27 ++++++++++++++--- next/tailwind.config.ts | 42 +++++---------------------- 4 files changed, 36 insertions(+), 46 deletions(-) diff --git a/next/src/app/api/rest/upload/route.ts b/next/src/app/api/rest/upload/route.ts index c3ba7107..8c46fd4b 100644 --- a/next/src/app/api/rest/upload/route.ts +++ b/next/src/app/api/rest/upload/route.ts @@ -57,11 +57,12 @@ export async function POST(req: Request) { const result = await TestSuiteSchema.safeParseAsync(testSuite); if (!result.success) { - NextResponse.json(result.error, { + return NextResponse.json(result.error, { status: 422, }); + } else { + await caller.evaluations.create(result.data); } - await caller.evaluations.create(result.data); return NextResponse.json("ok"); } diff --git a/next/src/app/layout.tsx b/next/src/app/layout.tsx index 2a45b8ce..62479753 100644 --- a/next/src/app/layout.tsx +++ b/next/src/app/layout.tsx @@ -4,7 +4,7 @@ import { Inter } from "next/font/google"; import { cookies } from "next/headers"; import { TRPCReactProvider } from "~/trpc/react"; -import type {ReactNode} from "react"; +import type { ReactNode } from "react"; const inter = Inter({ subsets: ["latin"], @@ -17,11 +17,7 @@ export const metadata = { icons: [{ rel: "icon", url: "/favicon.ico" }], }; -export default function RootLayout({ - children, -}: { - children: ReactNode; -}) { +export default function RootLayout({ children }: { children: ReactNode }) { return ( diff --git a/next/src/app/page.tsx b/next/src/app/page.tsx index 68708e37..47fb48b1 100644 --- a/next/src/app/page.tsx +++ b/next/src/app/page.tsx @@ -1,15 +1,34 @@ import { db } from "~/server/db"; -import { Card, Grid, Metric, Tab, TabGroup, TabList, TabPanel, TabPanels, Text, Title } from "@tremor/react"; +import { + Card, + Grid, + Metric, + Tab, + TabGroup, + TabList, + TabPanel, + TabPanels, + Text, + Title, +} from "@tremor/react"; import TestSuitesTable from "~/app/_components/test-suites-table"; +import { getServerAuthSession } from "~/server/auth"; +import Link from "next/link"; export default async function Home() { // const hello = await api.post.hello.query({ text: "from tRPC" }); - // const session = await getServerAuthSession(); + const session = await getServerAuthSession(); return (
- Bananalytics 🍌 + Bananalytics 🍌 Full stack Banalyses observability + + {session ? "Sign out" : "Sign in"} + Dashboard @@ -17,7 +36,7 @@ export default async function Home() { - + {/* Placeholder to set height */}
diff --git a/next/tailwind.config.ts b/next/tailwind.config.ts index 4ac802bd..164f45da 100644 --- a/next/tailwind.config.ts +++ b/next/tailwind.config.ts @@ -42,46 +42,20 @@ export default { inverted: "#ffffff", // white }, }, - // dark mode - "dark-tremor": { - brand: { - faint: "#0B1229", // custom - muted: "#172554", // blue-950 - subtle: "#1e40af", // blue-800 - DEFAULT: "#3b82f6", // blue-500 - emphasis: "#60a5fa", // blue-400 - inverted: "#030712", // gray-950 - }, - background: { - muted: "#131A2B", // custom - subtle: "#1f2937", // gray-800 - DEFAULT: "#111827", // gray-900 - emphasis: "#d1d5db", // gray-300 - }, - border: { - DEFAULT: "#1f2937", // gray-800 - }, - ring: { - DEFAULT: "#1f2937", // gray-800 - }, - content: { - subtle: "#4b5563", // gray-600 - DEFAULT: "#6b7280", // gray-500 - emphasis: "#e5e7eb", // gray-200 - strong: "#f9fafb", // gray-50 - inverted: "#000000", // black - }, - }, }, boxShadow: { // light "tremor-input": "0 1px 2px 0 rgb(0 0 0 / 0.05)", - "tremor-card": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", - "tremor-dropdown": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)", + "tremor-card": + "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", + "tremor-dropdown": + "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)", // dark "dark-tremor-input": "0 1px 2px 0 rgb(0 0 0 / 0.05)", - "dark-tremor-card": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", - "dark-tremor-dropdown": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)", + "dark-tremor-card": + "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", + "dark-tremor-dropdown": + "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)", }, borderRadius: { "tremor-small": "0.375rem",