Skip to content

Commit b3fca53

Browse files
committed
refactor form input fields
1 parent 354fd79 commit b3fca53

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

packages/frontend/src/pages/AiBuilder/components/AIFormModalContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export const AIFormModalContent = ({
7676
resize={field.resize}
7777
minH={field.minH}
7878
maxH={field.maxH}
79+
required={field.required}
7980
/>
8081
{errors[field.key] && (
8182
<FormErrorMessage>

packages/frontend/src/pages/AiBuilder/schema.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ import z from 'zod'
22

33
export const AI_FORM_SCHEMA = z.object({
44
flowName: z.string().trim().min(1, 'Flow name is required'),
5-
trigger: z
6-
.string()
7-
.trim()
8-
.min(15, 'Description must be at least 15 characters')
9-
.max(250, 'Description must not exceed 250 characters'),
5+
trigger: z.string().trim(),
106
actions: z
117
.string()
128
.trim()

packages/frontend/src/pages/Flows/constants.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
export const AI_FORM_FIELDS = [
2-
{
3-
key: 'trigger' as const,
4-
label: 'How does your workflow start?',
5-
placeholder: 'When a new joiner submits a form with their details',
6-
resize: 'none' as const,
7-
},
82
{
93
key: 'actions' as const,
10-
label: 'Describe what happens next step-by-step',
4+
label: 'What should this workflow accomplish?',
115
placeholder:
12-
'Add this new joiner to the database\nSend the new joiner a welcome email\nInform respective team that there is a new joiner',
6+
'This workflow should help me to collect attendance for my event.',
7+
required: true,
138
resize: 'vertical' as const,
149
minH: '100px',
1510
maxH: '200px',
1611
},
12+
{
13+
key: 'trigger' as const,
14+
label: 'Where does your data come from?',
15+
placeholder: 'When a new joiner submits a form with their details',
16+
required: true,
17+
resize: 'vertical' as const,
18+
minH: '42px',
19+
maxH: '126px',
20+
},
1721
]
1822

1923
export const AI_FORM_IDEAS = [

0 commit comments

Comments
 (0)