-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Data Modeling
To allow for Compass to show certain field details in the drawer with the field editing options we need to be able to select one or more fields. This ticket involves adding the handlers to the diagramming package to allow for a user to select one or more fields (when they have cmd held it'll add to the selection). Interface at the bottom and in the tech design.
We'll need to add a selection hook that keeps some state of what's already selected for the multi-select. Only fields from the same collection can be selected together, if it's a new collection, it's a new selection. The `onFieldClick` should fire alongside `onFieldSelectionChange` when clicking a new element.
Here's how react flow does their selection, note there are a few other components involved as well: https://github.com/xyflow/xyflow/blob/main/packages/react/src/components/NodesSelection/index.tsx
Let's add a storybook that shows this behavior as well.
interface DiagramProps {
/* ... Existing props. */
onFieldClick: (
event: ReactMouseEvent,
params:
) => void;
onFieldSelectionChange: (
event: ReactMouseEvent,
params:
) => void;
}