✨ feat(form): Make version field optional and set default value; update site domain placeholder for clarity
This commit is contained in:
parent
4a002333d4
commit
42ba9e88ad
@ -50,7 +50,7 @@ const defaultValues = {
|
|||||||
|
|
||||||
const versionSchema = z.object({
|
const versionSchema = z.object({
|
||||||
url: z.string(),
|
url: z.string(),
|
||||||
version: z.string(),
|
version: z.string().optional(),
|
||||||
description: z.string().optional(),
|
description: z.string().optional(),
|
||||||
is_default: z.boolean().optional(),
|
is_default: z.boolean().optional(),
|
||||||
});
|
});
|
||||||
@ -221,6 +221,7 @@ export default function SubscribeAppForm<
|
|||||||
name: 'version',
|
name: 'version',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
placeholder: t('version'),
|
placeholder: t('version'),
|
||||||
|
defaultValue: '1.0.0',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'description',
|
name: 'description',
|
||||||
@ -251,7 +252,10 @@ export default function SubscribeAppForm<
|
|||||||
]}
|
]}
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
form.setValue(field.name, value);
|
form.setValue(
|
||||||
|
field.name,
|
||||||
|
value.filter((item) => item.url),
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|||||||
@ -122,7 +122,7 @@ export default function Site() {
|
|||||||
<TableCell className='text-right'>
|
<TableCell className='text-right'>
|
||||||
<Textarea
|
<Textarea
|
||||||
className='h-52'
|
className='h-52'
|
||||||
placeholder={t('siteDomainPlaceholder')}
|
placeholder={`${t('siteDomainPlaceholder')}\nexample.com\nwww.example.com`}
|
||||||
defaultValue={data?.host}
|
defaultValue={data?.host}
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
updateConfig('host', e.target.value);
|
updateConfig('host', e.target.value);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user