Bring back raw workflow run output visualizer (#10294)
[My last PR](https://github.com/twentyhq/twenty/pull/10146#issuecomment-2665863910), which introduced the workflow run visualizer, made it impossible to debug an execution as it's not complete yet. In this PR, I'm bringing back the raw output visualizer and hiding the flow visualizer as it's been broken by the recent change to the output format.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { useWorkflowRun } from '@/workflow/hooks/useWorkflowRun';
|
||||
import styled from '@emotion/styled';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
import { CodeEditor } from 'twenty-ui';
|
||||
|
||||
const StyledSourceCodeContainer = styled.div`
|
||||
margin: ${({ theme }) => theme.spacing(4)};
|
||||
`;
|
||||
|
||||
export const WorkflowRunOutputVisualizer = ({
|
||||
workflowRunId,
|
||||
}: {
|
||||
workflowRunId: string;
|
||||
}) => {
|
||||
const workflowRun = useWorkflowRun({ workflowRunId });
|
||||
if (!isDefined(workflowRun)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<StyledSourceCodeContainer>
|
||||
<CodeEditor
|
||||
value={JSON.stringify(workflowRun.output, null, 2)}
|
||||
language="json"
|
||||
options={{ readOnly: true, domReadOnly: true }}
|
||||
/>
|
||||
</StyledSourceCodeContainer>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user