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
Topology: Refactor types and operations #5010
Topology: Refactor types and operations #5010
Conversation
@@ -179,7 +180,7 @@ export class DndManagerImpl implements DndManager { | |||
|
|||
beginDrag( | |||
sourceIds: string | string[], | |||
operation: string, | |||
operation: DragOperationWithType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
operation: DragOperationWithType, | |
operation: DragOperationWithType | undefined, |
): boolean => { | ||
return !!( | ||
operation && | ||
(typeof (operation as any).type === 'string' || Object.keys(operation).length > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a proper type? Or a guard type function.
(typeof (operation as any).type === 'string' || Object.keys(operation).length > 0) | |
(typeof (operation as DragOperationWithType).type === 'string' || Object.keys(operation).length > 0) |
const graphWorkloadDropTargetSpec: DropTargetSpec< | ||
GraphElement, | ||
const graphDropTargetSpec: DropTargetSpec< | ||
GraphElement | DragNodeObject, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this was incorrectly typed before. Can we not make it:
GraphElement | DragNodeObject, | |
DragNodeObject, |
1ddf5f8
to
e22f15d
Compare
e22f15d
to
77ff234
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, jeff-phillips-18 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes:
https://issues.redhat.com/browse/ODC-3167
Analysis / Root cause:
The current topology drag/drop feature requires components to understand what is being dragged and what items are allowed based on the operation and item type.
Solution Description:
Update drag types to include information about the object being dragged rather than depending on a specific type of drag object.
Update the drag operation to include information about the operation rather than depending on specific drag operation types.
Screen shots / Gifs for design review:
No visual changes
Browser conformance:
/kind cleanup