feat: pick select field option colors (#2748)

Closes #2433

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Thaïs
2023-11-29 12:49:41 +01:00
committed by GitHub
parent aa4bd0146b
commit 3617abb0e6
14 changed files with 186 additions and 97 deletions

View File

@ -2,7 +2,7 @@ import { useState } from 'react';
import { DeepPartial } from 'react-hook-form';
import { z } from 'zod';
import { mainColors, ThemeColor } from '@/ui/theme/constants/colors';
import { themeColorSchema } from '@/ui/theme/utils/themeColorSchema';
import {
FieldMetadataType,
RelationMetadataType,
@ -59,9 +59,7 @@ const selectSchema = fieldSchema.merge(
select: z
.array(
z.object({
color: z.enum(
Object.keys(mainColors) as [ThemeColor, ...ThemeColor[]],
),
color: themeColorSchema,
isDefault: z.boolean().optional(),
label: z.string().min(1),
}),