Fixing Mobile UI - Event Types (#2065)
* Event Types - Mobile Ui * Removing Daily video from default list Added this for testing purposes * Removing ZOD + mt on clock Co-authored-by: Peer Richelsen <peeroke@gmail.com>pull/2057/head^2
parent
a311f6bf4b
commit
91b732ff1c
|
@ -488,7 +488,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{location.type === LocationType.Daily && (
|
{location.type === LocationType.Daily && (
|
||||||
<div className="flex flex-grow">
|
<div className="flex flex-grow items-center">
|
||||||
<svg
|
<svg
|
||||||
id="svg"
|
id="svg"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
|
@ -629,7 +629,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="flex rounded-sm px-3 py-2 hover:bg-gray-100"
|
className="flex rounded-sm py-2 hover:bg-gray-100"
|
||||||
onClick={() => setShowLocationModal(true)}>
|
onClick={() => setShowLocationModal(true)}>
|
||||||
<PlusIcon className="mt-0.5 h-4 w-4 text-neutral-900" />
|
<PlusIcon className="mt-0.5 h-4 w-4 text-neutral-900" />
|
||||||
<span className="ml-1 text-sm font-medium text-neutral-700">{t("add_location")}</span>
|
<span className="ml-1 text-sm font-medium text-neutral-700">{t("add_location")}</span>
|
||||||
|
@ -744,7 +744,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||||
<MinutesField
|
<MinutesField
|
||||||
label={
|
label={
|
||||||
<>
|
<>
|
||||||
<ClockIcon className="mt-0.5 h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2" />{" "}
|
<ClockIcon className="h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2" />{" "}
|
||||||
{t("duration")}
|
{t("duration")}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
@ -767,7 +767,7 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
|
||||||
<label
|
<label
|
||||||
htmlFor="location"
|
htmlFor="location"
|
||||||
className="mt-2.5 flex text-sm font-medium text-neutral-700">
|
className="mt-2.5 flex text-sm font-medium text-neutral-700">
|
||||||
<LocationMarkerIcon className="mt-0.5 h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2" />
|
<LocationMarkerIcon className="mt-0.5 mb-4 h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2" />
|
||||||
{t("location")}
|
{t("location")}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
import * as z from "zod"
|
|
||||||
import * as imports from "../zod-utils"
|
|
||||||
import { PeriodType, SchedulingType } from "@prisma/client"
|
|
||||||
import { CompleteUser, UserModel, CompleteTeam, TeamModel, CompleteBooking, BookingModel, CompleteAvailability, AvailabilityModel, CompleteWebhook, WebhookModel, CompleteDestinationCalendar, DestinationCalendarModel, CompleteEventTypeCustomInput, EventTypeCustomInputModel, CompleteSchedule, ScheduleModel } from "./index"
|
|
||||||
|
|
||||||
// Helper schema for JSON fields
|
|
||||||
type Literal = boolean | number | string
|
|
||||||
type Json = Literal | { [key: string]: Json } | Json[]
|
|
||||||
const literalSchema = z.union([z.string(), z.number(), z.boolean()])
|
|
||||||
const jsonSchema: z.ZodSchema<Json> = z.lazy(() => z.union([literalSchema, z.array(jsonSchema), z.record(jsonSchema)]))
|
|
||||||
|
|
||||||
export const _EventTypeModel = z.object({
|
|
||||||
id: z.number().int(),
|
|
||||||
title: z.string().nonempty(),
|
|
||||||
slug: imports.eventTypeSlug,
|
|
||||||
description: z.string().nullish(),
|
|
||||||
position: z.number().int(),
|
|
||||||
locations: imports.eventTypeLocations,
|
|
||||||
length: z.number().int(),
|
|
||||||
hidden: z.boolean(),
|
|
||||||
userId: z.number().int().nullish(),
|
|
||||||
teamId: z.number().int().nullish(),
|
|
||||||
eventName: z.string().nullish(),
|
|
||||||
timeZone: z.string().nullish(),
|
|
||||||
periodType: z.nativeEnum(PeriodType),
|
|
||||||
periodStartDate: z.date().nullish(),
|
|
||||||
periodEndDate: z.date().nullish(),
|
|
||||||
periodDays: z.number().int().nullish(),
|
|
||||||
periodCountCalendarDays: z.boolean().nullish(),
|
|
||||||
requiresConfirmation: z.boolean(),
|
|
||||||
disableGuests: z.boolean(),
|
|
||||||
minimumBookingNotice: z.number().int(),
|
|
||||||
schedulingType: z.nativeEnum(SchedulingType).nullish(),
|
|
||||||
price: z.number().int(),
|
|
||||||
currency: z.string(),
|
|
||||||
slotInterval: z.number().int().nullish(),
|
|
||||||
metadata: jsonSchema,
|
|
||||||
})
|
|
||||||
|
|
||||||
export interface CompleteEventType extends z.infer<typeof _EventTypeModel> {
|
|
||||||
users: CompleteUser[]
|
|
||||||
team?: CompleteTeam | null
|
|
||||||
bookings: CompleteBooking[]
|
|
||||||
availability: CompleteAvailability[]
|
|
||||||
webhooks: CompleteWebhook[]
|
|
||||||
destinationCalendar?: CompleteDestinationCalendar | null
|
|
||||||
customInputs: CompleteEventTypeCustomInput[]
|
|
||||||
Schedule: CompleteSchedule[]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EventTypeModel contains all relations on your model in addition to the scalars
|
|
||||||
*
|
|
||||||
* NOTE: Lazy required in case of potential circular dependencies within schema
|
|
||||||
*/
|
|
||||||
export const EventTypeModel: z.ZodSchema<CompleteEventType> = z.lazy(() => _EventTypeModel.extend({
|
|
||||||
users: UserModel.array(),
|
|
||||||
team: TeamModel.nullish(),
|
|
||||||
bookings: BookingModel.array(),
|
|
||||||
availability: AvailabilityModel.array(),
|
|
||||||
webhooks: WebhookModel.array(),
|
|
||||||
destinationCalendar: DestinationCalendarModel.nullish(),
|
|
||||||
customInputs: EventTypeCustomInputModel.array(),
|
|
||||||
Schedule: ScheduleModel.array(),
|
|
||||||
}))
|
|
Loading…
Reference in New Issue