From 04b8ff4c6c5553b8041e77f09201318b64d7fe1d Mon Sep 17 00:00:00 2001 From: Deyan Nenov Date: Tue, 31 Oct 2023 00:28:48 +0000 Subject: [PATCH] resources --- .../Properties/Resources.Designer.cs | 9 ++++++ .../Properties/Resources.en-US.resx | 3 ++ src/DynamoCoreWpf/Properties/Resources.resx | 3 ++ .../PackageManager/PublishPackageViewModel.cs | 29 +++++++++++-------- .../Pages/PublishPackageFinishPage.xaml | 2 +- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 7c644d993c5..7ae9bf62a43 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -5780,6 +5780,15 @@ public static string PackageManagerPackageUpdated { } } + /// + /// Looks up a localized string similar to Virus scan in progress. Your package will be searchable in approximately 15 minutes.. + /// + public static string PackageManagerPublishOnlineFinishedMessage { + get { + return ResourceManager.GetString("PackageManagerPublishOnlineFinishedMessage", resourceCulture); + } + } + /// /// Looks up a localized string similar to Publish a Package. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index 4203e05748d..4bd206ffe6a 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -2958,6 +2958,9 @@ This package will be unloaded after the next Dynamo restart. Publish a Package + + Virus scan in progress. Your package will be searchable in approximately 15 minutes. + Installed Packages diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index 5c9ca066f6a..cf148a74e0d 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -1283,6 +1283,9 @@ Don't worry, you'll have the option to save your work. Publish a Package + + Virus scan in progress. Your package will be searchable in approximately 15 minutes. + Installed Packages diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs index 53bd21a1cab..77ed1b6d046 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PublishPackageViewModel.cs @@ -1877,9 +1877,9 @@ private void PublishLocally() UploadState = PackageUploadHandle.State.Copying; Uploading = true; - if(RetainFolderStructureOverride) + if (RetainFolderStructureOverride) { - var updatedFiles = UpdateFilesForRetainFolderStructre(files); + var updatedFiles = UpdateFilesForRetainFolderStructure(files); // begin publishing to local directory retaining the folder structure var remapper = new CustomNodePathRemapper(DynamoViewModel.Model.CustomNodeManager, @@ -1918,9 +1918,12 @@ private void PublishLocally() /// /// /// - private List> UpdateFilesForRetainFolderStructre(IEnumerable files) + private IEnumerable> UpdateFilesForRetainFolderStructure(IEnumerable files) { - if(!files.Any() || !PreviewPackageContents.Any()) { return null; } + if (!files.Any() || !PreviewPackageContents.Any()) + { + return Enumerable.Empty>(); + } var updatedFiles = files.Select(file => { @@ -1931,23 +1934,22 @@ private List> UpdateFilesForRetainFolderStructre(IEnumerable 1 ) + if (PreviewPackageContents.Count() > 1) { // we cannot have more than 1 root folder at this stage - return null; + return Enumerable.Empty>(); } - var updatedFileStructure = new List>(); + var updatedFileStructure = new List>(); var packageFolderItem = PreviewPackageContents.First(); - // For each - foreach(var root in packageFolderItem.ChildItems) + foreach (var root in packageFolderItem.ChildItems) { - var updatedFolder = new List(); + var updatedFolder = new List(); if (root.DependencyType.Equals(DependencyType.Folder)) { var folderContents = PackageItemRootViewModel.GetFiles(root); - foreach(var item in folderContents) + foreach (var item in folderContents) { if (item.DependencyType.Equals(DependencyType.Folder) || item.DependencyType.Equals(DependencyType.CustomNode)) continue; if (updatedFiles.Contains(item.FilePath)) @@ -1956,7 +1958,10 @@ private List> UpdateFilesForRetainFolderStructre(IEnumerable -