diff --git a/src/NuGetGallery/ViewModels/PackageViewModel.cs b/src/NuGetGallery/ViewModels/PackageViewModel.cs index 36f741057d..4fb3ff0017 100644 --- a/src/NuGetGallery/ViewModels/PackageViewModel.cs +++ b/src/NuGetGallery/ViewModels/PackageViewModel.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using NuGet.Versioning; using System; using System.Collections.Generic; using System.Linq; @@ -24,7 +25,13 @@ public PackageViewModel(Package package) Version = String.IsNullOrEmpty(package.NormalizedVersion) ? NuGetVersionFormatter.Normalize(package.Version) : package.NormalizedVersion; - + + HasSemVer2Version = NuGetVersion.Parse(_fullVersion).IsSemVer2; + HasSemVer2Dependency = package.Dependencies.ToList() + .Where(pd => pd.VersionSpec != null) + .Select(pd => VersionRange.Parse(pd.VersionSpec)) + .Any(p => (p.HasUpperBound && p.MaxVersion.IsSemVer2) || (p.HasLowerBound && p.MinVersion.IsSemVer2)); + Description = package.Description; ReleaseNotes = package.ReleaseNotes; IconUrl = package.IconUrl; @@ -80,6 +87,8 @@ public string Id public string Version { get; set; } public string FullVersion => _fullVersion; public bool IsSemVer2 => _isSemVer2; + public bool HasSemVer2Version { get; } + public bool HasSemVer2Dependency { get; } public string Title { diff --git a/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml b/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml index 569e3f7d5d..6339952245 100644 --- a/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml +++ b/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml @@ -209,12 +209,7 @@ @if (Model.IsSemVer2) { - @ViewHelpers.AlertWarning( - @ - This package is only available for download with Visual Studio 2017 (version 15.3) and above or with NuGet client 4.3.0 and above. - Reach out to support if you have more questions. - - ) + @ViewHelpers.AlertIsSemVer2Package(Model.HasSemVer2Version, Model.HasSemVer2Dependency) } @if (!Model.Listed && !Model.Deleted) From 93901d101fa7e54995b4ece62488ce6a91c5119d Mon Sep 17 00:00:00 2001 From: Joel Verhagen Date: Wed, 6 Sep 2017 08:21:10 -0700 Subject: [PATCH 05/19] Use JsonRequestBehavior.AllowGet on endpoints that both return JSON and support GET (#4618) Fix https://github.com/NuGet/NuGetGallery/issues/4597 --- src/NuGetGallery/Controllers/AppController.cs | 8 +++-- .../Controllers/PackagesController.cs | 12 +++++-- .../Controllers/AppControllerFacts.cs | 32 +++++++++++++++++-- .../Controllers/PackagesControllerFacts.cs | 3 +- 4 files changed, 47 insertions(+), 8 deletions(-) diff --git a/src/NuGetGallery/Controllers/AppController.cs b/src/NuGetGallery/Controllers/AppController.cs index cf19c822f9..a0c8cb722b 100644 --- a/src/NuGetGallery/Controllers/AppController.cs +++ b/src/NuGetGallery/Controllers/AppController.cs @@ -54,7 +54,7 @@ protected internal virtual ActionResult SafeRedirect(string returnUrl) /// HTTP status code for response /// Object to Jsonify and return /// - protected internal JsonResult Json(int statusCode, object obj) + protected internal JsonResult Json(int statusCode, object obj, JsonRequestBehavior jsonRequestBehavior) { Response.StatusCode = statusCode; if (statusCode >= 400) @@ -62,9 +62,13 @@ protected internal JsonResult Json(int statusCode, object obj) Response.TrySkipIisCustomErrors = true; } - return Json(obj); + return Json(obj, jsonRequestBehavior); } + protected internal JsonResult Json(int statusCode, object obj) + { + return Json(statusCode, obj, JsonRequestBehavior.DenyGet); + } /// /// Called before the action method is invoked. diff --git a/src/NuGetGallery/Controllers/PackagesController.cs b/src/NuGetGallery/Controllers/PackagesController.cs index 267dca1fb0..cd064a7d03 100644 --- a/src/NuGetGallery/Controllers/PackagesController.cs +++ b/src/NuGetGallery/Controllers/PackagesController.cs @@ -102,7 +102,7 @@ public virtual JsonResult UploadPackageProgress() AsyncFileUploadProgress progress = _cacheService.GetProgress(username); if (progress == null) { - return Json(404, null); + return Json(404, null, JsonRequestBehavior.AllowGet); } return Json(progress, JsonRequestBehavior.AllowGet); @@ -1001,12 +1001,18 @@ public virtual ActionResult Edit(string id, string version) var package = _packageService.FindPackageByIdAndVersion(id, version); if (package == null) { - return Json(404, new string[] { string.Format(Strings.PackageWithIdAndVersionNotFound, id, version) }); + return Json( + 404, + new string[] + { + string.Format(Strings.PackageWithIdAndVersionNotFound, id, version) + }, + JsonRequestBehavior.AllowGet); } if (!package.IsOwner(User)) { - return Json(403, new string[] { Strings.Unauthorized }); + return Json(403, new string[] { Strings.Unauthorized }, JsonRequestBehavior.AllowGet); } var packageRegistration = _packageService.FindPackageRegistrationById(id); diff --git a/tests/NuGetGallery.Facts/Controllers/AppControllerFacts.cs b/tests/NuGetGallery.Facts/Controllers/AppControllerFacts.cs index 4ed73119d8..721f67878a 100644 --- a/tests/NuGetGallery.Facts/Controllers/AppControllerFacts.cs +++ b/tests/NuGetGallery.Facts/Controllers/AppControllerFacts.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Web.Mvc; using NuGetGallery.Framework; using Xunit; @@ -25,10 +26,37 @@ public void GivenNoActiveUserPrincipal_ItReturnsNull() } } - public class TestableAppController : AppController + public class TheJsonMethod : TestContainer { - // Nothing but a concrete class to test an abstract class :) + [Fact] + public void AllowsJsonRequestBehaviorToBeSpecified() + { + // Arrange + var controller = GetController(); + + // Act + var output = controller.Json(400, null, JsonRequestBehavior.AllowGet); + // Assert + Assert.Equal(JsonRequestBehavior.AllowGet, output.JsonRequestBehavior); + } + + [Fact] + public void DefaultsToDenyGet() + { + // Arrange + var controller = GetController(); + + // Act + var output = controller.Json(400, null); + + // Assert + Assert.Equal(JsonRequestBehavior.DenyGet, output.JsonRequestBehavior); + } + } + + public class TestableAppController : AppController + { public User InvokeGetCurrentUser() { return GetCurrentUser(); diff --git a/tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs b/tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs index c86875142c..bf4169070d 100644 --- a/tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs +++ b/tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs @@ -1923,7 +1923,8 @@ public void WillReturnHttpNotFoundForUnknownUser() var result = controller.UploadPackageProgress(); // Assert - Assert.IsType(result); + var jsonResult = Assert.IsType(result); + Assert.Equal(JsonRequestBehavior.AllowGet, jsonResult.JsonRequestBehavior); } [Fact] From b979bf7e7f4d94e82aa2ba094bed282a020d84d6 Mon Sep 17 00:00:00 2001 From: Xavier Decoster Date: Wed, 6 Sep 2017 20:42:35 +0200 Subject: [PATCH 06/19] Fix incorrect test setup (#4622) --- .../Controllers/CuratedFeedsControllerFacts.cs | 9 +++++---- .../Controllers/PackagesControllerFacts.cs | 6 +++--- .../ViewModels/DisplayPackageViewModelFacts.cs | 15 ++++++++------- .../ViewModels/ListPackageItemViewModelFacts.cs | 17 ++++++++++++++++- .../ViewModels/PackageViewModelFacts.cs | 5 +++++ 5 files changed, 37 insertions(+), 15 deletions(-) diff --git a/tests/NuGetGallery.Facts/Controllers/CuratedFeedsControllerFacts.cs b/tests/NuGetGallery.Facts/Controllers/CuratedFeedsControllerFacts.cs index f9460598fb..84b2880d1a 100644 --- a/tests/NuGetGallery.Facts/Controllers/CuratedFeedsControllerFacts.cs +++ b/tests/NuGetGallery.Facts/Controllers/CuratedFeedsControllerFacts.cs @@ -24,7 +24,7 @@ public TestableCuratedFeedsController() Fakes = new Fakes(); StubCuratedFeed = new CuratedFeed - { Key = 0, Name = "aName", Managers = new HashSet(new[] { Fakes.User }) }; + { Key = 0, Name = "aName", Managers = new HashSet(new[] { Fakes.User }) }; StubCuratedFeedService = new Mock(); SetOwinContextOverride(Fakes.CreateOwinContext()); @@ -189,14 +189,15 @@ public async Task WillSearchForAPackage() Id = "RedPill", Key = 2, DownloadCount = 0, - Packages = new [] + Packages = new[] { new Package { + Version = "1.0.0", Key = 89932, } }, - Owners = new [] + Owners = new[] { new User { @@ -208,7 +209,7 @@ public async Task WillSearchForAPackage() redPill.Packages.ElementAt(0).PackageRegistration = redPill; - var mockPackageRegistrations = new [] { redPill }.AsQueryable(); + var mockPackageRegistrations = new[] { redPill }.AsQueryable(); var mockPackages = new[] { redPill.Packages.ElementAt(0) }.AsQueryable(); controller.StubCuratedFeedService diff --git a/tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs b/tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs index bf4169070d..270f1bf71f 100644 --- a/tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs +++ b/tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs @@ -399,8 +399,8 @@ public async Task GivenAnAbsoluteLatestVersionItQueriesTheCorrectVersion() Id = "Foo", Owners = new List() }, - Version = "2.0.0a", - NormalizedVersion = "2.0.0a", + Version = "2.0.0", + NormalizedVersion = "2.0.0", IsLatest = true, Title = "A test package!" }); @@ -414,7 +414,7 @@ public async Task GivenAnAbsoluteLatestVersionItQueriesTheCorrectVersion() // Assert var model = ResultAssert.IsView(result); Assert.Equal("Foo", model.Id); - Assert.Equal("2.0.0a", model.Version); + Assert.Equal("2.0.0", model.Version); Assert.Equal("A test package!", model.Title); Assert.True(model.LatestVersion); } diff --git a/tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs b/tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs index 403ba09dd1..26a46618c1 100644 --- a/tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs +++ b/tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs @@ -14,13 +14,14 @@ public class DisplayPackageViewModelFacts public void TheCtorSortsPackageVersionsProperly() { var package = new Package + { + Version = "1.0.0", + Dependencies = Enumerable.Empty().ToList(), + PackageRegistration = new PackageRegistration { - Dependencies = Enumerable.Empty().ToList(), - PackageRegistration = new PackageRegistration - { - Owners = Enumerable.Empty().ToList(), - } - }; + Owners = Enumerable.Empty().ToList(), + } + }; package.PackageRegistration.Packages = new[] { @@ -82,7 +83,7 @@ public void AvgDownloadsPerDayConsidersOldestPackageVersionInHistory() // Act var viewModel = new DisplayPackageViewModel(package, packageHistory); - + // Assert Assert.Equal(daysSinceFirstPackageCreated, viewModel.TotalDaysSinceCreated); Assert.Equal(totalDownloadCount / daysSinceFirstPackageCreated, viewModel.DownloadsPerDay); diff --git a/tests/NuGetGallery.Facts/ViewModels/ListPackageItemViewModelFacts.cs b/tests/NuGetGallery.Facts/ViewModels/ListPackageItemViewModelFacts.cs index b496a8e89a..171c3448c4 100644 --- a/tests/NuGetGallery.Facts/ViewModels/ListPackageItemViewModelFacts.cs +++ b/tests/NuGetGallery.Facts/ViewModels/ListPackageItemViewModelFacts.cs @@ -40,6 +40,7 @@ public void LicenseNamesAreParsedByCommas() { var package = new Package { + Version = "1.0.0", LicenseNames = "l1,l2, l3 ,l4 , l5 ", }; var packageViewModel = new ListPackageItemViewModel(package); @@ -51,6 +52,7 @@ public void LicenseReportFieldsKeptWhenLicenseReportDisabled() { var package = new Package { + Version = "1.0.0", HideLicenseReport = true, LicenseNames = "l1", LicenseReportUrl = "url" @@ -65,6 +67,7 @@ public void LicenseReportUrlKeptWhenLicenseReportEnabled() { var package = new Package { + Version = "1.0.0", HideLicenseReport = false, LicenseReportUrl = "url" }; @@ -77,6 +80,7 @@ public void LicenseNamesKeptWhenLicenseReportEnabled() { var package = new Package { + Version = "1.0.0", HideLicenseReport = false, LicenseNames = "l1" }; @@ -89,6 +93,7 @@ public void LicenseUrlKeptWhenLicenseReportDisabled() { var package = new Package { + Version = "1.0.0", HideLicenseReport = true, LicenseUrl = "url" }; @@ -103,6 +108,7 @@ public void ShortDescriptionsNotTruncated() var description = "A Short Description"; var package = new Package() { + Version = "1.0.0", Description = description }; @@ -122,6 +128,7 @@ public void LongDescriptionsTruncated() var package = new Package() { + Version = "1.0.0", Description = description }; @@ -142,6 +149,7 @@ public void LongDescriptionsSingleWordTruncatedToLimit() var package = new Package() { + Version = "1.0.0", Description = description }; @@ -155,7 +163,10 @@ public void LongDescriptionsSingleWordTruncatedToLimit() [Fact] public void EmptyTagsAreParsedEmpty() { - var package = new Package() { }; + var package = new Package() + { + Version = "1.0.0" + }; var listPackageItemViewModel = new ListPackageItemViewModel(package); @@ -167,6 +178,7 @@ public void TagsAreParsed() { var package = new Package() { + Version = "1.0.0", Tags = "tag1 tag2 tag3" }; @@ -198,6 +210,7 @@ public void AuthorsIsFlattenedAuthors() var package = new Package() { + Version = "1.0.0", Authors = authors, FlattenedAuthors = flattenedAuthors }; @@ -212,6 +225,7 @@ public void UseVersionIfLatestAndStableNotSame() { var package = new Package() { + Version = "1.0.0", IsLatest = true, IsLatestStable = false }; @@ -237,6 +251,7 @@ public void UseVersionIfLatestSemVer2AndStableSemVer2NotSame() { var package = new Package() { + Version = "1.0.0", SemVerLevelKey = SemVerLevelKey.SemVer2, IsLatestSemVer2 = true, IsLatestStableSemVer2 = false diff --git a/tests/NuGetGallery.Facts/ViewModels/PackageViewModelFacts.cs b/tests/NuGetGallery.Facts/ViewModels/PackageViewModelFacts.cs index 2f0009ae0f..db96ca16c9 100644 --- a/tests/NuGetGallery.Facts/ViewModels/PackageViewModelFacts.cs +++ b/tests/NuGetGallery.Facts/ViewModels/PackageViewModelFacts.cs @@ -35,6 +35,7 @@ public void LicenseNamesAreParsedByCommas() { var package = new Package { + Version = "1.0.0", LicenseNames = "l1,l2, l3 ,l4 , l5 ", }; var packageViewModel = new PackageViewModel(package); @@ -46,6 +47,7 @@ public void LicenseReportFieldsKeptWhenLicenseReportDisabled() { var package = new Package { + Version = "1.0.0", HideLicenseReport = true, LicenseNames = "l1", LicenseReportUrl = "url" @@ -60,6 +62,7 @@ public void LicenseReportUrlKeptWhenLicenseReportEnabled() { var package = new Package { + Version = "1.0.0", HideLicenseReport = false, LicenseReportUrl = "url" }; @@ -72,6 +75,7 @@ public void LicenseNamesKeptWhenLicenseReportEnabled() { var package = new Package { + Version = "1.0.0", HideLicenseReport = false, LicenseNames = "l1" }; @@ -84,6 +88,7 @@ public void LicenseUrlKeptWhenLicenseReportDisabled() { var package = new Package { + Version = "1.0.0", HideLicenseReport = true, LicenseUrl = "url" }; From f62358a7e012db3ad3d08a16775ebb032563890d Mon Sep 17 00:00:00 2001 From: Kristian Hellang Date: Tue, 29 Aug 2017 13:06:26 +0200 Subject: [PATCH 07/19] Move pager to center of the page (#4599) --- src/Bootstrap/dist/css/bootstrap-theme.css | 1 - src/Bootstrap/less/theme/common-list-packages.less | 3 +-- src/NuGetGallery/Content/gallery/css/bootstrap-theme.css | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Bootstrap/dist/css/bootstrap-theme.css b/src/Bootstrap/dist/css/bootstrap-theme.css index 90895d6318..51ccdaf91a 100644 --- a/src/Bootstrap/dist/css/bootstrap-theme.css +++ b/src/Bootstrap/dist/css/bootstrap-theme.css @@ -374,7 +374,6 @@ img.package-icon { } } .pager { - float: right; margin-top: 75px; margin-bottom: 0; } diff --git a/src/Bootstrap/less/theme/common-list-packages.less b/src/Bootstrap/less/theme/common-list-packages.less index 643e5b575d..6c79dfec6d 100644 --- a/src/Bootstrap/less/theme/common-list-packages.less +++ b/src/Bootstrap/less/theme/common-list-packages.less @@ -66,5 +66,4 @@ .pager { margin-top: 75px; margin-bottom: 0px; - float: right; -} \ No newline at end of file +} diff --git a/src/NuGetGallery/Content/gallery/css/bootstrap-theme.css b/src/NuGetGallery/Content/gallery/css/bootstrap-theme.css index 90895d6318..51ccdaf91a 100644 --- a/src/NuGetGallery/Content/gallery/css/bootstrap-theme.css +++ b/src/NuGetGallery/Content/gallery/css/bootstrap-theme.css @@ -374,7 +374,6 @@ img.package-icon { } } .pager { - float: right; margin-top: 75px; margin-bottom: 0; } From 86ef41479f38508131c47e2f7de918caac301ec5 Mon Sep 17 00:00:00 2001 From: Xavier Decoster Date: Thu, 7 Sep 2017 18:14:03 +0200 Subject: [PATCH 08/19] Fix versionspec parsing in PackageViewModel + test coverage. (#4629) --- src/NuGetGallery/UrlExtensions.cs | 2 - .../ViewModels/PackageViewModel.cs | 2 +- .../ViewModels/PackageViewModelFacts.cs | 107 ++++++++++++++++++ 3 files changed, 108 insertions(+), 3 deletions(-) diff --git a/src/NuGetGallery/UrlExtensions.cs b/src/NuGetGallery/UrlExtensions.cs index da51bd4d1b..c0fed5a7f9 100644 --- a/src/NuGetGallery/UrlExtensions.cs +++ b/src/NuGetGallery/UrlExtensions.cs @@ -86,8 +86,6 @@ public static string PackageList(this UrlHelper url, int page, string q, bool in return url.Action("ListPackages", "Packages", routeValues); } - - public static string CuratedPackageList(this UrlHelper url, int page, string q, string curatedFeedName) { return url.Action("ListPackages", "CuratedFeeds", new diff --git a/src/NuGetGallery/ViewModels/PackageViewModel.cs b/src/NuGetGallery/ViewModels/PackageViewModel.cs index 4fb3ff0017..b5387132c4 100644 --- a/src/NuGetGallery/ViewModels/PackageViewModel.cs +++ b/src/NuGetGallery/ViewModels/PackageViewModel.cs @@ -28,7 +28,7 @@ public PackageViewModel(Package package) HasSemVer2Version = NuGetVersion.Parse(_fullVersion).IsSemVer2; HasSemVer2Dependency = package.Dependencies.ToList() - .Where(pd => pd.VersionSpec != null) + .Where(pd => !string.IsNullOrEmpty(pd.VersionSpec)) .Select(pd => VersionRange.Parse(pd.VersionSpec)) .Any(p => (p.HasUpperBound && p.MaxVersion.IsSemVer2) || (p.HasLowerBound && p.MinVersion.IsSemVer2)); diff --git a/tests/NuGetGallery.Facts/ViewModels/PackageViewModelFacts.cs b/tests/NuGetGallery.Facts/ViewModels/PackageViewModelFacts.cs index db96ca16c9..32a29241d1 100644 --- a/tests/NuGetGallery.Facts/ViewModels/PackageViewModelFacts.cs +++ b/tests/NuGetGallery.Facts/ViewModels/PackageViewModelFacts.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Collections.Generic; using Xunit; namespace NuGetGallery.ViewModels @@ -95,5 +96,111 @@ public void LicenseUrlKeptWhenLicenseReportDisabled() var packageViewModel = new PackageViewModel(package); Assert.NotNull(packageViewModel.LicenseUrl); } + + [Theory] + [InlineData(null)] + [InlineData("")] + public void HasSemVer2DependencyIsFalseWhenInvalidDependencyVersionRange(string versionSpec) + { + // Arrange + var package = new Package + { + Version = "1.0.0", + Dependencies = new List + { + new PackageDependency { VersionSpec = versionSpec} + } + }; + + // Act + var viewModel = new PackageViewModel(package); + + // Assert + Assert.False(viewModel.HasSemVer2Dependency); + } + + [Theory] + [InlineData("2.0.0-alpha.1")] + [InlineData("2.0.0+metadata")] + [InlineData("2.0.0-alpha+metadata")] + public void HasSemVer2DependencyWhenSemVer2DependencyVersionSpec(string versionSpec) + { + // Arrange + var package = new Package + { + Version = "1.0.0", + Dependencies = new List + { + new PackageDependency { VersionSpec = versionSpec} + } + }; + + // Act + var viewModel = new PackageViewModel(package); + + // Assert + Assert.True(viewModel.HasSemVer2Dependency); + } + + [Theory] + [InlineData("2.0.0-alpha")] + [InlineData("2.0.0")] + [InlineData("2.0.0.0")] + public void HasSemVer2DependencyIsFalseWhenNonSemVer2DependencyVersionSpec(string versionSpec) + { + // Arrange + var package = new Package + { + Version = "1.0.0", + Dependencies = new List + { + new PackageDependency { VersionSpec = versionSpec} + } + }; + + // Act + var viewModel = new PackageViewModel(package); + + // Assert + Assert.False(viewModel.HasSemVer2Dependency); + } + + [Theory] + [InlineData("2.0.0-alpha")] + [InlineData("2.0.0")] + [InlineData("2.0.0.0")] + public void HasSemVer2VersionIsFalseWhenNonSemVer2Version(string version) + { + // Arrange + var package = new Package + { + Version = version + }; + + // Act + var viewModel = new PackageViewModel(package); + + // Assert + Assert.False(viewModel.HasSemVer2Version); + } + + [Theory] + [InlineData("2.0.0-alpha.1")] + [InlineData("2.0.0+metadata")] + [InlineData("2.0.0-alpha+metadata")] + public void HasSemVer2VersionIsTrueWhenSemVer2Version(string version) + { + // Arrange + var package = new Package + { + Version = version + }; + + // Act + var viewModel = new PackageViewModel(package); + + // Assert + Assert.True(viewModel.HasSemVer2Version); + } } } From e7831a472f8ebed354d59383eeb31a9186d98fb8 Mon Sep 17 00:00:00 2001 From: Joel Verhagen Date: Thu, 7 Sep 2017 10:43:09 -0700 Subject: [PATCH 09/19] Use TotalDownloadCount sum for total on user packages list instead of DownloadCount (#4630) Fix https://github.com/NuGet/NuGetGallery/issues/4607 --- src/NuGetGallery/Views/Users/_UserPackagesList.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NuGetGallery/Views/Users/_UserPackagesList.cshtml b/src/NuGetGallery/Views/Users/_UserPackagesList.cshtml index f53fb878b7..1d03467227 100644 --- a/src/NuGetGallery/Views/Users/_UserPackagesList.cshtml +++ b/src/NuGetGallery/Views/Users/_UserPackagesList.cshtml @@ -2,7 +2,7 @@ @{ var packagesString = "package" + (Model.Packages.Count() != 1 ? "s" : ""); - var numDownloads = Model.Packages.Sum(p => p.DownloadCount); + var numDownloads = Model.Packages.Sum(p => p.TotalDownloadCount); var downloadsString = "download" + (numDownloads != 1 ? "s" : ""); } From af0c618b9e58764464e59502991e47839e75b066 Mon Sep 17 00:00:00 2001 From: Loic Sharma Date: Thu, 7 Sep 2017 13:33:54 -0700 Subject: [PATCH 10/19] Updated third-party tabs' support notice (#4631) --- src/NuGetGallery/Views/Packages/DisplayPackage.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml b/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml index 6339952245..ff1e7f0b07 100644 --- a/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml +++ b/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml @@ -92,8 +92,8 @@ { @ViewHelpers.AlertWarning( @ - This client is not supported by the NuGet team. - Contact its maintainers for support. + The NuGet Team does not provide support for this client. + Please contact its maintainers for support. ) }