Add Workflow Run show page (#7719)

In this PR:

- Display a workflow version visualizer for the version of the workflow
the run was executed on.
- Display the output of the run as code.


https://github.com/user-attachments/assets/d617300a-bff4-4328-a35c-291dc86d81cf
This commit is contained in:
Baptiste Devessier
2024-10-21 12:04:44 +02:00
committed by GitHub
parent b914182b78
commit e7eeb3b820
12 changed files with 335 additions and 169 deletions

View File

@ -8,6 +8,7 @@ import {
IconMail,
IconNotes,
IconPaperclip,
IconPrinter,
IconSettings,
IconTimelineEvent,
} from 'twenty-ui';
@ -26,6 +27,10 @@ export const useRecordShowContainerTabs = (
const isWorkflowVersion =
isWorkflowEnabled &&
targetObjectNameSingular === CoreObjectNameSingular.WorkflowVersion;
const isWorkflowRun =
isWorkflowEnabled &&
targetObjectNameSingular === CoreObjectNameSingular.WorkflowRun;
const isWorkflowRelated = isWorkflow || isWorkflowVersion || isWorkflowRun;
const isCompanyOrPerson = [
CoreObjectNameSingular.Company,
@ -54,7 +59,7 @@ export const useRecordShowContainerTabs = (
id: 'timeline',
title: 'Timeline',
Icon: IconTimelineEvent,
hide: isInRightDrawer || isWorkflow || isWorkflowVersion,
hide: isInRightDrawer || isWorkflowRelated,
},
{
id: 'tasks',
@ -63,8 +68,7 @@ export const useRecordShowContainerTabs = (
hide:
targetObjectNameSingular === CoreObjectNameSingular.Note ||
targetObjectNameSingular === CoreObjectNameSingular.Task ||
isWorkflow ||
isWorkflowVersion,
isWorkflowRelated,
},
{
id: 'notes',
@ -73,14 +77,13 @@ export const useRecordShowContainerTabs = (
hide:
targetObjectNameSingular === CoreObjectNameSingular.Note ||
targetObjectNameSingular === CoreObjectNameSingular.Task ||
isWorkflow ||
isWorkflowVersion,
isWorkflowRelated,
},
{
id: 'files',
title: 'Files',
Icon: IconPaperclip,
hide: isWorkflow || isWorkflowVersion,
hide: isWorkflowRelated,
},
{
id: 'emails',
@ -102,9 +105,21 @@ export const useRecordShowContainerTabs = (
},
{
id: 'workflowVersion',
title: 'Workflow Version',
title: 'Flow',
Icon: IconSettings,
hide: !isWorkflowVersion,
},
{
id: 'workflowRunOutput',
title: 'Output',
Icon: IconPrinter,
hide: !isWorkflowRun,
},
{
id: 'workflowRunFlow',
title: 'Flow',
Icon: IconSettings,
hide: !isWorkflowRun,
},
];
};