* feat(db): add new col: user appTheme * feat(event-types page): apply appTheme color * add appTheme for trpc * feat: mutate main page theme * feat: add english translation for app theme update section * modify keys in common (en) * add woring * Revert yarn.lock to its state before unintended changes * feat(i18n): add back the i18n string (for dark/light mode switching) * refactor: refactor ThemeLabel * fix: add new user field "appTheme" to test files * chore: modify TODO comment * chore: update common.json (en) for "theme" since we had appTheme now, I think it's better to update the wording here to avoid confusion * fix: update button's data-testid to fix e2e test error * chore: remove comment * fix: fix brand-color-not-apply bug * solve type error * fix: fix type error * fix: use correct storageKey for booker / dashboard * fix: tidy up * fix: skeleton --------- Co-authored-by: swh00tw <a6140000@gmail.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Keith Williams <keithwillcode@gmail.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Udit Takkar <udit222001@gmail.com>
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { z } from "zod";
|
|
|
|
import { FULL_NAME_LENGTH_MAX_LIMIT } from "@calcom/lib/constants";
|
|
import { bookerLayouts, userMetadata } from "@calcom/prisma/zod-utils";
|
|
|
|
export const updateUserMetadataAllowedKeys = z.object({
|
|
sessionTimeout: z.number().optional(), // Minutes
|
|
defaultBookerLayouts: bookerLayouts.optional(),
|
|
});
|
|
|
|
export const ZUpdateProfileInputSchema = z.object({
|
|
username: z.string().optional(),
|
|
name: z.string().max(FULL_NAME_LENGTH_MAX_LIMIT).optional(),
|
|
email: z.string().optional(),
|
|
bio: z.string().optional(),
|
|
avatar: z.string().nullable().optional(),
|
|
timeZone: z.string().optional(),
|
|
weekStart: z.string().optional(),
|
|
hideBranding: z.boolean().optional(),
|
|
allowDynamicBooking: z.boolean().optional(),
|
|
allowSEOIndexing: z.boolean().optional(),
|
|
receiveMonthlyDigestEmail: z.boolean().optional(),
|
|
brandColor: z.string().optional(),
|
|
darkBrandColor: z.string().optional(),
|
|
theme: z.string().optional().nullable(),
|
|
appTheme: z.string().optional().nullable(),
|
|
completedOnboarding: z.boolean().optional(),
|
|
locale: z.string().optional(),
|
|
timeFormat: z.number().optional(),
|
|
disableImpersonation: z.boolean().optional(),
|
|
metadata: userMetadata.optional(),
|
|
});
|
|
|
|
export type TUpdateProfileInputSchema = z.infer<typeof ZUpdateProfileInputSchema>;
|