Add Manual Triggers (#8024)

In this PR:

- Add support for manual triggers in the backend
- Add a right drawer to let users select the type of trigger they want
- Create a specific right drawer for database event triggers
- Create a right drawer for manual triggers; let the user select where
the manual trigger should be made available
- Create a default trigger as soon as the user selects the type of
trigger they want. It prevents the user to see empty selects for record
type and event type. By default, the database event trigger will be set
to "company.created". It should be visible enough for users to
understand what happens and choose another record type or event type.



https://github.com/user-attachments/assets/29a21985-1823-4890-9eb3-e4f876459c7a
This commit is contained in:
Baptiste Devessier
2024-10-25 14:24:56 +02:00
committed by GitHub
parent bf2ba25a6e
commit 0144553667
31 changed files with 609 additions and 205 deletions

View File

@ -0,0 +1 @@
export const CREATE_STEP_STEP_ID = 'create-step';

View File

@ -0,0 +1 @@
export const EMPTY_TRIGGER_STEP_ID = 'empty-trigger';

View File

@ -0,0 +1,19 @@
import { WorkflowManualTriggerAvailability } from '@/workflow/types/Workflow';
import { IconCheckbox, IconComponent, IconSquare } from 'twenty-ui';
export const MANUAL_TRIGGER_AVAILABILITY_OPTIONS: Array<{
label: string;
value: WorkflowManualTriggerAvailability;
Icon: IconComponent;
}> = [
{
label: 'When record(s) are selected',
value: 'WHEN_RECORD_SELECTED',
Icon: IconCheckbox,
},
{
label: 'When no record(s) are selected',
value: 'EVERYWHERE',
Icon: IconSquare,
},
];

View File

@ -0,0 +1,19 @@
import { WorkflowTriggerType } from '@/workflow/types/Workflow';
import { IconComponent, IconSettingsAutomation } from 'twenty-ui';
export const TRIGGER_TYPES: Array<{
label: string;
type: WorkflowTriggerType;
icon: IconComponent;
}> = [
{
label: 'Database Event',
type: 'DATABASE_EVENT',
icon: IconSettingsAutomation,
},
{
label: 'Manual',
type: 'MANUAL',
icon: IconSettingsAutomation,
},
];