Update workflow nodes configuration (#6861)
- Improve the design of the right drawer - Allow to update the trigger of the workflow: the object and the event listened to - Allow to update the selected serverless function that a code action should execute - Change how we determine which workflow version to display in the visualizer. We fetch the selected workflow's data, including whether it has a draft or a published version. If the workflow has a draft version, it gets displayed; otherwise, we display the last published version. - I used the type `WorkflowWithCurrentVersion` to forward the currently edited workflow with its _current_ version embedded across the app. - I created single-responsibility hooks like `useFindWorkflowWithCurrentVersion`, `useFindShowPageWorkflow`, `useUpdateWorkflowVersionTrigger` or `useUpdateWorkflowVersionStep`. - I updated the types for workflow related objects, like `Workflow` and `WorkflowVersion`. See `packages/twenty-front/src/modules/workflow/types/Workflow.ts`. - This introduced the possibility to have `null` values for triggers and steps. I made the according changes in the codebase and in the tests. - I created a utility function to extract both parts of object-event format (`company.created`): `packages/twenty-front/src/modules/workflow/utils/splitWorkflowTriggerEventName.ts`
This commit is contained in:
committed by
GitHub
parent
c55dfbde6e
commit
a2b1062db6
@ -1,8 +0,0 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const showPageWorkflowDiagramTriggerNodeSelectionState = createState<
|
||||
string | undefined
|
||||
>({
|
||||
key: 'showPageWorkflowDiagramTriggerNodeSelectionState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
@ -1,7 +0,0 @@
|
||||
import { ApolloError } from '@apollo/client';
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const showPageWorkflowErrorState = createState<ApolloError | undefined>({
|
||||
key: 'showPageWorkflowErrorState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const showPageWorkflowIdState = createState<string | undefined>({
|
||||
key: 'showPageWorkflowIdState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const showPageWorkflowLoadingState = createState<boolean>({
|
||||
key: 'showPageWorkflowLoadingState',
|
||||
defaultValue: true,
|
||||
});
|
||||
@ -1,8 +0,0 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const showPageWorkflowSelectedNodeState = createState<
|
||||
string | undefined
|
||||
>({
|
||||
key: 'showPageWorkflowSelectedNodeState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
@ -1,9 +1,7 @@
|
||||
import { WorkflowDiagram } from '@/workflow/types/WorkflowDiagram';
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const showPageWorkflowDiagramState = createState<
|
||||
WorkflowDiagram | undefined
|
||||
>({
|
||||
key: 'showPageWorkflowDiagramState',
|
||||
export const workflowDiagramState = createState<WorkflowDiagram | undefined>({
|
||||
key: 'workflowDiagramState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const workflowDiagramTriggerNodeSelectionState = createState<
|
||||
string | undefined
|
||||
>({
|
||||
key: 'workflowDiagramTriggerNodeSelectionState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const workflowIdState = createState<string | undefined>({
|
||||
key: 'workflowIdState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
|
||||
export const workflowSelectedNodeState = createState<string | undefined>({
|
||||
key: 'workflowSelectedNodeState',
|
||||
defaultValue: undefined,
|
||||
});
|
||||
Reference in New Issue
Block a user