Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual alignment on workflow canvas #773

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ and this project adheres to
[690](https://github.com/OpenFn/Lightning/issues/690)
- Updated describe-package dependency, fixing sparkles in adaptor-docs
[657](https://github.com/OpenFn/Lightning/issues/657)
- Clicks on the workflow canvas were not lining up with the nodes users clicked
on; they are now [733](https://github.com/OpenFn/Lightning/issues/733)

## [0.5.0] - 2023-04-03

Expand Down
10 changes: 9 additions & 1 deletion assets/js/workflow-diagram/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,20 @@ const WorkflowDiagram = React.forwardRef<
}
}, [ref]);

// TODO: Remove workflow nodes properly in https://github.com/OpenFn/Lightning/issues/316
// Note: this is TD's ugly hack to solve https://github.com/OpenFn/Lightning/issues/733
const nakedNodes = nodes
.filter(node => !(node.type == 'workflow'))
.map(node => {
return { ...node, parentNode: null };
});

return (
<ReactFlowProvider>
<ReactFlow
// Thank you, Christopher Möller, for explaining that we can use this...
proOptions={{ account: 'paid-pro', hideAttribution: true }}
nodes={nodes}
nodes={nakedNodes}
edges={edges}
onNodesChange={onNodesChange}
onEdgesChange={onEdgesChange}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/workflow-diagram/src/nodes/JobNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const JobNode = ({
</div>
</div>
<div
className="flex flex-col items-center opacity-0
className="flex flex-col w-fit mx-auto items-center opacity-0
group-hover:opacity-100 transition duration-150 ease-in-out"
>
<PlusButton />
Expand Down