forked from twentyhq/twenty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display workflow visualizer on show page (twentyhq#6894)
- Removed the route I previously used to visualize workflows - Created another tab in the `<ShowPageRightContainer />` component in which we display the visualizer Questions: - Should I use a feature flag to hide the feature? Closes twentyhq#6858
- Loading branch information
Showing
7 changed files
with
71 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/twenty-front/src/modules/workflow/components/Workflow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity'; | ||
import { WorkflowDiagramCanvas } from '@/workflow/components/WorkflowDiagramCanvas'; | ||
import { WorkflowShowPageEffect } from '@/workflow/components/WorkflowShowPageEffect'; | ||
import { workflowDiagramState } from '@/workflow/states/workflowDiagramState'; | ||
import styled from '@emotion/styled'; | ||
import '@xyflow/react/dist/style.css'; | ||
import { useRecoilValue } from 'recoil'; | ||
|
||
const StyledFlowContainer = styled.div` | ||
height: 100%; | ||
width: 100%; | ||
/* Below we reset the default styling of Reactflow */ | ||
.react-flow__node-input, | ||
.react-flow__node-default, | ||
.react-flow__node-output, | ||
.react-flow__node-group { | ||
padding: 0; | ||
} | ||
--xy-node-border-radius: none; | ||
--xy-node-border: none; | ||
--xy-node-background-color: none; | ||
--xy-node-boxshadow-hover: none; | ||
--xy-node-boxshadow-selected: none; | ||
`; | ||
|
||
export const Workflow = ({ | ||
targetableObject, | ||
}: { | ||
targetableObject: ActivityTargetableObject; | ||
}) => { | ||
const workflowId = targetableObject.id; | ||
|
||
const workflowDiagram = useRecoilValue(workflowDiagramState); | ||
|
||
return ( | ||
<> | ||
<WorkflowShowPageEffect workflowId={workflowId} /> | ||
|
||
<StyledFlowContainer> | ||
{workflowDiagram === undefined ? null : ( | ||
<WorkflowDiagramCanvas diagram={workflowDiagram} /> | ||
)} | ||
</StyledFlowContainer> | ||
</> | ||
); | ||
}; |
64 changes: 0 additions & 64 deletions
64
packages/twenty-front/src/pages/workflows/WorkflowShowPage.tsx
This file was deleted.
Oops, something went wrong.