3827 client - Add Trigger Form components for form-based workflows#3829
3827 client - Add Trigger Form components for form-based workflows#3829
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds form-based trigger functionality to the ByteChef workflow automation platform. It introduces new components for rendering dynamic forms that can trigger workflows, along with a DateTimePicker component for date/time selection. The feature is controlled by a new feature flag (ff-3827).
Key Changes
- New TriggerForm component that dynamically renders forms based on backend definitions with support for multiple field types (input, textarea, select, radio, checkbox, file upload, date/time pickers, and custom HTML)
- DateTimePicker component for selecting both date and time in a single picker
- Feature flag integration to conditionally show/hide the form trigger option in the workflow editor
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/routes.tsx | Adds two new routes for the trigger form with optional environment parameter |
| client/src/pages/platform/workflow-editor/components/WorkflowNodesPopoverMenuComponentList.tsx | Implements feature flag filtering to conditionally show form trigger component |
| client/src/pages/automation/trigger-form/trigger-form.ts | Defines types and API function for fetching form definitions |
| client/src/pages/automation/trigger-form/TriggerForm.tsx | Main form component with dynamic field rendering and submission logic |
| client/src/pages/automation/project-deployments/components/project-deployment-workflow-list/ProjectDeploymentWorkflowListItem.tsx | Adds UI button to open form trigger workflows, similar to existing chat trigger |
| client/src/main.tsx | Updates public routes to allow unauthenticated access to form and chat pages |
| client/src/components/DateTimePicker/DateTimePicker.tsx | New reusable component for date and time selection |
Comments suppressed due to low confidence (1)
client/src/pages/automation/project-deployments/components/project-deployment-workflow-list/ProjectDeploymentWorkflowListItem.tsx:220
- The environment path mapping logic is duplicated between the form trigger button (lines 185-191) and the chat trigger button (lines 212-220). This same complex ternary expression appears in both places. Extract this into a reusable helper function to avoid code duplication and make future changes easier to maintain.
`/chat/${environmentId === 2 ? '' : environmentId === 1 ? 'staging/' : 'development/'}` +
projectDeploymentWorkflow.staticWebhookUrl?.substring(
projectDeploymentWorkflow.staticWebhookUrl?.lastIndexOf(
'/webhooks/'
) + 10,
projectDeploymentWorkflow.staticWebhookUrl?.length
),
'_blank'
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...eployments/components/project-deployment-workflow-list/ProjectDeploymentWorkflowListItem.tsx
Outdated
Show resolved
Hide resolved
client/src/pages/platform/workflow-editor/components/WorkflowNodesPopoverMenuComponentList.tsx
Show resolved
Hide resolved
|
Kad rješiš komentare od Copilota ponovo zatraži review @ivicac Uzmi u obzir stvari iz prijašnjih review-ova:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 18 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
client/src/pages/automation/trigger-form/components/CustomHTMLFieldRenderer.tsx
Outdated
Show resolved
Hide resolved
client/src/pages/automation/trigger-form/components/HiddenFieldRenderer.tsx
Outdated
Show resolved
Hide resolved
client/src/pages/automation/trigger-form/components/FileInputFieldRenderer.tsx
Outdated
Show resolved
Hide resolved
...eployments/components/project-deployment-workflow-list/ProjectDeploymentWorkflowListItem.tsx
Outdated
Show resolved
Hide resolved
client/src/pages/automation/trigger-form/components/InputFieldRenderer.tsx
Show resolved
Hide resolved
client/src/pages/automation/trigger-form/components/DateTimeFieldRenderer.tsx
Show resolved
Hide resolved
client/src/pages/automation/trigger-form/components/FileInputFieldRenderer.tsx
Show resolved
Hide resolved
client/src/pages/automation/trigger-form/components/SelectFieldRenderer.tsx
Show resolved
Hide resolved
368dcec to
1f30e82
Compare
|


DateTimePickercomponent for selecting date and time