Skip to content

Workspace Refactoring - #7937

Merged
ikeough merged 10 commits into
DynamoDS:masterfrom
ikeough:QNTM-687
Jun 12, 2017
Merged

ikeough merged 10 commits into
DynamoDS:masterfrom
ikeough:QNTM-687

Conversation

@ikeough

@ikeough ikeough commented Jun 7, 2017 •

Copy link
Copy Markdown
Contributor

Purpose

This PR moves graph layout, presets, and node to code out to separate extensions classes. It moves the undo recorder to separate .cs files, but keeps it as a partial class of WorkspaceModel.

It also moves and renames the json serialization methods recently added by @QilongTang to core. These are now the static method WorkspaceModel.FromJson(...) and the extension method myWorkspace.ToJson(...).

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 n/a
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any. n/a
  • Changes to the API follow Semantic Versioning, and are documented in the API Changes document.

Reviewers

@QilongTang

@mjkkirschner

Copy link
Copy Markdown
Member

@ikeough do you have access to the self service CI EC job?

private bool isVisibleInDynamoLibrary;

protected override void RequestRun()
internal override void RequestRun()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

whats the need for this change?

@ikeough ikeough Jun 7, 2017 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was upgraded to internal in the base class as well, as it's called from the NodeToCodeExtensions.

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aha, apparently your sorting plugin decides to put system usings after Dynamo usings which is default for most plugins. Either way is acceptable among developers, but just hope that we specify that in the coding standard.

/// </summary>
/// <returns>A string representing the serialized WorkspaceModel.</returns>
public static string SaveWorkspaceToJson(WorkspaceModel workspace, LibraryServices libraryServices,
public static string ToJson(this WorkspaceModel workspace, LibraryServices libraryServices,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Neat

@QilongTang

Copy link
Copy Markdown
Contributor

@ikeough LGTM. I appreciate the fact your are making toJson and fromJson part of workspaceModel in this PR as I was planning to log a tech_debt on this refactoring. I do have sessionTraceData serialization changes in my branch depending on this PR. So :shipit: and I shall re-work the changes based on the new signatures.

@QilongTang QilongTang added the LGTM label Jun 8, 2017
@mjkkirschner

Copy link
Copy Markdown
Member

@ikeough I saw one failing test on your run last night on the CI, was that fixed?

@ikeough

ikeough commented Jun 8, 2017

Copy link
Copy Markdown
Contributor Author

@mjkkirschner I haven't fixed that test yet. Will do so before merging.

@ikeough

ikeough commented Jun 12, 2017

Copy link
Copy Markdown
Contributor Author

I am leaving the one failing test DynamoCoreWpfTests.RecordedTestsDSEngine.Defect_MAGN_904 outstanding as it has been verified to predate this work.

@ikeough
ikeough merged commit 848e1f6 into DynamoDS:master Jun 12, 2017
@ikeough
ikeough deleted the QNTM-687 branch June 12, 2017 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants