Add record picker with variables (#8813)

- Add update actions
- Create a folder for workflow actions
- Add a SingleRecordPicker with variables handler



https://github.com/user-attachments/assets/9fd57ce1-1b8d-424a-8aa1-69468d684fa1
This commit is contained in:
Thomas Trompette
2024-11-29 20:33:45 +01:00
committed by GitHub
parent 29eb9fe77b
commit b542b43878
12 changed files with 563 additions and 49 deletions
@@ -3,6 +3,18 @@ import { WorkflowStep, WorkflowStepType } from '@/workflow/types/Workflow';
import { assertUnreachable } from '@/workflow/utils/assertUnreachable';
import { v4 } from 'uuid';
const BASE_DEFAULT_STEP_SETTINGS = {
outputSchema: {},
errorHandlingOptions: {
continueOnFailure: {
value: false,
},
retryOnFailure: {
value: false,
},
},
};
export const getStepDefaultDefinition = ({
type,
activeObjectMetadataItems,
@@ -25,15 +37,7 @@ export const getStepDefaultDefinition = ({
serverlessFunctionVersion: '',
serverlessFunctionInput: {},
},
outputSchema: {},
errorHandlingOptions: {
continueOnFailure: {
value: false,
},
retryOnFailure: {
value: false,
},
},
...BASE_DEFAULT_STEP_SETTINGS,
},
};
}
@@ -50,15 +54,7 @@ export const getStepDefaultDefinition = ({
subject: '',
body: '',
},
outputSchema: {},
errorHandlingOptions: {
continueOnFailure: {
value: false,
},
retryOnFailure: {
value: false,
},
},
...BASE_DEFAULT_STEP_SETTINGS,
},
};
}
@@ -74,20 +70,27 @@ export const getStepDefaultDefinition = ({
objectName: activeObjectMetadataItems[0].nameSingular,
objectRecord: {},
},
outputSchema: {},
errorHandlingOptions: {
continueOnFailure: {
value: false,
},
retryOnFailure: {
value: false,
},
},
...BASE_DEFAULT_STEP_SETTINGS,
},
};
}
case 'RECORD_CRUD.DELETE':
case 'RECORD_CRUD.UPDATE': {
case 'RECORD_CRUD.UPDATE':
return {
id: newStepId,
name: 'Update Record',
type: 'RECORD_CRUD',
valid: false,
settings: {
input: {
type: 'UPDATE',
objectName: activeObjectMetadataItems[0].nameSingular,
objectRecordId: '',
objectRecord: {},
},
...BASE_DEFAULT_STEP_SETTINGS,
},
};
case 'RECORD_CRUD.DELETE': {
throw new Error('Not implemented yet');
}
default: {