This commit is contained in:
Luke Vella 2024-02-13 16:49:52 +08:00
parent d203ca7b6b
commit 00df1a2e40
5 changed files with 78 additions and 42 deletions

View file

@ -40,7 +40,7 @@ import {
InviteCard, InviteCard,
InviteCardForm, InviteCardForm,
InviteCardGeneral, InviteCardGeneral,
} from "@/app/[locale]/create/invite-card"; } from "@/app/[locale]/(admin)/create/invite-card";
import { import {
PageContainer, PageContainer,
PageContent, PageContent,
@ -426,8 +426,8 @@ export function CreateForm() {
<div className="max-w-xl grow"> <div className="max-w-xl grow">
<CreateFormInput /> <CreateFormInput />
</div> </div>
<div className="rounded-md border bg-gray-100 px-5 py-4"> <div className="hidden rounded-md border bg-gray-100 px-5 py-4 lg:block">
<h2 className="text-muted-foreground mb-1 text-sm">Preview</h2> <div className="text-muted-foreground mb-1 text-sm">Preview</div>
<CreateFormPreview /> <CreateFormPreview />
</div> </div>
</form> </form>

View file

@ -1,18 +1,14 @@
import { Button } from "@rallly/ui/button"; import { Button } from "@rallly/ui/button";
import { ArrowLeftIcon, ChevronRightIcon, XIcon } from "lucide-react"; import { ChevronRightIcon, XIcon } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { CreateForm } from "@/app/[locale]/create/create-form"; import { CreateForm } from "@/app/[locale]/(admin)/create/create-form";
import { import { PageContainer, PageContent } from "@/app/components/page-layout";
PageContainer,
PageContent,
PageHeader,
} from "@/app/components/page-layout";
import { getTranslation } from "@/app/i18n"; import { getTranslation } from "@/app/i18n";
export default async function Page({ params }: { params: { locale: string } }) { export default async function Page({ params }: { params: { locale: string } }) {
return ( return (
<PageContainer className="flex flex-col bg-white"> <PageContainer className="flex flex-col bg-gray-50">
<PageContent className="grow"> <PageContent className="grow">
<div className="mb-4 flex items-center justify-between"> <div className="mb-4 flex items-center justify-between">
<div className="text-muted-foreground flex items-center gap-x-4 text-sm"> <div className="text-muted-foreground flex items-center gap-x-4 text-sm">

View file

@ -52,12 +52,13 @@ model User {
customerId String? @map("customer_id") customerId String? @map("customer_id")
subscriptionId String? @unique @map("subscription_id") subscriptionId String? @unique @map("subscription_id")
comments Comment[] comments Comment[]
polls Poll[] polls Poll[]
watcher Watcher[] watcher Watcher[]
events Event[] events Event[]
subscription Subscription? @relation(fields: [subscriptionId], references: [id]) subscription Subscription? @relation(fields: [subscriptionId], references: [id])
accounts Account[] accounts Account[]
schedulingPolls SchedulingPoll[]
@@map("users") @@map("users")
} }
@ -127,35 +128,35 @@ enum PollStatus {
} }
model Poll { model Poll {
id String @id @unique @map("id") id String @id @unique @map("id")
createdAt DateTime @default(now()) @map("created_at") createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at") updatedAt DateTime @updatedAt @map("updated_at")
deadline DateTime? deadline DateTime?
title String title String
description String? description String?
location String? location String?
userId String @map("user_id") userId String @map("user_id")
timeZone String? @map("time_zone") timeZone String? @map("time_zone")
closed Boolean @default(false) // @deprecated closed Boolean @default(false) // @deprecated
status PollStatus @default(live) status PollStatus @default(live)
deleted Boolean @default(false) deleted Boolean @default(false)
deletedAt DateTime? @map("deleted_at") deletedAt DateTime? @map("deleted_at")
touchedAt DateTime @default(now()) @map("touched_at") touchedAt DateTime @default(now()) @map("touched_at")
participantUrlId String @unique @map("participant_url_id") participantUrlId String @unique @map("participant_url_id")
adminUrlId String @unique @map("admin_url_id") adminUrlId String @unique @map("admin_url_id")
eventId String? @unique @map("event_id") eventId String? @unique @map("event_id")
hideParticipants Boolean @default(false) @map("hide_participants") hideParticipants Boolean @default(false) @map("hide_participants")
hideScores Boolean @default(false) @map("hide_scores") hideScores Boolean @default(false) @map("hide_scores")
disableComments Boolean @default(false) @map("disable_comments") disableComments Boolean @default(false) @map("disable_comments")
requireParticipantEmail Boolean @default(false) @map("require_participant_email") requireParticipantEmail Boolean @default(false) @map("require_participant_email")
user User? @relation(fields: [userId], references: [id]) user User? @relation(fields: [userId], references: [id])
event Event? @relation(fields: [eventId], references: [id]) event Event? @relation(fields: [eventId], references: [id])
options Option[] options Option[]
participants Participant[] participants Participant[]
watchers Watcher[] watchers Watcher[]
comments Comment[] comments Comment[]
votes Vote[] votes Vote[]
@@index([userId], type: Hash) @@index([userId], type: Hash)
@@map("polls") @@map("polls")
@ -171,7 +172,7 @@ model Event {
duration Int @default(0) @map("duration_minutes") duration Int @default(0) @map("duration_minutes")
createdAt DateTime @default(now()) @map("created_at") createdAt DateTime @default(now()) @map("created_at")
Poll Poll? Poll Poll?
@@index([userId], type: Hash) @@index([userId], type: Hash)
@@map("events") @@map("events")
@ -205,6 +206,45 @@ model Participant {
@@map("participants") @@map("participants")
} }
model SchedulingPoll {
id String @id @default(cuid())
userId String @map("user_id")
user User @relation(fields: [userId], references: [id])
prompt String?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
eventTitle String @map("event_title")
eventDescription String? @map("event_description")
eventLocation String? @map("event_location")
eventTimeZone String? @map("time_zone")
eventDuration Int? @map("event_duration_minutes")
pollOptions DateTime[] @map("poll_options")
responses SchedulingPollResponse[]
@@index([userId], type: Hash)
@@map("scheduling_polls")
}
model SchedulingPollResponse {
id String @id @default(cuid())
userId String @map("user_id")
name String
email String
timeZone String @map("time_zone")
locale String
notificationsEnabled Boolean @map("notifications_enabled")
schedulingPollId String @map("scheduling_poll_id")
votes Json
createdAt DateTime @default(now()) @map("created_at")
schedulingPoll SchedulingPoll @relation(fields: [schedulingPollId], references: [id])
availabilityHeatmapId String?
@@index([schedulingPollId], type: Hash)
@@map("scheduling_poll_responses")
}
model Option { model Option {
id String @id @default(cuid()) id String @id @default(cuid())
start DateTime @db.Timestamp(0) start DateTime @db.Timestamp(0)