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

DYN-6653 Create new workspace based on Templates - Part II #14982

Merged
merged 11 commits into from
Mar 20, 2024

Conversation

zeusongit
Copy link
Contributor

@zeusongit zeusongit commented Feb 27, 2024

Purpose

ToDo:

  • Opening a template then save should not save to template path
  • Short cut key combo Ctrl + T does not work yet (changed to Ctrl+Shift+O as per VS standards for open menu)
  • Unit tests

Screenshot 2024-02-27 at 11 51 42 AM

This PR:

  • adds a new hotkey to open templates: Ctrl+Shift+O (FYI @Amoursol, Ctrl+T has a conflict)

  • adds the template location as a preference setting, can be updated or reset by the user.
    DynamoSandbox_Xn66Ld9N1S

  • When saving a file opened from template the save dialog will be pointed to the last accessed location by the user that is not the templates directory, if null, will be redirected to Desktop.
    (In the screen capture below, the template is opened on first use, some changes are made and while saving the last accessed location was null, so Desktop was the default location)
    DynamoSandbox_3c1USuuWUx

  • When opening a graph after opening a template, the open dialog will

    • open the file dialog at the current file's directory, if saved
    • else, open the samples directory, if available
    • else , open the last accessed path (or desktop, if it was the templates directory)

(In the screen capture below, a file is opened from a random location, then a template is opened, after some changes while saving the template, the last accessed location is opened by default, not the template directory)
DynamoSandbox_a8prr3crz9

Declarations

Check these if you believe they are true

  • The codebase 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.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

  • Create new workspace based on Templates - Part II

Reviewers

@DynamoDS/dynamo

@zeusongit zeusongit added the WIP label Feb 27, 2024
@zeusongit zeusongit marked this pull request as ready for review February 28, 2024 00:02
@zeusongit zeusongit removed the WIP label Feb 28, 2024
@zeusongit zeusongit added this to the 3.1 milestone Feb 28, 2024
@zeusongit zeusongit self-assigned this Feb 28, 2024
@zeusongit zeusongit changed the title WIP - DYN-6653 Create new workspace based on Templates - Part II DYN-6653 Create new workspace based on Templates - Part II Feb 28, 2024
Copy link

github-actions bot commented Mar 13, 2024

UI Smoke Tests

Test: success. 2 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests - net8.0

@@ -2615,6 +2659,9 @@ public void ShowSaveDialogAndSaveResult(object parameter)
if (_fileDialog.ShowDialog() == DialogResult.OK)
{
SaveAs(_fileDialog.FileName);
LastSavedLocation = Path.GetDirectoryName(_fileDialog.FileName);
//set the IsTemplate to false, after saving it as a file
vm.Model.CurrentWorkspace.IsTemplate = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

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

LGTM with comments

@@ -1537,28 +1562,6 @@ private void InitializeCommands()
CopyToClipboardCommand = new DelegateCommand(p => CopyToClipboard(p));
}

public bool UpdateBackupLocation(string newBackupLocation)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be a API break as the class is public too.

}
}

public void ResetBackupLocation()
Copy link
Contributor

Choose a reason for hiding this comment

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

same APi break.

@QilongTang
Copy link
Contributor

4 Errors in the API checks
D:\a\Dynamo\Dynamo\Dynamo\src\DynamoCoreWpf\PublicAPI.Unshipped.txt(4014,1): error RS0017: Symbol 'Dynamo.Wpf.Views.Debug.UpdateNodeIconsWindow.errorFile -> string' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [D:\a\Dynamo\Dynamo\Dynamo\src\DynamoCoreWpf\DynamoCoreWpf.csproj] D:\a\Dynamo\Dynamo\Dynamo\src\DynamoCoreWpf\PublicAPI.Unshipped.txt(4018,1): error RS0017: Symbol 'Dynamo.Wpf.Views.Debug.UpdateNodeIconsWindow.logFile -> string' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [D:\a\Dynamo\Dynamo\Dynamo\src\DynamoCoreWpf\DynamoCoreWpf.csproj] D:\a\Dynamo\Dynamo\Dynamo\src\DynamoCoreWpf\PublicAPI.Unshipped.txt(4039,1): error RS0017: Symbol 'Dynamo.Wpf.Views.Debug.UpdateNodeIconsWindow.OnPropertyChanged(string propertyName) -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [D:\a\Dynamo\Dynamo\Dynamo\src\DynamoCoreWpf\DynamoCoreWpf.csproj] D:\a\Dynamo\Dynamo\Dynamo\src\DynamoCoreWpf\PublicAPI.Unshipped.txt(5557,1): error RS0017: Symbol 'static readonly Dynamo.Wpf.Views.Debug.UpdateNodeIconsWindow.logPath -> string' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [D:\a\Dynamo\Dynamo\Dynamo\src\DynamoCoreWpf\DynamoCoreWpf.csproj]

@zeusongit
Copy link
Contributor Author

Merging, API break analysis failures have been fixed and build passed earlier.

@zeusongit zeusongit merged commit 74f3895 into DynamoDS:master Mar 20, 2024
19 checks passed
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