mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-11 05:20:57 +00:00
refactor(web): make description optional and remove default values for bot, pipeline, and knowledge base
- Remove .min(1) validation on description field, replace with .optional().default('')
- Remove pre-filled default description text from all three create forms
- Remove required asterisk (*) marker from description labels
- No backend changes needed: Bot/Pipeline DB accepts empty string, KB DB allows null
This commit is contained in:
@@ -80,9 +80,7 @@ export default function PipelineFormComponent({
|
||||
? z.object({
|
||||
basic: z.object({
|
||||
name: z.string().min(1, { message: t('pipelines.nameRequired') }),
|
||||
description: z
|
||||
.string()
|
||||
.min(1, { message: t('pipelines.descriptionRequired') }),
|
||||
description: z.string().optional().default(''),
|
||||
emoji: z.string().optional(),
|
||||
}),
|
||||
ai: z.record(z.string(), z.any()),
|
||||
@@ -93,9 +91,7 @@ export default function PipelineFormComponent({
|
||||
: z.object({
|
||||
basic: z.object({
|
||||
name: z.string().min(1, { message: t('pipelines.nameRequired') }),
|
||||
description: z
|
||||
.string()
|
||||
.min(1, { message: t('pipelines.descriptionRequired') }),
|
||||
description: z.string().optional().default(''),
|
||||
emoji: z.string().optional(),
|
||||
}),
|
||||
ai: z.record(z.string(), z.any()).optional(),
|
||||
@@ -563,10 +559,7 @@ export default function PipelineFormComponent({
|
||||
name="basic.description"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t('common.description')}
|
||||
<span className="text-destructive">*</span>
|
||||
</FormLabel>
|
||||
<FormLabel>{t('common.description')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
|
||||
Reference in New Issue
Block a user