Add Record Create action in the frontend (#8514)
In this PR: - Updated the front-end types for workflows to include CRUD actions and global naming changes - Allow users to create a Record Create action - Scaffold the edit for Record Create action; for now, I render a `<VariableTagInput />` component for every editable field; it's likely we'll change it soon Closes https://github.com/twentyhq/private-issues/issues/142 Demo: https://github.com/user-attachments/assets/6f0b207a-b7d2-46d9-b5ab-9e32bde55d76
This commit is contained in:
committed by
GitHub
parent
316537a68a
commit
c17e18b1e9
@ -1,3 +1,4 @@
|
||||
import { WorkflowEditActionFormRecordCreate } from '@/workflow/components/WorkflowEditActionFormRecordCreate';
|
||||
import { WorkflowEditActionFormSendEmail } from '@/workflow/components/WorkflowEditActionFormSendEmail';
|
||||
import { WorkflowEditActionFormServerlessFunction } from '@/workflow/components/WorkflowEditActionFormServerlessFunction';
|
||||
import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/components/WorkflowEditTriggerDatabaseEventForm';
|
||||
@ -9,6 +10,7 @@ import {
|
||||
} from '@/workflow/types/Workflow';
|
||||
import { assertUnreachable } from '@/workflow/utils/assertUnreachable';
|
||||
import { getStepDefinitionOrThrow } from '@/workflow/utils/getStepDefinitionOrThrow';
|
||||
import { isWorkflowRecordCreateAction } from '@/workflow/utils/isWorkflowRecordCreateAction';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
|
||||
type WorkflowStepDetailProps =
|
||||
@ -53,8 +55,7 @@ export const WorkflowStepDetail = ({
|
||||
return (
|
||||
<WorkflowEditTriggerDatabaseEventForm
|
||||
trigger={stepDefinition.definition}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
triggerOptions={props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -62,8 +63,7 @@ export const WorkflowStepDetail = ({
|
||||
return (
|
||||
<WorkflowEditTriggerManualForm
|
||||
trigger={stepDefinition.definition}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
triggerOptions={props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -80,8 +80,7 @@ export const WorkflowStepDetail = ({
|
||||
return (
|
||||
<WorkflowEditActionFormServerlessFunction
|
||||
action={stepDefinition.definition}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
actionOptions={props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -89,11 +88,22 @@ export const WorkflowStepDetail = ({
|
||||
return (
|
||||
<WorkflowEditActionFormSendEmail
|
||||
action={stepDefinition.definition}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
actionOptions={props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
case 'RECORD_CRUD': {
|
||||
if (isWorkflowRecordCreateAction(stepDefinition.definition)) {
|
||||
return (
|
||||
<WorkflowEditActionFormRecordCreate
|
||||
action={stepDefinition.definition}
|
||||
actionOptions={props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return assertUnreachable(
|
||||
|
||||
Reference in New Issue
Block a user