## Improvements - This PR calls `fitView` when the Reactflow component inits. It tries to fit the flow in a view with a fixed min and max zoom. - Every time the WorkflowDiagramCanvas is rendered for a different `workflowVersionId`, the `fitView` will be re-called. This is implemented with a React `key`. - The canvas will be re-rendered when an activated/deactivated version is updated (and a new draft version is created.) - It will also be re-rendered when the user selects another workflow version and this doesn't cause the `WorkflowDiagramCanvas` component to unmount. It happens if the user wants to go the previous or next workflow or workflow version. ## Previous Behavior  ## New Behavior  https://github.com/user-attachments/assets/cb73f456-58b1-49c3-bd31-a1650810e9dd ## Notes Closes #7047 This PR is a simplification of #7151. We'll have to improve the way we manage zoom in another PR.
19 lines
478 B
TypeScript
19 lines
478 B
TypeScript
import { IconButton } from '@/ui/input/button/components/IconButton';
|
|
import styled from '@emotion/styled';
|
|
import { Handle, Position } from '@xyflow/react';
|
|
import { IconPlus } from 'twenty-ui';
|
|
|
|
export const StyledTargetHandle = styled(Handle)`
|
|
visibility: hidden;
|
|
`;
|
|
|
|
export const WorkflowDiagramCreateStepNode = () => {
|
|
return (
|
|
<>
|
|
<StyledTargetHandle type="target" position={Position.Top} />
|
|
|
|
<IconButton Icon={IconPlus} size="small" />
|
|
</>
|
|
);
|
|
};
|