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

Selective shift + click output connections grabs connectors for selected nodes only #9585

Merged
merged 3 commits into from
Mar 19, 2019

Conversation

alfarok
Copy link
Contributor

@alfarok alfarok commented Mar 18, 2019

Purpose

selective_shift_click_outport

This PR pulls in the work originally completed by @yeexinc in #7900 and adds several tests that leverage recorded commands. The recorded tests verify the proper connectors are grabbed when a shift+click operation occurs. Only selected downstream nodes that are connected to the given output port will be removed upon shift+clicking. Testing coverage also verifies the graph remains in a known state after several undo/redo commands are conducted after using selective shift-click operations. The last test performs a large series of shift+clicks and ctrl+clicks with and without selected nodes to test these commands in successive combinations verifying the graph's final state produce a specific numeric combination. All tests pass on the self-serve CI.

Declarations

Check these if you believe they are true

  • The code base is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning, and are documented in the API Changes document.

Reviewers

@mjkkirschner @QilongTang

@alfarok
Copy link
Contributor Author

alfarok commented Mar 18, 2019

All tests passing on the self-serve. It originally showed 3 failing tests but that was because #9580 was not pulled into this branch. After pulling in the latest additions from master I verified these do pass with the fix.

@alfarok alfarok mentioned this pull request Mar 18, 2019
7 tasks
@QilongTang
Copy link
Contributor

QilongTang commented Mar 18, 2019

one comment thne LGTM, thank you for all the detailed comments

if (numOfConnectors == 0) return;

activeStartPorts = new PortModel[numOfConnectors];

for (int i = 0; i < numOfConnectors; i++)
{
ConnectorModel connector = selectedPort.Connectors[i];
ConnectorModel connector = selectedConnectors[i];
connectorsForDeletion.Add(connector);
Copy link
Contributor

Choose a reason for hiding this comment

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

connectorsForDeletion seems a dup to me after the refactor? What do you think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's still required as removing it will break undo/redo. Below we call CurrentWorkspace.SaveAndDeleteModels(connectorsForDeletion) where SaveAndDeleteModels() is a method in UndoRedo.cs which is a partial class of the WorkspaceModel. Several new and old recorded tests break as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand before the refactor it is required, but after the refactor, it contains exactly all the connectors in selectedConnectors.
Can we call code below to preserve the undo/redo behavior?

CurrentWorkspace.SaveAndDeleteModels(selectedConnectors);

Copy link
Contributor Author

@alfarok alfarok Mar 19, 2019

Choose a reason for hiding this comment

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

I think we can do this:

CurrentWorkspace.SaveAndDeleteModels(selectedConnectors.ToList<ModelBase>());

Since connectorsForDeletion = List<ModelBase> while selectedConnectors = List<ConnectorModel> and ConnectorModel is derived from ModelBase

@QilongTang
Copy link
Contributor

LGTM to me now. Thank you for addressing the comment

@alfarok alfarok added the LGTM Looks good to me label Mar 19, 2019
@alfarok alfarok merged commit d442504 into DynamoDS:master Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM Looks good to me
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants