From e98e07f080f5a43ff687fe69c4a251f25158be43 Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Tue, 30 Jul 2024 15:05:49 -0400 Subject: [PATCH] DYN-6620 Add version size data to Package Details (#15411) --- src/DynamoCore/DynamoCore.csproj | 2 +- src/DynamoCoreWpf/DynamoCoreWpf.csproj | 10 +++++----- src/DynamoMLDataPipeline/DynamoMLDataPipeline.csproj | 2 +- src/DynamoPackages/DynamoPackages.csproj | 2 +- src/PackageDetailsViewExtension/PackageDetailItem.cs | 3 +-- .../PackageDetailsView.xaml | 2 +- .../PackageDetailsViewExtension.csproj | 2 +- .../NodeDocumentationMarkdownGenerator.csproj | 2 +- test/DynamoCoreTests/DynamoCoreTests.csproj | 2 +- test/DynamoCoreWpfTests/DynamoCoreWpfTests.csproj | 2 +- .../ViewExtensions/PackageDetailsViewExtensionTests.cs | 6 +++++- .../PackageManagerTests/PackageManagerTests.csproj | 2 +- 12 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/DynamoCore/DynamoCore.csproj b/src/DynamoCore/DynamoCore.csproj index 9a8babf22fe..b41e9032aff 100644 --- a/src/DynamoCore/DynamoCore.csproj +++ b/src/DynamoCore/DynamoCore.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/DynamoCoreWpf/DynamoCoreWpf.csproj b/src/DynamoCoreWpf/DynamoCoreWpf.csproj index f8324828b2c..598494a5acf 100644 --- a/src/DynamoCoreWpf/DynamoCoreWpf.csproj +++ b/src/DynamoCoreWpf/DynamoCoreWpf.csproj @@ -1,4 +1,4 @@ - + true @@ -31,9 +31,9 @@ - + - + @@ -67,7 +67,7 @@ - + @@ -186,7 +186,7 @@ - + diff --git a/src/DynamoMLDataPipeline/DynamoMLDataPipeline.csproj b/src/DynamoMLDataPipeline/DynamoMLDataPipeline.csproj index ee94e15110a..ec432450d8e 100644 --- a/src/DynamoMLDataPipeline/DynamoMLDataPipeline.csproj +++ b/src/DynamoMLDataPipeline/DynamoMLDataPipeline.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/DynamoPackages/DynamoPackages.csproj b/src/DynamoPackages/DynamoPackages.csproj index 1fc32772e9e..0e66655da88 100644 --- a/src/DynamoPackages/DynamoPackages.csproj +++ b/src/DynamoPackages/DynamoPackages.csproj @@ -30,7 +30,7 @@ - + diff --git a/src/PackageDetailsViewExtension/PackageDetailItem.cs b/src/PackageDetailsViewExtension/PackageDetailItem.cs index 89e73aa2d86..558da338c80 100644 --- a/src/PackageDetailsViewExtension/PackageDetailItem.cs +++ b/src/PackageDetailsViewExtension/PackageDetailItem.cs @@ -196,8 +196,7 @@ public PackageDetailItem(string packageName, PackageVersion packageVersion, bool this.CopyRightYear = PackageVersion.copyright_year; this.CanInstall = canInstall; this.IsEnabledForInstall = isEnabledForInstall && canInstall; - //TODO: point this property to the package version size after it has been added to the db. - this.PackageSize = Dynamo.Properties.Resources.NoneString; + this.PackageSize = string.IsNullOrEmpty(PackageVersion.size) ? "--" : PackageVersion.size; // To avoid displaying package self-dependencies. diff --git a/src/PackageDetailsViewExtension/PackageDetailsView.xaml b/src/PackageDetailsViewExtension/PackageDetailsView.xaml index 2aae238ec5c..2155061f2bd 100644 --- a/src/PackageDetailsViewExtension/PackageDetailsView.xaml +++ b/src/PackageDetailsViewExtension/PackageDetailsView.xaml @@ -684,7 +684,7 @@ diff --git a/src/PackageDetailsViewExtension/PackageDetailsViewExtension.csproj b/src/PackageDetailsViewExtension/PackageDetailsViewExtension.csproj index e5bc78299dd..fe4875fbd01 100644 --- a/src/PackageDetailsViewExtension/PackageDetailsViewExtension.csproj +++ b/src/PackageDetailsViewExtension/PackageDetailsViewExtension.csproj @@ -14,7 +14,7 @@ false - + diff --git a/src/Tools/NodeDocumentationMarkdownGenerator/NodeDocumentationMarkdownGenerator.csproj b/src/Tools/NodeDocumentationMarkdownGenerator/NodeDocumentationMarkdownGenerator.csproj index 21d442e49ae..6bd90dd4377 100644 --- a/src/Tools/NodeDocumentationMarkdownGenerator/NodeDocumentationMarkdownGenerator.csproj +++ b/src/Tools/NodeDocumentationMarkdownGenerator/NodeDocumentationMarkdownGenerator.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/DynamoCoreTests/DynamoCoreTests.csproj b/test/DynamoCoreTests/DynamoCoreTests.csproj index 8de071c28e9..21821b07eb3 100644 --- a/test/DynamoCoreTests/DynamoCoreTests.csproj +++ b/test/DynamoCoreTests/DynamoCoreTests.csproj @@ -34,7 +34,7 @@ - + all compile; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/DynamoCoreWpfTests/DynamoCoreWpfTests.csproj b/test/DynamoCoreWpfTests/DynamoCoreWpfTests.csproj index 2b345480239..ee4e62637cd 100644 --- a/test/DynamoCoreWpfTests/DynamoCoreWpfTests.csproj +++ b/test/DynamoCoreWpfTests/DynamoCoreWpfTests.csproj @@ -37,7 +37,7 @@ - + all compile; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/DynamoCoreWpfTests/ViewExtensions/PackageDetailsViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/PackageDetailsViewExtensionTests.cs index 3fa2e7a10a2..17fe0c8fad7 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/PackageDetailsViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/PackageDetailsViewExtensionTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Dynamo.PackageDetails; using Dynamo.PackageManager; @@ -49,6 +49,7 @@ public class PackageDetailsViewExtensionTests : SystemTestBase host_dependencies = new List(Hosts), version = "0.0.1", name = "test", + size = "2.19 MiB", }, new PackageVersion { @@ -61,6 +62,7 @@ public class PackageDetailsViewExtensionTests : SystemTestBase host_dependencies = new List(Hosts), version = "0.0.2", name = "test", + size = "4.19 MiB", }, new PackageVersion { @@ -73,6 +75,7 @@ public class PackageDetailsViewExtensionTests : SystemTestBase host_dependencies = new List(Hosts), version = "0.0.3", name = "test", + size = "5.19 MiB", }, }; private static List DependencyVersions { get; } = new List {"1", "2", "3"}; @@ -418,6 +421,7 @@ public void TestViewPackageDetailsCommand() Assert.AreEqual(packageToOpen, packageDetailsViewModel.PackageName); Assert.AreEqual(packageAuthor.First().username, packageDetailsViewModel.PackageAuthorName); Assert.AreEqual(packageDescription, packageDetailsViewModel.PackageDescription); + Assert.AreEqual(false, string.IsNullOrEmpty(packageDetailsViewModel.PackageDetailItems.FirstOrDefault().PackageSize)); } } } diff --git a/test/Libraries/PackageManagerTests/PackageManagerTests.csproj b/test/Libraries/PackageManagerTests/PackageManagerTests.csproj index a556d4e4a89..5ffe5931ac8 100644 --- a/test/Libraries/PackageManagerTests/PackageManagerTests.csproj +++ b/test/Libraries/PackageManagerTests/PackageManagerTests.csproj @@ -20,7 +20,7 @@ - + all compile; build; native; contentfiles; analyzers; buildtransitive