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

Topology: Refactor types and operations #5010

Conversation

jeff-phillips-18
Copy link
Member

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:

  • Chrome
  • Firefox
  • Safari
  • Edge

/kind cleanup

@openshift-ci-robot openshift-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. component/dev-console Related to dev-console labels Apr 10, 2020
@openshift-ci-robot openshift-ci-robot added the component/knative Related to knative-plugin label Apr 10, 2020
@jeff-phillips-18 jeff-phillips-18 changed the title Refactor types operations Topology: Refactor types and operations Apr 10, 2020
@@ -179,7 +180,7 @@ export class DndManagerImpl implements DndManager {

beginDrag(
sourceIds: string | string[],
operation: string,
operation: DragOperationWithType,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
operation: DragOperationWithType,
operation: DragOperationWithType | undefined,

): boolean => {
return !!(
operation &&
(typeof (operation as any).type === 'string' || Object.keys(operation).length > 0)
Copy link
Contributor

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.

Suggested change
(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,
Copy link
Contributor

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:

Suggested change
GraphElement | DragNodeObject,
DragNodeObject,

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 15, 2020
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 15, 2020
@openshift-merge-robot openshift-merge-robot merged commit 3f62d49 into openshift:master Apr 16, 2020
@spadgett spadgett added this to the v4.5 milestone Apr 16, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the refactor-types-operations branch December 2, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/dev-console Related to dev-console component/knative Related to knative-plugin kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants