diff --git a/apps/web/src/pages/workflows/[id].tsx b/apps/web/src/pages/workflows/[id].tsx index 14b2f957..4288b89a 100644 --- a/apps/web/src/pages/workflows/[id].tsx +++ b/apps/web/src/pages/workflows/[id].tsx @@ -26,6 +26,10 @@ import { SelectItemWithDescription, SelectTrigger, SelectValue, + Command, + CommandGroup, + CommandItem, + CommandList, Switch, } from '@plunk/ui'; import type {Template, Workflow, WorkflowExecution, WorkflowStep, WorkflowTransition} from '@plunk/db'; @@ -793,6 +797,7 @@ function SettingsDialog({workflow, open, onOpenChange, onSave}: SettingsDialogPr const [description, setDescription] = useState(workflow.description ?? ''); const [allowReentry, setAllowReentry] = useState(workflow.allowReentry ?? false); const [eventName, setEventName] = useState(triggerConfig?.eventName ?? ''); + const [eventPopoverOpen, setEventPopoverOpen] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false); // Sync state when workflow changes or dialog opens @@ -852,29 +857,50 @@ function SettingsDialog({workflow, open, onOpenChange, onSave}: SettingsDialogPr
The event that triggers this workflow to start for a contact
@@ -961,6 +987,7 @@ function AddStepDialog({open, onOpenChange, workflowId, onSuccess}: AddStepDialo // WAIT_FOR_EVENT fields const [eventName, setEventName] = useState(''); + const [eventPopoverOpen, setEventPopoverOpen] = useState(false); const [eventTimeoutAmount, setEventTimeoutAmount] = useState('1'); const [eventTimeoutUnit, setEventTimeoutUnit] = useState<'minutes' | 'hours' | 'days'>('days'); @@ -1611,34 +1638,53 @@ function AddStepDialog({open, onOpenChange, workflowId, onSuccess}: AddStepDialo - {eventNamesData?.eventNames && eventNamesData.eventNames.length > 0 ? ( - - ) : ( +- {eventNamesData?.eventNames && eventNamesData.eventNames.length > 0 - ? 'The workflow will pause until this event occurs' - : 'Enter the event name to wait for'} + Enter the event name to wait for, or select from previously tracked events
- Select from previously tracked events in your project -
- > - ) : ( - <> - setEventName(e.target.value)} - required - placeholder="e.g., email.clicked, user.upgraded" - className="mt-1.5" - /> -- The workflow will pause until this event is triggered by the contact -
- > - )} ++ Enter the event name to wait for, or select from previously tracked events +
- {eventNamesData?.eventNames && eventNamesData.eventNames.length > 0 - ? 'Select from previously tracked events' - : 'No events tracked yet. Enter the event name that will trigger this workflow.'} + The event that triggers this workflow to start for a contact