author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
455,737
14.07.2017 14:48:02
25,200
e53f8127d4b9a4959b755dc34851194204be2ae0
Add ability for columns to hide content with ellipsis when narrow screen.
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -840,6 +840,12 @@ img.package-icon {\noverflow: hidden;\ntext-overflow: ellipsis;\n}\n+.page-statistics-overview td {\n+ max-width: 0;\n+ overflow: hidden;\n+ text-overflow: ellipsis;\n+ white-space: nowrap;\n+}\n.page-statistics-overview .stats-title-text {\nmargin-bottom: 10px;\nfont-size: 1.6em;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-statistics-overview.less", "new_path": "src/Bootstrap/less/theme/page-statistics-overview.less", "diff": ".page-statistics-overview {\n+ td {\n+ max-width: 0;\n+ overflow: hidden;\n+ text-overflow: ellipsis;\n+ white-space: nowrap;\n+ }\n+\n.stats-title-text {\nfont-size: 1.6em;\nmargin-bottom: 10px;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -840,6 +840,12 @@ img.package-icon {\noverflow: hidden;\ntext-overflow: ellipsis;\n}\n+.page-statistics-overview td {\n+ max-width: 0;\n+ overflow: hidden;\n+ text-overflow: ellipsis;\n+ white-space: nowrap;\n+}\n.page-statistics-overview .stats-title-text {\nmargin-bottom: 10px;\nfont-size: 1.6em;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Statistics/Index.cshtml", "new_path": "src/NuGetGallery/Views/Statistics/Index.cshtml", "diff": "index++;\n<tr tabindex=\"0\" aria-label=\"Week of @Model.DisplayWeek(item.Year, item.WeekOfYear, StatisticsPackagesViewModel.WeekFormats.StartOnly), @(item.Downloads) Downloads\">\n- <td class=\"text-left\">@Model.DisplayWeek(item.Year, item.WeekOfYear)</td>\n+ <td class=\"text-left\" title=\"@Model.DisplayWeek(item.Year, item.WeekOfYear)\">@Model.DisplayWeek(item.Year, item.WeekOfYear)</td>\n<td class=\"text-right\">@Model.DisplayDownloads(item.Downloads)</td>\n</tr>\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add ability for columns to hide content with ellipsis when narrow screen. (#4399)
455,737
19.07.2017 11:44:19
25,200
dbd43f4c5db229aefeb1c732aff7c40170867eb7
Remove margin bottom on p element in svg.
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -979,6 +979,9 @@ img.package-icon {\n.page-stats-per-package #stats-graph-svg .bartext {\nfont-size: 1em;\n}\n+.page-stats-per-package #stats-graph-svg p {\n+ margin-bottom: none;\n+}\n.page-status .status-general {\npadding: 13px;\nmargin-bottom: 24px;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-statistics-per-package.less", "new_path": "src/Bootstrap/less/theme/page-statistics-per-package.less", "diff": ".bartext {\nfont-size: 1em;\n}\n+\n+ p {\n+ margin-bottom: none;\n+ }\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -979,6 +979,9 @@ img.package-icon {\n.page-stats-per-package #stats-graph-svg .bartext {\nfont-size: 1em;\n}\n+.page-stats-per-package #stats-graph-svg p {\n+ margin-bottom: none;\n+}\n.page-status .status-general {\npadding: 13px;\nmargin-bottom: 24px;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Remove margin bottom on p element in svg.
455,737
19.07.2017 11:44:37
25,200
5921e390b069219c5e9510077c7679d8ebf018d7
Treat keydown as changed on edit inputs.
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/page-edit.js", "new_path": "src/NuGetGallery/Scripts/gallery/page-edit.js", "diff": "@@ -28,7 +28,7 @@ var EditViewManager = new function () {\ndocument.location = $(this).val();\n});\n- $('input[type=\"text\"], input[type=\"checkbox\"], textarea').on('change', function () {\n+ $('input[type=\"text\"], input[type=\"checkbox\"], textarea').on('change keydown', function () {\n$(this).addClass(\"edited\");\n_changedState[$(this).attr('id')] = true;\n$('#verify-submit-button').removeAttr('disabled');\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Treat keydown as changed on edit inputs.
455,737
19.07.2017 11:44:56
25,200
11599b177c2b71d07885bf7601f1e4f14efec1ff
Fix tab stopping on package display.
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "</table>\n@if (rowCount > 5)\n{\n- <a role=\"button\" data-toggle=\"collapse\" class=\"icon-link\" data-target=\"#hidden-versions\"\n+ <a href=\"#\" role=\"button\" data-toggle=\"collapse\" class=\"icon-link\" data-target=\"#hidden-versions\"\naria-expanded=\"false\" aria-controls=\"hidden-versions\" id=\"show-hidden-versions\">\n<i class=\"ms-Icon ms-Icon--CalculatorAddition\" aria-hidden=\"true\"></i>\n<span>Show more</span>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix tab stopping on package display.
455,736
21.07.2017 11:13:11
25,200
0cf18f83d373fe13ac6cd3678ae02512f63df5ba
[Redesign] Fix front page statistics for cultures where the thousands seperator is not a comma Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/StatisticsController.cs", "new_path": "src/NuGetGallery/Controllers/StatisticsController.cs", "diff": "@@ -55,9 +55,9 @@ public virtual async Task<ActionResult> Totals()\nreturn Json(\nnew\n{\n- Downloads = stats.Downloads.ToNuGetNumberString(),\n- UniquePackages = stats.UniquePackages.ToNuGetNumberString(),\n- TotalPackages = stats.TotalPackages.ToNuGetNumberString(),\n+ Downloads = stats.Downloads,\n+ UniquePackages = stats.UniquePackages,\n+ TotalPackages = stats.TotalPackages,\nLastUpdatedDateUtc = stats.LastUpdateDateUtc\n},\nJsonRequestBehavior.AllowGet);\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/page-home.js", "new_path": "src/NuGetGallery/Scripts/gallery/page-home.js", "diff": "$(function () {\n'use strict';\n- function commaThousands(value) {\n- var output = value.toString();\n- for (var i = output.length - 3; i > 0; i -= 3)\n- {\n- output = output.slice(0, i) + ',' + output.slice(i);\n- }\n-\n- return output;\n- }\n-\nfunction updateStat(observable, unparsedValue) {\n- var parsedValue = window.nuget.parseNumber(unparsedValue);\n+ var parsedValue = parseInt(unparsedValue);\nif (!isNaN(parsedValue)) {\nobservable(parsedValue);\n}\n@@ -46,20 +36,22 @@ $(function () {\nko.bindingHandlers.animateNumber = {\ninit: function (element, valueAccessor) {\nvar value = ko.unwrap(valueAccessor());\n- $(element).text(value);\n+ $(element).data('value', value);\n+ $(element).text(value.toLocaleString());\n},\nupdate: function (element, valueAccessor) {\n- var oldValue = window.nuget.parseNumber($(element).text());\n+ var oldValue = $(element).data('value');\nvar newValue = ko.unwrap(valueAccessor());\n+ $(element).data('value', newValue);\n$({ value: oldValue }).animate({ value: newValue }, {\nduration: 250,\neasing: 'swing',\nstep: function () {\n- $(element).text(commaThousands(Math.floor(this.value)));\n+ $(element).text(Math.floor(this.value).toLocaleString());\n},\ndone: function () {\n- $(element).text(commaThousands(newValue));\n+ $(element).text(newValue.toLocaleString());\n}\n});\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Fix front page statistics for cultures where the thousands seperator is not a comma Fix https://github.com/NuGet/NuGetGallery/issues/4443
455,736
21.07.2017 11:40:28
25,200
1123111e0d1ad4fdf6067a76adf6e60c86ffb548
[Redesign] Comma separate total package count and numbers on manage package page Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/ListPackages.cshtml", "new_path": "src/NuGetGallery/Views/Shared/ListPackages.cshtml", "diff": "}\nelse\n{\n- <text>There are @Model.TotalCount packages</text>\n+ <text>There are @Model.TotalCount.ToNuGetNumberString() packages</text>\n}\n}\nelse\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "new_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "diff": "</a>\n</h2>\n<div class=\"panel-collapse collapse in\" id=\"packages-@Model.Name\" aria-expanded=\"true\">\n- <p>You have <b>@Model.Packages.Count() @Model.Name.ToLowerInvariant() @packagesString</b> with a total of <b>@numDownloads @downloadsString</b></p>\n+ <p>\n+ You have <b>@Model.Packages.Count().ToNuGetNumberString() @Model.Name.ToLowerInvariant() @packagesString</b>\n+ with a total of <b>@numDownloads.ToNuGetNumberString() @downloadsString</b>\n+ </p>\n<div class=\"list-packages\" role=\"list\">\n@foreach (var package in @Model.Packages)\n{\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Comma separate total package count and numbers on manage package page Fix https://github.com/NuGet/NuGetGallery/issues/4444
455,776
21.07.2017 16:51:12
25,200
94d86ae3406944bf30dc01616e73c034ad1c4c6c
Require anti-forgery token on manage owners page
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/JsonApiController.cs", "new_path": "src/NuGetGallery/Controllers/JsonApiController.cs", "diff": "@@ -89,6 +89,7 @@ public virtual ActionResult GetAddPackageOwnerConfirmation(string id, string use\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic async Task<JsonResult> AddPackageOwner(string id, string username, string message)\n{\nManagePackageOwnerModel model;\n@@ -118,6 +119,7 @@ public async Task<JsonResult> AddPackageOwner(string id, string username, string\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic async Task<JsonResult> RemovePackageOwner(string id, string username)\n{\nManagePackageOwnerModel model;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/ManagePackageOwners.cshtml", "new_path": "src/NuGetGallery/Views/Packages/ManagePackageOwners.cshtml", "diff": "ViewBag.Tab = \"Packages\";\n}\n+<form id=\"AntiForgeryForm\">\n+ @Html.AntiForgeryToken()\n+</form>\n<h1 class=\"page-heading\">Manage Owners for Package \"@Model.Title.Abbreviate(50)\"</h1>\n</p>\n@using (Html.BeginForm())\n{\n- @Html.AntiForgeryToken()\n<fieldset class=\"form\">\n<legend>Add Owner</legend>\n<div id=\"input-form\">\nalert('An unexpected error occurred! \"' + errorThrown + '\"');\n};\n+ var addAntiForgeryToken = function (data) {\n+ var $field = $(\"#AntiForgeryForm input[name=__RequestVerificationToken]\");\n+ data[\"__RequestVerificationToken\"] = $field.val();\n+ return data;\n+ }\n+\nvar viewModel = {\npackage: { id: '@Model.Id' },\nowners: ko.observableArray([]),\nreturn true;\n},\n- headers: function () {\n- return { '__RequestVerificationToken': $('input[name=\"\"__RequestVerificationToken\"\"]').val() };\n- },\n-\nresetAddOwnerConfirmation: function () {\nviewModel.confirmation('');\nviewModel.policyMessage('');\ncache: false,\ndataType: 'json',\ntype: 'GET',\n- headers: viewModel.headers(),\n- contentType: 'application/json; charset=utf-8',\n+ dataType: 'json',\nsuccess: function (data) {\nif (data.success) {\nviewModel.confirmation(data.confirmation);\ncache: false,\ndataType: 'json',\ntype: 'POST',\n- headers: viewModel.headers(),\n- data: window.JSON.stringify(ownerInputModel),\n- contentType: 'application/json; charset=utf-8',\n+ dataType: 'json',\n+ data: addAntiForgeryToken(ownerInputModel),\nsuccess: function (data) {\nif (data.success) {\nvar newOwner = new Owner(data.name, /* pending */ true, data.current);\ncache: false,\ndataType: 'json',\ntype: 'POST',\n- headers: viewModel.headers(),\n- contentType: 'application/json; charset=utf-8',\n+ dataType: 'json',\n+ data: addAntiForgeryToken({}),\nsuccess: function (data) {\nif (data.success) {\nif (item.current) {\ncache: false,\ndataType: 'json',\ntype: 'GET',\n- contentType: 'application/json; charset=utf-8',\n+ dataType: 'json',\nsuccess: function (data) {\nviewModel.owners($.map(data, function (item) { return new Owner(item.name, item.pending, item.current); }));\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Require anti-forgery token on manage owners page (#4455)
455,772
24.07.2017 12:05:03
25,200
0b090329bc96bc294d418121f118a3c246ebb670
fix password autocomplete
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/Account.cshtml", "new_path": "src/NuGetGallery/Views/Users/Account.cshtml", "diff": "@Html.ValidationSummaryFor(\"ChangePassword\")\n<div class=\"form-field\">\n@Html.LabelFor(m => m.ChangePassword.OldPassword)\n- @Html.PasswordFor(m => m.ChangePassword.OldPassword)\n+ @Html.PasswordFor(m => m.ChangePassword.OldPassword, new { autocomplete = \"off\" })\n@Html.ValidationMessageFor(m => m.ChangePassword.OldPassword)\n</div>\n<div class=\"form-field\">\n@Html.LabelFor(m => m.ChangePassword.NewPassword)\n- @Html.PasswordFor(m => m.ChangePassword.NewPassword)\n+ @Html.PasswordFor(m => m.ChangePassword.NewPassword, new { autocomplete = \"off\" })\n@Html.ValidationMessageFor(m => m.ChangePassword.NewPassword)\n</div>\n<img src=\"@Url.Content(\"~/Content/images/required.png\")\" alt=\"Blue border on left means required.\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
fix password autocomplete
455,736
21.07.2017 12:36:16
25,200
fbc9af3085eeebe151e92adcf6f9de94660e8f29
[Redesign] Describe the front page images using a title on the anchor rather than an image alt Fix accessibility issue 467716
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Pages/Home.cshtml", "new_path": "src/NuGetGallery/Views/Pages/Home.cshtml", "diff": "</div>\n<div class=\"row row-gap\">\n<div class=\"col-sm-4\">\n- <a href=\"https://docs.microsoft.com/en-us/nuget/quickstart/use-a-package\">\n- <img width=\"225\" height=\"225\" alt=\"Cartoon image of a person lifting a package into the clouds\"\n+ <a href=\"https://docs.microsoft.com/en-us/nuget/quickstart/use-a-package\"\n+ title=\"Learn about how to use NuGet packages\">\n+ <img width=\"225\" height=\"225\"\nsrc=\"~/Content/gallery/img/orange-circle.svg\"\n@ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/orange-circle-225x225.png\")) />\n<h3>Learn</h3>\n</p>\n</div>\n<div class=\"col-sm-4\">\n- <a href=\"@Url.PackageList()\">\n- <img width=\"225\" height=\"225\" alt=\"Cartoon image of a person looking into the clouds with a telescope\"\n+ <a href=\"@Url.PackageList()\"\n+ title=\"Explore packages available on NuGet.org\">\n+ <img width=\"225\" height=\"225\"\nsrc=\"~/Content/gallery/img/purple-circle.svg\"\n@ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/purple-circle-225x225.png\")) />\n<h3>Explore</h3>\n</p>\n</div>\n<div class=\"col-sm-4\">\n- <a href=\"https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package\">\n- <img width=\"225\" height=\"225\" alt=\"Cartoon image of a toolbox\"\n+ <a href=\"https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package\"\n+ title=\"Learn how to create a NuGet package\">\n+ <img width=\"225\" height=\"225\"\nsrc=\"~/Content/gallery/img/blue-circle.svg\"\n@ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/blue-circle-225x225.png\")) />\n<h3>Create</h3>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Describe the front page images using a title on the anchor rather than an image alt Fix accessibility issue 467716
455,736
21.07.2017 13:00:57
25,200
7a5e37ef9cb0c956cb3bc2f6b1ed9b59a8f17fed
[Redesign] Add role="alert" and aria-live="assertive" to validation messages Fix accessibility issue 467720
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ExtensionMethods.cs", "new_path": "src/NuGetGallery/ExtensionMethods.cs", "diff": "@@ -377,10 +377,12 @@ public static HtmlString ShowCheckboxFor<TModel>(this HtmlHelper<TModel> html, E\nvar metadata = ModelMetadata.FromLambdaExpression(expression, html.ViewData);\nvar propertyName = metadata.PropertyName.ToLower();\n- return html.ValidationMessageFor(expression, validationMessage: null, htmlAttributes: new\n+ return html.ValidationMessageFor(expression, validationMessage: null, htmlAttributes: new Dictionary<string, object>\n{\n- id = $\"{propertyName}-validation-message\",\n- @class = \"help-block\"\n+ { \"id\", $\"{propertyName}-validation-message\" },\n+ { \"class\", \"help-block\" },\n+ { \"role\", \"alert\" },\n+ { \"aria-live\", \"assertive\" },\n});\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Add role="alert" and aria-live="assertive" to validation messages Fix accessibility issue 467720
455,736
21.07.2017 13:48:34
25,200
9f7fdb9dfcc39269957e2d783a5b96a55e9ab91f
[Redesign] Focus the copy button after the copy to clipboard is complete Fix accessibility issue 467727
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/common.js", "new_path": "src/NuGetGallery/Scripts/gallery/common.js", "diff": "// source: http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript\n// enhancement with special case for IEs, otherwise the temp textarea will be visible\n- nuget.copyTextToClipboard = function (text) {\n+ nuget.copyTextToClipboard = function (text, elementToFocus) {\nif (detectIE()) {\ntry {\nwindow.clipboardData.setData('Text', text);\n}\ndocument.body.removeChild(textArea);\n+\n+ // Focus the element provided so that tab order is not reset to the beginning of the page.\n+ if (elementToFocus) {\n+ elementToFocus.focus();\n+ }\n}\n};\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/page-api-keys.js", "new_path": "src/NuGetGallery/Scripts/gallery/page-api-keys.js", "diff": "};\nthis.Copy = function () {\n- window.nuget.copyTextToClipboard(self.Value());\nvar $copyButton = self._GetCopyButton();\n+ window.nuget.copyTextToClipboard(self.Value(), $copyButton);\n$copyButton.popover('show');\nsetTimeout(function () {\n$copyButton.popover('destroy');\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/page-display-package.js", "new_path": "src/NuGetGallery/Scripts/gallery/page-display-package.js", "diff": "@@ -7,7 +7,7 @@ $(function () {\ncopyButton.click(function () {\nvar text = $('#' + id + '-text').text().trim();\n- window.nuget.copyTextToClipboard(text);\n+ window.nuget.copyTextToClipboard(text, copyButton);\ncopyButton.popover('show');\nsetTimeout(function () {\ncopyButton.popover('destroy');\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Focus the copy button after the copy to clipboard is complete Fix accessibility issue 467727
455,736
21.07.2017 18:52:21
25,200
d92ddb311a2e473779228e465b6a884587b80af1
[Redesign] Assume dates are UTC (even though their DateTimeKind is Unspecified) Never show relative years -- show full dates at that point Fix Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "new_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "diff": "}\nif(ver.BuildDateUtc != DateTime.MinValue) {\n- @: Built at <span class=\"s-localtime\" data-utc=\"@ver.BuildDateUtc.ToJavaScriptUTC()\">@ver.BuildDateUtc.ToNuGetShortDateString()</span>.\n+ @: Built on <span class=\"s-localtime\" data-utc=\"@ver.BuildDateUtc.ToString(\"O\")\" title=\"@ver.BuildDateUtc.ToString(\"O\")\">@ver.BuildDateUtc.ToNuGetShortDateString()</span>.\n}\n} else {\n@:.\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Extensions/DateTimeExtensions.cs", "new_path": "src/NuGetGallery/Extensions/DateTimeExtensions.cs", "diff": "@@ -18,29 +18,9 @@ public static bool IsInThePast(this DateTime date)\nreturn date < DateTime.UtcNow;\n}\n- public static string ToJavaScriptUTC(this DateTime self)\n- {\n- return ToJavaScript(self.ToUniversalTime());\n- }\n-\n- public static string ToJavaScript(this DateTime self)\n- {\n- return self.ToString(\"O\", CultureInfo.CurrentCulture);\n- }\n-\n- public static string ToNuGetShortDateTimeString(this DateTime self)\n- {\n- return self.ToString(\"yyyy-MM-dd HH:mm:ss\", CultureInfo.CurrentCulture);\n- }\n-\npublic static string ToNuGetShortDateString(this DateTime self)\n{\n- return self.ToString(\"yyyy-MM-dd\", CultureInfo.CurrentCulture);\n- }\n-\n- public static string ToNuGetLongDateString(this DateTime self)\n- {\n- return self.ToString(\"D\", CultureInfo.CurrentCulture);\n+ return self.ToString(\"d\", CultureInfo.CurrentCulture);\n}\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/common.js", "new_path": "src/NuGetGallery/Scripts/gallery/common.js", "diff": "unparsedValue = ('' + unparsedValue).replace(/,/g, '');\nvar parsedValue = parseInt(unparsedValue);\nreturn parsedValue;\n- }\n+ };\n// source: http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript\n// enhancement with special case for IEs, otherwise the temp textarea will be visible\n// Detects whether SVG is supported in the browser.\nnuget.supportsSvg = function () {\nreturn !!(document.createElementNS && document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect);\n- }\n+ };\n// Source: https://developers.google.com/analytics/devguides/collection/analyticsjs/sending-hits\nnuget.createFunctionWithTimeout = function (callback, opt_timeout) {\nvar allButLast = items.slice(0, -1).join(', ');\nvar last = items.slice(-1)[0];\n- return [allButLast, last].join(items.length < 2 ? '' : (items.length == 2 ? ' and ' : ', and '));\n+ return [allButLast, last].join(items.length < 2 ? '' : items.length === 2 ? ' and ' : ', and ');\n};\nnuget.resetFormValidation = function (formElement) {\nreturn typeof ga === 'function';\n};\n+ nuget.getDateFormats = function (input) {\n+ var datetime = moment.utc(input);\n+\n+ if (!datetime.isValid()) {\n+ return null;\n+ }\n+\n+ var title = datetime.utc().format();\n+\n+ // Determine if the duration is less than 11 months, which is moment.js's threshold to switch to\n+ // years display.\n+ var duration = moment.duration(moment().diff(datetime)).abs();\n+ var text;\n+ if (duration.as('M') <= 10) {\n+ text = datetime.fromNow();\n+ } else {\n+ text = datetime.format(\"l\");\n+ }\n+\n+ return {\n+ title: title,\n+ text: text\n+ };\n+ };\n+\nwindow.nuget = nuget;\ninitializeJQueryValidator();\n$(function () {\n// Use moment.js to format attributes with the \"datetime\" attribute to \"X time ago\".\n$.each($('*[data-datetime]'), function () {\n- var datetime = moment($(this).data().datetime);\n- if (!$(this).attr('title')) {\n- $(this).attr('title', datetime.utc().format());\n+ var $el = $(this);\n+ var formats = window.nuget.getDateFormats($el.data().datetime);\n+ if (!formats) {\n+ return;\n+ }\n+\n+ if (!$el.attr('title')) {\n+ $el.attr('title', formats.title);\n}\n- $(this).text(datetime.fromNow());\n+\n+ $el.text(formats.text);\n});\n// Handle confirm pop-ups.\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/TelemetryService.cs", "new_path": "src/NuGetGallery/Services/TelemetryService.cs", "diff": "@@ -126,13 +126,13 @@ private static string GetClientVersion()\nprivate static string GetAccountCreationDate(User user)\n{\n- return user.CreatedUtc != null ? user.CreatedUtc.Value.ToString(\"o\") : \"N/A\";\n+ return user.CreatedUtc?.ToString(\"O\") ?? \"N/A\";\n}\nprivate static string GetApiKeyCreationDate(User user, IIdentity identity)\n{\nvar apiKey = user.GetCurrentApiKeyCredential(identity);\n- return apiKey?.Created.ToString(\"o\") ?? \"N/A\";\n+ return apiKey?.Created.ToString(\"O\") ?? \"N/A\";\n}\nprivate static void TrackEvent(string eventName, Action<Dictionary<string, string>> addProperties)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "@packageVersion.DownloadCount.ToNuGetNumberString()\n</td>\n<td>\n- <span data-datetime=\"@packageVersion.LastUpdated.ToString(\"O\")\">@packageVersion.LastUpdated.ToNuGetLongDateString()</span>\n+ <span data-datetime=\"@packageVersion.LastUpdated.ToString(\"O\")\">@packageVersion.LastUpdated.ToNuGetShortDateString()</span>\n</td>\n@if ((Model.IsOwner(User) || User.IsAdministrator()))\n{\n@packageVersion.DownloadCount\n</td>\n<td>\n- <span data-datetime=\"@packageVersion.LastUpdated.ToString(\"O\")\">@packageVersion.LastUpdated.ToNuGetLongDateString()</span>\n+ <span data-datetime=\"@packageVersion.LastUpdated.ToString(\"O\")\">@packageVersion.LastUpdated.ToNuGetShortDateString()</span>\n</td>\n<td></td>\n</tr>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/_ListPackage.cshtml", "new_path": "src/NuGetGallery/Views/Shared/_ListPackage.cshtml", "diff": "<li>\n<span>\n<i class=\"ms-Icon ms-Icon--History\" aria-hidden=\"true\"></i>\n- last updated <span data-datetime=\"@Model.LastUpdated.ToJavaScriptUTC()\"></span>\n+ last updated <span data-datetime=\"@Model.LastUpdated.ToString(\"O\")\">@Model.LastUpdated.ToNuGetShortDateString()</span>\n</span>\n</li>\n<li>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Statistics/_LastUpdated.cshtml", "new_path": "src/NuGetGallery/Views/Statistics/_LastUpdated.cshtml", "diff": "@if (Model.LastUpdatedUtc != null)\n{\n<div class=\"last-updated\">\n- Statistics last updated at @Model.LastUpdatedUtc.Value.ToNuGetShortDateTimeString() UTC.\n+ Statistics last updated <span data-datetime=\"@Model.LastUpdatedUtc.Value.ToString(\"O\")\">@Model.LastUpdatedUtc.Value.ToString(\"f\")</span>.\n</div>\n}\n\\ No newline at end of file\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Assume dates are UTC (even though their DateTimeKind is Unspecified) Never show relative years -- show full dates at that point Fix https://github.com/NuGet/NuGetGallery/issues/4280 Fix https://github.com/NuGet/NuGetGallery/issues/4424
455,737
25.07.2017 10:51:29
25,200
48d64f1a6dff27af0697fe9e78a9bb1e442e8785
Hide charts if data to display isn't there.
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Statistics/Index.cshtml", "new_path": "src/NuGetGallery/Views/Statistics/Index.cshtml", "diff": "<div class=\"col-md-6 col-xs-12\">\n<h2 class=\"stats-title-text\">NuGet Client Usage (Last 6 Weeks)</h2>\n<div class=\"col-xs-12 chart\">\n- <svg class=\"chart\" id=\"bar-chart-client-usage\">\n@{\n+\nvar limitCount = 15;\nvar minDL = 1000;\nvar showVersions = Model.NuGetClientVersion.Where(e => e.Downloads > minDL);\n{\nshowVersions = showVersions.Skip(Math.Max(0, showVersions.Count() - limitCount));\n}\n+ }\n+ @if (showVersions != null && showVersions.Count() > 0)\n+ {\n+ <svg class=\"chart\" id=\"bar-chart-client-usage\">\n+ @{\nvar chartFullWidthInPercent = 90.0;\nvar chartFullHeightInPercent = 90.0;\n}\n}\n</svg>\n+ }\n</div>\n<table class=\"table col-xs-12 borderless\">\n<thead>\n@{\nforeach (var item in Model.NuGetClientVersion.Reverse())\n{\n- index++;\n-\n<tr tabindex=\"0\" aria-label=\"Version @(item.Version) with @(item.Downloads) Downloads\">\n<td class=\"text-left\">@item.Version</td>\n<td class=\"text-right\">@Model.DisplayDownloads(item.Downloads)</td>\n<div class=\"col-md-6 col-xs-12\">\n<h2 class=\"stats-title-text\">Downloaded Packages Per Week (Last 6 Weeks)</h2>\n<div class=\"col-xs-12 chart\">\n+ @if (Model.Last6Weeks != null)\n+ {\n<svg class=\"chart\" id=\"line-chart-sixweeks-downloads\">\n@{\nvar chartFullWidthInPercent = 90.0;\n}\n</svg>\n+ }\n</div>\n<table class=\"table col-xs-12 borderless\">\n<thead>\n@{\nforeach (var item in Model.Last6Weeks)\n{\n- index++;\n-\n<tr tabindex=\"0\" aria-label=\"Week of @Model.DisplayWeek(item.Year, item.WeekOfYear, StatisticsPackagesViewModel.WeekFormats.StartOnly), @(item.Downloads) Downloads\">\n<td class=\"text-left\" title=\"@Model.DisplayWeek(item.Year, item.WeekOfYear)\">@Model.DisplayWeek(item.Year, item.WeekOfYear)</td>\n<td class=\"text-right\">@Model.DisplayDownloads(item.Downloads)</td>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Hide charts if data to display isn't there.
455,736
26.07.2017 14:54:45
25,200
e19809c812348fd2ff8e8cad89486be2ef52349d
[Redesign] Tabs should have aria-selected attribute in addition to aria-expanded Fix accessibility issue 469486
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/.gitignore", "new_path": "src/Bootstrap/.gitignore", "diff": "@@ -43,3 +43,4 @@ node_modules\n# .map files are currently unused and minification is done by MVC.\ndist/css/*.map\ndist/css/*.min.css\n+dist/js/*.min.js\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/js/bootstrap.js", "new_path": "src/Bootstrap/dist/js/bootstrap.js", "diff": "@@ -2136,11 +2136,13 @@ if (typeof jQuery === 'undefined') {\n.end()\n.find('[data-toggle=\"tab\"]')\n.attr('aria-expanded', false)\n+ .attr('aria-selected', false)\nelement\n.addClass('active')\n.find('[data-toggle=\"tab\"]')\n.attr('aria-expanded', true)\n+ .attr('aria-selected', true)\nif (transition) {\nelement[0].offsetWidth // reflow for transition\n" }, { "change_type": "DELETE", "old_path": "src/Bootstrap/dist/js/bootstrap.min.js", "new_path": null, "diff": "-/*!\n- * Bootstrap v3.3.7 (http://getbootstrap.com)\n- * Copyright 2011-2017 Twitter, Inc.\n- * Licensed under the MIT license\n- */\n-if(\"undefined\"==typeof jQuery)throw new Error(\"Bootstrap's JavaScript requires jQuery\");+function(a){\"use strict\";var b=a.fn.jquery.split(\" \")[0].split(\".\");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error(\"Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4\")}(jQuery),+function(a){\"use strict\";function b(){var a=document.createElement(\"bootstrap\"),b={WebkitTransition:\"webkitTransitionEnd\",MozTransition:\"transitionend\",OTransition:\"oTransitionEnd otransitionend\",transition:\"transitionend\"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(\"bsTransitionEnd\",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var c=a(this),e=c.data(\"bs.alert\");e||c.data(\"bs.alert\",e=new d(this)),\"string\"==typeof b&&e[b].call(c)})}var c='[data-dismiss=\"alert\"]',d=function(b){a(b).on(\"click\",c,this.close)};d.VERSION=\"3.3.7\",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger(\"closed.bs.alert\").remove()}var e=a(this),f=e.attr(\"data-target\");f||(f=e.attr(\"href\"),f=f&&f.replace(/.*(?=#[^\\s]*$)/,\"\"));var g=a(\"#\"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(\".alert\")),g.trigger(b=a.Event(\"close.bs.alert\")),b.isDefaultPrevented()||(g.removeClass(\"in\"),a.support.transition&&g.hasClass(\"fade\")?g.one(\"bsTransitionEnd\",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on(\"click.bs.alert.data-api\",c,d.prototype.close)}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.button\"),f=\"object\"==typeof b&&b;e||d.data(\"bs.button\",e=new c(this,f)),\"toggle\"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION=\"3.3.7\",c.DEFAULTS={loadingText:\"loading...\"},c.prototype.setState=function(b){var c=\"disabled\",d=this.$element,e=d.is(\"input\")?\"val\":\"html\",f=d.data();b+=\"Text\",null==f.resetText&&d.data(\"resetText\",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),\"loadingText\"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle=\"buttons\"]');if(b.length){var c=this.$element.find(\"input\");\"radio\"==c.prop(\"type\")?(c.prop(\"checked\")&&(a=!1),b.find(\".active\").removeClass(\"active\"),this.$element.addClass(\"active\")):\"checkbox\"==c.prop(\"type\")&&(c.prop(\"checked\")!==this.$element.hasClass(\"active\")&&(a=!1),this.$element.toggleClass(\"active\")),c.prop(\"checked\",this.$element.hasClass(\"active\")),a&&c.trigger(\"change\")}else this.$element.attr(\"aria-pressed\",!this.$element.hasClass(\"active\")),this.$element.toggleClass(\"active\")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on(\"click.bs.button.data-api\",'[data-toggle^=\"button\"]',function(c){var d=a(c.target).closest(\".btn\");b.call(d,\"toggle\"),a(c.target).is('input[type=\"radio\"], input[type=\"checkbox\"]')||(c.preventDefault(),d.is(\"input,button\")?d.trigger(\"focus\"):d.find(\"input:visible,button:visible\").first().trigger(\"focus\"))}).on(\"focus.bs.button.data-api blur.bs.button.data-api\",'[data-toggle^=\"button\"]',function(b){a(b.target).closest(\".btn\").toggleClass(\"focus\",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.carousel\"),f=a.extend({},c.DEFAULTS,d.data(),\"object\"==typeof b&&b),g=\"string\"==typeof b?b:f.slide;e||d.data(\"bs.carousel\",e=new c(this,f)),\"number\"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(\".carousel-indicators\"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on(\"keydown.bs.carousel\",a.proxy(this.keydown,this)),\"hover\"==this.options.pause&&!(\"ontouchstart\"in document.documentElement)&&this.$element.on(\"mouseenter.bs.carousel\",a.proxy(this.pause,this)).on(\"mouseleave.bs.carousel\",a.proxy(this.cycle,this))};c.VERSION=\"3.3.7\",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:\"hover\",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(\".item\"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d=\"prev\"==a&&0===c||\"next\"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e=\"prev\"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(\".item.active\"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one(\"slid.bs.carousel\",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?\"next\":\"prev\",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(\".next, .prev\").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide(\"next\")},c.prototype.prev=function(){if(!this.sliding)return this.slide(\"prev\")},c.prototype.slide=function(b,d){var e=this.$element.find(\".item.active\"),f=d||this.getItemForDirection(b,e),g=this.interval,h=\"next\"==b?\"left\":\"right\",i=this;if(f.hasClass(\"active\"))return this.sliding=!1;var j=f[0],k=a.Event(\"slide.bs.carousel\",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(\".active\").removeClass(\"active\");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass(\"active\")}var m=a.Event(\"slid.bs.carousel\",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass(\"slide\")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one(\"bsTransitionEnd\",function(){f.removeClass([b,h].join(\" \")).addClass(\"active\"),e.removeClass([\"active\",h].join(\" \")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass(\"active\"),f.addClass(\"active\"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr(\"data-target\")||(d=e.attr(\"href\"))&&d.replace(/.*(?=#[^\\s]+$)/,\"\"));if(f.hasClass(\"carousel\")){var g=a.extend({},f.data(),e.data()),h=e.attr(\"data-slide-to\");h&&(g.interval=!1),b.call(f,g),h&&f.data(\"bs.carousel\").to(h),c.preventDefault()}};a(document).on(\"click.bs.carousel.data-api\",\"[data-slide]\",e).on(\"click.bs.carousel.data-api\",\"[data-slide-to]\",e),a(window).on(\"load\",function(){a('[data-ride=\"carousel\"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){\"use strict\";function b(b){var c,d=b.attr(\"data-target\")||(c=b.attr(\"href\"))&&c.replace(/.*(?=#[^\\s]+$)/,\"\");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data(\"bs.collapse\"),f=a.extend({},d.DEFAULTS,c.data(),\"object\"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data(\"bs.collapse\",e=new d(this,f)),\"string\"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle=\"collapse\"][href=\"#'+b.id+'\"],[data-toggle=\"collapse\"][data-target=\"#'+b.id+'\"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION=\"3.3.7\",d.TRANSITION_DURATION=0,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass(\"width\");return a?\"width\":\"height\"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass(\"in\")){var b,e=this.$parent&&this.$parent.children(\".panel\").children(\".in, .collapsing\");if(!(e&&e.length&&(b=e.data(\"bs.collapse\"),b&&b.transitioning))){var f=a.Event(\"show.bs.collapse\");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,\"hide\"),b||e.data(\"bs.collapse\",null));var g=this.dimension();this.$element.removeClass(\"collapse\").addClass(\"collapsing\")[g](0).attr(\"aria-expanded\",!0),this.$trigger.removeClass(\"collapsed\").attr(\"aria-expanded\",!0),this.transitioning=1;var h=function(){this.$element.removeClass(\"collapsing\").addClass(\"collapse in\")[g](\"\"),this.transitioning=0,this.$element.trigger(\"shown.bs.collapse\")};if(!a.support.transition)return h.call(this);var i=a.camelCase([\"scroll\",g].join(\"-\"));this.$element.one(\"bsTransitionEnd\",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass(\"in\")){var b=a.Event(\"hide.bs.collapse\");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass(\"collapsing\").removeClass(\"collapse in\").attr(\"aria-expanded\",!1),this.$trigger.addClass(\"collapsed\").attr(\"aria-expanded\",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass(\"collapsing\").addClass(\"collapse\").trigger(\"hidden.bs.collapse\")};return a.support.transition?void this.$element[c](0).one(\"bsTransitionEnd\",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass(\"in\")?\"hide\":\"show\"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle=\"collapse\"][data-parent=\"'+this.options.parent+'\"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass(\"in\");a.attr(\"aria-expanded\",c),b.toggleClass(\"collapsed\",!c).attr(\"aria-expanded\",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on(\"click.bs.collapse.data-api\",'[data-toggle=\"collapse\"]',function(d){var e=a(this);e.attr(\"data-target\")||d.preventDefault();var f=b(e),g=f.data(\"bs.collapse\"),h=g?\"toggle\":e.data();c.call(f,h)})}(jQuery),+function(a){\"use strict\";function b(b){var c=b.attr(\"data-target\");c||(c=b.attr(\"href\"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\\s]*$)/,\"\"));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass(\"open\")&&(c&&\"click\"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event(\"hide.bs.dropdown\",f)),c.isDefaultPrevented()||(d.attr(\"aria-expanded\",\"false\"),e.removeClass(\"open\").trigger(a.Event(\"hidden.bs.dropdown\",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data(\"bs.dropdown\");d||c.data(\"bs.dropdown\",d=new g(this)),\"string\"==typeof b&&d[b].call(c)})}var e=\".dropdown-backdrop\",f='[data-toggle=\"dropdown\"]',g=function(b){a(b).on(\"click.bs.dropdown\",this.toggle)};g.VERSION=\"3.3.7\",g.prototype.toggle=function(d){var e=a(this);if(!e.is(\".disabled, :disabled\")){var f=b(e),g=f.hasClass(\"open\");if(c(),!g){\"ontouchstart\"in document.documentElement&&!f.closest(\".navbar-nav\").length&&a(document.createElement(\"div\")).addClass(\"dropdown-backdrop\").insertAfter(a(this)).on(\"click\",c);var h={relatedTarget:this};if(f.trigger(d=a.Event(\"show.bs.dropdown\",h)),d.isDefaultPrevented())return;e.trigger(\"focus\").attr(\"aria-expanded\",\"true\"),f.toggleClass(\"open\").trigger(a.Event(\"shown.bs.dropdown\",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(\".disabled, :disabled\")){var e=b(d),g=e.hasClass(\"open\");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger(\"focus\"),d.trigger(\"click\");var h=\" li:not(.disabled):visible a\",i=e.find(\".dropdown-menu\"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger(\"focus\")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on(\"click.bs.dropdown.data-api\",c).on(\"click.bs.dropdown.data-api\",\".dropdown form\",function(a){a.stopPropagation()}).on(\"click.bs.dropdown.data-api\",f,g.prototype.toggle).on(\"keydown.bs.dropdown.data-api\",f,g.prototype.keydown).on(\"keydown.bs.dropdown.data-api\",\".dropdown-menu\",g.prototype.keydown)}(jQuery),+function(a){\"use strict\";function b(b,d){return this.each(function(){var e=a(this),f=e.data(\"bs.modal\"),g=a.extend({},c.DEFAULTS,e.data(),\"object\"==typeof b&&b);f||e.data(\"bs.modal\",f=new c(this,g)),\"string\"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(\".modal-dialog\"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(\".modal-content\").load(this.options.remote,a.proxy(function(){this.$element.trigger(\"loaded.bs.modal\")},this))};c.VERSION=\"3.3.7\",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event(\"show.bs.modal\",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass(\"modal-open\"),this.escape(),this.resize(),this.$element.on(\"click.dismiss.bs.modal\",'[data-dismiss=\"modal\"]',a.proxy(this.hide,this)),this.$dialog.on(\"mousedown.dismiss.bs.modal\",function(){d.$element.one(\"mouseup.dismiss.bs.modal\",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass(\"fade\");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass(\"in\"),d.enforceFocus();var f=a.Event(\"shown.bs.modal\",{relatedTarget:b});e?d.$dialog.one(\"bsTransitionEnd\",function(){d.$element.trigger(\"focus\").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger(\"focus\").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event(\"hide.bs.modal\"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off(\"focusin.bs.modal\"),this.$element.removeClass(\"in\").off(\"click.dismiss.bs.modal\").off(\"mouseup.dismiss.bs.modal\"),this.$dialog.off(\"mousedown.dismiss.bs.modal\"),a.support.transition&&this.$element.hasClass(\"fade\")?this.$element.one(\"bsTransitionEnd\",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off(\"focusin.bs.modal\").on(\"focusin.bs.modal\",a.proxy(function(a){document===a.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger(\"focus\")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on(\"keydown.dismiss.bs.modal\",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off(\"keydown.dismiss.bs.modal\")},c.prototype.resize=function(){this.isShown?a(window).on(\"resize.bs.modal\",a.proxy(this.handleUpdate,this)):a(window).off(\"resize.bs.modal\")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass(\"modal-open\"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger(\"hidden.bs.modal\")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass(\"fade\")?\"fade\":\"\";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement(\"div\")).addClass(\"modal-backdrop \"+e).appendTo(this.$body),this.$element.on(\"click.dismiss.bs.modal\",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&(\"static\"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass(\"in\"),!b)return;f?this.$backdrop.one(\"bsTransitionEnd\",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass(\"in\");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass(\"fade\")?this.$backdrop.one(\"bsTransitionEnd\",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:\"\",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:\"\"})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:\"\",paddingRight:\"\"})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css(\"padding-right\")||0,10);this.originalBodyPad=document.body.style.paddingRight||\"\",this.bodyIsOverflowing&&this.$body.css(\"padding-right\",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css(\"padding-right\",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement(\"div\");a.className=\"modal-scrollbar-measure\",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on(\"click.bs.modal.data-api\",'[data-toggle=\"modal\"]',function(c){var d=a(this),e=d.attr(\"href\"),f=a(d.attr(\"data-target\")||e&&e.replace(/.*(?=#[^\\s]+$)/,\"\")),g=f.data(\"bs.modal\")?\"toggle\":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is(\"a\")&&c.preventDefault(),f.one(\"show.bs.modal\",function(a){a.isDefaultPrevented()||f.one(\"hidden.bs.modal\",function(){d.is(\":visible\")&&d.trigger(\"focus\")})}),b.call(f,g,this)})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.tooltip\"),f=\"object\"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data(\"bs.tooltip\",e=new c(this,f)),\"string\"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init(\"tooltip\",a,b)};c.VERSION=\"3.3.7\",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:\"top\",selector:!1,template:'<div class=\"tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>',trigger:\"hover focus\",title:\"\",delay:0,html:!1,container:!1,viewport:{selector:\"body\",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error(\"`selector` option must be specified when initializing \"+this.type+\" on the window.document object!\");for(var e=this.options.trigger.split(\" \"),f=e.length;f--;){var g=e[f];if(\"click\"==g)this.$element.on(\"click.\"+this.type,this.options.selector,a.proxy(this.toggle,this));else if(\"manual\"!=g){var h=\"hover\"==g?\"mouseenter\":\"focusin\",i=\"hover\"==g?\"mouseleave\":\"focusout\";this.$element.on(h+\".\"+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+\".\"+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:\"manual\",selector:\"\"}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&\"number\"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data(\"bs.\"+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c)),b instanceof a.Event&&(c.inState[\"focusin\"==b.type?\"focus\":\"hover\"]=!0),c.tip().hasClass(\"in\")||\"in\"==c.hoverState?void(c.hoverState=\"in\"):(clearTimeout(c.timeout),c.hoverState=\"in\",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){\"in\"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data(\"bs.\"+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c)),b instanceof a.Event&&(c.inState[\"focusout\"==b.type?\"focus\":\"hover\"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState=\"out\",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){\"out\"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event(\"show.bs.\"+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr(\"id\",g),this.$element.attr(\"aria-describedby\",g),this.options.animation&&f.addClass(\"fade\");var h=\"function\"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\\s?auto?\\s?/i,j=i.test(h);j&&(h=h.replace(i,\"\")||\"top\"),f.detach().css({top:0,left:0,display:\"block\"}).addClass(h).data(\"bs.\"+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger(\"inserted.bs.\"+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h=\"bottom\"==h&&k.bottom+m>o.bottom?\"top\":\"top\"==h&&k.top-m<o.top?\"bottom\":\"right\"==h&&k.right+l>o.width?\"left\":\"left\"==h&&k.left-l<o.left?\"right\":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger(\"shown.bs.\"+e.type),e.hoverState=null,\"out\"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass(\"fade\")?f.one(\"bsTransitionEnd\",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css(\"margin-top\"),10),h=parseInt(d.css(\"margin-left\"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass(\"in\");var i=d[0].offsetWidth,j=d[0].offsetHeight;\"top\"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?\"offsetWidth\":\"offsetHeight\";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?\"left\":\"top\",50*(1-a/b)+\"%\").css(c?\"top\":\"left\",\"\")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(\".tooltip-inner\")[this.options.html?\"html\":\"text\"](b),a.removeClass(\"fade in top bottom left right\")},c.prototype.hide=function(b){function d(){\"in\"!=e.hoverState&&f.detach(),e.$element&&e.$element.removeAttr(\"aria-describedby\").trigger(\"hidden.bs.\"+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event(\"hide.bs.\"+this.type);if(this.$element.trigger(g),!g.isDefaultPrevented())return f.removeClass(\"in\"),a.support.transition&&f.hasClass(\"fade\")?f.one(\"bsTransitionEnd\",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this},c.prototype.fixTitle=function(){var a=this.$element;(a.attr(\"title\")||\"string\"!=typeof a.attr(\"data-original-title\"))&&a.attr(\"data-original-title\",a.attr(\"title\")||\"\").attr(\"title\",\"\")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d=\"BODY\"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=window.SVGElement&&c instanceof window.SVGElement,g=d?{top:0,left:0}:f?null:b.offset(),h={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},i=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,h,i,g)},c.prototype.getCalculatedOffset=function(a,b,c,d){return\"bottom\"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:\"top\"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:\"left\"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr(\"data-original-title\")||(\"function\"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+\" `template` option must consist of exactly 1 top-level element!\");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(\".tooltip-arrow\")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data(\"bs.\"+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass(\"in\")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off(\".\"+a.type).removeData(\"bs.\"+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.popover\"),f=\"object\"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data(\"bs.popover\",e=new c(this,f)),\"string\"==typeof b&&e[b]())})}var c=function(a,b){this.init(\"popover\",a,b)};if(!a.fn.tooltip)throw new Error(\"Popover requires tooltip.js\");c.VERSION=\"3.3.7\",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:\"right\",trigger:\"click\",content:\"\",template:'<div class=\"popover\" role=\"tooltip\"><div class=\"arrow\"></div><h3 class=\"popover-title\"></h3><div class=\"popover-content\"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(\".popover-title\")[this.options.html?\"html\":\"text\"](b),a.find(\".popover-content\").children().detach().end()[this.options.html?\"string\"==typeof c?\"html\":\"append\":\"text\"](c),a.removeClass(\"fade top bottom left right in\"),a.find(\".popover-title\").html()||a.find(\".popover-title\").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr(\"data-content\")||(\"function\"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(\".arrow\")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){\"use strict\";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||\"\")+\" .nav li > a\",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on(\"scroll.bs.scrollspy\",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data(\"bs.scrollspy\"),f=\"object\"==typeof c&&c;e||d.data(\"bs.scrollspy\",e=new b(this,f)),\"string\"==typeof c&&e[c]()})}b.VERSION=\"3.3.7\",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c=\"offset\",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c=\"position\",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data(\"target\")||b.attr(\"href\"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(\":visible\")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){\n-this.activeTarget=b,this.clear();var c=this.selector+'[data-target=\"'+b+'\"],'+this.selector+'[href=\"'+b+'\"]',d=a(c).parents(\"li\").addClass(\"active\");d.parent(\".dropdown-menu\").length&&(d=d.closest(\"li.dropdown\").addClass(\"active\")),d.trigger(\"activate.bs.scrollspy\")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,\".active\").removeClass(\"active\")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on(\"load.bs.scrollspy.data-api\",function(){a('[data-spy=\"scroll\"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.tab\");e||d.data(\"bs.tab\",e=new c(this)),\"string\"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION=\"3.3.7\",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest(\"ul:not(.dropdown-menu)\"),d=b.data(\"target\");if(d||(d=b.attr(\"href\"),d=d&&d.replace(/.*(?=#[^\\s]*$)/,\"\")),!b.parent(\"li\").hasClass(\"active\")){var e=c.find(\".active:last a\"),f=a.Event(\"hide.bs.tab\",{relatedTarget:b[0]}),g=a.Event(\"show.bs.tab\",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest(\"li\"),c),this.activate(h,h.parent(),function(){e.trigger({type:\"hidden.bs.tab\",relatedTarget:b[0]}),b.trigger({type:\"shown.bs.tab\",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass(\"active\").find(\"> .dropdown-menu > .active\").removeClass(\"active\").end().find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!1),b.addClass(\"active\").find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!0),h?(b[0].offsetWidth,b.addClass(\"in\")):b.removeClass(\"fade\"),b.parent(\".dropdown-menu\").length&&b.closest(\"li.dropdown\").addClass(\"active\").end().find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!0),e&&e()}var g=d.find(\"> .active\"),h=e&&a.support.transition&&(g.length&&g.hasClass(\"fade\")||!!d.find(\"> .fade\").length);g.length&&h?g.one(\"bsTransitionEnd\",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass(\"in\")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),\"show\")};a(document).on(\"click.bs.tab.data-api\",'[data-toggle=\"tab\"]',e).on(\"click.bs.tab.data-api\",'[data-toggle=\"pill\"]',e)}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.affix\"),f=\"object\"==typeof b&&b;e||d.data(\"bs.affix\",e=new c(this,f)),\"string\"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on(\"scroll.bs.affix.data-api\",a.proxy(this.checkPosition,this)).on(\"click.bs.affix.data-api\",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION=\"3.3.7\",c.RESET=\"affix affix-top affix-bottom\",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&\"top\"==this.affixed)return e<c&&\"top\";if(\"bottom\"==this.affixed)return null!=c?!(e+this.unpin<=f.top)&&\"bottom\":!(e+g<=a-d)&&\"bottom\";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&e<=c?\"top\":null!=d&&i+j>=a-d&&\"bottom\"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass(\"affix\");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(\":visible\")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());\"object\"!=typeof d&&(f=e=d),\"function\"==typeof e&&(e=d.top(this.$element)),\"function\"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css(\"top\",\"\");var i=\"affix\"+(h?\"-\"+h:\"\"),j=a.Event(i+\".bs.affix\");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin=\"bottom\"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace(\"affix\",\"affixed\")+\".bs.affix\")}\"bottom\"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on(\"load\",function(){a('[data-spy=\"affix\"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/js/tab.js", "new_path": "src/Bootstrap/js/tab.js", "diff": ".end()\n.find('[data-toggle=\"tab\"]')\n.attr('aria-expanded', false)\n+ .attr('aria-selected', false)\nelement\n.addClass('active')\n.find('[data-toggle=\"tab\"]')\n.attr('aria-expanded', true)\n+ .attr('aria-selected', true)\nif (transition) {\nelement[0].offsetWidth // reflow for transition\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/bootstrap.js", "new_path": "src/NuGetGallery/Scripts/gallery/bootstrap.js", "diff": "@@ -2136,11 +2136,13 @@ if (typeof jQuery === 'undefined') {\n.end()\n.find('[data-toggle=\"tab\"]')\n.attr('aria-expanded', false)\n+ .attr('aria-selected', false)\nelement\n.addClass('active')\n.find('[data-toggle=\"tab\"]')\n.attr('aria-expanded', true)\n+ .attr('aria-selected', true)\nif (transition) {\nelement[0].offsetWidth // reflow for transition\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "@helper CommandTab(string label, string id, bool active)\n{\n<li role=\"presentation\" class=\"@(active ? \"active\" : string.Empty)\">\n- <a href=\"#@id\" aria-controls=\"@id\" title=\"Switch to tab panel which contains package installation command for @label\"\n- role=\"tab\" data-toggle=\"tab\">\n+ <a href=\"#@id\" aria-expanded=\"@(active ? \"true\" : \"false\")\"\n+ aria-selected=\"@(active ? \"true\" : \"false\")\"\n+ aria-controls=\"@id\" role=\"tab\" data-toggle=\"tab\"\n+ title=\"Switch to tab panel which contains package installation command for @label\">\n@label\n</a>\n</li>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Tabs should have aria-selected attribute in addition to aria-expanded Fix accessibility issue 469486
455,736
26.07.2017 14:59:01
25,200
7a73bbfa52de50ee1f81093028e8dd848814c503
[Redesign] Add aria-label to package command copy button Fix accessibility issue 469487
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "</li>\n}\n-@helper CommandPanel(Func<MvcHtmlString, HelperResult> htmlContent, string id, bool active)\n+@helper CommandPanel(Func<MvcHtmlString, HelperResult> htmlContent, string label, string id, bool active)\n{\n<div role=\"tabpanel\" class=\"tab-pane @(active ? \"active\" : string.Empty)\" id=\"@id\">\n<div>\n</div>\n<div class=\"copy-button\">\n<button id=\"@id-button\" class=\"btn btn-default btn-warning\" type=\"button\"\n- data-toggle=\"popover\" data-placement=\"bottom\" data-content=\"Copied.\">\n+ data-toggle=\"popover\" data-placement=\"bottom\" data-content=\"Copied.\"\n+ aria-label=\"Copy the @label command\">\n<span class=\"ms-Icon ms-Icon--Copy\" aria-hidden=\"true\"></span>\n</button>\n</div>\n@CommandTab(\".NET CLI\", \"dotnet-cli\", active: false)\n</ul>\n<div class=\"tab-content\">\n- @CommandPanel(@<text>Install-Package @Model.Id -Version @Model.Version</text>, \"package-manager\", active: true)\n- @CommandPanel(@<text>dotnet add package @Model.Id --version @Model.Version</text>, \"dotnet-cli\", active: false)\n+ @CommandPanel(@<text>Install-Package @Model.Id -Version @Model.Version</text>, \"Package Manager\", \"package-manager\", active: true)\n+ @CommandPanel(@<text>dotnet add package @Model.Id --version @Model.Version</text>, \".NET CLI\", \"dotnet-cli\", active: false)\n</div>\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Add aria-label to package command copy button Fix accessibility issue 469487
455,736
26.07.2017 15:20:11
25,200
283a5871b162cab6651817f258b5403bc9759b55
[Redesign] Make sure all pages use role="main" Fix accessibility issue 469492
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "new_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "diff": "@helper ErrorPage(UrlHelper url, System.Web.Mvc.HtmlHelper html, string errorNumber, string errorName, Func<MvcHtmlString, HelperResult> errorTextMain, Func<MvcHtmlString, HelperResult> errorTextSub = null)\n{\n- <section class=\"container main-container\">\n+ <section role=\"main\" class=\"container main-container\">\n<div class=\"row page-error\">\n<div class=\"col-sm-12 ms-fontWeight-light\">\n<p class=\"oops\">Oops!</p>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/CuratedFeeds/CuratedFeed.cshtml", "new_path": "src/NuGetGallery/Views/CuratedFeeds/CuratedFeed.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<section class=\"main-container container page-manage-curated-feed\">\n+<section role=\"main\" class=\"container main-container page-manage-curated-feed\">\n<div class=\"row\">\n<div class=\"col-md-12\">\n<h1 class=\"text-center\">Curated Feed <a href=\"@Url.CuratedPackageList(0, \"\", Model.Name)\" class=\"ms-noWrap\">@Model.Name</a></h1>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/CuratedPackages/CreateCuratedPackageForm.cshtml", "new_path": "src/NuGetGallery/Views/CuratedPackages/CreateCuratedPackageForm.cshtml", "diff": "ViewBag.MdPageColumns = Constants.ColumnsFormMd;\nLayout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<section class=\"main-container container\">\n+<section role=\"main\" class=\"container main-container\">\n<div class=\"row\">\n<div class=\"col-md-12\">\n<h1 class=\"text-center\">Include Package in <a href=\"@Url.CuratedPackageList(0, \"\", (string)ViewBag.CuratedFeedName)\" class=\"ms-noWrap\">@ViewBag.CuratedFeedName</a></h1>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/Delete.cshtml", "new_path": "src/NuGetGallery/Views/Packages/Delete.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<section class=\"container main-container page-delete-package\">\n+<section role=\"main\" class=\"container main-container page-delete-package\">\n<div class=\"row\">\n<div class=\"@ViewHelpers.GetColumnClasses(ViewBag)\">\n@Html.Partial(\"_PackageHeading\", new PackageHeadingModel\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/Edit.cshtml", "new_path": "src/NuGetGallery/Views/Packages/Edit.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<div class=\"container main-container page-edit-package\">\n+<section role=\"main\" class=\"container main-container page-edit-package\">\n<div class=\"row\">\n<div class=\"@ViewHelpers.GetColumnClasses(ViewBag)\">\n@Html.Partial(\"_PackageHeading\", new PackageHeadingModel\n@Html.Partial(\"_EditMetadata\")\n</div>\n</div>\n-</div>\n+</section>\n@section BottomScripts {\n@Scripts.Render(\"~/Scripts/jquery-ui-1.10.3.js\")\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/ReportAbuse.cshtml", "new_path": "src/NuGetGallery/Views/Packages/ReportAbuse.cshtml", "diff": "string returnUrl = ViewData.ContainsKey(Constants.ReturnUrlViewDataKey) ? (string)ViewData[Constants.ReturnUrlViewDataKey] : Request.RawUrl;\n}\n-<section class=\"container main-container page-report-abuse\">\n+<section role=\"main\" class=\"container main-container page-report-abuse\">\n<div class=\"row report-form\">\n<div class=\"@ViewHelpers.GetColumnClasses(ViewBag)\">\n@Html.Partial(\"_PackageHeading\", new PackageHeadingModel\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/ReportMyPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/ReportMyPackage.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<div class=\"container main-container page-report-abuse\">\n+<section role=\"main\" class=\"container main-container page-report-abuse\">\n<div class=\"row report-form\">\n<div class=\"@ViewHelpers.GetColumnClasses(ViewBag)\">\n@Html.Partial(\"_PackageHeading\", new PackageHeadingModel\n}\n</div>\n</div>\n-</div>\n+</section>\n@section BottomScripts {\n@Html.SpamPreventionScript()\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/UploadPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/UploadPackage.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<div class=\"page-upload container main-container\" role=\"main\">\n+<section role=\"main\" class=\"container main-container page-upload\">\n<div class=\"row\">\n<div class=\"@ViewHelpers.GetColumnClasses(ViewBag)\">\n<h1 class=\"page-heading text-center\">Upload Your Package</h1>\n@Html.Partial(\"_EditMetadata\")\n</div>\n</div>\n-</div>\n+</section>\n@section BottomScripts\n{\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Pages/About.cshtml", "new_path": "src/NuGetGallery/Views/Pages/About.cshtml", "diff": "<ul class=\"contributors list-inline\" data-bind=\"foreach: $data\"><li class=\"contributor\"><a data-bind=\"attr: { href: html_url }\"><img class=\"avatar\" data-bind=\"attr: { src: avatar_url, title: login }\" /></a></li></ul>\n</script>\n-<section class=\"container main-container page-about\">\n+<section role=\"main\" class=\"container main-container page-about\">\n<div class=\"row\">\n<div class=\"col-xs-12\">\n<h1>About NuGet</h1>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Statistics/Index.cshtml", "new_path": "src/NuGetGallery/Views/Statistics/Index.cshtml", "diff": "}\n}\n-<section class=\"container main-container page-statistics-overview\">\n+<section role=\"main\" class=\"container main-container page-statistics-overview\">\n<h1>Statistics</h1>\n<span class=\"page-subheading ms-fontSize-l\">\n@Html.Partial(\"_LastUpdated\", Model)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Statistics/PackageDownloadsByVersion.cshtml", "new_path": "src/NuGetGallery/Views/Statistics/PackageDownloadsByVersion.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<div class=\"container main-container page-stats-per-package\">\n+<section role=\"main\" class=\"container main-container page-stats-per-package\">\n<div class=\"row\">\n<h1 class=\"statistics-report-title col-sm-12 page-heading\">\nPackage Downloads for <a href=\"@Url.Package(Model.PackageId)\">@Model.PackageId</a>\n</div>\n@Html.Partial(\"_PivotTable\")\n-</div>\n+</section>\n@section BottomScripts\n{\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Statistics/PackageDownloadsDetail.cshtml", "new_path": "src/NuGetGallery/Views/Statistics/PackageDownloadsDetail.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<div class=\"container main-container page-stats-per-package\">\n+<section role=\"main\" class=\"container main-container page-stats-per-package\">\n<div class=\"row\">\n<h1 class=\"statistics-report-title col-sm-12 page-heading\">\nPackage Downloads for <a href=\"@Url.Package(Model.PackageId, Model.PackageVersion)\">@Model.PackageId @Model.PackageVersion</a>\n</div>\n@Html.Partial(\"_PivotTable\")\n-</div>\n+</section>\n@section BottomScripts\n{\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/Confirm.cshtml", "new_path": "src/NuGetGallery/Views/Users/Confirm.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<section class=\"container main-container\" role=\"main\">\n+<section role=\"main\" class=\"container main-container\">\n<div class=\"row\">\n<div class=\"col-xs-12\">\n@if (Model.SuccessfulConfirmation)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/ConfirmationRequired.cshtml", "new_path": "src/NuGetGallery/Views/Users/ConfirmationRequired.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<section class=\"container main-container\" role=\"main\">\n+<section role=\"main\" class=\"container main-container\">\n<div class=\"row\">\n<div class=\"col-sm-12\">\n@if (Model.SentEmail)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/Profiles.cshtml", "new_path": "src/NuGetGallery/Views/Users/Profiles.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<div class=\"container main-container page-profile\">\n+<section role=\"main\" class=\"container main-container page-profile\">\n<section role=\"main\" class=\"row\">\n<aside class=\"col-md-3 col-md-push-9 profile-details\">\n@ViewHelpers.GravatarImage(Model.EmailAddress ?? Model.UnconfirmedEmailAddress, Model.Username, 332, responsive: true)\n@ViewHelpers.PreviousNextPager(Model.Pager)\n</article>\n</section>\n-</div>\n\\ No newline at end of file\n+</section>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/Thanks.cshtml", "new_path": "src/NuGetGallery/Views/Users/Thanks.cshtml", "diff": "Layout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n}\n-<article role=\"main\" class=\"container main-container text-center\">\n+<section role=\"main\" class=\"container main-container text-center\">\n<div class=\"row\">\n<div class=\"col-xs-12\">\n<h1>\n<p>Have a NuGet package ready for the world? <a href=\"@Url.UploadPackage()\">Upload a package</a></p>\n</div>\n</div>\n-</article>\n+</section>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Make sure all pages use role="main" Fix accessibility issue 469492
455,736
26.07.2017 15:42:21
25,200
c3921083919d2d703fe02bb8ed5649353def8928
[Redesign] Make sure there is a package title on every page Fix accessibility issue 469494
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "@model DisplayPackageViewModel\n-\n@{\nViewBag.Title = Model.Id + \" \" + Model.Version;\nViewBag.Tab = \"Packages\";\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Make sure there is a package title on every page Fix accessibility issue 469494
455,736
26.07.2017 16:06:39
25,200
99a575e400b3b95d7c4787de2e67e3ce1a1bccad
[Redesign] Move the long account checkbox descriptions outside of the label Fix accessibility issue 469496
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -396,6 +396,9 @@ img.package-icon {\n.page-account-settings .form-group + .form-group .btn {\nmargin-top: 20px;\n}\n+.page-account-settings .checkbox .description {\n+ padding-left: 20px;\n+}\n.page-api-keys .example-commands {\npadding: 8px 10px;\nfont-family: Consolas, Menlo, Monaco, \"Courier New\", monospace;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-account-settings.less", "new_path": "src/Bootstrap/less/theme/page-account-settings.less", "diff": "margin-top: 20px;\n}\n}\n+\n+ .checkbox {\n+ .description {\n+ padding-left: 20px;\n+ }\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -396,6 +396,9 @@ img.package-icon {\n.page-account-settings .form-group + .form-group .btn {\nmargin-top: 20px;\n}\n+.page-account-settings .checkbox .description {\n+ padding-left: 20px;\n+}\n.page-api-keys .example-commands {\npadding: 8px 10px;\nfont-family: Consolas, Menlo, Monaco, \"Courier New\", monospace;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/Account.cshtml", "new_path": "src/NuGetGallery/Views/Users/Account.cshtml", "diff": "<label>\n@Html.ShowCheckboxFor(x => x.ChangeNotifications.EmailAllowed)\n<b>Users can contact me through the @Config.Current.Brand</b>\n- <br />\n+ </label>\n+ <div class=\"description\">\nThis setting allows other registered users of the site to contact you\nabout packages that you own using the <em>Contact Owners</em> form, or to request\nthat you become an owner of their package. Disabling this setting means users cannot\ncontact you for these reasons.\n- </label>\n+ </div>\n</div>\n<div class=\"checkbox\">\n<label>\n@Html.ShowCheckboxFor(x => x.ChangeNotifications.NotifyPackagePushed)\n<b>Notify me when a package is pushed to @Config.Current.Brand using my account</b>\n- <br />\n+ </label>\n+ <div class=\"description\">\nThis setting enables notifications whenever a package is pushed using your\naccount. We recommend to enable this setting so that you can inspect whether a\npackage was pushed intentionally or not. Disabling this setting means no notification\nwill be sent on push.\n- </label>\n+ </div>\n</div>\n<p>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Move the long account checkbox descriptions outside of the label Fix accessibility issue 469496
455,736
26.07.2017 17:09:22
25,200
44021b850f27c8b539e4e0e6202d7c15f9bc4a75
[Redesign] Give transient messages role="alert" Fix accessibility issue 469498
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/Gallery/Header.cshtml", "new_path": "src/NuGetGallery/Views/Shared/Gallery/Header.cshtml", "diff": "<div class=\"alert-transient @(ViewBag.HasJumbotron == true ? \"alert-transient-jumbotron\" : string.Empty)\">\n<div class=\"container\">\n<div class=\"row\">\n- <div class=\"@ViewHelpers.GetColumnClasses(ViewBag)\">\n+ <div class=\"@ViewHelpers.GetColumnClasses(ViewBag)\" role=\"alert\" aria-live=\"assertive\">\n@ViewHelpers.AlertInfo(@<text>@TempData[\"Message\"]</text>)\n</div>\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Give transient messages role="alert" Fix accessibility issue 469498
455,736
27.07.2017 09:28:25
25,200
513a45b33db76385520cd0583fa9e4fe0b09a6db
[Redesign] Make the warnings on the API key page role="alert" Fix accessibility issue 469501
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "new_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "diff": "@helper Alert(Func<MvcHtmlString, HelperResult> htmlContent, string subclass, string icon, bool isAlertRole = false)\n{\n- <div class=\"alert alert-@subclass\" @if (isAlertRole) { <text> role=\"alert\" </text> }>\n+ <div class=\"alert alert-@subclass\" @if (isAlertRole) { <text> role=\"alert\" aria-live=\"assertive\" </text> }>\n<ul class=\"list-unstyled ms-Icon-ul\">\n<li>\n<i class=\"ms-Icon ms-Icon--@icon\" aria-hidden=\"true\"></i>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/ApiKeys.cshtml", "new_path": "src/NuGetGallery/Views/Users/ApiKeys.cshtml", "diff": "have\n<!-- /ko -->\nexpired.\n- </text>)\n+ </text>,\n+ isAlertRole: true)\n<!-- /ko -->\n<!-- ko if: AnyJustCreated -->\n@ViewHelpers.AlertWarning(\nA new API key has been created. Make sure to copy your new API key now using the\n<b>Copy</b>\nbutton below. You will not be able to do so again.\n- </text>)\n+ </text>,\n+ isAlertRole: true)\n<!-- /ko -->\n<!-- ko if: AnyJustRegenerated -->\n@ViewHelpers.AlertWarning(\nYour API key has been regenerated. Make sure to copy your new API key now using the\n<b>Copy</b>\nbutton below. You will not be able to do so again.\n- </text>)\n+ </text>,\n+ isAlertRole: true)\n<!-- /ko -->\n<div data-bind=\"template: { name: 'api-key-details', foreach: ApiKeys }\">\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Make the warnings on the API key page role="alert" Fix accessibility issue 469501
455,736
27.07.2017 10:19:11
25,200
c245f2caeedc052be830a791879f2d4c8e0cc943
[Redesign] Fix outline on links for Firefox (as -webkit-focus-ring-color is not supported) Fix accessibility issue 470363
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap.css", "new_path": "src/Bootstrap/dist/css/bootstrap.css", "diff": "@@ -301,6 +301,7 @@ a:focus {\ntext-decoration: underline;\n}\na:focus {\n+ outline: 2px auto Highlight;\noutline: 5px auto -webkit-focus-ring-color;\noutline-offset: -2px;\n}\n@@ -1730,6 +1731,7 @@ select[size] {\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n+ outline: 2px auto Highlight;\noutline: 5px auto -webkit-focus-ring-color;\noutline-offset: -2px;\n}\n@@ -2221,6 +2223,7 @@ select[multiple].input-lg {\n.btn.focus,\n.btn:active.focus,\n.btn.active.focus {\n+ outline: 2px auto Highlight;\noutline: 5px auto -webkit-focus-ring-color;\noutline-offset: -2px;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/mixins/tab-focus.less", "new_path": "src/Bootstrap/less/mixins/tab-focus.less", "diff": "// WebKit-specific. Other browsers will keep their default outline style.\n// (Initially tried to also force default via `outline: initial`,\n// but that seems to erroneously remove the outline in Firefox altogether.)\n+ // The next line came from: https://stackoverflow.com/a/38571103\n+ outline: 2px auto Highlight;\noutline: 5px auto -webkit-focus-ring-color;\noutline-offset: -2px;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap.css", "diff": "@@ -301,6 +301,7 @@ a:focus {\ntext-decoration: underline;\n}\na:focus {\n+ outline: 2px auto Highlight;\noutline: 5px auto -webkit-focus-ring-color;\noutline-offset: -2px;\n}\n@@ -1730,6 +1731,7 @@ select[size] {\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n+ outline: 2px auto Highlight;\noutline: 5px auto -webkit-focus-ring-color;\noutline-offset: -2px;\n}\n@@ -2221,6 +2223,7 @@ select[multiple].input-lg {\n.btn.focus,\n.btn:active.focus,\n.btn.active.focus {\n+ outline: 2px auto Highlight;\noutline: 5px auto -webkit-focus-ring-color;\noutline-offset: -2px;\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Fix outline on links for Firefox (as -webkit-focus-ring-color is not supported) Fix accessibility issue 470363
455,736
27.07.2017 11:16:15
25,200
6d5343c740ed095dce924df33d09947bdc887576
[Redesign] Don't put radio buttons inside labels as this encounters as SizeOfSet a bug in Edge Fix accessibility issue 469500
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -243,6 +243,10 @@ img.package-icon {\npointer-events: none;\nopacity: .75;\n}\n+.radio .label-sibling,\n+.checkbox .label-sibling {\n+ margin-left: 20px;\n+}\n#edit-metadata-form-container .loading:after {\ndisplay: inline-block;\n/* ascii code for the ellipsis character */\n@@ -396,9 +400,6 @@ img.package-icon {\n.page-account-settings .form-group + .form-group .btn {\nmargin-top: 20px;\n}\n-.page-account-settings .checkbox .description {\n- padding-left: 20px;\n-}\n.page-api-keys .example-commands {\npadding: 8px 10px;\nfont-family: Consolas, Menlo, Monaco, \"Courier New\", monospace;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/base.less", "new_path": "src/Bootstrap/less/theme/base.less", "diff": "@@ -311,3 +311,9 @@ img.package-icon {\npointer-events: none;\nopacity: 0.75;\n}\n+\n+.radio, .checkbox {\n+ .label-sibling {\n+ margin-left: 20px;\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-account-settings.less", "new_path": "src/Bootstrap/less/theme/page-account-settings.less", "diff": "margin-top: 20px;\n}\n}\n-\n- .checkbox {\n- .description {\n- padding-left: 20px;\n- }\n- }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -243,6 +243,10 @@ img.package-icon {\npointer-events: none;\nopacity: .75;\n}\n+.radio .label-sibling,\n+.checkbox .label-sibling {\n+ margin-left: 20px;\n+}\n#edit-metadata-form-container .loading:after {\ndisplay: inline-block;\n/* ascii code for the ellipsis character */\n@@ -396,9 +400,6 @@ img.package-icon {\n.page-account-settings .form-group + .form-group .btn {\nmargin-top: 20px;\n}\n-.page-account-settings .checkbox .description {\n- padding-left: 20px;\n-}\n.page-api-keys .example-commands {\npadding: 8px 10px;\nfont-family: Consolas, Menlo, Monaco, \"Courier New\", monospace;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/page-api-keys.js", "new_path": "src/NuGetGallery/Scripts/gallery/page-api-keys.js", "diff": "this.DescriptionId = ComputedId(\"description\");\nthis.GlobPatternId = ComputedId(\"glob-pattern\");\nthis.ExpiresInId = ComputedId(\"expires-in\");\n+ this.PackagePushId = ComputedId(\"package-push\");\n+ this.PackagePushVersionId = ComputedId(\"package-push-version\");\nthis.IconUrl = ko.pureComputed(function () {\nif (this.HasExpired()) {\nreturn initialData.ImageUrls.ApiKeyExpired;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/Account.cshtml", "new_path": "src/NuGetGallery/Views/Users/Account.cshtml", "diff": "@Html.ShowCheckboxFor(x => x.ChangeNotifications.EmailAllowed)\n<b>Users can contact me through the @Config.Current.Brand</b>\n</label>\n- <div class=\"description\">\n+ <div class=\"label-sibling\">\nThis setting allows other registered users of the site to contact you\nabout packages that you own using the <em>Contact Owners</em> form, or to request\nthat you become an owner of their package. Disabling this setting means users cannot\n@Html.ShowCheckboxFor(x => x.ChangeNotifications.NotifyPackagePushed)\n<b>Notify me when a package is pushed to @Config.Current.Brand using my account</b>\n</label>\n- <div class=\"description\">\n+ <div class=\"label-sibling\">\nThis setting enables notifications whenever a package is pushed using your\naccount. We recommend to enable this setting so that you can inspect whether a\npackage was pushed intentionally or not. Disabling this setting means no notification\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/ApiKeys.cshtml", "new_path": "src/NuGetGallery/Views/Users/ApiKeys.cshtml", "diff": "<ul role=\"presentation\" data-bind=\"css: { disabled: !PushEnabled() }\">\n<li>\n<div class=\"radio\">\n- <label>\n+ <div class=\"label-sibling\">\n<input name=\"PushScope\" type=\"radio\" value=\"@NuGetScopes.PackagePush\"\n- data-bind=\"checked: PushScope, enable: PushEnabled\" checked />\n+ data-bind=\"checked: PushScope, enable: PushEnabled,\n+ attr: { id: PackagePushId }\" checked />\n+ </div>\n+ <label data-bind=\"attr: { for: PackagePushId }\">\n@NuGetScopes.Describe(NuGetScopes.PackagePush)\n</label>\n</div>\n</li>\n<li>\n<div class=\"radio\">\n- <label>\n+ <div class=\"label-sibling\">\n<input name=\"PushScope\" type=\"radio\" value=\"@NuGetScopes.PackagePushVersion\"\n- data-bind=\"checked: PushScope, enable: PushEnabled\" />\n+ data-bind=\"checked: PushScope, enable: PushEnabled,\n+ attr: { id: PackagePushVersionId }\" />\n+ </div>\n+ <label data-bind=\"attr: { for: PackagePushVersionId }\">\n@NuGetScopes.Describe(NuGetScopes.PackagePushVersion)\n</label>\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Don't put radio buttons inside labels as this encounters as SizeOfSet a bug in Edge Fix accessibility issue 469500
455,736
27.07.2017 12:37:10
25,200
eac418b6a9562b6515bf4c56b721229acc7b5046
[Redesign] Leave default border on focused form-controls Fix accessibility issue 470375 and 470379
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap.css", "new_path": "src/Bootstrap/dist/css/bootstrap.css", "diff": "@@ -1762,7 +1762,6 @@ output {\n}\n.form-control:focus {\nborder-color: #66afe9;\n- outline: 0;\n-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);\nbox-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/mixins/forms.less", "new_path": "src/Bootstrap/less/mixins/forms.less", "diff": "@color-rgba: rgba(red(@color), green(@color), blue(@color), .6);\n&:focus {\nborder-color: @color;\n- outline: 0;\n.box-shadow(~\"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}\");\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap.css", "diff": "@@ -1762,7 +1762,6 @@ output {\n}\n.form-control:focus {\nborder-color: #66afe9;\n- outline: 0;\n-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);\nbox-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Leave default border on focused form-controls Fix accessibility issue 470375 and 470379
455,736
27.07.2017 13:02:39
25,200
b17b7cf701f26b1deccca2b19449c809d64ad3d6
[Redesign] Make display page command tabs more clearly selected on high contrast Fix accessibility issue 470376
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -603,6 +603,12 @@ img.package-icon {\nbackground-color: #002440;\nborder: 0;\n}\n+@media screen and (-ms-high-contrast: active) {\n+ .page-package-details .install-tabs .nav-tabs > li.active > a {\n+ font-weight: 600;\n+ text-decoration: underline;\n+ }\n+}\n.page-package-details .install-tabs .tab-pane > div {\ndisplay: table;\nheight: 1px;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-display-package.less", "new_path": "src/Bootstrap/less/theme/page-display-package.less", "diff": "background-color: @panel-footer-bg;\nborder: 0;\ncolor: #fff;\n+\n+ @media screen and (-ms-high-contrast: active){\n+ & {\n+ font-weight: 600;\n+ text-decoration: underline;\n+ }\n+ }\n}\n.tab-pane {\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -603,6 +603,12 @@ img.package-icon {\nbackground-color: #002440;\nborder: 0;\n}\n+@media screen and (-ms-high-contrast: active) {\n+ .page-package-details .install-tabs .nav-tabs > li.active > a {\n+ font-weight: 600;\n+ text-decoration: underline;\n+ }\n+}\n.page-package-details .install-tabs .tab-pane > div {\ndisplay: table;\nheight: 1px;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Make display page command tabs more clearly selected on high contrast Fix accessibility issue 470376
455,736
27.07.2017 13:21:16
25,200
c51665237be0738f0e40503d2aff29dd932be29a
[Redesign] Make SVGs more friendly with high contrast on Edge and Firefox.
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -304,6 +304,12 @@ img.package-icon {\nsvg text {\nfill: WindowText;\n}\n+ .popover .arrow {\n+ display: none;\n+ }\n+ .dropdown-menu .divider {\n+ border-bottom: 1px solid windowText;\n+ }\n}\n.list-packages {\nborder-top: 1px solid #dbdbdb;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/common-high-contrast.less", "new_path": "src/Bootstrap/less/theme/common-high-contrast.less", "diff": "color: WindowText;\n}\n+\n+ .popover {\n+ .arrow {\n+ display: none;\n+ }\n+ }\n+\n+ .dropdown-menu {\n+ .divider {\n+ border-bottom: 1px solid windowText;\n+ }\n+ }\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -304,6 +304,12 @@ img.package-icon {\nsvg text {\nfill: WindowText;\n}\n+ .popover .arrow {\n+ display: none;\n+ }\n+ .dropdown-menu .divider {\n+ border-bottom: 1px solid windowText;\n+ }\n}\n.list-packages {\nborder-top: 1px solid #dbdbdb;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/img/api-key-expired.svg", "new_path": "src/NuGetGallery/Content/gallery/img/api-key-expired.svg", "diff": "-<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><title>nuget-key-expired</title><path d=\"M16,5.5a5.446,5.446,0,0,1-.75,2.773c-.094.159-.2.308-.309.456a4.481,4.481,0,0,0-.931-.45,4.625,4.625,0,0,0,.635-1.029A4.347,4.347,0,0,0,15,5.5a4.349,4.349,0,0,0-.356-1.75A4.525,4.525,0,0,0,12.25,1.355a4.485,4.485,0,0,0-3.5,0A4.525,4.525,0,0,0,6.356,3.75,4.349,4.349,0,0,0,6,5.5a3.878,3.878,0,0,0,.109.926,7.344,7.344,0,0,0,.281.895L1,12.711V15H3V13H5V11H7V9h.7a4.274,4.274,0,0,0,1.286.729,4.48,4.48,0,0,0-.537.855c-.15-.062-.3-.125-.445-.2V12H6v2H4v2H0V12.289L5.242,7.055a5.494,5.494,0,0,1-.18-.766A4.947,4.947,0,0,1,5,5.5a5.446,5.446,0,0,1,.75-2.773A5.613,5.613,0,0,1,7.727.75a5.485,5.485,0,0,1,5.547,0A5.613,5.613,0,0,1,15.25,2.727,5.446,5.446,0,0,1,16,5.5ZM12.707,3.293a1.017,1.017,0,0,0-.316-.215,1.016,1.016,0,0,0-.781,0,1.019,1.019,0,0,0-.531.531,1.016,1.016,0,0,0,0,.781,1.019,1.019,0,0,0,.531.531,1.016,1.016,0,0,0,.781,0,1.019,1.019,0,0,0,.531-.531,1.016,1.016,0,0,0,0-.781A1.018,1.018,0,0,0,12.707,3.293Z\" fill=\"#000\"/><path d=\"M12.5,9A3.5,3.5,0,1,0,16,12.5,3.5,3.5,0,0,0,12.5,9ZM10,12.5a2.483,2.483,0,0,1,.416-1.376l3.46,3.46A2.5,2.5,0,0,1,10,12.5Zm4.584,1.377-3.46-3.46a2.5,2.5,0,0,1,3.46,3.46Z\" fill=\"#e81123\"/></svg>\n\\ No newline at end of file\n+<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><title>nuget-key-expired</title><defs><style>@media screen and (-ms-high-contrast:active){.high-contrast-visible{fill: windowText;}}</style></defs><path d=\"M16,5.5a5.446,5.446,0,0,1-.75,2.773c-.094.159-.2.308-.309.456a4.481,4.481,0,0,0-.931-.45,4.625,4.625,0,0,0,.635-1.029A4.347,4.347,0,0,0,15,5.5a4.349,4.349,0,0,0-.356-1.75A4.525,4.525,0,0,0,12.25,1.355a4.485,4.485,0,0,0-3.5,0A4.525,4.525,0,0,0,6.356,3.75,4.349,4.349,0,0,0,6,5.5a3.878,3.878,0,0,0,.109.926,7.344,7.344,0,0,0,.281.895L1,12.711V15H3V13H5V11H7V9h.7a4.274,4.274,0,0,0,1.286.729,4.48,4.48,0,0,0-.537.855c-.15-.062-.3-.125-.445-.2V12H6v2H4v2H0V12.289L5.242,7.055a5.494,5.494,0,0,1-.18-.766A4.947,4.947,0,0,1,5,5.5a5.446,5.446,0,0,1,.75-2.773A5.613,5.613,0,0,1,7.727.75a5.485,5.485,0,0,1,5.547,0A5.613,5.613,0,0,1,15.25,2.727,5.446,5.446,0,0,1,16,5.5ZM12.707,3.293a1.017,1.017,0,0,0-.316-.215,1.016,1.016,0,0,0-.781,0,1.019,1.019,0,0,0-.531.531,1.016,1.016,0,0,0,0,.781,1.019,1.019,0,0,0,.531.531,1.016,1.016,0,0,0,.781,0,1.019,1.019,0,0,0,.531-.531,1.016,1.016,0,0,0,0-.781A1.018,1.018,0,0,0,12.707,3.293Z\" fill=\"#000\" class=\"high-contrast-visible\" /><path d=\"M12.5,9A3.5,3.5,0,1,0,16,12.5,3.5,3.5,0,0,0,12.5,9ZM10,12.5a2.483,2.483,0,0,1,.416-1.376l3.46,3.46A2.5,2.5,0,0,1,10,12.5Zm4.584,1.377-3.46-3.46a2.5,2.5,0,0,1,3.46,3.46Z\" fill=\"#e81123\"/></svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/img/api-key-legacy.svg", "new_path": "src/NuGetGallery/Content/gallery/img/api-key-legacy.svg", "diff": "-<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><title>nuget-key-legacy</title><path d=\"M12.922,3.609a1.016,1.016,0,0,1,0,.781,1.019,1.019,0,0,1-.531.531,1.016,1.016,0,0,1-.781,0c-.017-.008-.029-.023-.046-.031L11.5,4.764l-.031.062a.993.993,0,0,1-.176-.119,1.007,1.007,0,0,1-.215-.316,1.016,1.016,0,0,1,0-.781,1.019,1.019,0,0,1,.531-.531,1.016,1.016,0,0,1,.781,0,1.019,1.019,0,0,1,.531.531Zm2.883.43a5.432,5.432,0,0,0-.555-1.312A5.613,5.613,0,0,0,13.273.75a5.485,5.485,0,0,0-5.547,0A5.613,5.613,0,0,0,5.75,2.727,5.446,5.446,0,0,0,5,5.5a4.947,4.947,0,0,0,.063.789,5.494,5.494,0,0,0,.18.766L0,12.289V16H4V14H6V12H7.882L8,11.764V10.383a5.4,5.4,0,0,0,.563.255l.448-.9A4.281,4.281,0,0,1,7.7,9H7v2H5v2H3v2H1V12.711L6.391,7.32a7.344,7.344,0,0,1-.281-.895A3.878,3.878,0,0,1,6,5.5a4.349,4.349,0,0,1,.356-1.75A4.525,4.525,0,0,1,8.75,1.355a4.485,4.485,0,0,1,3.5,0A4.525,4.525,0,0,1,14.644,3.75,4.349,4.349,0,0,1,15,5.5a4.347,4.347,0,0,1-.356,1.75,4.575,4.575,0,0,1-.965,1.43c-.048.048-.107.084-.157.13l.465.93c.136-.113.273-.226.4-.352a5.559,5.559,0,0,0,.863-1.113A5.522,5.522,0,0,0,15.8,4.039Z\" fill=\"#000\"/><path d=\"M11,14h1v1H11Zm5,2H7l4.5-9Zm-7.586-.875h6.172L11.5,8.953ZM11,11v2.5h1V11Z\" fill=\"#ffb900\"/></svg>\n\\ No newline at end of file\n+<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><title>nuget-key-legacy</title><defs><style>@media screen and (-ms-high-contrast:active){.high-contrast-visible{fill: windowText;}}</style></defs><path d=\"M12.922,3.609a1.016,1.016,0,0,1,0,.781,1.019,1.019,0,0,1-.531.531,1.016,1.016,0,0,1-.781,0c-.017-.008-.029-.023-.046-.031L11.5,4.764l-.031.062a.993.993,0,0,1-.176-.119,1.007,1.007,0,0,1-.215-.316,1.016,1.016,0,0,1,0-.781,1.019,1.019,0,0,1,.531-.531,1.016,1.016,0,0,1,.781,0,1.019,1.019,0,0,1,.531.531Zm2.883.43a5.432,5.432,0,0,0-.555-1.312A5.613,5.613,0,0,0,13.273.75a5.485,5.485,0,0,0-5.547,0A5.613,5.613,0,0,0,5.75,2.727,5.446,5.446,0,0,0,5,5.5a4.947,4.947,0,0,0,.063.789,5.494,5.494,0,0,0,.18.766L0,12.289V16H4V14H6V12H7.882L8,11.764V10.383a5.4,5.4,0,0,0,.563.255l.448-.9A4.281,4.281,0,0,1,7.7,9H7v2H5v2H3v2H1V12.711L6.391,7.32a7.344,7.344,0,0,1-.281-.895A3.878,3.878,0,0,1,6,5.5a4.349,4.349,0,0,1,.356-1.75A4.525,4.525,0,0,1,8.75,1.355a4.485,4.485,0,0,1,3.5,0A4.525,4.525,0,0,1,14.644,3.75,4.349,4.349,0,0,1,15,5.5a4.347,4.347,0,0,1-.356,1.75,4.575,4.575,0,0,1-.965,1.43c-.048.048-.107.084-.157.13l.465.93c.136-.113.273-.226.4-.352a5.559,5.559,0,0,0,.863-1.113A5.522,5.522,0,0,0,15.8,4.039Z\" fill=\"#000\" class=\"high-contrast-visible\" /><path d=\"M11,14h1v1H11Zm5,2H7l4.5-9Zm-7.586-.875h6.172L11.5,8.953ZM11,11v2.5h1V11Z\" fill=\"#ffb900\"/></svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/img/api-key-new.svg", "new_path": "src/NuGetGallery/Content/gallery/img/api-key-new.svg", "diff": "-<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><title>nuget-key-new</title><path d=\"M16,5.5a5.446,5.446,0,0,1-.75,2.773c-.075.128-.164.247-.249.368l-.383-.383L14,8.875V8.291a4.62,4.62,0,0,0,.644-1.041A4.347,4.347,0,0,0,15,5.5a4.349,4.349,0,0,0-.356-1.75A4.525,4.525,0,0,0,12.25,1.355a4.485,4.485,0,0,0-3.5,0A4.525,4.525,0,0,0,6.355,3.75,4.35,4.35,0,0,0,6,5.5a3.878,3.878,0,0,0,.109.926,7.333,7.333,0,0,0,.281.895L1,12.711V15H3V13H5V11H7V9h.7a4.269,4.269,0,0,0,1.238.707l-.676.676.213.213c-.159-.065-.317-.132-.471-.213V12H6v2H4v2H0V12.289L5.242,7.055a5.494,5.494,0,0,1-.18-.766A4.947,4.947,0,0,1,5,5.5a5.446,5.446,0,0,1,.75-2.773A5.613,5.613,0,0,1,7.727.75a5.485,5.485,0,0,1,5.547,0A5.613,5.613,0,0,1,15.25,2.727,5.446,5.446,0,0,1,16,5.5ZM12.707,3.293a1.017,1.017,0,0,0-.316-.215,1.016,1.016,0,0,0-.781,0,1.019,1.019,0,0,0-.531.531,1.016,1.016,0,0,0,0,.781,1.019,1.019,0,0,0,.531.531,1.016,1.016,0,0,0,.781,0,1.019,1.019,0,0,0,.531-.531,1.016,1.016,0,0,0,0-.781A1.018,1.018,0,0,0,12.707,3.293Z\" fill=\"#000\"/><path d=\"M10.383,9.672,11.8,11.086l-.711.711L9.672,10.383Zm-.711,4.945.711.711L11.8,13.914l-.711-.711ZM11,12H9v1h2Zm4.328-1.617-.711-.711L13.2,11.086l.711.711ZM12,11h1V9H12Zm0,5h1V14H12Zm2-4v1h2V12Zm-.8,1.914,1.414,1.414.711-.711L13.914,13.2Z\" fill=\"#0075cc\"/></svg>\n\\ No newline at end of file\n+<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><title>nuget-key-new</title><defs><style>@media screen and (-ms-high-contrast:active){.high-contrast-visible{fill: windowText;}}</style></defs><path d=\"M16,5.5a5.446,5.446,0,0,1-.75,2.773c-.075.128-.164.247-.249.368l-.383-.383L14,8.875V8.291a4.62,4.62,0,0,0,.644-1.041A4.347,4.347,0,0,0,15,5.5a4.349,4.349,0,0,0-.356-1.75A4.525,4.525,0,0,0,12.25,1.355a4.485,4.485,0,0,0-3.5,0A4.525,4.525,0,0,0,6.355,3.75,4.35,4.35,0,0,0,6,5.5a3.878,3.878,0,0,0,.109.926,7.333,7.333,0,0,0,.281.895L1,12.711V15H3V13H5V11H7V9h.7a4.269,4.269,0,0,0,1.238.707l-.676.676.213.213c-.159-.065-.317-.132-.471-.213V12H6v2H4v2H0V12.289L5.242,7.055a5.494,5.494,0,0,1-.18-.766A4.947,4.947,0,0,1,5,5.5a5.446,5.446,0,0,1,.75-2.773A5.613,5.613,0,0,1,7.727.75a5.485,5.485,0,0,1,5.547,0A5.613,5.613,0,0,1,15.25,2.727,5.446,5.446,0,0,1,16,5.5ZM12.707,3.293a1.017,1.017,0,0,0-.316-.215,1.016,1.016,0,0,0-.781,0,1.019,1.019,0,0,0-.531.531,1.016,1.016,0,0,0,0,.781,1.019,1.019,0,0,0,.531.531,1.016,1.016,0,0,0,.781,0,1.019,1.019,0,0,0,.531-.531,1.016,1.016,0,0,0,0-.781A1.018,1.018,0,0,0,12.707,3.293Z\" fill=\"#000\" class=\"high-contrast-visible\" /><path d=\"M10.383,9.672,11.8,11.086l-.711.711L9.672,10.383Zm-.711,4.945.711.711L11.8,13.914l-.711-.711ZM11,12H9v1h2Zm4.328-1.617-.711-.711L13.2,11.086l.711.711ZM12,11h1V9H12Zm0,5h1V14H12Zm2-4v1h2V12Zm-.8,1.914,1.414,1.414.711-.711L13.914,13.2Z\" fill=\"#0075cc\"/></svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/img/api-key.svg", "new_path": "src/NuGetGallery/Content/gallery/img/api-key.svg", "diff": "-<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><title>nuget-key</title><path d=\"M5.242,7.055a5.484,5.484,0,0,1-.18-.766A4.947,4.947,0,0,1,5,5.5a5.446,5.446,0,0,1,.75-2.773A5.613,5.613,0,0,1,7.727.75a5.485,5.485,0,0,1,5.547,0A5.614,5.614,0,0,1,15.25,2.727a5.485,5.485,0,0,1,0,5.547,5.614,5.614,0,0,1-1.977,1.977A5.445,5.445,0,0,1,10.5,11,5.347,5.347,0,0,1,8,10.383V12H6v2H4v2H0V12.289ZM1,15H3V13H5V11H7V9h.7a4.279,4.279,0,0,0,1.316.742A4.445,4.445,0,0,0,10.5,10a4.347,4.347,0,0,0,1.75-.355A4.525,4.525,0,0,0,14.645,7.25,4.347,4.347,0,0,0,15,5.5a4.349,4.349,0,0,0-.355-1.75A4.525,4.525,0,0,0,12.25,1.355a4.485,4.485,0,0,0-3.5,0A4.525,4.525,0,0,0,6.355,3.75,4.349,4.349,0,0,0,6,5.5a3.88,3.88,0,0,0,.109.926,7.332,7.332,0,0,0,.281.895L1,12.711ZM12.391,3.078a1.019,1.019,0,0,1,.531.531,1.016,1.016,0,0,1,0,.781,1.019,1.019,0,0,1-.531.531,1.016,1.016,0,0,1-.781,0,1.019,1.019,0,0,1-.531-.531,1.016,1.016,0,0,1,0-.781,1.019,1.019,0,0,1,.531-.531,1.015,1.015,0,0,1,.781,0Z\" fill=\"#000\"/></svg>\n\\ No newline at end of file\n+<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><title>nuget-key</title><defs><style>@media screen and (-ms-high-contrast:active){.high-contrast-visible{fill: windowText;}}</style></defs><path d=\"M5.242,7.055a5.484,5.484,0,0,1-.18-.766A4.947,4.947,0,0,1,5,5.5a5.446,5.446,0,0,1,.75-2.773A5.613,5.613,0,0,1,7.727.75a5.485,5.485,0,0,1,5.547,0A5.614,5.614,0,0,1,15.25,2.727a5.485,5.485,0,0,1,0,5.547,5.614,5.614,0,0,1-1.977,1.977A5.445,5.445,0,0,1,10.5,11,5.347,5.347,0,0,1,8,10.383V12H6v2H4v2H0V12.289ZM1,15H3V13H5V11H7V9h.7a4.279,4.279,0,0,0,1.316.742A4.445,4.445,0,0,0,10.5,10a4.347,4.347,0,0,0,1.75-.355A4.525,4.525,0,0,0,14.645,7.25,4.347,4.347,0,0,0,15,5.5a4.349,4.349,0,0,0-.355-1.75A4.525,4.525,0,0,0,12.25,1.355a4.485,4.485,0,0,0-3.5,0A4.525,4.525,0,0,0,6.355,3.75,4.349,4.349,0,0,0,6,5.5a3.88,3.88,0,0,0,.109.926,7.332,7.332,0,0,0,.281.895L1,12.711ZM12.391,3.078a1.019,1.019,0,0,1,.531.531,1.016,1.016,0,0,1,0,.781,1.019,1.019,0,0,1-.531.531,1.016,1.016,0,0,1-.781,0,1.019,1.019,0,0,1-.531-.531,1.016,1.016,0,0,1,0-.781,1.019,1.019,0,0,1,.531-.531,1.015,1.015,0,0,1,.781,0Z\" fill=\"#000\" class=\"high-contrast-visible\" /></svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/img/circuit-board.svg", "new_path": "src/NuGetGallery/Content/gallery/img/circuit-board.svg", "diff": "-<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"574px\" height=\"396px\" viewBox=\"0 0 444.02 288.03\"><defs><style>.cls-1,.cls-2,.cls-3,.cls-5{fill:none;stroke-width:3px;}.cls-1,.cls-2{stroke:#9ebbe2;}.cls-1,.cls-2,.cls-3,.cls-4,.cls-5{stroke-linejoin:round;}.cls-2,.cls-5{stroke-linecap:round;}.cls-3,.cls-4,.cls-5{stroke:#fff;}.cls-4{fill:#fff;}</style></defs><title>Hero Image v7</title><g id=\"Layer_2\" data-name=\"Layer 2\"><g id=\"Hero\"><g id=\"chip\"><polygon class=\"cls-1\" points=\"215.98 176.65 289.6 134.15 289.6 124.15 250.63 101.65 177.01 144.15 177.01 154.15 215.98 176.65\"/><polygon class=\"cls-1\" points=\"177.01 144.15 215.99 166.65 215.98 176.65 177.01 154.15 177.01 144.15\"/><polygon class=\"cls-1\" points=\"215.99 166.65 289.6 124.15 289.6 134.15 215.98 176.65 215.99 166.65\"/><g id=\"clips\"><polyline class=\"cls-2\" points=\"280.94 134.15 289.52 139.1 289.52 144.19\"/><polyline id=\"_7\" data-name=\"7\" class=\"cls-2\" points=\"272.31 139.12 280.94 144.15 281.01 149.1\"/><polyline id=\"_6\" data-name=\"6\" class=\"cls-2\" points=\"263.62 143.65 272.2 149.1 272.31 154.17\"/><polyline id=\"_5\" data-name=\"5\" class=\"cls-2\" points=\"255.03 149.1 263.62 154.15 263.65 159.17\"/><polyline id=\"_4\" data-name=\"4\" class=\"cls-2\" points=\"246.3 154.15 254.85 159.09 255.03 164.19\"/><polyline id=\"_3\" data-name=\"3\" class=\"cls-2\" points=\"237.63 159.15 246.3 164.15 246.3 169.15\"/><polyline id=\"_2\" data-name=\"2\" class=\"cls-2\" points=\"228.97 164.15 237.63 169.15 237.63 174.15\"/><polyline id=\"_1\" data-name=\"1\" class=\"cls-2\" points=\"220.31 169.15 228.97 174.15 228.97 179.15\"/></g><g id=\"clips-2\" data-name=\"clips\"><polyline class=\"cls-2\" points=\"181.34 146.65 172.68 141.65 172.68 146.65\"/><polyline class=\"cls-2\" points=\"185.76 139.18 181.34 136.62 181.34 141.62\"/><polyline class=\"cls-2\" points=\"194.42 134.2 190 131.65 190 136.65\"/><polyline class=\"cls-2\" points=\"203.1 129.2 198.68 126.65 198.68 131.65\"/><polyline class=\"cls-2\" points=\"207.41 126.65 207.32 121.65 211.66 124.15\"/><polyline class=\"cls-2\" points=\"215.98 121.65 215.98 116.65 220.31 119.15\"/><polyline class=\"cls-2\" points=\"224.65 116.65 224.65 111.65 228.97 114.15\"/><polyline class=\"cls-2\" points=\"233.3 111.65 233.31 106.65 237.64 109.15\"/><polyline class=\"cls-2\" points=\"241.97 106.65 241.97 101.65 246.3 104.15\"/></g><g id=\"clips_copy_2\" data-name=\"clips copy 2\"><polyline id=\"_4-2\" data-name=\"4\" class=\"cls-2\" points=\"181.43 151.65 172.88 156.59 172.7 161.69\"/><polyline id=\"_3-2\" data-name=\"3\" class=\"cls-2\" points=\"190.09 156.65 181.43 161.65 181.43 166.65\"/><polyline id=\"_2-2\" data-name=\"2\" class=\"cls-2\" points=\"198.75 161.65 190.09 166.65 190.09 171.65\"/><polyline id=\"_1-2\" data-name=\"1\" class=\"cls-2\" points=\"207.41 166.65 198.75 171.65 198.75 176.65\"/></g><g id=\"clipsBack\"><polyline class=\"cls-2\" points=\"255.03 104.1 259.29 101.65 259.29 106.65\"/><polyline class=\"cls-2\" points=\"263.62 109.15 267.97 106.66 267.97 111.65\"/><polyline class=\"cls-2\" points=\"272.28 114.15 276.66 111.68 276.61 116.65\"/><polyline class=\"cls-2\" points=\"280.94 119.15 285.23 116.67 285.27 121.65\"/></g></g><g id=\"chips\"><g id=\"_2-3\" data-name=\"2\"><polygon class=\"cls-2\" points=\"315.33 118.95 345.56 101.5 345.56 96.5 328.24 86.5 297.97 103.98 297.97 109.02 315.33 118.95\"/><polygon class=\"cls-2\" points=\"315.33 113.95 345.56 96.5 345.56 101.5 315.33 118.95 315.33 113.95\"/><polygon class=\"cls-2\" points=\"297.97 103.98 315.33 113.95 315.33 118.95 297.97 109.02 297.97 103.98\"/></g><g id=\"_1-3\" data-name=\"1\"><polygon class=\"cls-2\" points=\"280.76 98.94 311 81.48 311 76.48 293.68 66.48 263.4 83.96 263.4 89 280.76 98.94\"/><polygon class=\"cls-2\" points=\"280.76 93.94 311 76.48 311 81.48 280.76 98.94 280.76 93.94\"/><polygon class=\"cls-2\" points=\"263.4 83.96 280.76 93.94 280.76 98.94 263.4 89 263.4 83.96\"/></g></g><g id=\"wires\"><path class=\"cls-1\" d=\"M290,189.15c-2.38,1.37-2.38,3.62,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.38,2.38-3.63,0-5A9.61,9.61,0,0,0,290,189.15Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"250.94\" y1=\"172.15\" x2=\"280.5\" y2=\"189.15\"/><path class=\"cls-1\" d=\"M189.68,241.53c-2.38,1.37-2.38,3.62,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.38,2.38-3.63,0-5A9.61,9.61,0,0,0,189.68,241.53Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"145.58\" y1=\"221.53\" x2=\"180.15\" y2=\"241.53\"/><polyline class=\"cls-2\" points=\"233.7 182.07 258.93 196.53 198.4 231.48 163.67 211.53\"/><polyline class=\"cls-2\" points=\"155.01 216.53 198.4 241.58 276.26 196.53 242.28 177.03\"/><polyline class=\"cls-2\" points=\"259.6 167.03 302.02 191.65 189.65 256.53 137.69 226.53\"/><line class=\"cls-2\" x1=\"194.12\" y1=\"178.95\" x2=\"163.67\" y2=\"196.53\"/><path class=\"cls-2\" d=\"M199.28,176.58\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"185.41\" y1=\"174.08\" x2=\"155.69\" y2=\"191.25\"/><line class=\"cls-2\" x1=\"176.71\" y1=\"169.05\" x2=\"155.69\" y2=\"181.26\"/><line class=\"cls-2\" x1=\"168.07\" y1=\"164.08\" x2=\"155.69\" y2=\"171.09\"/><polyline class=\"cls-2\" points=\"59.79 216.55 16.5 241.58 51.37 261.37\"/><line class=\"cls-2\" x1=\"94.43\" y1=\"236.55\" x2=\"51.37\" y2=\"261.37\"/><polyline class=\"cls-2\" points=\"129.03 231.48 189.65 266.53 302 201.66\"/><polyline class=\"cls-2\" points=\"167.94 109.06 180.97 116.48 150.73 134.15 168.14 144.19\"/><polyline class=\"cls-2\" points=\"176.66 104.03 194.13 114.16 163.77 131.37 176.49 139.12\"/><polyline class=\"cls-2\" points=\"185.46 98.95 206.9 111.53 176.47 129.15 185.12 134.15\"/><polyline class=\"cls-2\" points=\"194.12 93.95 219.96 109.06 189.79 126.67\"/><line class=\"cls-2\" x1=\"202.63\" y1=\"89.02\" x2=\"228.59\" y2=\"103.98\"/><path class=\"cls-2\" d=\"M29.77,229c-2.36-1.41-2.38-3.67,0-5a9.52,9.52,0,0,1,8.59,0c2.38,1.38,2.39,3.64,0,5A9.32,9.32,0,0,1,29.77,229Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"51.08\" y1=\"211.53\" x2=\"29.47\" y2=\"224.05\"/><path class=\"cls-2\" d=\"M51.67,236.38c-2.36-1.41-2.38-3.67,0-5a9.52,9.52,0,0,1,8.59,0c2.38,1.38,2.39,3.64,0,5A9.32,9.32,0,0,1,51.67,236.38Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"68.45\" y1=\"221.53\" x2=\"51.37\" y2=\"231.42\"/><path class=\"cls-2\" d=\"M103.56,116.75c-2.36-1.41-2.38-3.67,0-5a9.52,9.52,0,0,1,8.59,0c2.38,1.38,2.39,3.64,0,5A9.32,9.32,0,0,1,103.56,116.75Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"124.88\" y1=\"99.27\" x2=\"103.27\" y2=\"111.79\"/><polyline class=\"cls-2\" points=\"107.52 89.11 33.76 131.53 68.41 151.53\"/><polyline class=\"cls-2\" points=\"115.89 93.95 51.09 131.53 77.06 146.53\"/><polyline class=\"cls-2\" points=\"133.36 104.03 77.1 136.51 85.73 141.53\"/><polyline class=\"cls-2\" points=\"141.96 109.06 111.89 126.23 163.77 156.47 155.11 161.47\"/><line class=\"cls-2\" x1=\"267.51\" y1=\"221.49\" x2=\"293.61\" y2=\"236.55\"/><polyline class=\"cls-2\" points=\"302.23 241.53 293.57 246.53 258.97 226.55\"/><polyline class=\"cls-2\" points=\"310.89 246.53 293.57 256.53 250.36 231.48\"/><polyline class=\"cls-2\" points=\"319.55 251.53 293.61 266.5 233.04 231.48\"/><polyline class=\"cls-2\" points=\"328.21 256.53 293.57 276.53 215.63 231.61\"/><polyline class=\"cls-2\" points=\"336.87 261.53 293.57 286.53 224.18 246.53\"/><polyline class=\"cls-2\" points=\"77.06 226.53 59.79 236.55 77.06 246.53\"/><polyline class=\"cls-2\" points=\"85.77 231.42 77.11 236.5 85.73 241.53\"/><line class=\"cls-2\" x1=\"258.88\" y1=\"96.5\" x2=\"263.4\" y2=\"93.95\"/><line class=\"cls-2\" x1=\"277.05\" y1=\"156.96\" x2=\"310.49\" y2=\"176.58\"/><line class=\"cls-2\" x1=\"285.5\" y1=\"151.98\" x2=\"319.34\" y2=\"171.41\"/><line class=\"cls-2\" x1=\"294.24\" y1=\"147.03\" x2=\"327.98\" y2=\"166.49\"/><line class=\"cls-2\" x1=\"280.38\" y1=\"104.15\" x2=\"271.75\" y2=\"98.93\"/><line class=\"cls-2\" x1=\"297.71\" y1=\"93.92\" x2=\"302.04\" y2=\"96.5\"/><line class=\"cls-2\" x1=\"306.37\" y1=\"88.92\" x2=\"310.7\" y2=\"91.64\"/><polyline class=\"cls-2\" points=\"280.38 114.15 289.24 109.03 319.55 126.53 336.87 116.53\"/><polyline class=\"cls-2\" points=\"293.33 116.67 319.34 131.41 349.95 114.08 341.25 109.24\"/><line class=\"cls-2\" x1=\"268.54\" y1=\"162.09\" x2=\"301.99\" y2=\"181.72\"/><line class=\"cls-2\" x1=\"280.38\" y1=\"104.15\" x2=\"271.75\" y2=\"108.98\"/><line class=\"cls-2\" x1=\"258.88\" y1=\"96.5\" x2=\"267.55\" y2=\"101.5\"/><line class=\"cls-2\" x1=\"263.4\" y1=\"104.11\" x2=\"267.55\" y2=\"101.5\"/><line class=\"cls-2\" x1=\"332.46\" y1=\"113.94\" x2=\"336.87\" y2=\"116.53\"/><line class=\"cls-2\" x1=\"293.33\" y1=\"116.67\" x2=\"289.52\" y2=\"118.87\"/><path class=\"cls-1\" d=\"M159.69,253.78c-2.38,1.37-2.38,3.62,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.38,2.38-3.63,0-5A9.61,9.61,0,0,0,159.69,253.78Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"115.59\" y1=\"233.78\" x2=\"150.15\" y2=\"253.78\"/><path class=\"cls-2\" d=\"M70.92,104.73c-2.36-1.41-2.38-3.67,0-5a9.52,9.52,0,0,1,8.59,0c2.38,1.38,2.39,3.64,0,5A9.32,9.32,0,0,1,70.92,104.73Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"98.31\" y1=\"83.74\" x2=\"70.63\" y2=\"99.78\"/></g><g id=\"box2\"><polygon class=\"cls-3\" points=\"302 226.49 349.63 253.99 397.37 226.49 397.37 181.43 349.68 153.96 302 181.49 302 226.49\"/><polygon class=\"cls-3\" points=\"349.67 208.96 397.37 181.43 397.37 226.49 349.63 253.99 349.67 208.96\"/><polygon class=\"cls-3\" points=\"302 181.49 349.67 208.96 349.63 253.99 302 226.49 302 181.49\"/><g id=\"Layer_6_copy\" data-name=\"Layer 6 copy\"><polygon class=\"cls-4\" points=\"327.98 166.49 375.61 193.99 375.61 228.99 371.28 231.49 371.28 196.49 323.65 168.99 327.98 166.49\"/><polygon class=\"cls-4\" points=\"371.28 166.49 323.65 193.96 323.65 228.99 327.98 231.49 327.98 196.46 375.61 168.99 371.28 166.49\"/></g><g id=\"clips_copy_4\" data-name=\"clips copy 4\"><polyline class=\"cls-5\" points=\"392.93 223.99 401.59 228.99 401.59 233.99\"/><polyline class=\"cls-5\" points=\"384.27 228.99 392.93 233.99 392.93 238.99\"/><polyline class=\"cls-5\" points=\"375.61 233.99 384.27 238.99 384.27 243.99\"/><polyline class=\"cls-5\" points=\"366.95 238.99 375.61 243.99 375.61 248.99\"/><polyline class=\"cls-5\" points=\"358.29 243.99 366.95 248.99 366.95 253.99\"/><polyline class=\"cls-5\" points=\"349.67 248.96 358.29 253.99 358.29 258.99\"/></g><g id=\"clipsFront_copy\" data-name=\"clipsFront copy\"><polyline class=\"cls-5\" points=\"306.37 223.99 297.71 228.99 297.71 233.99\"/><polyline class=\"cls-5\" points=\"315.03 228.99 306.37 233.99 306.37 238.99\"/><polyline class=\"cls-5\" points=\"323.69 233.99 315.03 238.99 315.03 243.99\"/><polyline class=\"cls-5\" points=\"332.35 238.99 323.69 243.99 323.69 248.99\"/><polyline class=\"cls-5\" points=\"341.01 243.99 332.35 248.99 332.35 253.99\"/><polyline class=\"cls-5\" points=\"349.63 248.96 341.01 253.99 341.01 258.99\"/></g><polyline id=\"MrClips\" class=\"cls-5\" points=\"397.37 221.43 401.59 218.99 401.59 223.99\"/></g><g id=\"box3\"><g id=\"box\"><polygon class=\"cls-3\" points=\"59.74 201.53 107.38 229.03 155.11 201.53 155.11 156.47 107.43 129 59.74 156.53 59.74 201.53\"/><polygon class=\"cls-3\" points=\"107.42 184 155.11 156.47 155.11 201.53 107.38 229.03 107.42 184\"/><polygon class=\"cls-3\" points=\"59.74 156.53 107.42 184 107.38 229.03 59.74 201.53 59.74 156.53\"/><g id=\"Layer_6\" data-name=\"Layer 6\"><polygon class=\"cls-4\" points=\"85.73 141.53 133.36 169.03 133.36 204.03 129.03 206.53 129.03 171.53 81.39 144.03 85.73 141.53\"/><polygon class=\"cls-4\" points=\"129.03 141.53 81.39 169.01 81.39 204.03 85.73 206.53 85.73 171.5 133.36 144.03 129.03 141.53\"/></g><g id=\"clips-3\" data-name=\"clips\"><polyline class=\"cls-5\" points=\"150.68 199.03 159.34 204.03 159.34 209.03\"/><polyline class=\"cls-5\" points=\"142.02 204.03 150.68 209.03 150.68 214.03\"/><polyline class=\"cls-5\" points=\"133.36 209.03 142.02 214.03 142.02 219.03\"/><polyline class=\"cls-5\" points=\"124.7 214.03 133.36 219.03 133.36 224.03\"/><polyline class=\"cls-5\" points=\"116.04 219.03 124.7 224.03 124.7 229.03\"/><polyline class=\"cls-5\" points=\"107.42 224 116.04 229.03 116.04 234.03\"/></g><g id=\"clipsFront\"><polyline class=\"cls-5\" points=\"64.12 199.03 55.46 204.03 55.46 209.03\"/><polyline class=\"cls-5\" points=\"72.78 204.03 64.12 209.03 64.12 214.03\"/><polyline class=\"cls-5\" points=\"81.44 209.03 72.78 214.03 72.78 219.03\"/><polyline class=\"cls-5\" points=\"90.1 214.03 81.44 219.03 81.44 224.03\"/><polyline class=\"cls-5\" points=\"98.76 219.03 90.1 224.03 90.1 229.03\"/><polyline class=\"cls-5\" points=\"107.38 224 98.76 229.03 98.76 234.03\"/></g><polyline id=\"MrClips-2\" data-name=\"MrClips\" class=\"cls-5\" points=\"155.11 196.47 159.34 194.03 159.34 199.03\"/></g><polygon class=\"cls-3\" points=\"107.52 74.03 155.15 101.53 202.88 74.03 202.88 28.97 155.2 1.5 107.52 29.03 107.52 74.03\"/><polygon class=\"cls-3\" points=\"155.19 56.51 202.88 28.97 202.88 74.03 155.15 101.53 155.19 56.51\"/><polygon class=\"cls-3\" points=\"107.52 29.03 155.19 56.51 155.15 101.53 107.52 74.03 107.52 29.03\"/><g id=\"Layer_6_copy_2\" data-name=\"Layer 6 copy 2\"><polygon class=\"cls-4\" points=\"133.5 14.03 181.13 41.53 181.13 76.53 176.8 79.03 176.8 44.03 129.17 16.53 133.5 14.03\"/><polygon class=\"cls-4\" points=\"176.8 14.03 129.17 41.51 129.17 76.53 133.5 79.03 133.5 44 181.13 16.53 176.8 14.03\"/></g><g id=\"clips_copy_5\" data-name=\"clips copy 5\"><polyline class=\"cls-5\" points=\"198.45 71.53 207.11 76.53 207.11 81.53\"/><polyline class=\"cls-5\" points=\"189.79 76.53 198.45 81.53 198.45 86.53\"/><polyline class=\"cls-5\" points=\"181.13 81.53 189.79 86.53 189.79 91.53\"/><polyline class=\"cls-5\" points=\"172.47 86.53 181.13 91.53 181.13 96.53\"/><polyline class=\"cls-5\" points=\"163.81 91.53 172.47 96.53 172.47 101.53\"/><polyline class=\"cls-5\" points=\"155.19 96.5 163.81 101.53 163.81 106.53\"/></g><g id=\"clipsFront_copy_2\" data-name=\"clipsFront copy 2\"><polyline class=\"cls-5\" points=\"111.89 71.53 103.23 76.53 103.23 81.53\"/><polyline class=\"cls-5\" points=\"120.55 76.53 111.89 81.53 111.89 86.53\"/><polyline class=\"cls-5\" points=\"129.21 81.53 120.55 86.53 120.55 91.53\"/><polyline class=\"cls-5\" points=\"137.87 86.53 129.21 91.53 129.21 96.53\"/><polyline class=\"cls-5\" points=\"146.53 91.53 137.87 96.53 137.87 101.53\"/><polyline class=\"cls-5\" points=\"155.15 96.5 146.53 101.53 146.53 106.53\"/></g></g><g id=\"callouts\"><polyline class=\"cls-5\" points=\"406.23 221.49 436.41 204 436.39 134.07\"/><path class=\"cls-5\" d=\"M441.61,127.56c-2.38,1.38-2.38,3.63,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.37,2.38-3.62,0-5A9.61,9.61,0,0,0,441.61,127.56Z\" transform=\"translate(-9.54)\"/><polyline class=\"cls-5\" points=\"7.88 116.47 7.62 161.47 55.2 189.15\"/><path class=\"cls-5\" d=\"M0,111.53\" transform=\"translate(-9.54)\"/><path class=\"cls-5\" d=\"M12.79,109c-2.35,1.38-2.33,3.63.05,5a9.61,9.61,0,0,0,8.66,0c2.38-1.37,2.36-3.62-.05-5A9.61,9.61,0,0,0,12.79,109Z\" transform=\"translate(-9.54)\"/><path class=\"cls-5\" d=\"M242.42,67.56c-2.38,1.37-2.38,3.62,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.37,2.38-3.62,0-5A9.61,9.61,0,0,0,242.42,67.56Z\" transform=\"translate(-9.54)\"/><polyline class=\"cls-5\" points=\"237.22 73.99 237.22 98.81 211.33 84.21\"/></g></g></g></svg>\n\\ No newline at end of file\n+<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"574px\" height=\"396px\" viewBox=\"0 0 444.02 288.03\"><defs><style>.cls-1,.cls-2,.cls-3,.cls-5{fill:none;stroke-width:3px;}.cls-1,.cls-2{stroke:#9ebbe2;}.cls-1,.cls-2,.cls-3,.cls-4,.cls-5{stroke-linejoin:round;}.cls-2,.cls-5{stroke-linecap:round;}.cls-3,.cls-4,.cls-5{stroke:#fff;}.cls-4{fill:#fff;}@media screen and (-ms-high-contrast:active){.cls-3,.cls-4,.cls-5{stroke:windowText;}.cls-4{fill:windowText;}}</style></defs><title>Hero Image v7</title><g id=\"Layer_2\" data-name=\"Layer 2\"><g id=\"Hero\"><g id=\"chip\"><polygon class=\"cls-1\" points=\"215.98 176.65 289.6 134.15 289.6 124.15 250.63 101.65 177.01 144.15 177.01 154.15 215.98 176.65\"/><polygon class=\"cls-1\" points=\"177.01 144.15 215.99 166.65 215.98 176.65 177.01 154.15 177.01 144.15\"/><polygon class=\"cls-1\" points=\"215.99 166.65 289.6 124.15 289.6 134.15 215.98 176.65 215.99 166.65\"/><g id=\"clips\"><polyline class=\"cls-2\" points=\"280.94 134.15 289.52 139.1 289.52 144.19\"/><polyline id=\"_7\" data-name=\"7\" class=\"cls-2\" points=\"272.31 139.12 280.94 144.15 281.01 149.1\"/><polyline id=\"_6\" data-name=\"6\" class=\"cls-2\" points=\"263.62 143.65 272.2 149.1 272.31 154.17\"/><polyline id=\"_5\" data-name=\"5\" class=\"cls-2\" points=\"255.03 149.1 263.62 154.15 263.65 159.17\"/><polyline id=\"_4\" data-name=\"4\" class=\"cls-2\" points=\"246.3 154.15 254.85 159.09 255.03 164.19\"/><polyline id=\"_3\" data-name=\"3\" class=\"cls-2\" points=\"237.63 159.15 246.3 164.15 246.3 169.15\"/><polyline id=\"_2\" data-name=\"2\" class=\"cls-2\" points=\"228.97 164.15 237.63 169.15 237.63 174.15\"/><polyline id=\"_1\" data-name=\"1\" class=\"cls-2\" points=\"220.31 169.15 228.97 174.15 228.97 179.15\"/></g><g id=\"clips-2\" data-name=\"clips\"><polyline class=\"cls-2\" points=\"181.34 146.65 172.68 141.65 172.68 146.65\"/><polyline class=\"cls-2\" points=\"185.76 139.18 181.34 136.62 181.34 141.62\"/><polyline class=\"cls-2\" points=\"194.42 134.2 190 131.65 190 136.65\"/><polyline class=\"cls-2\" points=\"203.1 129.2 198.68 126.65 198.68 131.65\"/><polyline class=\"cls-2\" points=\"207.41 126.65 207.32 121.65 211.66 124.15\"/><polyline class=\"cls-2\" points=\"215.98 121.65 215.98 116.65 220.31 119.15\"/><polyline class=\"cls-2\" points=\"224.65 116.65 224.65 111.65 228.97 114.15\"/><polyline class=\"cls-2\" points=\"233.3 111.65 233.31 106.65 237.64 109.15\"/><polyline class=\"cls-2\" points=\"241.97 106.65 241.97 101.65 246.3 104.15\"/></g><g id=\"clips_copy_2\" data-name=\"clips copy 2\"><polyline id=\"_4-2\" data-name=\"4\" class=\"cls-2\" points=\"181.43 151.65 172.88 156.59 172.7 161.69\"/><polyline id=\"_3-2\" data-name=\"3\" class=\"cls-2\" points=\"190.09 156.65 181.43 161.65 181.43 166.65\"/><polyline id=\"_2-2\" data-name=\"2\" class=\"cls-2\" points=\"198.75 161.65 190.09 166.65 190.09 171.65\"/><polyline id=\"_1-2\" data-name=\"1\" class=\"cls-2\" points=\"207.41 166.65 198.75 171.65 198.75 176.65\"/></g><g id=\"clipsBack\"><polyline class=\"cls-2\" points=\"255.03 104.1 259.29 101.65 259.29 106.65\"/><polyline class=\"cls-2\" points=\"263.62 109.15 267.97 106.66 267.97 111.65\"/><polyline class=\"cls-2\" points=\"272.28 114.15 276.66 111.68 276.61 116.65\"/><polyline class=\"cls-2\" points=\"280.94 119.15 285.23 116.67 285.27 121.65\"/></g></g><g id=\"chips\"><g id=\"_2-3\" data-name=\"2\"><polygon class=\"cls-2\" points=\"315.33 118.95 345.56 101.5 345.56 96.5 328.24 86.5 297.97 103.98 297.97 109.02 315.33 118.95\"/><polygon class=\"cls-2\" points=\"315.33 113.95 345.56 96.5 345.56 101.5 315.33 118.95 315.33 113.95\"/><polygon class=\"cls-2\" points=\"297.97 103.98 315.33 113.95 315.33 118.95 297.97 109.02 297.97 103.98\"/></g><g id=\"_1-3\" data-name=\"1\"><polygon class=\"cls-2\" points=\"280.76 98.94 311 81.48 311 76.48 293.68 66.48 263.4 83.96 263.4 89 280.76 98.94\"/><polygon class=\"cls-2\" points=\"280.76 93.94 311 76.48 311 81.48 280.76 98.94 280.76 93.94\"/><polygon class=\"cls-2\" points=\"263.4 83.96 280.76 93.94 280.76 98.94 263.4 89 263.4 83.96\"/></g></g><g id=\"wires\"><path class=\"cls-1\" d=\"M290,189.15c-2.38,1.37-2.38,3.62,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.38,2.38-3.63,0-5A9.61,9.61,0,0,0,290,189.15Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"250.94\" y1=\"172.15\" x2=\"280.5\" y2=\"189.15\"/><path class=\"cls-1\" d=\"M189.68,241.53c-2.38,1.37-2.38,3.62,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.38,2.38-3.63,0-5A9.61,9.61,0,0,0,189.68,241.53Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"145.58\" y1=\"221.53\" x2=\"180.15\" y2=\"241.53\"/><polyline class=\"cls-2\" points=\"233.7 182.07 258.93 196.53 198.4 231.48 163.67 211.53\"/><polyline class=\"cls-2\" points=\"155.01 216.53 198.4 241.58 276.26 196.53 242.28 177.03\"/><polyline class=\"cls-2\" points=\"259.6 167.03 302.02 191.65 189.65 256.53 137.69 226.53\"/><line class=\"cls-2\" x1=\"194.12\" y1=\"178.95\" x2=\"163.67\" y2=\"196.53\"/><path class=\"cls-2\" d=\"M199.28,176.58\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"185.41\" y1=\"174.08\" x2=\"155.69\" y2=\"191.25\"/><line class=\"cls-2\" x1=\"176.71\" y1=\"169.05\" x2=\"155.69\" y2=\"181.26\"/><line class=\"cls-2\" x1=\"168.07\" y1=\"164.08\" x2=\"155.69\" y2=\"171.09\"/><polyline class=\"cls-2\" points=\"59.79 216.55 16.5 241.58 51.37 261.37\"/><line class=\"cls-2\" x1=\"94.43\" y1=\"236.55\" x2=\"51.37\" y2=\"261.37\"/><polyline class=\"cls-2\" points=\"129.03 231.48 189.65 266.53 302 201.66\"/><polyline class=\"cls-2\" points=\"167.94 109.06 180.97 116.48 150.73 134.15 168.14 144.19\"/><polyline class=\"cls-2\" points=\"176.66 104.03 194.13 114.16 163.77 131.37 176.49 139.12\"/><polyline class=\"cls-2\" points=\"185.46 98.95 206.9 111.53 176.47 129.15 185.12 134.15\"/><polyline class=\"cls-2\" points=\"194.12 93.95 219.96 109.06 189.79 126.67\"/><line class=\"cls-2\" x1=\"202.63\" y1=\"89.02\" x2=\"228.59\" y2=\"103.98\"/><path class=\"cls-2\" d=\"M29.77,229c-2.36-1.41-2.38-3.67,0-5a9.52,9.52,0,0,1,8.59,0c2.38,1.38,2.39,3.64,0,5A9.32,9.32,0,0,1,29.77,229Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"51.08\" y1=\"211.53\" x2=\"29.47\" y2=\"224.05\"/><path class=\"cls-2\" d=\"M51.67,236.38c-2.36-1.41-2.38-3.67,0-5a9.52,9.52,0,0,1,8.59,0c2.38,1.38,2.39,3.64,0,5A9.32,9.32,0,0,1,51.67,236.38Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"68.45\" y1=\"221.53\" x2=\"51.37\" y2=\"231.42\"/><path class=\"cls-2\" d=\"M103.56,116.75c-2.36-1.41-2.38-3.67,0-5a9.52,9.52,0,0,1,8.59,0c2.38,1.38,2.39,3.64,0,5A9.32,9.32,0,0,1,103.56,116.75Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"124.88\" y1=\"99.27\" x2=\"103.27\" y2=\"111.79\"/><polyline class=\"cls-2\" points=\"107.52 89.11 33.76 131.53 68.41 151.53\"/><polyline class=\"cls-2\" points=\"115.89 93.95 51.09 131.53 77.06 146.53\"/><polyline class=\"cls-2\" points=\"133.36 104.03 77.1 136.51 85.73 141.53\"/><polyline class=\"cls-2\" points=\"141.96 109.06 111.89 126.23 163.77 156.47 155.11 161.47\"/><line class=\"cls-2\" x1=\"267.51\" y1=\"221.49\" x2=\"293.61\" y2=\"236.55\"/><polyline class=\"cls-2\" points=\"302.23 241.53 293.57 246.53 258.97 226.55\"/><polyline class=\"cls-2\" points=\"310.89 246.53 293.57 256.53 250.36 231.48\"/><polyline class=\"cls-2\" points=\"319.55 251.53 293.61 266.5 233.04 231.48\"/><polyline class=\"cls-2\" points=\"328.21 256.53 293.57 276.53 215.63 231.61\"/><polyline class=\"cls-2\" points=\"336.87 261.53 293.57 286.53 224.18 246.53\"/><polyline class=\"cls-2\" points=\"77.06 226.53 59.79 236.55 77.06 246.53\"/><polyline class=\"cls-2\" points=\"85.77 231.42 77.11 236.5 85.73 241.53\"/><line class=\"cls-2\" x1=\"258.88\" y1=\"96.5\" x2=\"263.4\" y2=\"93.95\"/><line class=\"cls-2\" x1=\"277.05\" y1=\"156.96\" x2=\"310.49\" y2=\"176.58\"/><line class=\"cls-2\" x1=\"285.5\" y1=\"151.98\" x2=\"319.34\" y2=\"171.41\"/><line class=\"cls-2\" x1=\"294.24\" y1=\"147.03\" x2=\"327.98\" y2=\"166.49\"/><line class=\"cls-2\" x1=\"280.38\" y1=\"104.15\" x2=\"271.75\" y2=\"98.93\"/><line class=\"cls-2\" x1=\"297.71\" y1=\"93.92\" x2=\"302.04\" y2=\"96.5\"/><line class=\"cls-2\" x1=\"306.37\" y1=\"88.92\" x2=\"310.7\" y2=\"91.64\"/><polyline class=\"cls-2\" points=\"280.38 114.15 289.24 109.03 319.55 126.53 336.87 116.53\"/><polyline class=\"cls-2\" points=\"293.33 116.67 319.34 131.41 349.95 114.08 341.25 109.24\"/><line class=\"cls-2\" x1=\"268.54\" y1=\"162.09\" x2=\"301.99\" y2=\"181.72\"/><line class=\"cls-2\" x1=\"280.38\" y1=\"104.15\" x2=\"271.75\" y2=\"108.98\"/><line class=\"cls-2\" x1=\"258.88\" y1=\"96.5\" x2=\"267.55\" y2=\"101.5\"/><line class=\"cls-2\" x1=\"263.4\" y1=\"104.11\" x2=\"267.55\" y2=\"101.5\"/><line class=\"cls-2\" x1=\"332.46\" y1=\"113.94\" x2=\"336.87\" y2=\"116.53\"/><line class=\"cls-2\" x1=\"293.33\" y1=\"116.67\" x2=\"289.52\" y2=\"118.87\"/><path class=\"cls-1\" d=\"M159.69,253.78c-2.38,1.37-2.38,3.62,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.38,2.38-3.63,0-5A9.61,9.61,0,0,0,159.69,253.78Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"115.59\" y1=\"233.78\" x2=\"150.15\" y2=\"253.78\"/><path class=\"cls-2\" d=\"M70.92,104.73c-2.36-1.41-2.38-3.67,0-5a9.52,9.52,0,0,1,8.59,0c2.38,1.38,2.39,3.64,0,5A9.32,9.32,0,0,1,70.92,104.73Z\" transform=\"translate(-9.54)\"/><line class=\"cls-2\" x1=\"98.31\" y1=\"83.74\" x2=\"70.63\" y2=\"99.78\"/></g><g id=\"box2\"><polygon class=\"cls-3\" points=\"302 226.49 349.63 253.99 397.37 226.49 397.37 181.43 349.68 153.96 302 181.49 302 226.49\"/><polygon class=\"cls-3\" points=\"349.67 208.96 397.37 181.43 397.37 226.49 349.63 253.99 349.67 208.96\"/><polygon class=\"cls-3\" points=\"302 181.49 349.67 208.96 349.63 253.99 302 226.49 302 181.49\"/><g id=\"Layer_6_copy\" data-name=\"Layer 6 copy\"><polygon class=\"cls-4\" points=\"327.98 166.49 375.61 193.99 375.61 228.99 371.28 231.49 371.28 196.49 323.65 168.99 327.98 166.49\"/><polygon class=\"cls-4\" points=\"371.28 166.49 323.65 193.96 323.65 228.99 327.98 231.49 327.98 196.46 375.61 168.99 371.28 166.49\"/></g><g id=\"clips_copy_4\" data-name=\"clips copy 4\"><polyline class=\"cls-5\" points=\"392.93 223.99 401.59 228.99 401.59 233.99\"/><polyline class=\"cls-5\" points=\"384.27 228.99 392.93 233.99 392.93 238.99\"/><polyline class=\"cls-5\" points=\"375.61 233.99 384.27 238.99 384.27 243.99\"/><polyline class=\"cls-5\" points=\"366.95 238.99 375.61 243.99 375.61 248.99\"/><polyline class=\"cls-5\" points=\"358.29 243.99 366.95 248.99 366.95 253.99\"/><polyline class=\"cls-5\" points=\"349.67 248.96 358.29 253.99 358.29 258.99\"/></g><g id=\"clipsFront_copy\" data-name=\"clipsFront copy\"><polyline class=\"cls-5\" points=\"306.37 223.99 297.71 228.99 297.71 233.99\"/><polyline class=\"cls-5\" points=\"315.03 228.99 306.37 233.99 306.37 238.99\"/><polyline class=\"cls-5\" points=\"323.69 233.99 315.03 238.99 315.03 243.99\"/><polyline class=\"cls-5\" points=\"332.35 238.99 323.69 243.99 323.69 248.99\"/><polyline class=\"cls-5\" points=\"341.01 243.99 332.35 248.99 332.35 253.99\"/><polyline class=\"cls-5\" points=\"349.63 248.96 341.01 253.99 341.01 258.99\"/></g><polyline id=\"MrClips\" class=\"cls-5\" points=\"397.37 221.43 401.59 218.99 401.59 223.99\"/></g><g id=\"box3\"><g id=\"box\"><polygon class=\"cls-3\" points=\"59.74 201.53 107.38 229.03 155.11 201.53 155.11 156.47 107.43 129 59.74 156.53 59.74 201.53\"/><polygon class=\"cls-3\" points=\"107.42 184 155.11 156.47 155.11 201.53 107.38 229.03 107.42 184\"/><polygon class=\"cls-3\" points=\"59.74 156.53 107.42 184 107.38 229.03 59.74 201.53 59.74 156.53\"/><g id=\"Layer_6\" data-name=\"Layer 6\"><polygon class=\"cls-4\" points=\"85.73 141.53 133.36 169.03 133.36 204.03 129.03 206.53 129.03 171.53 81.39 144.03 85.73 141.53\"/><polygon class=\"cls-4\" points=\"129.03 141.53 81.39 169.01 81.39 204.03 85.73 206.53 85.73 171.5 133.36 144.03 129.03 141.53\"/></g><g id=\"clips-3\" data-name=\"clips\"><polyline class=\"cls-5\" points=\"150.68 199.03 159.34 204.03 159.34 209.03\"/><polyline class=\"cls-5\" points=\"142.02 204.03 150.68 209.03 150.68 214.03\"/><polyline class=\"cls-5\" points=\"133.36 209.03 142.02 214.03 142.02 219.03\"/><polyline class=\"cls-5\" points=\"124.7 214.03 133.36 219.03 133.36 224.03\"/><polyline class=\"cls-5\" points=\"116.04 219.03 124.7 224.03 124.7 229.03\"/><polyline class=\"cls-5\" points=\"107.42 224 116.04 229.03 116.04 234.03\"/></g><g id=\"clipsFront\"><polyline class=\"cls-5\" points=\"64.12 199.03 55.46 204.03 55.46 209.03\"/><polyline class=\"cls-5\" points=\"72.78 204.03 64.12 209.03 64.12 214.03\"/><polyline class=\"cls-5\" points=\"81.44 209.03 72.78 214.03 72.78 219.03\"/><polyline class=\"cls-5\" points=\"90.1 214.03 81.44 219.03 81.44 224.03\"/><polyline class=\"cls-5\" points=\"98.76 219.03 90.1 224.03 90.1 229.03\"/><polyline class=\"cls-5\" points=\"107.38 224 98.76 229.03 98.76 234.03\"/></g><polyline id=\"MrClips-2\" data-name=\"MrClips\" class=\"cls-5\" points=\"155.11 196.47 159.34 194.03 159.34 199.03\"/></g><polygon class=\"cls-3\" points=\"107.52 74.03 155.15 101.53 202.88 74.03 202.88 28.97 155.2 1.5 107.52 29.03 107.52 74.03\"/><polygon class=\"cls-3\" points=\"155.19 56.51 202.88 28.97 202.88 74.03 155.15 101.53 155.19 56.51\"/><polygon class=\"cls-3\" points=\"107.52 29.03 155.19 56.51 155.15 101.53 107.52 74.03 107.52 29.03\"/><g id=\"Layer_6_copy_2\" data-name=\"Layer 6 copy 2\"><polygon class=\"cls-4\" points=\"133.5 14.03 181.13 41.53 181.13 76.53 176.8 79.03 176.8 44.03 129.17 16.53 133.5 14.03\"/><polygon class=\"cls-4\" points=\"176.8 14.03 129.17 41.51 129.17 76.53 133.5 79.03 133.5 44 181.13 16.53 176.8 14.03\"/></g><g id=\"clips_copy_5\" data-name=\"clips copy 5\"><polyline class=\"cls-5\" points=\"198.45 71.53 207.11 76.53 207.11 81.53\"/><polyline class=\"cls-5\" points=\"189.79 76.53 198.45 81.53 198.45 86.53\"/><polyline class=\"cls-5\" points=\"181.13 81.53 189.79 86.53 189.79 91.53\"/><polyline class=\"cls-5\" points=\"172.47 86.53 181.13 91.53 181.13 96.53\"/><polyline class=\"cls-5\" points=\"163.81 91.53 172.47 96.53 172.47 101.53\"/><polyline class=\"cls-5\" points=\"155.19 96.5 163.81 101.53 163.81 106.53\"/></g><g id=\"clipsFront_copy_2\" data-name=\"clipsFront copy 2\"><polyline class=\"cls-5\" points=\"111.89 71.53 103.23 76.53 103.23 81.53\"/><polyline class=\"cls-5\" points=\"120.55 76.53 111.89 81.53 111.89 86.53\"/><polyline class=\"cls-5\" points=\"129.21 81.53 120.55 86.53 120.55 91.53\"/><polyline class=\"cls-5\" points=\"137.87 86.53 129.21 91.53 129.21 96.53\"/><polyline class=\"cls-5\" points=\"146.53 91.53 137.87 96.53 137.87 101.53\"/><polyline class=\"cls-5\" points=\"155.15 96.5 146.53 101.53 146.53 106.53\"/></g></g><g id=\"callouts\"><polyline class=\"cls-5\" points=\"406.23 221.49 436.41 204 436.39 134.07\"/><path class=\"cls-5\" d=\"M441.61,127.56c-2.38,1.38-2.38,3.63,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.37,2.38-3.62,0-5A9.61,9.61,0,0,0,441.61,127.56Z\" transform=\"translate(-9.54)\"/><polyline class=\"cls-5\" points=\"7.88 116.47 7.62 161.47 55.2 189.15\"/><path class=\"cls-5\" d=\"M0,111.53\" transform=\"translate(-9.54)\"/><path class=\"cls-5\" d=\"M12.79,109c-2.35,1.38-2.33,3.63.05,5a9.61,9.61,0,0,0,8.66,0c2.38-1.37,2.36-3.62-.05-5A9.61,9.61,0,0,0,12.79,109Z\" transform=\"translate(-9.54)\"/><path class=\"cls-5\" d=\"M242.42,67.56c-2.38,1.37-2.38,3.62,0,5a9.61,9.61,0,0,0,8.66,0c2.38-1.37,2.38-3.62,0-5A9.61,9.61,0,0,0,242.42,67.56Z\" transform=\"translate(-9.54)\"/><polyline class=\"cls-5\" points=\"237.22 73.99 237.22 98.81 211.33 84.21\"/></g></g></g></svg>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/img/default-package-icon.svg", "new_path": "src/NuGetGallery/Content/gallery/img/default-package-icon.svg", "diff": "<!-- Generator: Sketch 44 (41411) - http://www.bohemiancoding.com/sketch -->\n<title>ImageDefault</title>\n<desc>Created with Sketch.</desc>\n- <defs></defs>\n+ <defs>\n+ <style>\n+ @media screen and (-ms-high-contrast: active) {\n+ .high-contrast-visible {\n+ stroke: windowText;\n+ }\n+ }\n+ </style>\n+ </defs>\n<g id=\"Symbols\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n- <g id=\"Component/Row\" transform=\"translate(-20.000000, -21.000000)\" stroke=\"#004880\">\n+ <g id=\"Component/Row\" transform=\"translate(-20.000000, -21.000000)\" class=\"high-contrast-visible\" stroke=\"#004880\">\n<g id=\"_asset/LogoOutline\" transform=\"translate(20.000000, 21.000000)\">\n<g id=\"Group-2\">\n<rect id=\"Rectangle\" stroke-width=\"2\" x=\"9.65384615\" y=\"9.65384615\" width=\"39.3461538\" height=\"39.3461538\" rx=\"10\"></rect>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Make SVGs more friendly with high contrast on Edge and Firefox.
455,736
28.07.2017 08:20:14
25,200
4d9c6de06dee211247d8bb813d69807988787328
[Redesign] Wrap long IDs and titles on the display package page Fix issue
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -566,6 +566,8 @@ img.package-icon {\n}\n.page-package-details .package-title {\nmargin-bottom: 24px;\n+ word-break: break-all;\n+ word-break: break-word;\n}\n.page-package-details .package-title div {\nmargin-top: 2px;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-display-package.less", "new_path": "src/Bootstrap/less/theme/page-display-package.less", "diff": ".package-title {\nmargin-bottom: 24px;\n+ word-break: break-all;\n+ word-break: break-word;\ndiv {\nmargin-top: 2px;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -566,6 +566,8 @@ img.package-icon {\n}\n.page-package-details .package-title {\nmargin-bottom: 24px;\n+ word-break: break-all;\n+ word-break: break-word;\n}\n.page-package-details .package-title div {\nmargin-top: 2px;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "<article class=\"col-sm-8\">\n<div class=\"package-title\">\n<h1>\n- @Model.Id\n+ @Html.BreakWord(Model.Id)\n<small class=\"text-nowrap\">@Model.FullVersion</small>\n</h1>\n@if (!StringComparer.OrdinalIgnoreCase.Equals(Model.Id, Model.Title))\n{\n<div class=\"ms-fontSize-xl\">\n- @Model.Title\n+ @Html.BreakWord(Model.Title)\n</div>\n}\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Wrap long IDs and titles on the display package page Fix issue https://github.com/NuGet/NuGetGallery/issues/4470
455,736
28.07.2017 14:37:50
25,200
13df71d07a62eb162cd007d028121691c307a801
[Redesign] Minor polish on the manage packages package Finish off
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/Packages.cshtml", "new_path": "src/NuGetGallery/Views/Users/Packages.cshtml", "diff": "}\n<section role=\"main\" class=\"container main-container page-manage-packages page-package-details\">\n+ <div class=\"row\">\n+ <div class=\"col-xs-12\">\n<h1>Manage Packages</h1>\n+ </div>\n+ </div>\n@{\nvar listedPackages = Model.Packages.Where(p => p.Listed);\nvar unlistedPackages = Model.Packages.Where(p => !p.Listed);\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "new_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "diff": "<thead>\n<tr class=\"manage-package-headings\">\n<th class=\"col-sm-1\"></th>\n- <th class=\"col-sm-3\">Package Id</th>\n- <th class=\"col-sm-2\">Authors</th>\n+ <th class=\"col-sm-3\">Package ID</th>\n+ <th class=\"col-sm-2\">Owners</th>\n<th class=\"col-sm-2\">Downloads</th>\n<th class=\"col-sm-2\">Latest Version</th>\n<th class=\"col-sm-2\"></th>\n<a href=\"@Url.User(owner.Username)\">@owner.Username</a>\n}\n</td>\n- <td class=\"col-sm-2 align-middle\">@package.TotalDownloadCount</td>\n+ <td class=\"col-sm-2 align-middle\">@package.TotalDownloadCount.ToNuGetNumberString()</td>\n<td class=\"col-sm-2 align-middle\">@package.Version</td>\n<td class=\"col-sm-2 text-right align-middle\">\n<div class=\"btn-group\">\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Minor polish on the manage packages package Finish off https://github.com/NuGet/NuGetGallery/issues/4431
455,736
31.07.2017 12:05:03
25,200
e467981de769b4b1ca4668697e35f5b518bbc52a
[Redesign] Remove transition CSS from .collapsing class since the transition time is 0 in the JS
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap.css", "new_path": "src/Bootstrap/dist/css/bootstrap.css", "diff": "@@ -2682,18 +2682,10 @@ tbody.collapse.in {\ndisplay: table-row-group;\n}\n.collapsing {\n- position: relative;\n- height: 0;\n- overflow: hidden;\n- -webkit-transition-timing-function: ease;\n- -o-transition-timing-function: ease;\n- transition-timing-function: ease;\n- -webkit-transition-duration: .35s;\n- -o-transition-duration: .35s;\n- transition-duration: .35s;\n- -webkit-transition-property: height, visibility;\n- -o-transition-property: height, visibility;\n- transition-property: height, visibility;\n+ display: none;\n+ -webkit-transition: none;\n+ -o-transition: none;\n+ transition: none;\n}\n.caret {\ndisplay: inline-block;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/component-animations.less", "new_path": "src/Bootstrap/less/component-animations.less", "diff": "}\n.collapsing {\n- position: relative;\n- height: 0;\n- overflow: hidden;\n- .transition-property(~\"height, visibility\");\n- .transition-duration(.35s);\n- .transition-timing-function(ease);\n+ -webkit-transition: none;\n+ transition: none;\n+ display: none;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap.css", "diff": "@@ -2682,18 +2682,10 @@ tbody.collapse.in {\ndisplay: table-row-group;\n}\n.collapsing {\n- position: relative;\n- height: 0;\n- overflow: hidden;\n- -webkit-transition-timing-function: ease;\n- -o-transition-timing-function: ease;\n- transition-timing-function: ease;\n- -webkit-transition-duration: .35s;\n- -o-transition-duration: .35s;\n- transition-duration: .35s;\n- -webkit-transition-property: height, visibility;\n- -o-transition-property: height, visibility;\n- transition-property: height, visibility;\n+ display: none;\n+ -webkit-transition: none;\n+ -o-transition: none;\n+ transition: none;\n}\n.caret {\ndisplay: inline-block;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Remove transition CSS from .collapsing class since the transition time is 0 in the JS
455,736
31.07.2017 12:59:41
25,200
f81510f09de7551f5e5ce202ad4f63eb65f22903
[Redesign] Automatically expand the version list if the selected version is in the collapsed section
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Constants.cs", "new_path": "src/NuGetGallery/Constants.cs", "diff": "@@ -19,6 +19,8 @@ public static class Constants\npublic const int ColumnsWideAuthenticationMd = 6;\npublic const int ColumnsFormMd = 10;\n+ public const int VisibleVersions = 5;\n+\npublic const int GravatarElementSize = 32;\npublic const int GravatarImageSize = GravatarElementSize * 2;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "}\n}\n+@helper VersionListDivider(int rowCount, bool versionsExpanded)\n+{\n+ if (rowCount == Constants.VisibleVersions + 1)\n+ {\n+ @:</tbody><tbody class=\"no-border collapse @(versionsExpanded ? \"in\" : string.Empty)\" id=\"hidden-versions\">\n+ }\n+}\n+\n+\n@helper CommandTab(string label, string id, bool active)\n{\n<li role=\"presentation\" class=\"@(active ? \"active\" : string.Empty)\">\n</tr>\n</thead>\n<tbody class=\"no-border\">\n- @{var rowCount = 0;}\n+ @{\n+ var rowCount = 0;\n+ var versionsExpanded = Model\n+ .PackageVersions\n+ .Skip(Constants.VisibleVersions)\n+ .Any(v => v.IsCurrent(Model));\n+ }\n@foreach (var packageVersion in Model.PackageVersions)\n{\nif (!packageVersion.Deleted && (packageVersion.Listed || (Model.IsOwner(User) || User.IsAdministrator())))\n{\nrowCount++;\n- if (rowCount == 6)\n- {\n- @:</tbody><tbody class=\"no-border collapse\" id=\"hidden-versions\">\n- }\n+ @VersionListDivider(rowCount, versionsExpanded)\n<tr>\n<td>\n@if (packageVersion.IsCurrent(Model))\n{\n<a href=\"@Url.Package(packageVersion)\">\n+ <b>\n@packageVersion.FullVersion\n@if (packageVersion.IsCurrent(Model))\n{\n@:(current version)\n}\n+ </b>\n</a>\n}\nelse\nelse if (packageVersion.Deleted)\n{\nrowCount++;\n- if (rowCount == 6)\n- {\n- @:</tbody><tbody class=\"no-border collapse\" id=\"hidden-versions\">\n- }\n+ @VersionListDivider(rowCount, versionsExpanded)\n<tr class=\"deleted\">\n<td class=\"version\">\n- <s>@packageVersion.FullVersion</s> (deleted)\n+ @packageVersion.FullVersion (deleted)\n</td>\n<td>\n@packageVersion.DownloadCount\n}\n</tbody>\n</table>\n- @if (rowCount > 5)\n+ @if (rowCount > Constants.VisibleVersions)\n{\n<a href=\"#\" role=\"button\" data-toggle=\"collapse\" class=\"icon-link\" data-target=\"#hidden-versions\"\n- aria-expanded=\"false\" aria-controls=\"hidden-versions\" id=\"show-hidden-versions\">\n- <i class=\"ms-Icon ms-Icon--CalculatorAddition\" aria-hidden=\"true\"></i>\n- <span>Show more</span>\n+ aria-expanded=\"@(versionsExpanded ? \"true\" : \"false\")\" aria-controls=\"hidden-versions\" id=\"show-hidden-versions\">\n+ <i class=\"ms-Icon ms-Icon--Calculator@(versionsExpanded ? \"Subtract\" : \"Addition\")\" aria-hidden=\"true\"></i>\n+ <span>@(versionsExpanded ? \"Show less\" : \"Show more\")</span>\n</a>\n}\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Automatically expand the version list if the selected version is in the collapsed section
455,736
31.07.2017 13:18:45
25,200
782391c04304f5e314671bd0084c7041a42beba0
[Redesign] Fix ctrl + click on data-track links
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/common.js", "new_path": "src/NuGetGallery/Scripts/gallery/common.js", "diff": "@@ -285,6 +285,9 @@ $(function () {\nvar href = $(this).attr('href');\nvar category = $(this).data().track;\nif (window.nuget.isGaAvailable() && href && category) {\n+ if (e.altKey || e.ctrlKey || e.metaKey) {\n+ ga('send', 'event', category, 'click', href);\n+ } else {\ne.preventDefault();\nga('send', 'event', category, 'click', href, {\n'transport': 'beacon',\n@@ -293,6 +296,7 @@ $(function () {\n})\n});\n}\n+ }\n});\n});\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Fix ctrl + click on data-track links
455,794
01.08.2017 09:04:56
25,200
3a1e4f41449044bee4b93e601ea7e234714fb1b6
Cookie service init fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Start/DefaultDependenciesModule.cs", "new_path": "src/NuGetGallery/App_Start/DefaultDependenciesModule.cs", "diff": "@@ -526,7 +526,12 @@ private static void RegisterCookieComplianceService(ContainerBuilder builder, Co\nservice = GetAddInServices<ICookieComplianceService>(builder).FirstOrDefault() as CookieComplianceServiceBase;\n}\n- builder.RegisterInstance(service ?? new NullCookieComplianceService())\n+ if (service == null)\n+ {\n+ service = new NullCookieComplianceService();\n+ }\n+\n+ builder.RegisterInstance(service)\n.AsSelf()\n.As<ICookieComplianceService>()\n.SingleInstance();\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Cookie service init fix (#4488)
455,776
02.08.2017 11:04:37
25,200
94769fd9f7da4132ab14012d7a97a209eb232ede
Add AntiForgery tokens to some actions that were missing them
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "new_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "diff": "@@ -311,3 +311,10 @@ var hlp = new AccordionHelper(name, formModelStatePrefix, expanded, page);\n}\n</li>\n}\n+\n+@helper AjaxAntiForgeryToken(System.Web.Mvc.HtmlHelper html)\n+{\n+ <form id=\"AntiForgeryForm\">\n+ @html.AntiForgeryToken()\n+ </form>\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Controllers/LuceneController.cs", "new_path": "src/NuGetGallery/Areas/Admin/Controllers/LuceneController.cs", "diff": "@@ -55,6 +55,7 @@ private async Task<LuceneInfoModel> GetLuceneInfo()\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic virtual Task<ActionResult> Rebuild()\n{\nIndexingService.UpdateIndex(forceRefresh: true);\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Controllers/SecurityPolicyController.cs", "new_path": "src/NuGetGallery/Areas/Admin/Controllers/SecurityPolicyController.cs", "diff": "@@ -71,6 +71,7 @@ public virtual JsonResult Search(string query)\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic async Task<JsonResult> Update(List<string> subscriptionsJson)\n{\nvar subscribeRequests = subscriptionsJson?.Select(JsonConvert.DeserializeObject<JObject>)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Controllers/SupportRequestController.cs", "new_path": "src/NuGetGallery/Areas/Admin/Controllers/SupportRequestController.cs", "diff": "@@ -54,6 +54,7 @@ public ActionResult GetAdmins()\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic async Task<ActionResult> DisableAdmin(int key)\n{\ntry\n@@ -69,6 +70,7 @@ public async Task<ActionResult> DisableAdmin(int key)\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic async Task<ActionResult> EnableAdmin(int key)\n{\ntry\n@@ -84,6 +86,7 @@ public async Task<ActionResult> EnableAdmin(int key)\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic async Task<ActionResult> AddAdmin(string galleryUsername, string pagerDutyUsername)\n{\ntry\n@@ -99,6 +102,7 @@ public async Task<ActionResult> AddAdmin(string galleryUsername, string pagerDut\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic async Task<ActionResult> UpdateAdmin(int key, string galleryUsername, string pagerDutyUsername)\n{\ntry\n@@ -114,6 +118,7 @@ public async Task<ActionResult> UpdateAdmin(int key, string galleryUsername, str\n}\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic async Task<ActionResult> Save(int issueKey, int? assignedToId, int issueStatusId, string comment)\n{\ntry\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Views/Lucene/Index.cshtml", "new_path": "src/NuGetGallery/Areas/Admin/Views/Lucene/Index.cshtml", "diff": "@@ -35,6 +35,7 @@ else\n{\nusing (Html.BeginForm(\"Rebuild\", \"Lucene\"))\n{\n+ @Html.AntiForgeryToken()\n<fieldset class=\"form\">\n<input type=\"submit\" value=\"Rebuild Now\" />\n<p>NOTE: This will only affect the current instance!</p>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml", "new_path": "src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml", "diff": "ViewBag.Title = \"Security Policies\";\n}\n+@ViewHelpers.AjaxAntiForgeryToken(Html)\n+\n<section>\n<article id=\"stage\">\ncache: false,\ndataType: 'json',\ntype: 'POST',\n- data: JSON.stringify(subscriptions),\n- contentType: 'application/json; charset=utf-8',\n+ data: addAjaxAntiForgeryToken({ subscriptionsJson: subscriptions }),\nsuccess: function (data) {\n$self.changeTracker(false);\n$self.message(\"Security policies updated!\");\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Views/SupportRequest/Admins.cshtml", "new_path": "src/NuGetGallery/Areas/Admin/Views/SupportRequest/Admins.cshtml", "diff": "@Styles.Render(\"~/Content/supportrequests\")\n}\n+@ViewHelpers.AjaxAntiForgeryToken(Html)\n+\n<section>\n<article id=\"supportrequests\">\n<div style=\"display: none;\" id=\"addAdmin-dialog\">\n<form id=\"addAdmin-form\">\n- @Html.AntiForgeryToken()\n<fieldset class=\"form\">\n<legend>Add</legend>\n<div style=\"display: none;\" id=\"editAdmin-dialog\">\n<form id=\"editAdmin-form\">\n- @Html.AntiForgeryToken()\n<fieldset class=\"form\">\n<legend>Edit</legend>\nthis.createAdmin = function (success, error) {\nvar url = '@Url.Action(\"AddAdmin\")';\n- var model = JSON.stringify({\n+ var model = {\ngalleryUsername: $self.newGalleryUsername(),\npagerDutyUsername: $self.newPagerDutyUsername()\n- });\n+ };\n$.ajax({\nurl: url,\ntype: 'POST',\ncache: false,\ndataType: 'json',\n- contentType: 'application/json; charset=utf-8',\n- data: model,\n+ data: addAjaxAntiForgeryToken(model),\nsuccess: success\n})\n.error(error);\nthis.updateAdmin = function (success, error) {\nvar url = '@Url.Action(\"UpdateAdmin\")';\n- var model = JSON.stringify({\n+ var model = {\nkey: $self.admin.Key,\ngalleryUsername: $self.editGalleryUsername,\npagerDutyUsername: $self.editPagerDutyUsername\n- });\n+ };\n$.ajax({\nurl: url,\ntype: 'POST',\ncache: false,\ndataType: 'json',\n- contentType: 'application/json; charset=utf-8',\n- data: model,\n+ data: addAjaxAntiForgeryToken(model),\nsuccess: success\n})\n.error(error);\nthis.toggleAdminAccess = function (data) {\nvar confirmationText, url;\n- var model = JSON.stringify({\n+ var model = {\nkey: data.Key\n- });\n+ };\nif (data.AccessDisabled !== false) {\nconfirmationText = 'Are you sure you want to enable access for ' + data.GalleryUsername + '?';\ntype: 'POST',\ncache: false,\ndataType: 'json',\n- contentType: 'application/json; charset=utf-8',\n- data: model,\n+ data: addAjaxAntiForgeryToken(model),\nsuccess: function () {\n$self.refresh();\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Views/SupportRequest/Index.cshtml", "new_path": "src/NuGetGallery/Areas/Admin/Views/SupportRequest/Index.cshtml", "diff": "@Styles.Render(\"~/Content/supportrequests\")\n}\n+@ViewHelpers.AjaxAntiForgeryToken(Html)\n+\n<section>\n<article id=\"supportrequests\">\n<div id=\"sr-nav-menu\">\n<div style=\"display: none;\" id=\"editSupportRequest-dialog\">\n<form id=\"editSupportRequest-form\">\n- @Html.AntiForgeryToken()\n<fieldset class=\"form\">\n<legend>Edit</legend>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/CuratedPackagesController.cs", "new_path": "src/NuGetGallery/Controllers/CuratedPackagesController.cs", "diff": "@@ -46,6 +46,7 @@ public virtual ActionResult GetCreateCuratedPackageForm(string curatedFeedName)\n[ActionName(\"CuratedPackage\")]\n[HttpDelete]\n+ [ValidateAntiForgeryToken]\npublic virtual async Task<ActionResult> DeleteCuratedPackage(\nstring curatedFeedName,\nstring curatedPackageId)\n@@ -76,6 +77,7 @@ public virtual ActionResult GetCreateCuratedPackageForm(string curatedFeedName)\n[ActionName(\"CuratedPackage\")]\n[AcceptVerbs(\"patch\")]\n+ [ValidateAntiForgeryToken]\npublic virtual async Task<ActionResult> PatchCuratedPackage(\nstring curatedFeedName,\nstring curatedPackageId,\n@@ -113,6 +115,7 @@ public virtual ActionResult GetCreateCuratedPackageForm(string curatedFeedName)\n[ActionName(\"CuratedPackages\")]\n[HttpPost]\n+ [ValidateAntiForgeryToken]\npublic virtual async Task<ActionResult> PostCuratedPackages(\nstring curatedFeedName,\nCreateCuratedPackageRequest request)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/UsersController.cs", "new_path": "src/NuGetGallery/Controllers/UsersController.cs", "diff": "@@ -364,6 +364,7 @@ public virtual ActionResult Profiles(string username, int page = 1, bool showAll\n[HttpPost]\n[Authorize]\n+ [ValidateAntiForgeryToken]\npublic virtual async Task<ActionResult> ChangeEmail(AccountViewModel model)\n{\nif (!ModelState.IsValidField(\"ChangeEmail.NewEmail\"))\n@@ -424,6 +425,7 @@ public virtual async Task<ActionResult> ChangeEmail(AccountViewModel model)\n[HttpPost]\n[Authorize]\n+ [ValidateAntiForgeryToken]\npublic virtual async Task<ActionResult> CancelChangeEmail(AccountViewModel model)\n{\nvar user = GetCurrentUser();\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/supportrequests.js", "new_path": "src/NuGetGallery/Scripts/supportrequests.js", "diff": "@@ -16,20 +16,19 @@ function EditViewModel(editUrl) {\nthis.issueStatusChoices = ko.observableArray();\nthis.updateSupportRequest = function (success, error) {\n- var model = JSON.stringify({\n+ var model = {\nissueKey: $self.issue.Key,\nassignedToId: $self.editAssignedToId,\nissueStatusId: $self.editIssueStatusId,\ncomment: $self.editIssueComment()\n- });\n+ };\n$.ajax({\nurl: editUrl,\ntype: 'POST',\ncache: false,\ndataType: 'json',\n- contentType: 'application/json; charset=utf-8',\n- data: model,\n+ data: addAjaxAntiForgeryToken(model),\nsuccess: success\n})\n.error(error);\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/CuratedFeeds/CuratedFeed.cshtml", "new_path": "src/NuGetGallery/Views/CuratedFeeds/CuratedFeed.cshtml", "diff": "@{\nViewBag.Title = \"Curated Feed: \" + Model.Name;\n}\n+\n+@ViewHelpers.AjaxAntiForgeryToken(Html)\n+\n@section BottomScripts {\n<script>\nvar urlFormat = \"@Url.RouteUrl(RouteName.CuratedPackage, new { curatedFeedName = Model.Name, curatedPackageId = \"PACKAGE_ID\" })\";\nfunction deleteCuratedPackage(packageId) {\n$.ajax({\ntype: 'delete',\n- url: urlFormat.replace(\"PACKAGE_ID\", packageId)\n+ url: urlFormat.replace(\"PACKAGE_ID\", packageId),\n+ dataType: 'json',\n+ data: addAjaxAntiForgeryToken({})\n})\n.error(function(jqXhr, textStatus, errorThrown) {\nalert(\"Error: \" + errorThrown);\n$.ajax({\ntype: 'patch',\nurl: urlFormat.replace(\"PACKAGE_ID\", packageId),\n- data: { included: included },\n+ data: addAjaxAntiForgeryToken({ included: included }),\ndataType: 'json'\n})\n.error(function(jqXhr, textStatus, errorThrown) {\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/ManagePackageOwners.cshtml", "new_path": "src/NuGetGallery/Views/Packages/ManagePackageOwners.cshtml", "diff": "ViewBag.Tab = \"Packages\";\n}\n-<form id=\"AntiForgeryForm\">\n- @Html.AntiForgeryToken()\n-</form>\n+@ViewHelpers.AjaxAntiForgeryToken(Html)\n<h1 class=\"page-heading\">Manage Owners for Package \"@Model.Title.Abbreviate(50)\"</h1>\nalert('An unexpected error occurred! \"' + errorThrown + '\"');\n};\n- var addAntiForgeryToken = function (data) {\n- var $field = $(\"#AntiForgeryForm input[name=__RequestVerificationToken]\");\n- data[\"__RequestVerificationToken\"] = $field.val();\n- return data;\n- }\n-\nvar viewModel = {\npackage: { id: '@Model.Id' },\nowners: ko.observableArray([]),\ndataType: 'json',\ntype: 'POST',\ndataType: 'json',\n- data: addAntiForgeryToken(ownerInputModel),\n+ data: addAjaxAntiForgeryToken(ownerInputModel),\nsuccess: function (data) {\nif (data.success) {\nvar newOwner = new Owner(data.name, /* pending */ true, data.current);\ndataType: 'json',\ntype: 'POST',\ndataType: 'json',\n- data: addAntiForgeryToken({}),\n+ data: addAjaxAntiForgeryToken({}),\nsuccess: function (data) {\nif (data.success) {\nif (item.current) {\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "new_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "diff": "<Compile Include=\"Controllers\\AppControllerFacts.cs\" />\n<Compile Include=\"Controllers\\AuthenticationControllerFacts.cs\" />\n<Compile Include=\"Controllers\\ApiControllerFacts.cs\" />\n+ <Compile Include=\"Controllers\\ControllerTests.cs\" />\n<Compile Include=\"Controllers\\CuratedFeedsControllerFacts.cs\" />\n<Compile Include=\"Controllers\\CuratedPackagesControllerFacts.cs\" />\n<Compile Include=\"Controllers\\JsonApiControllerFacts.cs\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add AntiForgery tokens to some actions that were missing them (#4490)
455,743
02.08.2017 14:25:36
25,200
ed3c98ef2f8f87c7adaf179a5b6dffe74836b709
Ensure SSL v3 is disabled and that TLS v1.2 is enabled
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Start/OwinStartup.cs", "new_path": "src/NuGetGallery/App_Start/OwinStartup.cs", "diff": "@@ -41,6 +41,10 @@ public static void Configuration(IAppBuilder app)\nServicePointManager.UseNagleAlgorithm = false;\nServicePointManager.Expect100Continue = false;\n+ // Ensure that SSLv3 is disabled and that Tls v1.2 is enabled.\n+ ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Ssl3;\n+ ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;\n+\n// Register IoC\napp.UseAutofacInjection(GlobalConfiguration.Configuration);\nvar dependencyResolver = DependencyResolver.Current;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Ensure SSL v3 is disabled and that TLS v1.2 is enabled
455,736
02.08.2017 16:28:52
25,200
5775494b21edcb9ecf3dfd671b63c1e77f07558c
[Redesign] Make the search results page even more slim Reduce white space Reduce ID font size Make tags on the same line at downloads, last updated, and latest version Fix
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -212,16 +212,20 @@ img.package-icon {\n}\n.package-list {\npadding-left: 0;\n- margin-top: 10px;\n+ margin-top: 8px;\n+ margin-bottom: 8px;\nmargin-left: -5px;\nline-height: 20px;\ncolor: #666;\n}\n+.package-list a {\n+ color: #666;\n+}\n.package-list li {\ndisplay: list-item;\nlist-style: none;\n}\n-@media (min-width: 480px) {\n+@media (min-width: 768px) {\n.package-list li {\ndisplay: inline-block;\n}\n@@ -311,17 +315,13 @@ img.package-icon {\nborder-bottom: 1px solid windowText;\n}\n}\n-.list-packages {\n- border-top: 1px solid #dbdbdb;\n-}\n.list-packages .package {\npadding-top: 15px;\npadding-bottom: 15px;\nfont-size: 15px;\n- border-bottom: 1px solid #dbdbdb;\n}\n.list-packages .package .package-header .package-title {\n- font-size: 34px;\n+ font-size: 24px;\nfont-weight: 300;\nline-height: .9;\nword-break: break-all;\n@@ -339,21 +339,28 @@ img.package-icon {\n}\n.list-packages .package .package-title {\nmargin-top: 2px;\n+ font-size: 16px;\n}\n.list-packages .package .manage-package {\n- margin-top: 10px;\n+ margin-top: 8px;\nmargin-bottom: 0;\n}\n.list-packages .package .package-details {\n- margin-top: 10px;\n+ margin-top: 8px;\nline-height: 20px;\ncolor: #000;\nword-break: break-all;\nword-break: break-word;\n}\n-.list-packages .package .package-tags {\n- margin-top: 10px;\n- margin-left: -2px;\n+@media (min-width: 768px) {\n+ .list-packages .package .package-list {\n+ overflow: hidden;\n+ text-overflow: ellipsis;\n+ white-space: nowrap;\n+ }\n+ .list-packages .package .package-list li {\n+ display: inline;\n+ }\n}\n.pager {\nfloat: right;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/base.less", "new_path": "src/Bootstrap/less/theme/base.less", "diff": "@@ -272,18 +272,23 @@ img.package-icon {\n}\n.package-list {\n- margin-top: @padding-large-vertical;\n+ margin-top: 8px;\n+ margin-bottom: 8px;\nmargin-left: -5px;\npadding-left: 0;\nline-height: 20px;\ncolor: @gray-light;\n+ a {\n+ color: @gray-light;\n+ }\n+\nli {\nlist-style: none;\ndisplay: list-item;\n}\n- @media (min-width: @screen-xs-min) {\n+ @media (min-width: @screen-sm-min) {\nli {\ndisplay: inline-block;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/common-list-packages.less", "new_path": "src/Bootstrap/less/theme/common-list-packages.less", "diff": ".list-packages {\n- border-top: 1px solid @gray-lighter;\n.package {\npadding-top: (@padding-large-vertical * 1.5);\npadding-bottom: (@padding-large-vertical * 1.5);\n- border-bottom: 1px solid @gray-lighter;\nfont-size: 15px;\n.package-header {\n.package-title {\n- font-size: @font-size-h2;\n+ font-size: 24px;\nfont-weight: 300;\nline-height: 0.9;\nword-break: break-all;\n}\n.package-title {\n+ font-size: 16px;\nmargin-top: 2px;\n}\n.manage-package {\n- margin-top: @padding-large-vertical;\n+ margin-top: 8px;\nmargin-bottom: 0;\n}\n.package-details {\n- margin-top: @padding-large-vertical;\n+ margin-top: 8px;\ncolor: @text-color;\nline-height: 20px;\nword-break: break-all;\nword-break: break-word;\n}\n- .package-tags {\n- margin-top: @padding-large-vertical;\n- margin-left: -2px;\n+\n+ .package-list {\n+ @media (min-width: @screen-sm-min) {\n+ white-space: nowrap;\n+ overflow: hidden;\n+ text-overflow: ellipsis;\n+\n+ li {\n+ display: inline;\n+ }\n+ }\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -212,16 +212,20 @@ img.package-icon {\n}\n.package-list {\npadding-left: 0;\n- margin-top: 10px;\n+ margin-top: 8px;\n+ margin-bottom: 8px;\nmargin-left: -5px;\nline-height: 20px;\ncolor: #666;\n}\n+.package-list a {\n+ color: #666;\n+}\n.package-list li {\ndisplay: list-item;\nlist-style: none;\n}\n-@media (min-width: 480px) {\n+@media (min-width: 768px) {\n.package-list li {\ndisplay: inline-block;\n}\n@@ -311,17 +315,13 @@ img.package-icon {\nborder-bottom: 1px solid windowText;\n}\n}\n-.list-packages {\n- border-top: 1px solid #dbdbdb;\n-}\n.list-packages .package {\npadding-top: 15px;\npadding-bottom: 15px;\nfont-size: 15px;\n- border-bottom: 1px solid #dbdbdb;\n}\n.list-packages .package .package-header .package-title {\n- font-size: 34px;\n+ font-size: 24px;\nfont-weight: 300;\nline-height: .9;\nword-break: break-all;\n@@ -339,21 +339,28 @@ img.package-icon {\n}\n.list-packages .package .package-title {\nmargin-top: 2px;\n+ font-size: 16px;\n}\n.list-packages .package .manage-package {\n- margin-top: 10px;\n+ margin-top: 8px;\nmargin-bottom: 0;\n}\n.list-packages .package .package-details {\n- margin-top: 10px;\n+ margin-top: 8px;\nline-height: 20px;\ncolor: #000;\nword-break: break-all;\nword-break: break-word;\n}\n-.list-packages .package .package-tags {\n- margin-top: 10px;\n- margin-left: -2px;\n+@media (min-width: 768px) {\n+ .list-packages .package .package-list {\n+ overflow: hidden;\n+ text-overflow: ellipsis;\n+ white-space: nowrap;\n+ }\n+ .list-packages .package .package-list li {\n+ display: inline;\n+ }\n}\n.pager {\nfloat: right;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/_ListPackage.cshtml", "new_path": "src/NuGetGallery/Views/Shared/_ListPackage.cshtml", "diff": "@if (!StringComparer.OrdinalIgnoreCase.Equals(Model.Id, Model.Title))\n{\n- <div class=\"package-title ms-fontSize-l\">\n+ <div class=\"package-title\">\n@Html.BreakWord(Model.Title)\n</div>\n}\n- <ul class=\"package-list ms-fontWeight-semibold\">\n+ <ul class=\"package-list\">\n<li>\n- <span>\n+ <span class=\"icon-link\">\n<i class=\"ms-Icon ms-Icon--Download\" aria-hidden=\"true\"></i>\n@Model.TotalDownloadCount.ToNuGetNumberString() total @(Model.TotalDownloadCount == 1 ? \"download\" : \"downloads\")\n</span>\n</li>\n<li>\n- <span>\n+ <span class=\"icon-link\">\n<i class=\"ms-Icon ms-Icon--History\" aria-hidden=\"true\"></i>\nlast updated <span data-datetime=\"@Model.LastUpdated.ToString(\"O\")\">@Model.LastUpdated.ToNuGetShortDateString()</span>\n</span>\n</li>\n<li>\n- <span>\n+ <span class=\"icon-link\">\n<i class=\"ms-Icon ms-Icon--Flag\" aria-hidden=\"true\"></i>\nLatest version: <span class=\"text-nowrap\">@Model.FullVersion @(Model.Prerelease ? \"(prerelease)\" : \"\")</span>\n</span>\n</li>\n+ @if (Model.Tags.AnySafe())\n+ {\n+ <li class=\"package-tags\">\n+ <span class=\"icon-link\">\n+ <i class=\"ms-Icon ms-Icon--Tag\" aria-hidden=\"true\"></i>\n+ @foreach (var tag in Model.Tags)\n+ {\n+ <a href=\"@Url.Search(\"Tags:\\\"\" + tag + \"\\\"\")\" title=\"Search for @tag\">@tag</a>\n+ }\n+ </span>\n+ </li>\n+ }\n</ul>\n<div class=\"package-details\">\n}\n</div>\n- @if (@Model.Tags.AnySafe())\n- {\n- <div class=\"package-tags\">\n- @foreach (var tag in Model.Tags)\n- {\n- <a href=\"@Url.Search(\"Tags:\\\"\" + tag + \"\\\"\")\" title=\"Search for @tag\" class=\"tag\">@tag</a>\n- }\n- </div>\n- }\n-\n@if (Model.IsOwner(User))\n{\n<ul class=\"package-list manage-package\">\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Make the search results page even more slim Reduce white space Reduce ID font size Make tags on the same line at downloads, last updated, and latest version Fix https://github.com/NuGet/NuGetGallery/issues/4491
455,736
03.08.2017 09:17:38
25,200
38bdccb22c32f170705fc86da3881e80fcf1595e
[Redesign] Add pre-release checkbox to the search page Fix
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -773,6 +773,26 @@ img.package-icon {\n.page-list-packages h1 {\nmargin-bottom: 33px;\n}\n+.page-list-packages .row-heading .cell-heading h1 {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n+@media (min-width: 992px) {\n+ .page-list-packages .row-heading {\n+ display: table;\n+ width: 100%;\n+ }\n+ .page-list-packages .row-heading .cell-heading {\n+ display: table-cell;\n+ text-align: left;\n+ }\n+ .page-list-packages .row-heading .cell-controls {\n+ display: table-cell;\n+ margin-top: 42px;\n+ text-align: right;\n+ white-space: nowrap;\n+ }\n+}\n.page-manage-curated-feed .package-owners .owner {\nmargin-bottom: 10px;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-list-packages.less", "new_path": "src/Bootstrap/less/theme/page-list-packages.less", "diff": "h1 {\nmargin-bottom: 33px;\n}\n+\n+ .row-heading {\n+ .cell-heading {\n+ h1 {\n+ word-break: break-all;\n+ word-break: break-word;\n+ }\n+ }\n+\n+ @media (min-width: @screen-md-min) {\n+ display: table;\n+ width: 100%;\n+\n+ .cell-heading {\n+ text-align: left;\n+ display: table-cell;\n+ }\n+\n+ .cell-controls {\n+ margin-top: 42px;\n+ display: table-cell;\n+ text-align: right;\n+ white-space: nowrap;\n+ }\n+ }\n+ }\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -773,6 +773,26 @@ img.package-icon {\n.page-list-packages h1 {\nmargin-bottom: 33px;\n}\n+.page-list-packages .row-heading .cell-heading h1 {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n+@media (min-width: 992px) {\n+ .page-list-packages .row-heading {\n+ display: table;\n+ width: 100%;\n+ }\n+ .page-list-packages .row-heading .cell-heading {\n+ display: table-cell;\n+ text-align: left;\n+ }\n+ .page-list-packages .row-heading .cell-controls {\n+ display: table-cell;\n+ margin-top: 42px;\n+ text-align: right;\n+ white-space: nowrap;\n+ }\n+}\n.page-manage-curated-feed .package-owners .owner {\nmargin-bottom: 10px;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/CuratedFeedsController.cs", "new_path": "src/NuGetGallery/Controllers/CuratedFeedsController.cs", "diff": "@@ -67,6 +67,7 @@ public virtual async Task<ActionResult> ListPackages(string curatedFeedName, str\nvar searchFilter = SearchAdaptor.GetSearchFilter(\nq,\npage,\n+ includePrerelease: true,\nsortOrder: null,\ncontext: SearchFilter.UISearchContext,\nsemVerLevel: SemVerLevelKey.SemVerLevel2);\n@@ -93,7 +94,8 @@ public virtual async Task<ActionResult> ListPackages(string curatedFeedName, str\npage - 1,\nConstants.DefaultPackageListPageSize,\nUrl,\n- curatedFeedName);\n+ curatedFeedName,\n+ includePrerelease: true);\nViewBag.SearchTerm = q;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/PackagesController.cs", "new_path": "src/NuGetGallery/Controllers/PackagesController.cs", "diff": "@@ -453,11 +453,11 @@ public virtual async Task<ActionResult> DisplayPackage(string id, string version\nvar searchFilter = SearchAdaptor.GetSearchFilter(\nq: \"id:\\\"\" + normalizedRegistrationId + \"\\\" AND version:\\\"\" + package.Version + \"\\\"\",\npage: 1,\n+ includePrerelease: true,\nsortOrder: null,\ncontext: SearchFilter.ODataSearchContext,\nsemVerLevel: SemVerLevelKey.SemVerLevel2);\n- searchFilter.IncludePrerelease = true;\nsearchFilter.IncludeAllVersions = true;\nvar results = await externalSearchService.RawSearch(searchFilter);\n@@ -507,6 +507,7 @@ public virtual async Task<ActionResult> ListPackages(PackageListSearchViewModel\n{\nvar page = searchAndListModel.Page;\nvar q = searchAndListModel.Q;\n+ var includePrerelease = searchAndListModel.Prerel ?? true;\nif (page < 1)\n{\n@@ -528,7 +529,7 @@ public virtual async Task<ActionResult> ListPackages(PackageListSearchViewModel\nSearchResults results;\n// fetch most common query from cache to relieve load on the search service\n- if (string.IsNullOrEmpty(q) && page == 1)\n+ if (string.IsNullOrEmpty(q) && page == 1 && includePrerelease)\n{\nvar cachedResults = HttpContext.Cache.Get(\"DefaultSearchResults\");\nif (cachedResults == null)\n@@ -536,6 +537,7 @@ public virtual async Task<ActionResult> ListPackages(PackageListSearchViewModel\nvar searchFilter = SearchAdaptor.GetSearchFilter(\nq,\npage,\n+ includePrerelease: includePrerelease,\nsortOrder: null,\ncontext: SearchFilter.UISearchContext,\nsemVerLevel: SemVerLevelKey.SemVerLevel2);\n@@ -562,6 +564,7 @@ public virtual async Task<ActionResult> ListPackages(PackageListSearchViewModel\nvar searchFilter = SearchAdaptor.GetSearchFilter(\nq,\npage,\n+ includePrerelease: includePrerelease,\nsortOrder: null,\ncontext: SearchFilter.UISearchContext,\nsemVerLevel: SemVerLevelKey.SemVerLevel2);\n@@ -583,7 +586,8 @@ public virtual async Task<ActionResult> ListPackages(PackageListSearchViewModel\ntotalHits,\npage - 1,\nConstants.DefaultPackageListPageSize,\n- Url);\n+ Url,\n+ includePrerelease);\nViewBag.SearchTerm = q;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/OData/SearchService/SearchAdaptor.cs", "new_path": "src/NuGetGallery/OData/SearchService/SearchAdaptor.cs", "diff": "@@ -25,14 +25,14 @@ public static class SearchAdaptor\n/// </summary>\ninternal const int MaxPageSize = 100;\n- public static SearchFilter GetSearchFilter(string q, int page, string sortOrder, string context, string semVerLevel)\n+ public static SearchFilter GetSearchFilter(string q, int page, bool includePrerelease, string sortOrder, string context, string semVerLevel)\n{\nvar searchFilter = new SearchFilter(context)\n{\nSearchTerm = q,\nSkip = (page - 1) * Constants.DefaultPackageListPageSize, // pages are 1-based.\nTake = Constants.DefaultPackageListPageSize,\n- IncludePrerelease = true,\n+ IncludePrerelease = includePrerelease,\nSemVerLevel = semVerLevel\n};\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/PackageListSearchViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/PackageListSearchViewModel.cs", "diff": "@@ -7,5 +7,6 @@ public class PackageListSearchViewModel\n[AllowHtml]\npublic string Q { get; set; }\npublic int Page { get; set; }\n+ public bool? Prerel { get; set; }\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/PackageListViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/PackageListViewModel.cs", "diff": "@@ -16,8 +16,11 @@ public class PackageListViewModel\nint totalCount,\nint pageIndex,\nint pageSize,\n- UrlHelper url)\n- : this(packages, indexTimestampUtc, searchTerm, totalCount, pageIndex, pageSize, url, curatedFeed: null) { }\n+ UrlHelper url,\n+ bool includePrerelease)\n+ : this(packages, indexTimestampUtc, searchTerm, totalCount, pageIndex, pageSize, url, curatedFeed: null, includePrerelease: includePrerelease)\n+ {\n+ }\npublic PackageListViewModel(\nIQueryable<Package> packages,\n@@ -27,7 +30,8 @@ public class PackageListViewModel\nint pageIndex,\nint pageSize,\nUrlHelper url,\n- string curatedFeed)\n+ string curatedFeed,\n+ bool includePrerelease)\n{\n// TODO: Implement actual sorting\nIEnumerable<ListPackageItemViewModel> items = packages.ToList().Select(pv => new ListPackageItemViewModel(pv));\n@@ -43,31 +47,34 @@ public class PackageListViewModel\nPageIndex,\npageCount,\npage => curatedFeed == null ?\n- url.PackageList(page, searchTerm) :\n+ url.PackageList(page, searchTerm, includePrerelease) :\nurl.CuratedPackageList(page, searchTerm, curatedFeed)\n);\nItems = pager.Items;\nFirstResultIndex = 1 + (PageIndex * PageSize);\nLastResultIndex = FirstResultIndex + Items.Count() - 1;\nPager = pager;\n+ IncludePrerelease = includePrerelease;\n}\n- public int FirstResultIndex { get; set; }\n+ public int FirstResultIndex { get; }\n+\n+ public IEnumerable<ListPackageItemViewModel> Items { get; }\n- public IEnumerable<ListPackageItemViewModel> Items { get; private set; }\n+ public int LastResultIndex { get; }\n- public int LastResultIndex { get; set; }\n+ public IPreviousNextPager Pager { get; }\n- public IPreviousNextPager Pager { get; private set; }\n+ public int TotalCount { get; }\n- public int TotalCount { get; private set; }\n+ public string SearchTerm { get; }\n- public string SearchTerm { get; private set; }\n+ public int PageIndex { get; }\n- public int PageIndex { get; private set; }\n+ public int PageSize { get; }\n- public int PageSize { get; private set; }\n+ public DateTime? IndexTimestampUtc { get; }\n- public DateTime? IndexTimestampUtc { get; private set; }\n+ public bool IncludePrerelease { get; }\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/ListPackages.cshtml", "new_path": "src/NuGetGallery/Views/Shared/ListPackages.cshtml", "diff": "}\n<section role=\"main\" class=\"container main-container page-list-packages\">\n- <div class=\"row\">\n- <div class=\"col-xs-12\">\n+ <div class=\"row-heading clearfix\">\n+ <div class=\"cell-heading\">\n<h1>\n@if (String.IsNullOrEmpty(Model.SearchTerm))\n{\n<text>@Model.TotalCount.ToNuGetNumberString() packages </text>\n}\n- <text>returned for @Model.SearchTerm</text>\n+ <text>returned for @Html.BreakWord(Model.SearchTerm)</text>\n}\n</h1>\n</div>\n+ <div class=\"cell-controls\">\n+ <form action=\"@Url.PackageList()\" method=\"get\">\n+ @Html.Hidden(\"q\", Model.SearchTerm, new { id = \"search-term\" })\n+ <label>\n+ <input type=\"checkbox\" id=\"include-prerelease\" @(Model.IncludePrerelease ? \"checked\" : string.Empty) />\n+ Include prerelease\n+ </label>\n+ </form>\n+ </div>\n</div>\n<div class=\"list-packages\" role=\"list\">\n</div>\n</div>\n</section>\n+\n+@section bottomScripts {\n+ <script type=\"text/javascript\">\n+ $(function () {\n+ $(\"#include-prerelease\").on('change', function () {\n+ var parameters = {};\n+ var q = $('#search-term').val();\n+ if (q) {\n+ parameters.q = q;\n+ }\n+ if (!$(\"#include-prerelease\").is(':checked')) {\n+ parameters.prerel = 'false'\n+ }\n+ var queryString = $.param(parameters);\n+ var url = [\n+ location.protocol,\n+ '//',\n+ location.host,\n+ location.pathname,\n+ queryString ? '?' : '',\n+ queryString\n+ ].join('');\n+ window.location.href = url;\n+ })\n+ });\n+ </script>\n+}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs", "diff": "@@ -824,6 +824,40 @@ public async Task TrimsSearchTerm()\nvar model = result.Model as PackageListViewModel;\nAssert.Equal(\"test\", model.SearchTerm);\n}\n+\n+ [Fact]\n+ public async Task DefaultsToFirstPageAndIncludingPrerelease()\n+ {\n+ var searchService = new Mock<ISearchService>();\n+ searchService.Setup(s => s.Search(It.IsAny<SearchFilter>())).Returns(\n+ Task.FromResult(new SearchResults(0, DateTime.UtcNow)));\n+ var controller = CreateController(searchService: searchService);\n+ controller.SetCurrentUser(TestUtility.FakeUser);\n+\n+ var result = (await controller.ListPackages(new PackageListSearchViewModel { Q = \"test\" })) as ViewResult;\n+\n+ var model = result.Model as PackageListViewModel;\n+ Assert.True(model.IncludePrerelease);\n+ Assert.Equal(0, model.PageIndex);\n+ }\n+\n+ [Theory]\n+ [InlineData(false)]\n+ [InlineData(true)]\n+ public async Task PassesPrerelParameterOnToSearchFilter(bool prerel)\n+ {\n+ var searchService = new Mock<ISearchService>();\n+ searchService.Setup(s => s.Search(It.IsAny<SearchFilter>())).Returns(\n+ Task.FromResult(new SearchResults(0, DateTime.UtcNow)));\n+ var controller = CreateController(searchService: searchService);\n+ controller.SetCurrentUser(TestUtility.FakeUser);\n+\n+ var result = (await controller.ListPackages(new PackageListSearchViewModel { Q = \"test\", Prerel = prerel })) as ViewResult;\n+\n+ var model = result.Model as PackageListViewModel;\n+ Assert.Equal(prerel, model.IncludePrerelease);\n+ searchService.Verify(x => x.Search(It.Is<SearchFilter>(f => f.IncludePrerelease == prerel)));\n+ }\n}\npublic class TheReportAbuseMethod\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Add pre-release checkbox to the search page Fix https://github.com/NuGet/NuGetGallery/issues/4493
455,736
04.08.2017 09:29:07
25,200
35e871dfdac70f06fa77c00dc18184132e2d8a0a
Pass "prerel" parameter to the curated package list
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/CuratedFeedsController.cs", "new_path": "src/NuGetGallery/Controllers/CuratedFeedsController.cs", "diff": "@@ -55,7 +55,7 @@ public virtual ActionResult CuratedFeed(string name)\n}\n[HttpGet]\n- public virtual async Task<ActionResult> ListPackages(string curatedFeedName, string q, int page = 1)\n+ public virtual async Task<ActionResult> ListPackages(string curatedFeedName, string q, int page = 1, bool prerel = true)\n{\nif (page < 1)\n{\n@@ -67,7 +67,7 @@ public virtual async Task<ActionResult> ListPackages(string curatedFeedName, str\nvar searchFilter = SearchAdaptor.GetSearchFilter(\nq,\npage,\n- includePrerelease: true,\n+ includePrerelease: prerel,\nsortOrder: null,\ncontext: SearchFilter.UISearchContext,\nsemVerLevel: SemVerLevelKey.SemVerLevel2);\n@@ -95,7 +95,7 @@ public virtual async Task<ActionResult> ListPackages(string curatedFeedName, str\nConstants.DefaultPackageListPageSize,\nUrl,\ncuratedFeedName,\n- includePrerelease: true);\n+ includePrerelease: prerel);\nViewBag.SearchTerm = q;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Pass "prerel" parameter to the curated package list
455,736
07.08.2017 10:31:38
25,200
75c022ef06e32a4cbd20c834cbb76e2007bd314d
DEV and INT, point to the new index.json locations Fix
[ { "change_type": "MODIFY", "old_path": "content/DEV/Home.html", "new_path": "content/DEV/Home.html", "diff": "to use one of the following repository URLs:\n<ul>\n- <li>NuGet feed v3 (VS 2015 and later / NuGet v3.x and above): <code>http://api.dev.nugettest.org/v3-index/index.json</code></li>\n+ <li>NuGet feed v3 (VS 2015 and later / NuGet v3.x and above): <code>https://apidev.nugettest.org/v3/index.json</code></li>\n<li>NuGet feed v2 (VS 2013 and earlier / NuGet 2.x): <code>https://dev.nugettest.org/api/v2</code></li>\n</ul>\n</p>\n" }, { "change_type": "MODIFY", "old_path": "content/INT/Home.html", "new_path": "content/INT/Home.html", "diff": "to use one of the following repository URLs:\n<ul>\n- <li>NuGet feed v3 (VS 2015 and later / NuGet v3.x and above): <code>http://api.int.nugettest.org/v3-index/index.json</code></li>\n+ <li>NuGet feed v3 (VS 2015 and later / NuGet v3.x and above): <code>https://apiint.nugettest.org/v3/index.json</code></li>\n<li>NuGet feed v2 (VS 2013 and earlier / NuGet 2.x): <code>https://int.nugettest.org/api/v2</code></li>\n</ul>\n</p>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
DEV and INT, point to the new index.json locations (#4511) Fix https://github.com/NuGet/NuGetGallery/issues/4508
455,736
07.08.2017 11:55:58
25,200
8c3cb749062917890a8c87dbc7d39a2c644cc9ac
Redirect to HTTPS when using packages.nuget.org Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Web.config", "new_path": "src/NuGetGallery/Web.config", "diff": "<conditions>\n<add input=\"{HTTP_HOST}\" pattern=\"^packages([0-9]?)\\.nuget.org$\" />\n</conditions>\n- <action type=\"Redirect\" url=\"http://packages.nuget.org/v1/FeedService.svc\" redirectType=\"Permanent\" />\n+ <action type=\"Redirect\" url=\"https://packages.nuget.org/v1/FeedService.svc\" redirectType=\"Permanent\" />\n</rule>\n<rule name=\"Legacy image icon URL\" stopProcessing=\"true\">\n<match url=\"^media/default/packages/([a-z0-9_][a-z0-9._-]*)/([0-9.]+)/[\\w._ -]+\\.([a-z]+)$\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Redirect to HTTPS when using packages.nuget.org (#4516) Fix https://github.com/NuGet/NuGetGallery/issues/4515
455,736
07.08.2017 13:54:24
25,200
576f817f657705110f6b421fec04a72464a7918a
[Redesign] Make links clickable in description and release notes. Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Helpers/HtmlExtensions.cs", "new_path": "src/NuGetGallery/Helpers/HtmlExtensions.cs", "diff": "using System.Diagnostics;\nusing System.Linq;\nusing System.Linq.Expressions;\n+using System.Text.RegularExpressions;\nusing System.Web;\nusing System.Web.Mvc;\nusing System.Web.Mvc.Html;\n@@ -52,10 +53,28 @@ public static IHtmlString BreakWord(this HtmlHelper self, string text)\npublic static IHtmlString PreFormattedText(this HtmlHelper self, string text)\n{\n- return self.Raw(HttpUtility\n- .HtmlEncode(text)\n- .Replace(\"\\n\", \"<br />\")\n- .Replace(\" \", \"&nbsp; \"));\n+ // Encode HTML entities. Important! Security!\n+ var encodedText = HttpUtility.HtmlEncode(text);\n+\n+ // Turn HTTP and HTTPS URLs into links.\n+ // Source: https://stackoverflow.com/a/4750468\n+ encodedText = RegexEx.TryReplaceWithTimeout(\n+ encodedText,\n+ @\"((http|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&amp;:/~\\+#]*[\\w\\-\\@?^=%&amp;/~\\+#])?)\",\n+ match => $\"<a href=\\\"{match.Value}\\\">{match.Value}</a>\",\n+ RegexOptions.IgnoreCase);\n+\n+ // Replace new lines with the <br /> tag.\n+ encodedText = encodedText.Replace(\"\\n\", \"<br />\");\n+\n+ // Replace more than one space in a row with a space then &nbsp;.\n+ encodedText = RegexEx.TryReplaceWithTimeout(\n+ encodedText,\n+ \" +\",\n+ match => \" \" + string.Join(string.Empty, Enumerable.Repeat(\"&nbsp;\", match.Value.Length - 1)),\n+ RegexOptions.None);\n+\n+ return self.Raw(encodedText);\n}\npublic static IHtmlString ValidationSummaryFor(this HtmlHelper html, string key)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Compile Include=\"Filters\\ApiScopeRequiredAttribute.cs\" />\n<Compile Include=\"GlobalSuppressions.cs\" />\n<Compile Include=\"Helpers\\GravatarHelper.cs\" />\n+ <Compile Include=\"Helpers\\RegexEx.cs\" />\n<Compile Include=\"Infrastructure\\HttpStatusCodeWithServerWarningResult.cs\" />\n<Compile Include=\"Migrations\\201704191802404_AddIndexPackageRegistrationKeySemVer.cs\" />\n<Compile Include=\"Migrations\\201704191802404_AddIndexPackageRegistrationKeySemVer.Designer.cs\">\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "new_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "diff": "<Compile Include=\"Controllers\\StatisticsControllerFacts.cs\" />\n<Compile Include=\"Controllers\\UsersControllerFacts.cs\" />\n<Compile Include=\"Framework\\TestGalleryConfigurationService.cs\" />\n+ <Compile Include=\"Helpers\\HtmlExtensionsFacts.cs\" />\n<Compile Include=\"Infrastructure\\UserAuditRecordFacts.cs\" />\n<Compile Include=\"OData\\Filter\\ODataFilterFacts.cs\" />\n<Compile Include=\"OData\\SearchService\\SearchHijackerFacts.cs\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Redesign] Make links clickable in description and release notes. (#4505) Fix https://github.com/NuGet/NuGetGallery/issues/4492
455,759
08.08.2017 18:53:27
-7,200
098e77736965d9309672cf8f52fde9fd3a485c35
Fix avg download count calculated incorrectly. It should consider the oldest package version instead of the lowest version.
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/DisplayPackageViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/DisplayPackageViewModel.cs", "diff": "@@ -33,7 +33,7 @@ public DisplayPackageViewModel(Package package, IOrderedEnumerable<Package> pack\n// calculate the number of days since the package registration was created\n// round to the nearest integer, with a min value of 1\n// divide the total download count by this number\n- TotalDaysSinceCreated = Convert.ToInt32(Math.Max(1, Math.Round((DateTime.UtcNow - packageHistory.Last().Created).TotalDays)));\n+ TotalDaysSinceCreated = Convert.ToInt32(Math.Max(1, Math.Round((DateTime.UtcNow - packageHistory.Min(p => p.Created)).TotalDays)));\nDownloadsPerDay = TotalDownloadCount / TotalDaysSinceCreated; // for the package\n}\nelse\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs", "new_path": "tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs", "diff": "@@ -46,6 +46,48 @@ public void TheCtorSortsPackageVersionsProperly()\nAssert.Equal(\"1.0.10\", packageVersions[0].Version);\n}\n+ [Fact]\n+ public void AvgDownloadsPerDayConsidersOldestPackageVersionInHistory()\n+ {\n+ // Arrange\n+ var utcNow = DateTime.UtcNow;\n+ const int daysSinceFirstPackageCreated = 10;\n+ const int totalDownloadCount = 250;\n+\n+ var packageRegistration = new PackageRegistration\n+ {\n+ Owners = Enumerable.Empty<User>().ToList(),\n+ DownloadCount = totalDownloadCount\n+ };\n+\n+ var package = new Package\n+ {\n+ // Simulating that lowest package version was pushed latest, on-purpose,\n+ // to assert we use the *oldest* package version in the calculation.\n+ Created = utcNow,\n+ Dependencies = Enumerable.Empty<PackageDependency>().ToList(),\n+ DownloadCount = 10,\n+ PackageRegistration = packageRegistration,\n+ Version = \"1.0.0\"\n+ };\n+\n+ package.PackageRegistration.Packages = new[]\n+ {\n+ package,\n+ new Package { Version = \"1.0.1\", PackageRegistration = packageRegistration, DownloadCount = 100, Created = utcNow.AddDays(-daysSinceFirstPackageCreated) },\n+ new Package { Version = \"2.0.1\", PackageRegistration = packageRegistration, DownloadCount = 140, Created = utcNow.AddDays(-3) }\n+ };\n+\n+ var packageHistory = packageRegistration.Packages.OrderByDescending(p => new NuGetVersion(p.Version));\n+\n+ // Act\n+ var viewModel = new DisplayPackageViewModel(package, packageHistory);\n+\n+ // Assert\n+ Assert.Equal(daysSinceFirstPackageCreated, viewModel.TotalDaysSinceCreated);\n+ Assert.Equal(totalDownloadCount / daysSinceFirstPackageCreated, viewModel.DownloadsPerDay);\n+ }\n+\n[Fact]\npublic void DownloadsPerDayLabelShowsLessThanOneWhenAverageBelowOne()\n{\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix #4513: avg download count calculated incorrectly. (#4520) It should consider the oldest package version instead of the lowest version.
455,736
09.08.2017 10:32:25
25,200
1d1f060b4273c570f48bddc5cce650dfd130595a
Use date format "d" for week start and ends on the stat pages Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/StatisticsPackagesViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/StatisticsPackagesViewModel.cs", "diff": "@@ -99,13 +99,13 @@ public string DisplayWeek(int year, int weekOfYear, WeekFormats format = WeekFor\ncase WeekFormats.YearWeekNumber:\nreturn string.Format(CultureInfo.CurrentCulture, \"{0} wk {1}\", year, weekOfYear);\ncase WeekFormats.StartOnly:\n- outputStringTemplate = \"{0:MM/dd/yy}\";\n+ outputStringTemplate = \"{0:d}\";\nbreak;\ncase WeekFormats.EndOnly:\n- outputStringTemplate = \"{1:MM/dd/yy}\";\n+ outputStringTemplate = \"{1:d}\";\nbreak;\ncase WeekFormats.FullDate:\n- outputStringTemplate = \"{0:MM/dd/yy} - {1:MM/dd/yy}\";\n+ outputStringTemplate = \"{0:d} - {1:d}\";\nbreak;\ndefault:\nbreak;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Use date format "d" for week start and ends on the stat pages (#4533) Fix https://github.com/NuGet/NuGetGallery/issues/4529
455,736
09.08.2017 11:04:01
25,200
f19fb3a8d0ce854c41c455561dd471243bbcad5b
Improve manage package page handling of long IDs Fix
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -368,11 +368,21 @@ img.package-icon {\nmargin-bottom: 0;\n}\n.user-package-list .manage-package-listing .package-icon {\n+ min-width: 20px;\nmax-height: 2em;\n}\n.user-package-list .manage-package-listing .align-middle {\nvertical-align: middle;\n}\n+.user-package-list .manage-package-listing .package-id {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n+@media (min-width: 768px) {\n+ .user-package-list .manage-package-listing .package-controls {\n+ white-space: nowrap;\n+ }\n+}\n.user-package-list .table {\nborder-bottom: 1px solid #ddd;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/common-user-package-list.less", "new_path": "src/Bootstrap/less/theme/common-user-package-list.less", "diff": ".manage-package-listing {\n.package-icon {\nmax-height: 2em;\n+ min-width: 20px;\n}\n.align-middle {\nvertical-align: middle;\n}\n+\n+ .package-id {\n+ word-break: break-all;\n+ word-break: break-word;\n+ }\n+\n+ .package-controls {\n+ @media (min-width: @screen-sm-min) {\n+ white-space: nowrap;\n+ }\n+ }\n}\n.table {\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -368,11 +368,21 @@ img.package-icon {\nmargin-bottom: 0;\n}\n.user-package-list .manage-package-listing .package-icon {\n+ min-width: 20px;\nmax-height: 2em;\n}\n.user-package-list .manage-package-listing .align-middle {\nvertical-align: middle;\n}\n+.user-package-list .manage-package-listing .package-id {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n+@media (min-width: 768px) {\n+ .user-package-list .manage-package-listing .package-controls {\n+ white-space: nowrap;\n+ }\n+}\n.user-package-list .table {\nborder-bottom: 1px solid #ddd;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "new_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "diff": "<table class=\"table\">\n<thead>\n<tr class=\"manage-package-headings\">\n- <th class=\"col-sm-1\"></th>\n- <th class=\"col-sm-3\">Package ID</th>\n- <th class=\"col-sm-2\">Owners</th>\n- <th class=\"col-sm-2\">Downloads</th>\n- <th class=\"col-sm-2\">Latest Version</th>\n- <th class=\"col-sm-2\"></th>\n+ <th class=\"hidden-xs\"></th>\n+ <th>Package ID</th>\n+ <th>Owners</th>\n+ <th>Downloads</th>\n+ <th>Latest Version</th>\n+ <th></th>\n</tr>\n</thead>\n<tbody>\n@foreach (var package in @Model.Packages)\n{\n- //@Html.Partial(\"_ListPackage\", package)\n<tr class=\"manage-package-listing\">\n- <td class=\"col-sm-1 align-middle\">\n+ <td class=\"align-middle hidden-xs\">\n<img class=\"package-icon img-responsive\" aria-hidden=\"true\" alt=\"\"\nsrc=\"@(PackageHelper.ShouldRenderUrl(package.IconUrl) ? package.IconUrl : Url.Absolute(\"~/Content/gallery/img/default-package-icon.svg\"))\"\n@ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/default-package-icon-256x256.png\")) />\n</td>\n- <td class=\"col-sm-3 align-middle\"><a href=\"@Url.Package(package.Id)\">@package.Id</a></td>\n- <td class=\"col-sm-2 align-middle\">\n+ <td class=\"align-middle package-id\"><a href=\"@Url.Package(package.Id)\">@Html.BreakWord(package.Id)</a></td>\n+ <td class=\"align-middle\">\n@foreach (var owner in package.Owners)\n{\n<a href=\"@Url.User(owner.Username)\">@owner.Username</a>\n}\n</td>\n- <td class=\"col-sm-2 align-middle\">@package.TotalDownloadCount.ToNuGetNumberString()</td>\n- <td class=\"col-sm-2 align-middle\">@package.Version</td>\n- <td class=\"col-sm-2 text-right align-middle\">\n- <div class=\"btn-group\">\n+ <td class=\"align-middle text-nowrap\">@package.TotalDownloadCount.ToNuGetNumberString()</td>\n+ <td class=\"align-middle text-nowrap\">@package.Version</td>\n+ <td class=\"text-right align-middle package-controls\">\n<a href=\"@Url.EditPackage(package.Id, package.Version)\" class=\"btn\" title=\"Edit Package\" aria-label=\"Edit Package @package.Id Version @package.Version\">\n<i class=\"ms-Icon ms-Icon--Edit\" aria-hidden=\"true\"></i>\n</a>\n<a href=\"@Url.DeletePackage(package)\" class=\"btn\" title=\"Delete Package\" aria-lable=\"Delete Package @package.Id Version @package.Version\">\n<i class=\"ms-Icon ms-Icon--Delete\" aria-hidden=\"true\"></i>\n</a>\n- </div>\n</td>\n</tr>\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Improve manage package page handling of long IDs (#4532) Fix https://github.com/NuGet/NuGetGallery/issues/4527
455,736
09.08.2017 17:31:34
25,200
9a1f45fb8812105d7004ea2ba72a3a935d420bc0
Don't use moment.js date formatting since it is not culture aware Improve
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/common.js", "new_path": "src/NuGetGallery/Scripts/gallery/common.js", "diff": "if (duration.as('M') <= 10) {\ntext = datetime.fromNow();\n} else {\n- text = datetime.format(\"l\");\n+ text = null;\n}\nreturn {\n@@ -272,7 +272,9 @@ $(function () {\n$el.attr('title', formats.title);\n}\n+ if (formats.text) {\n$el.text(formats.text);\n+ }\n});\n// Handle confirm pop-ups.\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Don't use moment.js date formatting since it is not culture aware (#4544) Improve https://github.com/NuGet/NuGetGallery/issues/4529
455,736
10.08.2017 10:43:24
25,200
0fddd3696887aa4c5e33d7b99be7441f3812503e
Fix two accessibility issues and fix hover underline on alerts Enable "enter" key press on Upload button Make selected package command tab apparent on high-contrast Firefox Add `icon-text` class for text with an icon that is NOT a link (`icon-link` has other undesired rules) Fix accessibility issue 470376 Fix accessibility issue 476608
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -90,7 +90,8 @@ body h3 {\n.btn-search {\nheight: 36px;\n}\n-.icon-link .ms-Icon {\n+.icon-link .ms-Icon,\n+.icon-text .ms-Icon {\nposition: relative;\ntop: 2px;\n}\n@@ -624,16 +625,12 @@ img.package-icon {\nborder: 0;\n}\n.page-package-details .install-tabs .nav-tabs > li.active > a {\n+ font-weight: 600;\ncolor: #fff;\n+ text-decoration: underline;\nbackground-color: #002440;\nborder: 0;\n}\n-@media screen and (-ms-high-contrast: active) {\n- .page-package-details .install-tabs .nav-tabs > li.active > a {\n- font-weight: 600;\n- text-decoration: underline;\n- }\n-}\n.page-package-details .install-tabs .tab-pane > div {\ndisplay: table;\nheight: 1px;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/base.less", "new_path": "src/Bootstrap/less/theme/base.less", "diff": "@@ -114,7 +114,7 @@ body {\nheight: 36px;\n}\n-.icon-link {\n+.icon-link, .icon-text {\n.ms-Icon {\nposition: relative;\ntop: 2px;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-display-package.less", "new_path": "src/Bootstrap/less/theme/page-display-package.less", "diff": "background-color: @panel-footer-bg;\nborder: 0;\ncolor: #fff;\n-\n- @media screen and (-ms-high-contrast: active){\n- & {\nfont-weight: 600;\ntext-decoration: underline;\n}\n- }\n- }\n.tab-pane {\n> div {\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "new_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "diff": "@helper Alert(Func<MvcHtmlString, HelperResult> htmlContent, string subclass, string icon, bool isAlertRole = false)\n{\n- <div class=\"icon-link alert alert-@subclass\" @if (isAlertRole) { <text> role=\"alert\" aria-live=\"assertive\" </text> }>\n+ <div class=\"icon-text alert alert-@subclass\" @if (isAlertRole) { <text> role=\"alert\" aria-live=\"assertive\" </text> }>\n<i class=\"ms-Icon ms-Icon--@icon\" aria-hidden=\"true\"></i>\n@htmlContent(MvcHtmlString.Empty)\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -90,7 +90,8 @@ body h3 {\n.btn-search {\nheight: 36px;\n}\n-.icon-link .ms-Icon {\n+.icon-link .ms-Icon,\n+.icon-text .ms-Icon {\nposition: relative;\ntop: 2px;\n}\n@@ -624,16 +625,12 @@ img.package-icon {\nborder: 0;\n}\n.page-package-details .install-tabs .nav-tabs > li.active > a {\n+ font-weight: 600;\ncolor: #fff;\n+ text-decoration: underline;\nbackground-color: #002440;\nborder: 0;\n}\n-@media screen and (-ms-high-contrast: active) {\n- .page-package-details .install-tabs .nav-tabs > li.active > a {\n- font-weight: 600;\n- text-decoration: underline;\n- }\n-}\n.page-package-details .install-tabs .tab-pane > div {\ndisplay: table;\nheight: 1px;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/UploadPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/UploadPackage.cshtml", "diff": "window.nuget.configureExpanderHeading(\"upload-package-form\");\n$(function () {\n$(\"#browse-for-package-button\").on(\"keypress\", function (e) {\n- var keyCode = (e.keyCode || e.which);\n+ var code = (e.keyCode || e.which);\nvar isInteract = (code == 13 /*enter*/ || code == 32 /*space*/) && !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey;\nif (isInteract) {\n$(this).click();\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/_ListPackage.cshtml", "new_path": "src/NuGetGallery/Views/Shared/_ListPackage.cshtml", "diff": "<ul class=\"package-list\">\n<li>\n- <span class=\"icon-link\">\n+ <span class=\"icon-text\">\n<i class=\"ms-Icon ms-Icon--Download\" aria-hidden=\"true\"></i>\n@Model.TotalDownloadCount.ToNuGetNumberString() total @(Model.TotalDownloadCount == 1 ? \"download\" : \"downloads\")\n</span>\n</li>\n<li>\n- <span class=\"icon-link\">\n+ <span class=\"icon-text\">\n<i class=\"ms-Icon ms-Icon--History\" aria-hidden=\"true\"></i>\nlast updated <span data-datetime=\"@Model.LastUpdated.ToString(\"O\")\">@Model.LastUpdated.ToNuGetShortDateString()</span>\n</span>\n</li>\n<li>\n- <span class=\"icon-link\">\n+ <span class=\"icon-text\">\n<i class=\"ms-Icon ms-Icon--Flag\" aria-hidden=\"true\"></i>\nLatest version: <span class=\"text-nowrap\">@Model.FullVersion @(Model.Prerelease ? \"(prerelease)\" : \"\")</span>\n</span>\n@if (Model.Tags.AnySafe())\n{\n<li class=\"package-tags\">\n- <span class=\"icon-link\">\n+ <span class=\"icon-text\">\n<i class=\"ms-Icon ms-Icon--Tag\" aria-hidden=\"true\"></i>\n@foreach (var tag in Model.Tags)\n{\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix two accessibility issues and fix hover underline on alerts (#4547) Enable "enter" key press on Upload button Make selected package command tab apparent on high-contrast Firefox Add `icon-text` class for text with an icon that is NOT a link (`icon-link` has other undesired rules) Fix accessibility issue 470376 Fix accessibility issue 476608
455,736
14.08.2017 12:09:35
25,200
d4169b000c12890273b799f88f29ebb206dd9421
Introduce a type to represent the different password reset results (instead of null and exceptions) Supercedes Fixes
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Authentication/AuthenticationService.cs", "new_path": "src/NuGetGallery/Authentication/AuthenticationService.cs", "diff": "@@ -354,7 +354,7 @@ public virtual async Task<Credential> ResetPasswordWithToken(string username, st\nreturn null;\n}\n- public virtual async Task<User> GeneratePasswordResetToken(string usernameOrEmail, int expirationInMinutes)\n+ public virtual async Task<PasswordResetResult> GeneratePasswordResetToken(string usernameOrEmail, int expirationInMinutes)\n{\nif (String.IsNullOrEmpty(usernameOrEmail))\n{\n@@ -368,13 +368,13 @@ public virtual async Task<User> GeneratePasswordResetToken(string usernameOrEmai\nvar user = FindByUserNameOrEmail(usernameOrEmail);\nif (user == null)\n{\n- return null;\n+ return new PasswordResetResult(PasswordResetResultType.UserNotFound, user: null);\n}\n- await GeneratePasswordResetToken(user, expirationInMinutes);\n- return user;\n+ var resultType = await GeneratePasswordResetToken(user, expirationInMinutes);\n+ return new PasswordResetResult(resultType, user);\n}\n- public virtual async Task GeneratePasswordResetToken(User user, int expirationInMinutes)\n+ public virtual async Task<PasswordResetResultType> GeneratePasswordResetToken(User user, int expirationInMinutes)\n{\nif (user == null)\n{\n@@ -388,12 +388,12 @@ public virtual async Task GeneratePasswordResetToken(User user, int expirationIn\nif (!user.Confirmed)\n{\n- throw new UserSafeException(Strings.UserIsNotYetConfirmed);\n+ return PasswordResetResultType.UserNotConfirmed;\n}\nif (!string.IsNullOrEmpty(user.PasswordResetToken) && !user.PasswordResetTokenExpirationDate.IsInThePast())\n{\n- return;\n+ return PasswordResetResultType.Success;\n}\nuser.PasswordResetToken = CryptographyService.GenerateToken();\n@@ -416,6 +416,8 @@ public virtual async Task GeneratePasswordResetToken(User user, int expirationIn\nawait Auditing.SaveAuditRecordAsync(auditRecord);\nawait Entities.SaveChangesAsync();\n+\n+ return PasswordResetResultType.Success;\n}\npublic virtual async Task<bool> ChangePassword(User user, string oldPassword, string newPassword)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/UsersController.cs", "new_path": "src/NuGetGallery/Controllers/UsersController.cs", "diff": "@@ -182,21 +182,19 @@ public virtual async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel m\nif (ModelState.IsValid)\n{\n- try\n- {\n- var user = await _authService.GeneratePasswordResetToken(model.Email, Constants.PasswordResetTokenExpirationHours * 60);\n- if (user != null)\n- {\n- return SendPasswordResetEmail(user, forgotPassword: true);\n- }\n-\n- ModelState.AddModelError(\"Email\", Strings.CouldNotFindAnyoneWithThatEmail);\n- }\n- catch (Exception e)\n- {\n- e.Log();\n-\n- ModelState.AddModelError(\"Email\", e.GetUserSafeMessage());\n+ var result = await _authService.GeneratePasswordResetToken(model.Email, Constants.PasswordResetTokenExpirationHours * 60);\n+ switch (result.Type)\n+ {\n+ case PasswordResetResultType.UserNotConfirmed:\n+ ModelState.AddModelError(\"Email\", Strings.UserIsNotYetConfirmed);\n+ break;\n+ case PasswordResetResultType.UserNotFound:\n+ ModelState.AddModelError(\"Email\", Strings.CouldNotFindAnyoneWithThatUsernameOrEmail);\n+ break;\n+ case PasswordResetResultType.Success:\n+ return SendPasswordResetEmail(result.User, forgotPassword: true);\n+ default:\n+ throw new NotImplementedException($\"The passwword reset result type '{result.Type}' is not supported.\");\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Compile Include=\"Authentication\\NuGetPackagePattern.cs\" />\n<Compile Include=\"Authentication\\PasswordAuthenticationResult.cs\" />\n<Compile Include=\"Authentication\\NuGetScopes.cs\" />\n+ <Compile Include=\"Authentication\\PasswordResetResult.cs\" />\n<Compile Include=\"Authentication\\Providers\\AuthenticatorT.cs\" />\n<Compile Include=\"Authentication\\Providers\\AzureActiveDirectory\\AzureActiveDirectoryAuthenticator.cs\" />\n<Compile Include=\"Authentication\\Providers\\AzureActiveDirectory\\AzureActiveDirectoryAuthenticatorConfiguration.cs\" />\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Strings.Designer.cs", "new_path": "src/NuGetGallery/Strings.Designer.cs", "diff": "@@ -352,11 +352,11 @@ public class Strings {\n}\n/// <summary>\n- /// Looks up a localized string similar to Could not find anyone with that email..\n+ /// Looks up a localized string similar to Could not find anyone with that username or email..\n/// </summary>\n- public static string CouldNotFindAnyoneWithThatEmail {\n+ public static string CouldNotFindAnyoneWithThatUsernameOrEmail {\nget {\n- return ResourceManager.GetString(\"CouldNotFindAnyoneWithThatEmail\", resourceCulture);\n+ return ResourceManager.GetString(\"CouldNotFindAnyoneWithThatUsernameOrEmail\", resourceCulture);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Strings.resx", "new_path": "src/NuGetGallery/Strings.resx", "diff": "@@ -329,8 +329,8 @@ The {1} Team</value>\n<data name=\"UserKeyIsRequired\" xml:space=\"preserve\">\n<value>A user key is required.</value>\n</data>\n- <data name=\"CouldNotFindAnyoneWithThatEmail\" xml:space=\"preserve\">\n- <value>Could not find anyone with that email.</value>\n+ <data name=\"CouldNotFindAnyoneWithThatUsernameOrEmail\" xml:space=\"preserve\">\n+ <value>Could not find anyone with that username or email.</value>\n</data>\n<data name=\"InvalidOrExpiredPasswordResetToken\" xml:space=\"preserve\">\n<value>The Password Reset Token is not valid or expired.</value>\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Authentication/AuthenticationServiceFacts.cs", "new_path": "tests/NuGetGallery.Facts/Authentication/AuthenticationServiceFacts.cs", "diff": "@@ -957,28 +957,35 @@ public async Task WritesAuditRecordWhenReplacingPasswordCredential()\npublic class TheGeneratePasswordResetTokenMethod : TestContainer\n{\n[Fact]\n- public async Task ReturnsNullIfEmailIsNotFound()\n+ public async Task ReturnsUserNotFoundTypeIfUserDoesNotExist()\n{\n// Arrange\nvar authService = Get<AuthenticationService>();\n// Act\n- var token = await authService.GeneratePasswordResetToken(\"nobody@nowhere.com\", 1440);\n+ var result = await authService.GeneratePasswordResetToken(\"nobody@nowhere.com\", 1440);\n// Assert\n- Assert.Null(token);\n+ Assert.NotNull(result);\n+ Assert.Equal(PasswordResetResultType.UserNotFound, result.Type);\n+ Assert.Null(result.User);\n}\n[Fact]\n- public async Task ThrowsExceptionIfUserIsNotConfirmed()\n+ public async Task ReturnsUserNotConfirmedTypeIfUserIsNotConfirmed()\n{\n// Arrange\nvar user = new User(\"user\") { UnconfirmedEmailAddress = \"unique@example.com\" };\nvar authService = Get<AuthenticationService>();\nauthService.Entities.Users.Add(user);\n- // Act/Assert\n- await AssertEx.Throws<UserSafeException>(() => authService.GeneratePasswordResetToken(user.Username, 1440));\n+ // Act\n+ var result = await authService.GeneratePasswordResetToken(user.Username, 1440);\n+\n+ // Assert\n+ Assert.NotNull(result);\n+ Assert.Equal(PasswordResetResultType.UserNotConfirmed, result.Type);\n+ Assert.Same(user, result.User);\n}\n[Fact]\n@@ -996,10 +1003,12 @@ public async Task SetsPasswordResetTokenUsingEmail()\nvar currentDate = DateTime.UtcNow;\n// Act\n- var returnedUser = await authService.GeneratePasswordResetToken(user.EmailAddress, 1440);\n+ var result = await authService.GeneratePasswordResetToken(user.EmailAddress, 1440);\n// Assert\n- Assert.Same(user, returnedUser);\n+ Assert.NotNull(result);\n+ Assert.Equal(PasswordResetResultType.Success, result.Type);\n+ Assert.Same(user, result.User);\nAssert.NotNull(user.PasswordResetToken);\nAssert.NotEmpty(user.PasswordResetToken);\nAssert.True(user.PasswordResetTokenExpirationDate >= currentDate.AddMinutes(1440));\n@@ -1020,10 +1029,12 @@ public async Task WithExistingNotYetExpiredTokenReturnsExistingToken()\nauthService.Entities.Users.Add(user);\n// Act\n- var returnedUser = await authService.GeneratePasswordResetToken(user.EmailAddress, 1440);\n+ var result = await authService.GeneratePasswordResetToken(user.EmailAddress, 1440);\n// Assert\n- Assert.Same(user, returnedUser);\n+ Assert.NotNull(result);\n+ Assert.Equal(PasswordResetResultType.Success, result.Type);\n+ Assert.Same(user, result.User);\nAssert.Equal(\"existing-token\", user.PasswordResetToken);\n}\n@@ -1043,11 +1054,12 @@ public async Task WithExistingExpiredTokenReturnsNewToken()\nvar currentDate = DateTime.UtcNow;\n// Act\n- var returnedUser = await authService.GeneratePasswordResetToken(user.EmailAddress, 1440);\n+ var result = await authService.GeneratePasswordResetToken(user.EmailAddress, 1440);\n// Assert\n- Assert.Same(user, returnedUser);\n- Assert.NotEmpty(user.PasswordResetToken);\n+ Assert.NotNull(result);\n+ Assert.Equal(PasswordResetResultType.Success, result.Type);\n+ Assert.Same(user, result.User);\nAssert.NotEqual(\"existing-token\", user.PasswordResetToken);\nAssert.True(user.PasswordResetTokenExpirationDate >= currentDate.AddMinutes(1440));\n}\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/UsersControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/UsersControllerFacts.cs", "diff": "@@ -238,7 +238,7 @@ public async Task SendsEmailWithPasswordResetUrl()\n.Returns(user);\nGetMock<AuthenticationService>()\n.Setup(s => s.GeneratePasswordResetToken(\"user\", Constants.PasswordResetTokenExpirationHours * 60))\n- .CompletesWith(user);\n+ .CompletesWith(new PasswordResetResult(PasswordResetResultType.Success, user));\nvar controller = GetController<UsersController>();\nvar model = new ForgotPasswordViewModel { Email = \"user\" };\n@@ -254,7 +254,7 @@ public async Task RedirectsAfterGeneratingToken()\nvar user = new User { EmailAddress = \"some@example.com\", Username = \"somebody\" };\nGetMock<AuthenticationService>()\n.Setup(s => s.GeneratePasswordResetToken(\"user\", Constants.PasswordResetTokenExpirationHours * 60))\n- .CompletesWith(user)\n+ .CompletesWith(new PasswordResetResult(PasswordResetResultType.Success, user))\n.Verifiable();\nvar controller = GetController<UsersController>();\n@@ -268,11 +268,11 @@ public async Task RedirectsAfterGeneratingToken()\n}\n[Fact]\n- public async Task ReturnsSameViewIfTokenGenerationFails()\n+ public async Task ShowsErrorIfUserWasNotFound()\n{\nGetMock<AuthenticationService>()\n.Setup(s => s.GeneratePasswordResetToken(\"user\", Constants.PasswordResetTokenExpirationHours * 60))\n- .CompletesWithNull();\n+ .ReturnsAsync(new PasswordResetResult(PasswordResetResultType.UserNotFound, user: null));\nvar controller = GetController<UsersController>();\nvar model = new ForgotPasswordViewModel { Email = \"user\" };\n@@ -281,6 +281,7 @@ public async Task ReturnsSameViewIfTokenGenerationFails()\nAssert.NotNull(result);\nAssert.IsNotType(typeof(RedirectResult), result);\n+ Assert.Contains(Strings.CouldNotFindAnyoneWithThatUsernameOrEmail, result.ViewData.ModelState[\"Email\"].Errors.Select(e => e.ErrorMessage));\n}\n[Fact]\n@@ -298,7 +299,57 @@ public async Task ShowsErrorIfUnconfirmedAccount()\nAssert.NotNull(result);\nAssert.IsNotType(typeof(RedirectResult), result);\n- Assert.Equal(\"You cannot reset your password until you confirm your account.\", controller.ModelState[\"Email\"].Errors[0].ErrorMessage);\n+ Assert.Contains(Strings.UserIsNotYetConfirmed, result.ViewData.ModelState[\"Email\"].Errors.Select(e => e.ErrorMessage));\n+ }\n+\n+ [Fact]\n+ public async Task ThrowsNotImplementedExceptionWhenResultTypeIsUnknown()\n+ {\n+ // Arrange\n+ GetMock<AuthenticationService>()\n+ .Setup(s => s.GeneratePasswordResetToken(\"user\", Constants.PasswordResetTokenExpirationHours * 60))\n+ .ReturnsAsync(new PasswordResetResult((PasswordResetResultType)(-1), user: new User()));\n+ var controller = GetController<UsersController>();\n+\n+ var model = new ForgotPasswordViewModel { Email = \"user\" };\n+\n+ // Act & Assert\n+ await Assert.ThrowsAsync<NotImplementedException>(() => controller.ForgotPassword(model));\n+ }\n+\n+ [Theory]\n+ [MemberData(nameof(ResultTypes))]\n+ public async Task NoResultsTypesThrow(PasswordResetResultType resultType)\n+ {\n+ // Arrange\n+ GetMock<AuthenticationService>()\n+ .Setup(s => s.GeneratePasswordResetToken(\"user\", Constants.PasswordResetTokenExpirationHours * 60))\n+ .ReturnsAsync(new PasswordResetResult(resultType, user: new User()));\n+ var controller = GetController<UsersController>();\n+\n+ var model = new ForgotPasswordViewModel { Email = \"user\" };\n+\n+ try\n+ {\n+ // Act\n+ await controller.ForgotPassword(model);\n+ }\n+ catch (Exception e)\n+ {\n+ // Assert\n+ Assert.True(false, $\"No exception should be thrown for result type {resultType}: {e}\");\n+ }\n+ }\n+\n+ public static IEnumerable<object[]> ResultTypes\n+ {\n+ get\n+ {\n+ return Enum\n+ .GetValues(typeof(PasswordResetResultType))\n+ .Cast<PasswordResetResultType>()\n+ .Select(v => new object[] { v });\n+ }\n}\n}\n@@ -1145,8 +1196,8 @@ public async Task GivenNoOldPassword_ItSendsAPasswordSetEmail()\nGetMock<AuthenticationService>()\n.Setup(a => a.GeneratePasswordResetToken(user, It.IsAny<int>()))\n- .Callback<User, int>((u, _) => u.PasswordResetToken = \"t0k3n\")\n- .Completes();\n+ .ReturnsAsync(PasswordResetResultType.Success)\n+ .Callback<User, int>((u, _) => u.PasswordResetToken = \"t0k3n\");\nstring actualConfirmUrl = null;\nGetMock<IMessageService>()\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Introduce a type to represent the different password reset results (instead of null and exceptions) (#4555) Supercedes https://github.com/NuGet/NuGetGallery/pull/4551 Fixes https://github.com/NuGet/NuGetGallery/issues/4548
455,736
17.08.2017 07:41:04
25,200
5a711658cec4e106147ce219ff617cc6cd931ddc
Break long lines in the package details page Fix
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -252,6 +252,10 @@ img.package-icon {\n.checkbox .label-sibling {\nmargin-left: 20px;\n}\n+.break-word {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n#edit-metadata-form-container .loading:after {\ndisplay: inline-block;\n/* ascii code for the ellipsis character */\n@@ -584,12 +588,14 @@ img.package-icon {\n}\n.page-package-details .package-title {\nmargin-bottom: 24px;\n- word-break: break-all;\n- word-break: break-word;\n}\n.page-package-details .package-title div {\nmargin-top: 2px;\n}\n+.page-package-details .package-details-main {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n.page-package-details .package-details-info .ms-Icon-ul li {\nmargin-bottom: 15px;\n}\n@@ -643,7 +649,6 @@ img.package-icon {\nfont-family: Consolas, Menlo, Monaco, \"Courier New\", monospace;\nline-height: 1.5;\ncolor: #fff;\n- word-wrap: break-word;\nbackground-color: #002440;\nborder-color: #002440;\nborder-style: solid;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/base.less", "new_path": "src/Bootstrap/less/theme/base.less", "diff": "@@ -322,3 +322,8 @@ img.package-icon {\nmargin-left: 20px;\n}\n}\n+\n+.break-word {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/common-list-packages.less", "new_path": "src/Bootstrap/less/theme/common-list-packages.less", "diff": ".package-header {\n.package-title {\n+ .break-word;\nfont-size: 24px;\nfont-weight: 300;\nline-height: 0.9;\n- word-break: break-all;\n- word-break: break-word;\n}\n.package-by {\n}\n.package-details {\n+ .break-word;\nmargin-top: 8px;\ncolor: @text-color;\nline-height: 20px;\n- word-break: break-all;\n- word-break: break-word;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/common-user-package-list.less", "new_path": "src/Bootstrap/less/theme/common-user-package-list.less", "diff": "}\n.package-id {\n- word-break: break-all;\n- word-break: break-word;\n+ .break-word;\n}\n.package-controls {\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-display-package.less", "new_path": "src/Bootstrap/less/theme/page-display-package.less", "diff": ".package-title {\nmargin-bottom: 24px;\n- word-break: break-all;\n- word-break: break-word;\ndiv {\nmargin-top: 2px;\n}\n}\n+ .package-details-main {\n+ .break-word;\n+ }\n+\n.package-details-info {\n.ms-Icon-ul {\nli {\npadding: 0 10px 8px 10px;\nwidth: 100%;\nmax-width: 1px;\n- word-wrap: break-word;\nline-height: 1.5;\n// Add a border with the same color as the background to support visual callout\n// in high contrast mode (since borders are shown).\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-list-packages.less", "new_path": "src/Bootstrap/less/theme/page-list-packages.less", "diff": ".row-heading {\n.cell-heading {\nh1 {\n- word-break: break-all;\n- word-break: break-word;\n+ .break-word;\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -252,6 +252,10 @@ img.package-icon {\n.checkbox .label-sibling {\nmargin-left: 20px;\n}\n+.break-word {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n#edit-metadata-form-container .loading:after {\ndisplay: inline-block;\n/* ascii code for the ellipsis character */\n@@ -584,12 +588,14 @@ img.package-icon {\n}\n.page-package-details .package-title {\nmargin-bottom: 24px;\n- word-break: break-all;\n- word-break: break-word;\n}\n.page-package-details .package-title div {\nmargin-top: 2px;\n}\n+.page-package-details .package-details-main {\n+ word-break: break-all;\n+ word-break: break-word;\n+}\n.page-package-details .package-details-info .ms-Icon-ul li {\nmargin-bottom: 15px;\n}\n@@ -643,7 +649,6 @@ img.package-icon {\nfont-family: Consolas, Menlo, Monaco, \"Courier New\", monospace;\nline-height: 1.5;\ncolor: #fff;\n- word-wrap: break-word;\nbackground-color: #002440;\nborder-color: #002440;\nborder-style: solid;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "@ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/default-package-icon-256x256.png\")) />\n</h3>\n</aside>\n- <article class=\"col-sm-8\">\n+ <article class=\"col-sm-8 package-details-main\">\n<div class=\"package-title\">\n<h1>\n@Html.BreakWord(Model.Id)\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Break long lines in the package details page (#4569) Fix https://github.com/NuGet/NuGetGallery/issues/4564
455,736
18.08.2017 10:44:17
25,200
bb6201d7b6ef6e52ccd86c4197fac2dadbd03977
Add storage connection strings for each distinct purpose in the gallery Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Auditing/CloudAuditingService.cs", "new_path": "src/NuGetGallery.Core/Auditing/CloudAuditingService.cs", "diff": "@@ -14,7 +14,7 @@ namespace NuGetGallery.Auditing\n/// <summary>\n/// Writes audit records to a specific container in the Cloud Storage Account provided\n/// </summary>\n- public class CloudAuditingService : AuditingService\n+ public class CloudAuditingService : AuditingService, ICloudStorageStatusDependency\n{\npublic static readonly string DefaultContainerName = \"auditing\";\n@@ -26,7 +26,6 @@ public class CloudAuditingService : AuditingService\npublic CloudAuditingService(string instanceId, string localIP, string storageConnectionString, Func<Task<AuditActor>> getOnBehalfOf)\n: this(instanceId, localIP, GetContainer(storageConnectionString), getOnBehalfOf)\n{\n-\n}\npublic CloudAuditingService(string instanceId, string localIP, CloudBlobContainer auditContainer, Func<Task<AuditActor>> getOnBehalfOf)\n@@ -121,5 +120,10 @@ private static async Task WriteBlob(string auditData, string fullPath, CloudBloc\nthrow;\n}\n}\n+\n+ public Task<bool> IsAvailableAsync()\n+ {\n+ return _auditContainer.ExistsAsync();\n+ }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/NuGetGallery.Core.csproj", "new_path": "src/NuGetGallery.Core/NuGetGallery.Core.csproj", "diff": "<Compile Include=\"Entities\\Scope.cs\" />\n<Compile Include=\"Entities\\UserSecurityPolicy.cs\" />\n<Compile Include=\"Entities\\User.cs\" />\n+ <Compile Include=\"ICloudStorageStatusDependency.cs\" />\n<Compile Include=\"Infrastructure\\AzureEntityList.cs\" />\n<Compile Include=\"Infrastructure\\TableErrorLog.cs\" />\n<Compile Include=\"PackageReaderCoreExtensions.cs\" />\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Start/DefaultDependenciesModule.cs", "new_path": "src/NuGetGallery/App_Start/DefaultDependenciesModule.cs", "diff": "using System.Net;\nusing System.Net.Mail;\nusing System.Security.Principal;\n-using System.Threading;\nusing System.Web;\nusing System.Web.Hosting;\nusing System.Web.Mvc;\nusing AnglicanGeek.MarkdownMailer;\nusing Autofac;\n+using Autofac.Core;\nusing Elmah;\nusing Microsoft.WindowsAzure.ServiceRuntime;\nusing NuGetGallery.Areas.Admin;\n@@ -71,19 +71,6 @@ protected override void Load(ContainerBuilder builder)\nConfigureSearch(builder, configuration);\n- if (!string.IsNullOrEmpty(configuration.Current.AzureStorageConnectionString))\n- {\n- builder.RegisterInstance(new TableErrorLog(configuration.Current.AzureStorageConnectionString))\n- .As<ErrorLog>()\n- .SingleInstance();\n- }\n- else\n- {\n- builder.RegisterInstance(new SqlErrorLog(configuration.Current.SqlConnectionString))\n- .As<ErrorLog>()\n- .SingleInstance();\n- }\n-\nbuilder.RegisterType<DateTimeProvider>().AsSelf().As<IDateTimeProvider>().SingleInstance();\nbuilder.RegisterType<HttpContextCacheService>()\n@@ -91,11 +78,6 @@ protected override void Load(ContainerBuilder builder)\n.As<ICacheService>()\n.InstancePerLifetimeScope();\n- builder.RegisterType<ContentService>()\n- .AsSelf()\n- .As<IContentService>()\n- .SingleInstance();\n-\nbuilder.Register(c => new EntitiesContext(configuration.Current.SqlConnectionString, readOnly: configuration.Current.ReadOnlyMode))\n.AsSelf()\n.As<IEntitiesContext>()\n@@ -194,11 +176,6 @@ protected override void Load(ContainerBuilder builder)\n.As<ITempDataProvider>()\n.InstancePerLifetimeScope();\n- builder.RegisterType<NuGetExeDownloaderService>()\n- .AsSelf()\n- .As<INuGetExeDownloaderService>()\n- .InstancePerLifetimeScope();\n-\nbuilder.RegisterType<StatusService>()\n.AsSelf()\n.As<IStatusService>()\n@@ -279,7 +256,7 @@ protected override void Load(ContainerBuilder builder)\nbreak;\ncase StorageType.AzureStorage:\nConfigureForAzureStorage(builder, configuration);\n- defaultAuditingService = GetAuditingServiceForAzureStorage(configuration);\n+ defaultAuditingService = GetAuditingServiceForAzureStorage(builder, configuration);\nbreak;\n}\n@@ -287,21 +264,6 @@ protected override void Load(ContainerBuilder builder)\nRegisterCookieComplianceService(builder, configuration, diagnosticsService);\n- builder.RegisterType<FileSystemService>()\n- .AsSelf()\n- .As<IFileSystemService>()\n- .SingleInstance();\n-\n- builder.RegisterType<PackageFileService>()\n- .AsSelf()\n- .As<IPackageFileService>()\n- .InstancePerLifetimeScope();\n-\n- builder.RegisterType<UploadFileService>()\n- .AsSelf()\n- .As<IUploadFileService>()\n- .InstancePerLifetimeScope();\n-\n// todo: bind all package curators by convention\nbuilder.RegisterType<WebMatrixPackageCurator>()\n.AsSelf()\n@@ -389,11 +351,24 @@ private static void ConfigureAutocomplete(ContainerBuilder builder, IGalleryConf\nprivate static void ConfigureForLocalFileSystem(ContainerBuilder builder, IGalleryConfigurationService configuration)\n{\n+ builder.RegisterType<FileSystemService>()\n+ .AsSelf()\n+ .As<IFileSystemService>()\n+ .SingleInstance();\n+\nbuilder.RegisterType<FileSystemFileStorageService>()\n.AsSelf()\n.As<IFileStorageService>()\n.SingleInstance();\n+ foreach (var dependent in StorageDependent.GetAll(configuration.Current))\n+ {\n+ builder.RegisterType(dependent.ImplementationType)\n+ .AsSelf()\n+ .As(dependent.InterfaceType)\n+ .InstancePerLifetimeScope();\n+ }\n+\nbuilder.RegisterInstance(NullReportService.Instance)\n.AsSelf()\n.As<IReportService>()\n@@ -409,34 +384,75 @@ private static void ConfigureForLocalFileSystem(ContainerBuilder builder, IGalle\n.AsSelf()\n.As<IAggregateStatsService>()\n.InstancePerLifetimeScope();\n+\n+ builder.RegisterInstance(new SqlErrorLog(configuration.Current.SqlConnectionString))\n+ .As<ErrorLog>()\n+ .SingleInstance();\n+ }\n+\n+ private static IAuditingService GetAuditingServiceForLocalFileSystem(IGalleryConfigurationService configuration)\n+ {\n+ var auditingPath = Path.Combine(\n+ FileSystemFileStorageService.ResolvePath(configuration.Current.FileStorageDirectory),\n+ FileSystemAuditingService.DefaultContainerName);\n+\n+ return new FileSystemAuditingService(auditingPath, AuditActor.GetAspNetOnBehalfOfAsync);\n}\nprivate static void ConfigureForAzureStorage(ContainerBuilder builder, IGalleryConfigurationService configuration)\n{\n- builder.RegisterInstance(new CloudBlobClientWrapper(configuration.Current.AzureStorageConnectionString, configuration.Current.AzureStorageReadAccessGeoRedundant))\n+ /// The goal here is to initialize a <see cref=\"ICloudBlobClient\"/> and <see cref=\"IFileStorageService\"/>\n+ /// instance for each unique connection string. Each dependent of <see cref=\"IFileStorageService\"/> (that\n+ /// is, each service that has a <see cref=\"IFileStorageService\"/> constructor parameter) is registered in\n+ /// <see cref=\"StorageDependent.GetAll(IAppConfiguration)\"/> and is grouped by the respective storage\n+ /// connection string. Each group is given a binding key which refers to the appropriate instance of the\n+ /// <see cref=\"IFileStorageService\"/>.\n+ var completedBindingKeys = new HashSet<string>();\n+ foreach (var dependent in StorageDependent.GetAll(configuration.Current))\n+ {\n+ if (completedBindingKeys.Add(dependent.BindingKey))\n+ {\n+ builder.RegisterInstance(new CloudBlobClientWrapper(dependent.AzureStorageConnectionString, configuration.Current.AzureStorageReadAccessGeoRedundant))\n.AsSelf()\n.As<ICloudBlobClient>()\n- .SingleInstance();\n+ .SingleInstance()\n+ .Keyed<ICloudBlobClient>(dependent.BindingKey);\nbuilder.RegisterType<CloudBlobFileStorageService>()\n+ .WithParameter(new ResolvedParameter(\n+ (pi, ctx) => pi.ParameterType == typeof(ICloudBlobClient),\n+ (pi, ctx) => ctx.ResolveKeyed<ICloudBlobClient>(dependent.BindingKey)))\n.AsSelf()\n.As<IFileStorageService>()\n- .SingleInstance();\n+ .As<ICloudStorageStatusDependency>()\n+ .SingleInstance()\n+ .Keyed<IFileStorageService>(dependent.BindingKey);\n+ }\n+\n+ builder.RegisterType(dependent.ImplementationType)\n+ .WithParameter(new ResolvedParameter(\n+ (pi, ctx) => pi.ParameterType == typeof(IFileStorageService),\n+ (pi, ctx) => ctx.ResolveKeyed<IFileStorageService>(dependent.BindingKey)))\n+ .AsSelf()\n+ .As(dependent.InterfaceType)\n+ .InstancePerLifetimeScope();\n+ }\n// when running on Windows Azure, we use a back-end job to calculate stats totals and store in the blobs\n- builder.RegisterInstance(new JsonAggregateStatsService(configuration.Current.AzureStorageConnectionString, configuration.Current.AzureStorageReadAccessGeoRedundant))\n+ builder.RegisterInstance(new JsonAggregateStatsService(configuration.Current.AzureStorage_Statistics_ConnectionString, configuration.Current.AzureStorageReadAccessGeoRedundant))\n.AsSelf()\n.As<IAggregateStatsService>()\n.SingleInstance();\n// when running on Windows Azure, pull the statistics from the warehouse via storage\n- builder.RegisterInstance(new CloudReportService(configuration.Current.AzureStorageConnectionString, configuration.Current.AzureStorageReadAccessGeoRedundant))\n+ builder.RegisterInstance(new CloudReportService(configuration.Current.AzureStorage_Statistics_ConnectionString, configuration.Current.AzureStorageReadAccessGeoRedundant))\n.AsSelf()\n.As<IReportService>()\n+ .As<ICloudStorageStatusDependency>()\n.SingleInstance();\n// when running on Windows Azure, download counts come from the downloads.v1.json blob\n- var downloadCountService = new CloudDownloadCountService(configuration.Current.AzureStorageConnectionString, configuration.Current.AzureStorageReadAccessGeoRedundant);\n+ var downloadCountService = new CloudDownloadCountService(configuration.Current.AzureStorage_Statistics_ConnectionString, configuration.Current.AzureStorageReadAccessGeoRedundant);\nbuilder.RegisterInstance(downloadCountService)\n.AsSelf()\n.As<IDownloadCountService>()\n@@ -447,18 +463,13 @@ private static void ConfigureForAzureStorage(ContainerBuilder builder, IGalleryC\n.AsSelf()\n.As<IStatisticsService>()\n.SingleInstance();\n- }\n-\n- private static IAuditingService GetAuditingServiceForLocalFileSystem(IGalleryConfigurationService configuration)\n- {\n- var auditingPath = Path.Combine(\n- FileSystemFileStorageService.ResolvePath(configuration.Current.FileStorageDirectory),\n- FileSystemAuditingService.DefaultContainerName);\n- return new FileSystemAuditingService(auditingPath, AuditActor.GetAspNetOnBehalfOfAsync);\n+ builder.RegisterInstance(new TableErrorLog(configuration.Current.AzureStorage_Errors_ConnectionString))\n+ .As<ErrorLog>()\n+ .SingleInstance();\n}\n- private static IAuditingService GetAuditingServiceForAzureStorage(IGalleryConfigurationService configuration)\n+ private static IAuditingService GetAuditingServiceForAzureStorage(ContainerBuilder builder, IGalleryConfigurationService configuration)\n{\nstring instanceId;\ntry\n@@ -472,10 +483,16 @@ private static IAuditingService GetAuditingServiceForAzureStorage(IGalleryConfig\nvar localIp = AuditActor.GetLocalIpAddressAsync().Result;\n- return new CloudAuditingService(instanceId, localIp, configuration.Current.AzureStorageConnectionString, AuditActor.GetAspNetOnBehalfOfAsync);\n+ var service = new CloudAuditingService(instanceId, localIp, configuration.Current.AzureStorage_Auditing_ConnectionString, AuditActor.GetAspNetOnBehalfOfAsync);\n+\n+ builder.RegisterInstance(service)\n+ .As<ICloudStorageStatusDependency>()\n+ .SingleInstance();\n+\n+ return service;\n}\n- private static IAuditingService CombineServices(IEnumerable<IAuditingService> services)\n+ private static IAuditingService CombineAuditingServices(IEnumerable<IAuditingService> services)\n{\nif (!services.Any())\n{\n@@ -510,7 +527,7 @@ private static void RegisterAuditingServices(ContainerBuilder builder, IAuditing\nservices.Add(defaultAuditingService);\n}\n- var service = CombineServices(services);\n+ var service = CombineAuditingServices(services);\nbuilder.RegisterInstance(service)\n.AsSelf()\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Configuration/AppConfiguration.cs", "new_path": "src/NuGetGallery/Configuration/AppConfiguration.cs", "diff": "@@ -42,10 +42,27 @@ public class AppConfiguration : IAppConfiguration\n[TypeConverter(typeof(StringArrayConverter))]\npublic string[] ForceSslExclusion { get; set; }\n- /// <summary>\n- /// Gets the connection string to use when connecting to azure storage\n- /// </summary>\n- public string AzureStorageConnectionString { get; set; }\n+\n+ [DisplayName(\"AzureStorage.Auditing.ConnectionString\")]\n+ public string AzureStorage_Auditing_ConnectionString { get; set; }\n+\n+ [DisplayName(\"AzureStorage.Content.ConnectionString\")]\n+ public string AzureStorage_Content_ConnectionString { get; set; }\n+\n+ [DisplayName(\"AzureStorage.Errors.ConnectionString\")]\n+ public string AzureStorage_Errors_ConnectionString { get; set; }\n+\n+ [DisplayName(\"AzureStorage.NuGetExe.ConnectionString\")]\n+ public string AzureStorage_NuGetExe_ConnectionString { get; set; }\n+\n+ [DisplayName(\"AzureStorage.Packages.ConnectionString\")]\n+ public string AzureStorage_Packages_ConnectionString { get; set; }\n+\n+ [DisplayName(\"AzureStorage.Statistics.ConnectionString\")]\n+ public string AzureStorage_Statistics_ConnectionString { get; set; }\n+\n+ [DisplayName(\"AzureStorage.Uploads.ConnectionString\")]\n+ public string AzureStorage_Uploads_ConnectionString { get; set; }\n/// <summary>\n/// Gets a setting if Read Access Geo Redundant is enabled in azure storage\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Configuration/IAppConfiguration.cs", "new_path": "src/NuGetGallery/Configuration/IAppConfiguration.cs", "diff": "@@ -51,9 +51,39 @@ public interface IAppConfiguration\nstring[] ForceSslExclusion { get; set; }\n/// <summary>\n- /// Gets the connection string to use when connecting to azure storage\n+ /// The Azure Storage connection string used for auditing.\n/// </summary>\n- string AzureStorageConnectionString { get; set; }\n+ string AzureStorage_Auditing_ConnectionString { get; set; }\n+\n+ /// <summary>\n+ /// The Azure Storage connection string used for static content.\n+ /// </summary>\n+ string AzureStorage_Content_ConnectionString { get; set; }\n+\n+ /// <summary>\n+ /// The Azure Storage connection string used for Elmah error logs.\n+ /// </summary>\n+ string AzureStorage_Errors_ConnectionString { get; set; }\n+\n+ /// <summary>\n+ /// The Azure Storage connection string used for downloading nuget.exe.\n+ /// </summary>\n+ string AzureStorage_NuGetExe_ConnectionString { get; set; }\n+\n+ /// <summary>\n+ /// The Azure Storage connection string used for packages, after upload.\n+ /// </summary>\n+ string AzureStorage_Packages_ConnectionString { get; set; }\n+\n+ /// <summary>\n+ /// The Azure Storage connection string used for statistics.\n+ /// </summary>\n+ string AzureStorage_Statistics_ConnectionString { get; set; }\n+\n+ /// <summary>\n+ /// The Azure Storage connection string used for package uploads, before publishing.\n+ /// </summary>\n+ string AzureStorage_Uploads_ConnectionString { get; set; }\n/// <summary>\n/// Gets a setting if Read Access Geo Redundant is enabled in azure storage\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Compile Include=\"App_Start\\NuGetODataV1FeedConfig.cs\" />\n<Compile Include=\"App_Start\\NuGetODataConfig.cs\" />\n<Compile Include=\"App_Start\\RuntimeServiceProvider.cs\" />\n+ <Compile Include=\"App_Start\\StorageDependent.cs\" />\n<Compile Include=\"App_Start\\WebApiConfig.cs\" />\n<Compile Include=\"App_Start\\AutofacConfig.cs\" />\n<Compile Include=\"Areas\\Admin\\Controllers\\DeleteController.cs\" />\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/CloudBlobFileStorageService.cs", "new_path": "src/NuGetGallery/Services/CloudBlobFileStorageService.cs", "diff": "namespace NuGetGallery\n{\n- public class CloudBlobFileStorageService : IFileStorageService\n+ public class CloudBlobFileStorageService : IFileStorageService, ICloudStorageStatusDependency\n{\nprivate readonly ICloudBlobClient _client;\nprivate readonly IAppConfiguration _configuration;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/StatusService.cs", "new_path": "src/NuGetGallery/Services/StatusService.cs", "diff": "// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\nusing System;\n+using System.Collections.Generic;\nusing System.Data.Entity;\nusing System.Diagnostics.CodeAnalysis;\nusing System.Globalization;\n@@ -19,7 +20,7 @@ public class StatusService : IStatusService\n{\nprivate readonly HttpClient _httpClient = new HttpClient();\nprivate readonly IEntitiesContext _entities;\n- private readonly IFileStorageService _fileStorageService;\n+ private readonly List<ICloudStorageStatusDependency> _cloudStorageAvailabilityChecks;\nprivate readonly IAppConfiguration _config;\nprivate const string Available = \"Available\";\n@@ -31,11 +32,11 @@ public class StatusService : IStatusService\npublic StatusService(\nIEntitiesContext entities,\n- IFileStorageService fileStorageService,\n+ IEnumerable<ICloudStorageStatusDependency> cloudStorageAvailabilityChecks,\nIAppConfiguration config)\n{\n_entities = entities;\n- _fileStorageService = fileStorageService;\n+ _cloudStorageAvailabilityChecks = cloudStorageAvailabilityChecks.ToList();\n_config = config;\n}\n@@ -92,7 +93,9 @@ private bool IsSqlAzureAvailable()\ntry\n{\n// Check Storage Availability\n- storageAvailable = await _fileStorageService.IsAvailableAsync();\n+ var tasks = _cloudStorageAvailabilityChecks.Select(s => s.IsAvailableAsync());\n+ var eachAvailable = await Task.WhenAll(tasks);\n+ storageAvailable = eachAvailable.All(a => a);\n}\ncatch (Exception ex)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Web.config", "new_path": "src/NuGetGallery/Web.config", "diff": "<!-- These should change on every deployment (to rotate credentials, etc.) -->\n<add key=\"Gallery.StorageType\" value=\"FileSystem\" />\n<!-- The storage type to use. Can be FileSystem (default) or AzureStorage -->\n- <add key=\"Gallery.AzureStorageConnectionString\" value=\"\" />\n- <!-- The connection string for the Azure Storage Account used for Package Storage IF Gallery.StorageType is AzureStorage -->\n+\n+ <add key=\"Gallery.AzureStorage.Auditing.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Content.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Errors.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.NuGetExe.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Packages.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Statistics.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Uploads.ConnectionString\" value=\"\" />\n+ <!-- The various Azure Storage connection strings to use. If the Gallery.StorageType is AzureStorage, all must be defined. -->\n+\n<add key=\"Gallery.AzureStorageReadAccessGeoRedundant\" value=\"false\" />\n<!-- If the storage account has to fall-back to a secondary (when Read Access Geo Redundant is enabled in Azure storage), change Gallery.AzureStorageReadAccessGeoRedundant to true -->\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "new_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "diff": "</ItemGroup>\n<ItemGroup>\n<Compile Include=\"AppConfigIsCorrectlyApplied.cs\" />\n+ <Compile Include=\"App_Start\\StorageDependentFacts.cs\" />\n<Compile Include=\"App_Start\\RuntimeServiceProviderTests.cs\" />\n<Compile Include=\"Areas\\Admin\\Controllers\\SecurityPolicyControllerFacts.cs\" />\n<Compile Include=\"Authentication\\AuthenticatorFacts.cs\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add storage connection strings for each distinct purpose in the gallery (#4568) Fix https://github.com/NuGet/NuGetGallery/issues/4554
455,736
21.08.2017 08:08:29
25,200
04428257d26326c9cbf5108e36eaa2e2de3a3e0c
Redirect preview.nuget.org to www.nuget.org Progress on
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Web.config", "new_path": "src/NuGetGallery/Web.config", "diff": "</conditions>\n<action type=\"Redirect\" url=\"{MapProtocol:{HTTPS}}www.nuget.org/{R:1}\" redirectType=\"Permanent\" />\n</rule>\n+ <rule name=\"Redirect preview\">\n+ <match url=\"^(.*)$\" />\n+ <conditions>\n+ <add input=\"{HTTP_HOST}\" pattern=\"^preview\\.nuget\\.org$\" />\n+ </conditions>\n+ <action type=\"Redirect\" url=\"{MapProtocol:{HTTPS}}www.nuget.org/{R:1}\" redirectType=\"Permanent\" />\n+ </rule>\n<rule name=\"Legacy feed root URL\" stopProcessing=\"true\">\n<match url=\"^$\" />\n<conditions>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Redirect preview.nuget.org to www.nuget.org (#4579) Progress on https://github.com/NuGet/Engineering/issues/695
455,736
22.08.2017 14:29:58
25,200
f57f82f362a19654ab9f97031c08c465ac8f4ea0
Enumerate the package ID and versions to be deleted as hidden fields Fix Regression was caused by
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/Delete.cshtml", "new_path": "src/NuGetGallery/Views/Packages/Delete.cshtml", "diff": "@using (Html.BeginForm(\"Delete\", \"Packages\", FormMethod.Post, new { id = \"delete-form\" }))\n{\n@Html.AntiForgeryToken()\n+ foreach (var p in Model.DeletePackagesRequest.Packages)\n+ {\n+ <input type=\"hidden\" name=\"DeletePackagesRequest.Packages[]\" value=\"@p\" />\n+ }\n<div id=\"form-field-reason\" class=\"form-group @Html.HasErrorFor(m => m.DeletePackagesRequest.Reason)\">\n@Html.ShowLabelFor(m => m.DeletePackagesRequest.Reason)\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Enumerate the package ID and versions to be deleted as hidden fields (#4580) Fix https://github.com/NuGet/NuGetGallery/issues/4577 Regression was caused by https://github.com/NuGet/NuGetGallery/commit/257c61df1d6aff8b312af55cd7dfb891668dce88
455,776
23.08.2017 14:25:45
25,200
4771a5898a235f2cea2b1f46876fee0727cab431
Remove CookieComplianceEnabled flag
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Start/DefaultDependenciesModule.cs", "new_path": "src/NuGetGallery/App_Start/DefaultDependenciesModule.cs", "diff": "@@ -537,11 +537,7 @@ private static void RegisterAuditingServices(ContainerBuilder builder, IAuditing\nprivate static void RegisterCookieComplianceService(ContainerBuilder builder, ConfigurationService configuration, DiagnosticsService diagnostics)\n{\n- CookieComplianceServiceBase service = null;\n- if (configuration.Current.CookieComplianceEnabled)\n- {\n- service = GetAddInServices<ICookieComplianceService>(builder).FirstOrDefault() as CookieComplianceServiceBase;\n- }\n+ var service = GetAddInServices<ICookieComplianceService>(builder).FirstOrDefault() as CookieComplianceServiceBase;\nif (service == null)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Configuration/AppConfiguration.cs", "new_path": "src/NuGetGallery/Configuration/AppConfiguration.cs", "diff": "@@ -19,9 +19,6 @@ public class AppConfiguration : IAppConfiguration\n[DefaultValue(\"\")]\npublic string RedesignBanner { get; set; }\n- [DefaultValue(false)]\n- public bool CookieComplianceEnabled { get; set; }\n-\n/// <summary>\n/// Gets a setting indicating if SSL is required for all operations once logged in.\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Configuration/IAppConfiguration.cs", "new_path": "src/NuGetGallery/Configuration/IAppConfiguration.cs", "diff": "@@ -28,11 +28,6 @@ public interface IAppConfiguration\n/// </summary>\nstring RedesignBanner { get; set; }\n- /// <summary>\n- /// Gets a setting if cookie compliance shim should be enabled.\n- /// </summary>\n- bool CookieComplianceEnabled { get; set; }\n-\n/// <summary>\n/// Gets a setting indicating if SSL is required for all operations once logged in.\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Web.config", "new_path": "src/NuGetGallery/Web.config", "diff": "<!-- redesign banner on the top - leave blank to remove the banner from the site. -->\n<add key=\"Gallery.RedesignBanner\" value=\"\" />\n- <!-- EU cookie banner integration settings -->\n- <add key=\"Gallery.CookieComplianceEnabled\" value=\"false\" />\n-\n<add key=\"Gallery.FacebookAppId\" value=\"\" />\n<!-- Set this if you have a Application Insights instrumentation key to use for your gallery deployment -->\n<add key=\"Gallery.AppInsightsInstrumentationKey\" value=\"\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Remove CookieComplianceEnabled flag (#4588)
455,747
31.08.2017 15:18:56
25,200
fd9d321d370275c598ebedfcd6122e9aba0eaac9
[Prefix]Add visual indicator for Reserved prefix Packages Add visual indicator for reserved packages in details, search, profile pages.
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -332,6 +332,12 @@ img.package-icon {\nword-break: break-all;\nword-break: break-word;\n}\n+.list-packages .package .package-header .reserved-indicator {\n+ width: 20px;\n+ margin-top: 3px;\n+ margin-left: 3px;\n+ vertical-align: top;\n+}\n.list-packages .package .package-header .package-by {\nmargin-left: 10px;\ncolor: #000;\n@@ -592,6 +598,9 @@ img.package-icon {\n.page-package-details .package-title div {\nmargin-top: 2px;\n}\n+.page-package-details .package-title .reserved-indicator {\n+ width: 25px;\n+}\n.page-package-details .package-details-main {\nword-break: break-all;\nword-break: break-word;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/common-list-packages.less", "new_path": "src/Bootstrap/less/theme/common-list-packages.less", "diff": "line-height: 0.9;\n}\n+ .reserved-indicator {\n+ margin-top: 3px;\n+ margin-left: 3px;\n+ vertical-align: top;\n+ width: 20px;\n+ }\n+\n.package-by {\nmargin-left: @padding-small-horizontal;\ncolor: @text-color;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-display-package.less", "new_path": "src/Bootstrap/less/theme/page-display-package.less", "diff": "div {\nmargin-top: 2px;\n}\n+\n+ .reserved-indicator {\n+ width: 25px;\n+ }\n}\n.package-details-main {\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -332,6 +332,12 @@ img.package-icon {\nword-break: break-all;\nword-break: break-word;\n}\n+.list-packages .package .package-header .reserved-indicator {\n+ width: 20px;\n+ margin-top: 3px;\n+ margin-left: 3px;\n+ vertical-align: top;\n+}\n.list-packages .package .package-header .package-by {\nmargin-left: 10px;\ncolor: #000;\n@@ -592,6 +598,9 @@ img.package-icon {\n.page-package-details .package-title div {\nmargin-top: 2px;\n}\n+.page-package-details .package-title .reserved-indicator {\n+ width: 25px;\n+}\n.page-package-details .package-details-main {\nword-break: break-all;\nword-break: break-word;\n" }, { "change_type": "ADD", "old_path": "src/NuGetGallery/Content/gallery/img/reserved-indicator-20x20.png", "new_path": "src/NuGetGallery/Content/gallery/img/reserved-indicator-20x20.png", "diff": "Binary files /dev/null and b/src/NuGetGallery/Content/gallery/img/reserved-indicator-20x20.png differ\n" }, { "change_type": "ADD", "old_path": "src/NuGetGallery/Content/gallery/img/reserved-indicator-25x25.png", "new_path": "src/NuGetGallery/Content/gallery/img/reserved-indicator-25x25.png", "diff": "Binary files /dev/null and b/src/NuGetGallery/Content/gallery/img/reserved-indicator-25x25.png differ\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/NuGetGallery/Content/gallery/img/reserved-indicator.svg", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n+<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n+<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 16 16\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:space=\"preserve\" style=\"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;\">\n+ <path d=\"M16,16L0,16L0,0L16,0L16,16Z\" style=\"fill:none;\"/>\n+ <path d=\"M8,1C4.16,1 1,4.16 1,8C1,11.84 4.16,15 8,15C11.84,15 15,11.84 15,8C15,4.16 11.84,1 8,1ZM6.3,12.389L3.043,9.132L4.457,7.718L6.3,9.561L11.543,4.318L12.957,5.732L6.3,12.389Z\" style=\"fill:rgb(0,72,128);fill-rule:nonzero;\"/>\n+ <path d=\"M6.3,12.389L3.043,9.132L4.457,7.718L6.3,9.561L11.543,4.318L12.957,5.732L6.3,12.389Z\" style=\"fill:white;fill-rule:nonzero;\"/>\n+</svg>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Infrastructure/Lucene/LuceneSearchService.cs", "new_path": "src/NuGetGallery/Infrastructure/Lucene/LuceneSearchService.cs", "diff": "@@ -112,6 +112,7 @@ private static Package PackageFromDoc(Document doc)\nint key = Int32.Parse(doc.Get(\"Key\"), CultureInfo.InvariantCulture);\nint packageRegistrationKey = Int32.Parse(doc.Get(\"PackageRegistrationKey\"), CultureInfo.InvariantCulture);\nint packageSize = Int32.Parse(doc.Get(\"PackageFileSize\"), CultureInfo.InvariantCulture);\n+ bool isVerified = Boolean.Parse(doc.Get(\"IsVerified-Original\"));\nbool isLatest = Boolean.Parse(doc.Get(\"IsLatest\"));\nbool isLatestStable = Boolean.Parse(doc.Get(\"IsLatestStable\"));\nbool isLatestSemVer2 = Boolean.Parse(doc.Get(\"IsLatestSemVer2\"));\n@@ -172,6 +173,7 @@ private static Package PackageFromDoc(Document doc)\nId = doc.Get(\"Id-Original\"),\nDownloadCount = downloadCount,\nKey = packageRegistrationKey,\n+ IsVerified = isVerified,\nOwners = owners\n},\nPackageRegistrationKey = packageRegistrationKey,\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Infrastructure/PackageIndexEntity.cs", "new_path": "src/NuGetGallery/Infrastructure/PackageIndexEntity.cs", "diff": "@@ -124,6 +124,7 @@ public Document ToDocument()\ndocument.Add(new Field(\"Hash\", Package.Hash.ToStringSafe(), Field.Store.YES, Field.Index.NO));\ndocument.Add(new Field(\"HashAlgorithm\", Package.HashAlgorithm.ToStringSafe(), Field.Store.YES, Field.Index.NO));\ndocument.Add(new Field(\"Id-Original\", Package.PackageRegistration.Id, Field.Store.YES, Field.Index.NO));\n+ document.Add(new Field(\"IsVerified-Original\", Package.PackageRegistration.IsVerified.ToString(), Field.Store.YES, Field.Index.NO));\ndocument.Add(new Field(\"LastUpdated\", Package.LastUpdated.ToString(CultureInfo.InvariantCulture), Field.Store.YES, Field.Index.NO));\nif (Package.LastEdited != null)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Strings.Designer.cs", "new_path": "src/NuGetGallery/Strings.Designer.cs", "diff": "@@ -935,6 +935,15 @@ public class Strings {\n}\n}\n+ /// <summary>\n+ /// Looks up a localized string similar to The ID prefix of this package has been reserved for one of the owner of this package by NuGet.org..\n+ /// </summary>\n+ public static string ReservedNamespace_ReservedIndicatorTooltip {\n+ get {\n+ return ResourceManager.GetString(\"ReservedNamespace_ReservedIndicatorTooltip\", resourceCulture);\n+ }\n+ }\n+\n/// <summary>\n/// Looks up a localized string similar to User &apos;{0}&apos; is not an owner of the specified namespace.\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Strings.resx", "new_path": "src/NuGetGallery/Strings.resx", "diff": "@@ -561,4 +561,7 @@ For more information, please contact '{2}'.</value>\n<data name=\"ReservedNamespace_UserNotFound\" xml:space=\"preserve\">\n<value>User not found with username '{0}'</value>\n</data>\n+ <data name=\"ReservedNamespace_ReservedIndicatorTooltip\" xml:space=\"preserve\">\n+ <value>The ID prefix of this package has been reserved for one of the owner of this package by NuGet.org.</value>\n+ </data>\n</root>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/ListPackageItemViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/ListPackageItemViewModel.cs", "diff": "@@ -24,6 +24,7 @@ public ListPackageItemViewModel(Package package)\nAuthors = package.FlattenedAuthors;\nMinClientVersion = package.MinClientVersion;\nOwners = package.PackageRegistration?.Owners;\n+ IsVerified = package.PackageRegistration?.IsVerified;\nbool wasTruncated;\nShortDescription = Description.TruncateAtWordBoundary(_descriptionLengthLimit, _omissionString, out wasTruncated);\n@@ -37,6 +38,7 @@ public ListPackageItemViewModel(Package package)\npublic string ShortDescription { get; set; }\npublic bool IsDescriptionTruncated { get; set; }\npublic string PolicyMessage { get; set; }\n+ public bool? IsVerified { get; set; }\npublic bool UseVersion\n{\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "<h1>\n@Html.BreakWord(Model.Id)\n<small class=\"text-nowrap\">@Model.FullVersion</small>\n+\n+ @if (Model.IsVerified.HasValue && Model.IsVerified.Value)\n+ {\n+ <img class=\"reserved-indicator\"\n+ src=\"~/Content/gallery/img/reserved-indicator.svg\"\n+ @ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/reserved-indicator-25x25.png\"))\n+ title=\"@Strings.ReservedNamespace_ReservedIndicatorTooltip\" />\n+ }\n</h1>\n@if (!StringComparer.OrdinalIgnoreCase.Equals(Model.Id, Model.Title))\nvar encodedText = Url.Encode(string.Format(\"Check out {0} on #NuGet.\", Model.Id));\n}\n<p class=\"share-buttons\">\n- <a href=\"https://www.facebook.com/sharer/sharer.php?u=@absolutePackageUrl&t=@encodedText\" target=\"_blank\"><img\n- width=\"24\" height=\"24\" alt=\"Share this package on Facebook\"\n+ <a href=\"https://www.facebook.com/sharer/sharer.php?u=@absolutePackageUrl&t=@encodedText\" target=\"_blank\">\n+ <img width=\"24\" height=\"24\" alt=\"Share this package on Facebook\"\nsrc=\"@Url.Absolute(\"~/Content/gallery/img/facebook.svg\")\"\n- @ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/facebook-24x24.png\")) /></a>\n- <a href=\"https://twitter.com/intent/tweet?url=@absolutePackageUrl&text=@encodedText\" target=\"_blank\"><img\n- width=\"24\" height=\"24\" alt=\"Tweet this package\"\n+ @ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/facebook-24x24.png\")) />\n+ </a>\n+ <a href=\"https://twitter.com/intent/tweet?url=@absolutePackageUrl&text=@encodedText\" target=\"_blank\">\n+ <img width=\"24\" height=\"24\" alt=\"Tweet this package\"\nsrc=\"@Url.Absolute(\"~/Content/gallery/img/twitter.svg\")\"\n- @ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/twitter-24x24.png\")) /></a>\n+ @ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/twitter-24x24.png\")) />\n+ </a>\n</p>\n</aside>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/_ListPackage.cshtml", "new_path": "src/NuGetGallery/Views/Shared/_ListPackage.cshtml", "diff": "<div class=\"package-header\">\n<a class=\"package-title\" href=\"@Url.Package(Model.Id, Model.UseVersion ? Model.Version : null)\">@Html.BreakWord(Model.Id)</a>\n+ @if (Model.IsVerified.HasValue && Model.IsVerified.Value)\n+ {\n+ <img class=\"reserved-indicator\"\n+ src=\"~/Content/gallery/img/reserved-indicator.svg\"\n+ @ViewHelpers.ImageFallback(Url.Absolute(\"~/Content/gallery/img/reserved-indicator-20x20.png\"))\n+ title=\"@Strings.ReservedNamespace_ReservedIndicatorTooltip\"/>\n+ }\n+\n<span class=\"package-by\">\nby:\n@foreach (var owner in Model.Owners)\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Infrastructure/LuceneSearchServiceFacts.cs", "new_path": "tests/NuGetGallery.Facts/Infrastructure/LuceneSearchServiceFacts.cs", "diff": "@@ -28,6 +28,7 @@ public void IndexAndSearchAPackageByDescription(string semVerLevel)\nPackageRegistration = new PackageRegistration\n{\nId = \"Package #1\",\n+ IsVerified = false\n},\nTitle = \"Package #1 4.2.0\",\nDescription = \"Package #1 is an awesome package\",\n@@ -69,6 +70,7 @@ public void ResultsIncludeVersionAndNormalizedVersion(string semVerLevel)\nPackageRegistration = new PackageRegistration\n{\nId = \"Package #1\",\n+ IsVerified = false\n},\nTitle = \"Package #1 4.2.0\",\nDescription = \"Package #1 is an awesome package\",\n@@ -109,6 +111,7 @@ public void ResultsIncludeVersionAndNormalizedVersionEvenIfNormalizedVersionColu\nPackageRegistration = new PackageRegistration\n{\nId = \"Package #1\",\n+ IsVerified = false\n},\nTitle = \"Package #1 4.2.0\",\nDescription = \"Package #1 is an awesome package\",\n@@ -150,7 +153,8 @@ public void IndexAndSearchDavid123For12(string semVerLevel)\n{\nId = \"DavidTest123\",\nKey = 11500,\n- DownloadCount = 495\n+ DownloadCount = 495,\n+ IsVerified = false\n},\nDescription = \"Description\",\nListed = true,\n@@ -185,7 +189,8 @@ public void IndexAndSearchWithWordStemming(string semVerLevel)\n{\nId = \"SuperzipLib\",\nKey = 12,\n- DownloadCount = 41\n+ DownloadCount = 41,\n+ IsVerified = false\n},\nDescription = \"Library for compressing your filez\",\nListed = true,\n@@ -218,7 +223,8 @@ public void SearchUsingCombinedIdAndGeneralTerms(string semVerLevel)\n{\nId = \"RedDeath\",\nKey = 12,\n- DownloadCount = 41\n+ DownloadCount = 41,\n+ IsVerified = false\n},\nDescription = \"Yeah\",\nListed = true,\n@@ -238,7 +244,8 @@ public void SearchUsingCombinedIdAndGeneralTerms(string semVerLevel)\n{\nId = \"RedHerring\",\nKey = 12,\n- DownloadCount = 41\n+ DownloadCount = 41,\n+ IsVerified = false\n},\nDescription = \"Library for compressing your filez\",\nListed = true,\n@@ -273,7 +280,8 @@ public void SearchUsingExactPackageId(string semVerLevel)\n{\nId = \"NuGet.Core\",\nKey = 12,\n- DownloadCount = 25\n+ DownloadCount = 25,\n+ IsVerified = false\n},\nDescription = \"NuGet.Core is the core framework assembly for NuGet\",\nDownloadCount = 3,\n@@ -296,6 +304,7 @@ public void SearchUsingExactPackageId(string semVerLevel)\nId = \"SomeotherNuGet.Core.SimilarlyNamedPackage\",\nKey = 13,\nDownloadCount = 25,\n+ IsVerified = false\n},\nDescription =\n\"This isn't really NuGet.Core. The confusing package ID is the test!\",\n@@ -351,6 +360,7 @@ public void SearchForNuGetCoreWithExactField(string field, string term)\nId = \"NuGet.Core\",\nKey = 12,\nDownloadCount = 41,\n+ IsVerified = false,\nOwners = { new User { Username = \"NugetCoreOwner\" } },\n},\nDescription = \"NuGet.Core is the core framework assembly for NuGet that the rest of NuGet builds upon.\",\n@@ -373,6 +383,7 @@ public void SearchForNuGetCoreWithExactField(string field, string term)\nId = \"SomeotherNuGet.Core.SimilarlyNamedPackage\",\nKey = 13,\nDownloadCount = 2,\n+ IsVerified = false,\nOwners = { new User { Username = \"SomeOtherOwner\" } },\n},\nDescription = \"This isn't really NuGet.Core. But it needs to look a bit like it for the test case!\",\n@@ -413,7 +424,8 @@ public void SearchForJQueryUICombinedWithPartialId(string semVerLevel)\n{\nId = \"JQuery.UI.Combined\",\nKey = 12,\n- DownloadCount = 41\n+ DownloadCount = 41,\n+ IsVerified = false\n},\nDescription = \"jQuery UI is etc etc and many more important things\",\nListed = true,\n@@ -447,7 +459,8 @@ public void SearchForDegenerateSingleQuoteQuery(string semVerLevel)\n{\nId = \"JQuery.UI.Combined\",\nKey = 12,\n- DownloadCount = 41\n+ DownloadCount = 41,\n+ IsVerified = false\n},\nDescription = \"jQuery UI is etc etc and many more important things\",\nListed = true,\n@@ -481,7 +494,8 @@ public void SearchUsesPackageRegistrationDownloadCountsToPrioritize(string semVe\n{\nId = \"FooQuery\",\nKey = 13,\n- DownloadCount = 21\n+ DownloadCount = 21,\n+ IsVerified = false\n},\nDescription = \"FooQuery is overall much less popular than JQuery UI\",\nDownloadCount = 5,\n@@ -502,7 +516,8 @@ public void SearchUsesPackageRegistrationDownloadCountsToPrioritize(string semVe\n{\nId = \"JQuery.UI.Combined\",\nKey = 12,\n- DownloadCount = 42\n+ DownloadCount = 42,\n+ IsVerified = false\n},\nDownloadCount = 3,\nDescription = \"jQuery UI has only a few downloads of its latest and greatest version, but many total downloads\",\n@@ -538,7 +553,8 @@ public void IndexAndSearchRetrievesCanDriveV2Feed(string semVerLevel)\n{\nId = \"Pride\",\nKey = 456,\n- DownloadCount = 123456\n+ DownloadCount = 123456,\n+ IsVerified = false\n},\nCreated = new DateTime(2019, 2, 28, 0, 5, 59, DateTimeKind.Utc),\nDescription = \"DescriptionText\",\n@@ -629,7 +645,8 @@ public void SearchWorksAroundLuceneQuerySyntaxExceptions(string semVerLevel)\n{\nId = \"NuGet.Core\",\nKey = 12,\n- DownloadCount = 41\n+ DownloadCount = 41,\n+ IsVerified = false\n},\nDescription = \"NuGet.Core is the core framework assembly for NuGet that the rest of NuGet builds upon.\",\nListed = true,\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
[Prefix]Add visual indicator for Reserved prefix Packages (#4601) Add visual indicator for reserved packages in details, search, profile pages.
455,747
31.08.2017 17:16:15
25,200
3263cdb16182aea637fe2c65df2115b984279e66
Fix external search service to reflect the verified flag
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Infrastructure/Lucene/ExternalSearchService.cs", "new_path": "src/NuGetGallery/Infrastructure/Lucene/ExternalSearchService.cs", "diff": "@@ -267,6 +267,7 @@ private static Package ReadPackage(JObject doc)\n.Select(v => new User { Username = v.Value<string>() })\n.ToArray(),\nDownloadCount = reg.Value<int>(\"DownloadCount\"),\n+ IsVerified = reg.Value<bool>(\"Verified\"),\nKey = reg.Value<int>(\"Key\")\n};\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix external search service to reflect the verified flag (#4606)
455,743
01.09.2017 16:03:27
25,200
f554558269979151ecc94076eff5d338644f0cf0
Add support for third-party tabs on package details page
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -672,11 +672,9 @@ img.package-icon {\nline-height: 1.5;\nvertical-align: baseline;\n}\n-.page-package-details .install-tabs #package-manager .install-script span::before {\n- content: \"PM> \";\n-}\n-.page-package-details .install-tabs #dotnet-cli .install-script span::before {\n- content: \"> \";\n+.page-package-details .install-tabs .tab-pane .alert {\n+ width: 100%;\n+ margin: 0;\n}\n.page-downloads .list-tools li {\nmargin-top: 20px;\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/page-display-package.less", "new_path": "src/Bootstrap/less/theme/page-display-package.less", "diff": "line-height: 1.5;\n}\n}\n- }\n- #package-manager .install-script span::before {\n- content: \"PM> \";\n+ .alert {\n+ margin: 0;\n+ width: 100%;\n}\n-\n- #dotnet-cli .install-script span::before {\n- content: \"> \";\n}\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -672,11 +672,9 @@ img.package-icon {\nline-height: 1.5;\nvertical-align: baseline;\n}\n-.page-package-details .install-tabs #package-manager .install-script span::before {\n- content: \"PM> \";\n-}\n-.page-package-details .install-tabs #dotnet-cli .install-script span::before {\n- content: \"> \";\n+.page-package-details .install-tabs .tab-pane .alert {\n+ width: 100%;\n+ margin: 0;\n}\n.page-downloads .list-tools li {\nmargin-top: 20px;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Compile Include=\"ViewModels\\ApiKeyListViewModel.cs\" />\n<Compile Include=\"ViewModels\\ApiKeyViewModel.cs\" />\n<Compile Include=\"ViewModels\\PackageHeadingModel.cs\" />\n+ <Compile Include=\"ViewModels\\PackageManagerViewModel.cs\" />\n<Compile Include=\"ViewModels\\ReportMyPackageViewModel.cs\" />\n<Compile Include=\"ViewModels\\ScopeViewModel.cs\" />\n<Compile Include=\"ViewModels\\PackageListSearchViewModel.cs\" />\n+ <Compile Include=\"ViewModels\\ThirdPartyPackageManagerViewModel.cs\" />\n<Compile Include=\"WebApi\\PlainTextResult.cs\" />\n<Compile Include=\"WebApi\\QueryResult.cs\" />\n<Compile Include=\"WebApi\\QueryResultDefaults.cs\" />\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/page-display-package.js", "new_path": "src/NuGetGallery/Scripts/gallery/page-display-package.js", "diff": "@@ -24,8 +24,10 @@ $(function () {\n\"CalculatorSubtract\",\n\"Show more\");\n- configureCopyButton('package-manager');\n- configureCopyButton('dotnet-cli');\n+ for (var i in packageManagers)\n+ {\n+ configureCopyButton(packageManagers[i]);\n+ }\n// Enable the undo edit link.\n$(\"#undo-pending-edits\").click(function (e) {\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "ViewBag.Title = Model.Id + \" \" + Model.Version;\nViewBag.Tab = \"Packages\";\nLayout = \"~/Views/Shared/Gallery/Layout.cshtml\";\n+\nvar absolutePackageUrl = Url.Absolute(Url.Package(Model.Id));\n+\n+ var packageManagers = new PackageManagerViewModel[]\n+ {\n+ new PackageManagerViewModel()\n+ {\n+ Id = \"package-manager\",\n+ Name = \"Package Manager\",\n+ CommandPrefix = \"PM> \",\n+ InstallPackageCommand = string.Format(\"Install-Package {0} -Version {1}\", Model.Id, Model.Version)\n+ },\n+\n+ new PackageManagerViewModel()\n+ {\n+ Id = \"dotnet-cli\",\n+ Name = \".NET CLI\",\n+ CommandPrefix = \"> \",\n+ InstallPackageCommand = string.Format(\"dotnet add package {0} --version {1}\", Model.Id, Model.Version)\n+ },\n+ };\n}\n@section SocialMeta {\n@if (!String.IsNullOrWhiteSpace(ViewBag.FacebookAppID))\n}\n-@helper CommandTab(string label, string id, bool active)\n+@helper CommandTab(PackageManagerViewModel packageManager, bool active)\n{\n<li role=\"presentation\" class=\"@(active ? \"active\" : string.Empty)\">\n- <a href=\"#@id\" aria-expanded=\"@(active ? \"true\" : \"false\")\"\n+ <a href=\"#@packageManager.Id\" aria-expanded=\"@(active ? \"true\" : \"false\")\"\naria-selected=\"@(active ? \"true\" : \"false\")\"\n- aria-controls=\"@id\" role=\"tab\" data-toggle=\"tab\"\n- title=\"Switch to tab panel which contains package installation command for @label\">\n- @label\n+ aria-controls=\"@packageManager.Id\" role=\"tab\" data-toggle=\"tab\"\n+ title=\"Switch to tab panel which contains package installation command for @packageManager.Name\">\n+ @packageManager.Name\n</a>\n</li>\n}\n-@helper CommandPanel(Func<MvcHtmlString, HelperResult> htmlContent, string label, string id, bool active)\n+@helper CommandPanel(PackageManagerViewModel packageManager, bool active)\n{\n- <div role=\"tabpanel\" class=\"tab-pane @(active ? \"active\" : string.Empty)\" id=\"@id\">\n+ var thirdPartyPackageManager = packageManager as ThirdPartyPackageManagerViewModel;\n+\n+ <div role=\"tabpanel\" class=\"tab-pane @(active ? \"active\" : string.Empty)\" id=\"@packageManager.Id\">\n<div>\n- <div class=\"install-script\" id=\"@id-text\">\n+ <div class=\"install-script\" id=\"@packageManager.Id-text\">\n<span>\n- @htmlContent(MvcHtmlString.Empty)\n+ @packageManager.InstallPackageCommand\n</span>\n</div>\n<div class=\"copy-button\">\n- <button id=\"@id-button\" class=\"btn btn-default btn-warning\" type=\"button\"\n+ <button id=\"@packageManager.Id-button\" class=\"btn btn-default btn-warning\" type=\"button\"\ndata-toggle=\"popover\" data-placement=\"bottom\" data-content=\"Copied.\"\n- aria-label=\"Copy the @label command\">\n+ aria-label=\"Copy the @packageManager.Name command\">\n<span class=\"ms-Icon ms-Icon--Copy\" aria-hidden=\"true\"></span>\n</button>\n</div>\n</div>\n+ @if (thirdPartyPackageManager != null)\n+ {\n+ @ViewHelpers.AlertWarning(\n+ @<text>\n+ This client is not supported by the NuGet team.\n+ <a href=\"@thirdPartyPackageManager.ContactUrl\">Contact its maintainers for support</a>.\n+ </text>)\n+ }\n</div>\n}\n<div class=\"install-tabs\">\n<ul class=\"nav nav-tabs\" role=\"tablist\">\n- @CommandTab(\"Package Manager\", \"package-manager\", active: true)\n- @CommandTab(\".NET CLI\", \"dotnet-cli\", active: false)\n+ @{ var firstPackageManager = true; }\n+ @foreach (var packageManager in packageManagers)\n+ {\n+ @CommandTab(packageManager, active: firstPackageManager)\n+\n+ firstPackageManager = false;\n+ }\n</ul>\n<div class=\"tab-content\">\n- @CommandPanel(@<text>Install-Package @Model.Id -Version @Model.Version</text>, \"Package Manager\", \"package-manager\", active: true)\n- @CommandPanel(@<text>dotnet add package @Model.Id --version @Model.Version</text>, \".NET CLI\", \"dotnet-cli\", active: false)\n+ @{ firstPackageManager = true; }\n+ @foreach (var packageManager in packageManagers)\n+ {\n+ @CommandPanel(packageManager, active: firstPackageManager)\n+\n+ firstPackageManager = false;\n+ }\n</div>\n</div>\n</div>\n</section>\n+\n+\n@section BottomScripts {\n+ @{\n+ var packageManagersCss = string.Empty;\n+\n+ foreach (var packageManager in packageManagers)\n+ {\n+ packageManagersCss += \"#\" + packageManager.Id + \" .install-script span::before {\";\n+ packageManagersCss += \" content: \\\"\" + packageManager.CommandPrefix + \"\\\"\";\n+ packageManagersCss += \"}\";\n+ }\n+ }\n+\n+ <style type=\"text/css\">\n+ @Html.Raw(packageManagersCss)\n+ </style>\n+\n+ <script type=\"text/javascript\">\n+ var packageManagers = [@Html.Raw(string.Join(\",\", packageManagers.Select(pm => \"\\\"\" + pm.Id + \"\\\"\")))];\n+ </script>\n+\n@Scripts.Render(\"~/Scripts/gallery/page-display-package.min.js\")\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add support for third-party tabs on package details page (#4605)
455,744
05.09.2017 17:10:34
25,200
6c7b87b06aad9c7af0dd78e40caf6b9ce5e82537
Drop everything related to the ForceSSL cookie. We now always force SSL (if set up in configuration). So no need to have code specific for the authentication. Addresses
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/FormsAuthenticationService.cs", "new_path": "src/NuGetGallery/Services/FormsAuthenticationService.cs", "diff": "@@ -17,8 +17,6 @@ public FormsAuthenticationService(IAppConfiguration configuration)\n_configuration = configuration;\n}\n- private const string ForceSSLCookieName = \"ForceSSL\";\n-\npublic void SetAuthCookie(\nstring userName,\nbool createPersistentCookie,\n@@ -48,42 +46,11 @@ public FormsAuthenticationService(IAppConfiguration configuration)\nSecure = _configuration.RequireSSL\n};\ncontext.Response.Cookies.Add(formsCookie);\n-\n- if (_configuration.RequireSSL)\n- {\n- // Drop a second cookie indicating that the user is logged in via SSL (no secret data, just tells us to redirect them to SSL)\n- HttpCookie responseCookie = new HttpCookie(ForceSSLCookieName, \"true\");\n- responseCookie.HttpOnly = true;\n- context.Response.Cookies.Add(responseCookie);\n- }\n}\npublic void SignOut()\n{\nFormsAuthentication.SignOut();\n-\n- // Delete the \"LoggedIn\" cookie\n- HttpContext context = HttpContext.Current;\n- var cookie = context.Request.Cookies[ForceSSLCookieName];\n- if (cookie != null)\n- {\n- cookie.Expires = DateTime.UtcNow.AddDays(-1d);\n- context.Response.Cookies.Add(cookie);\n- }\n- }\n-\n-\n- public bool ShouldForceSSL(HttpContextBase context)\n- {\n- var cookie = context.Request.Cookies[ForceSSLCookieName];\n-\n- bool value;\n- if (cookie != null && Boolean.TryParse(cookie.Value, out value))\n- {\n- return value;\n- }\n-\n- return false;\n}\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/IFormsAuthenticationService.cs", "new_path": "src/NuGetGallery/Services/IFormsAuthenticationService.cs", "diff": "@@ -13,7 +13,5 @@ public interface IFormsAuthenticationService\nIEnumerable<string> roles);\nvoid SignOut();\n-\n- bool ShouldForceSSL(HttpContextBase context);\n}\n}\n\\ No newline at end of file\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Drop everything related to the ForceSSL cookie. (#4617) We now always force SSL (if set up in configuration). So no need to have code specific for the authentication. Addresses #4132.
455,759
06.09.2017 08:44:39
-7,200
adf19db0e79119ac94eeb542786c1c9a83eeda4c
Package details page warning for SemVer is inconsistent with other places. Fixes
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "new_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "diff": "@Alert(htmlContent, \"danger\", \"ErrorBadge\", isAlertRole)\n}\n+@helper AlertIsSemVer2Package(bool hasSemVer2Version, bool hasSemVer2Dependency)\n+{\n+ string warningHeader = null;\n+ if (hasSemVer2Version)\n+ {\n+ warningHeader = \"This package has a SemVer 2.0.0 package version.\";\n+ }\n+ else if (hasSemVer2Dependency)\n+ {\n+ warningHeader = \"This package is considered a SemVer 2.0.0 package as it has a package dependency on SemVer 2.0.0 package(s).\";\n+ }\n+\n+ if (warningHeader != null)\n+ {\n+ @AlertWarning(\n+ @<text>\n+ @warningHeader<br />\n+ <em>\n+ This package will only be available to download with SemVer 2.0.0 compatible NuGet clients, such as Visual\n+ Studio 2017 (version 15.3) and above or NuGet client 4.3.0 and above.\n+ <a href=\"https://go.microsoft.com/fwlink/?linkid=852248\" alt=\"Read more\">Read more</a><br />\n+ </em>\n+ </text>\n+ )\n+ }\n+}\n+\n@helper ErrorPage(UrlHelper url, System.Web.Mvc.HtmlHelper html, string errorNumber, string errorName, Func<MvcHtmlString, HelperResult> errorTextMain, Func<MvcHtmlString, HelperResult> errorTextSub = null)\n{\n<section role=\"main\" class=\"container main-container\">\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "@if (Model.IsSemVer2)\n{\n- @ViewHelpers.AlertWarning(\n- @<text>\n- 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.\n- Reach out to support if you have more questions.\n- </text>\n- )\n+ @ViewHelpers.AlertIsSemVer2Package(Model.HasSemVer2Version, Model.HasSemVer2Dependency)\n}\n@if (!Model.Listed && !Model.Deleted)\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Package details page warning for SemVer is inconsistent with other places. (#4611) Fixes #4552
455,736
06.09.2017 08:21:10
25,200
93901d101fa7e54995b4ece62488ce6a91c5119d
Use JsonRequestBehavior.AllowGet on endpoints that both return JSON and support GET Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/AppController.cs", "new_path": "src/NuGetGallery/Controllers/AppController.cs", "diff": "@@ -54,7 +54,7 @@ protected internal virtual ActionResult SafeRedirect(string returnUrl)\n/// <param name=\"statusCode\">HTTP status code for response</param>\n/// <param name=\"obj\">Object to Jsonify and return</param>\n/// <returns></returns>\n- protected internal JsonResult Json(int statusCode, object obj)\n+ protected internal JsonResult Json(int statusCode, object obj, JsonRequestBehavior jsonRequestBehavior)\n{\nResponse.StatusCode = statusCode;\nif (statusCode >= 400)\n@@ -62,9 +62,13 @@ protected internal JsonResult Json(int statusCode, object obj)\nResponse.TrySkipIisCustomErrors = true;\n}\n- return Json(obj);\n+ return Json(obj, jsonRequestBehavior);\n}\n+ protected internal JsonResult Json(int statusCode, object obj)\n+ {\n+ return Json(statusCode, obj, JsonRequestBehavior.DenyGet);\n+ }\n/// <summary>\n/// Called before the action method is invoked.\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/PackagesController.cs", "new_path": "src/NuGetGallery/Controllers/PackagesController.cs", "diff": "@@ -102,7 +102,7 @@ public virtual JsonResult UploadPackageProgress()\nAsyncFileUploadProgress progress = _cacheService.GetProgress(username);\nif (progress == null)\n{\n- return Json(404, null);\n+ return Json(404, null, JsonRequestBehavior.AllowGet);\n}\nreturn Json(progress, JsonRequestBehavior.AllowGet);\n@@ -1001,12 +1001,18 @@ public virtual ActionResult Edit(string id, string version)\nvar package = _packageService.FindPackageByIdAndVersion(id, version);\nif (package == null)\n{\n- return Json(404, new string[] { string.Format(Strings.PackageWithIdAndVersionNotFound, id, version) });\n+ return Json(\n+ 404,\n+ new string[]\n+ {\n+ string.Format(Strings.PackageWithIdAndVersionNotFound, id, version)\n+ },\n+ JsonRequestBehavior.AllowGet);\n}\nif (!package.IsOwner(User))\n{\n- return Json(403, new string[] { Strings.Unauthorized });\n+ return Json(403, new string[] { Strings.Unauthorized }, JsonRequestBehavior.AllowGet);\n}\nvar packageRegistration = _packageService.FindPackageRegistrationById(id);\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs", "diff": "@@ -1923,7 +1923,8 @@ public void WillReturnHttpNotFoundForUnknownUser()\nvar result = controller.UploadPackageProgress();\n// Assert\n- Assert.IsType<JsonResult>(result);\n+ var jsonResult = Assert.IsType<JsonResult>(result);\n+ Assert.Equal(JsonRequestBehavior.AllowGet, jsonResult.JsonRequestBehavior);\n}\n[Fact]\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Use JsonRequestBehavior.AllowGet on endpoints that both return JSON and support GET (#4618) Fix https://github.com/NuGet/NuGetGallery/issues/4597
455,759
07.09.2017 18:14:03
-7,200
86ef41479f38508131c47e2f7de918caac301ec5
Fix versionspec parsing in PackageViewModel + test coverage.
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/UrlExtensions.cs", "new_path": "src/NuGetGallery/UrlExtensions.cs", "diff": "@@ -86,8 +86,6 @@ public static string PackageList(this UrlHelper url, int page, string q, bool in\nreturn url.Action(\"ListPackages\", \"Packages\", routeValues);\n}\n-\n-\npublic static string CuratedPackageList(this UrlHelper url, int page, string q, string curatedFeedName)\n{\nreturn url.Action(\"ListPackages\", \"CuratedFeeds\", new\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/PackageViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/PackageViewModel.cs", "diff": "@@ -28,7 +28,7 @@ public PackageViewModel(Package package)\nHasSemVer2Version = NuGetVersion.Parse(_fullVersion).IsSemVer2;\nHasSemVer2Dependency = package.Dependencies.ToList()\n- .Where(pd => pd.VersionSpec != null)\n+ .Where(pd => !string.IsNullOrEmpty(pd.VersionSpec))\n.Select(pd => VersionRange.Parse(pd.VersionSpec))\n.Any(p => (p.HasUpperBound && p.MaxVersion.IsSemVer2) || (p.HasLowerBound && p.MinVersion.IsSemVer2));\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix versionspec parsing in PackageViewModel + test coverage. (#4629)
455,736
07.09.2017 10:43:09
25,200
e7831a472f8ebed354d59383eeb31a9186d98fb8
Use TotalDownloadCount sum for total on user packages list instead of DownloadCount Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "new_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "diff": "@{\nvar packagesString = \"package\" + (Model.Packages.Count() != 1 ? \"s\" : \"\");\n- var numDownloads = Model.Packages.Sum(p => p.DownloadCount);\n+ var numDownloads = Model.Packages.Sum(p => p.TotalDownloadCount);\nvar downloadsString = \"download\" + (numDownloads != 1 ? \"s\" : \"\");\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Use TotalDownloadCount sum for total on user packages list instead of DownloadCount (#4630) Fix https://github.com/NuGet/NuGetGallery/issues/4607
455,743
07.09.2017 13:33:54
25,200
af0c618b9e58764464e59502991e47839e75b066
Updated third-party tabs' support notice
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "{\n@ViewHelpers.AlertWarning(\n@<text>\n- This client is not supported by the NuGet team.\n- <a href=\"@thirdPartyPackageManager.ContactUrl\">Contact its maintainers for support</a>.\n+ The NuGet Team does not provide support for this client.\n+ Please contact its <a href=\"@thirdPartyPackageManager.ContactUrl\">maintainers</a> for support.\n</text>)\n}\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Updated third-party tabs' support notice (#4631)
455,736
08.09.2017 10:33:09
25,200
3b6070f22deef845c2e09b7c6eb4134706a655a9
Add AddPackageLicenseReport2 which supports a larger Value field Progress on
[ { "change_type": "ADD", "old_path": null, "new_path": "src/NuGetGallery/Infrastructure/AddPackageLicenseReport2.Down.sql", "diff": "+SET ANSI_NULLS ON\n+\n+IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AddPackageLicenseReport2]') AND type IN (N'P', N'PC'))\n+BEGIN\n+ DROP PROCEDURE [dbo].[AddPackageLicenseReport2]\n+END\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/NuGetGallery/Infrastructure/AddPackageLicenseReport2.Up.sql", "diff": "+SET ANSI_NULLS ON\n+\n+IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AddPackageLicenseReport2]') AND type IN (N'P', N'PC'))\n+BEGIN\n+ DROP PROCEDURE [dbo].[AddPackageLicenseReport2]\n+END\n+GO\n+\n+CREATE PROCEDURE [dbo].[AddPackageLicenseReport2]\n+(\n+ @sequence INT,\n+ @packageId NVARCHAR(128),\n+ @version NVARCHAR(64),\n+ @reportUrl NVARCHAR(256) = NULL,\n+ @licenseNames LicenseNamesList READONLY,\n+ @comment NVARCHAR(256) = NULL,\n+ @whatIf BIT = 0\n+ )\n+ AS\n+ BEGIN\n+\n+ SET NOCOUNT ON\n+\n+ DECLARE @reportKey INT\n+ DECLARE @packageKey INT\n+ DECLARE @licenseNamesStr VARCHAR(MAX)\n+ DECLARE @licenseKeys TABLE\n+ (\n+ [Key] INT NOT NULL PRIMARY KEY\n+ )\n+\n+ -- Check input\n+\n+ IF @sequence IS NULL RETURN\n+ IF @packageId IS NULL RETURN\n+ IF @version IS NULL RETURN\n+\n+ DECLARE @returnTable TABLE\n+ (\n+ [Action] nvarchar(128),\n+ [Table] nvarchar(128),\n+ [Value] nvarchar(max)\n+ )\n+\n+ -- Get package key\n+\n+ SET @packageKey =\n+ (\n+ SELECT P.[Key]\n+ FROM PackageRegistrations AS R\n+ JOIN Packages AS P\n+ ON R.[Key] = P.PackageRegistrationKey\n+ WHERE (R.Id = @packageId) AND (P.Version = @version)\n+ )\n+\n+ IF @packageKey IS NULL\n+ BEGIN\n+ INSERT INTO @returnTable([Action], [Table], [Value]) VALUES('Error', 'Packages', 'Package not found: ' + @packageId + ' ' + @version)\n+\n+ -- Return results\n+ SELECT -1 AS 'ReturnCode'\n+ SELECT * FROM @returnTable\n+ END\n+ ELSE\n+ BEGIN\n+\n+ BEGIN TRANSACTION\n+\n+ -- Add non-existing license names\n+ MERGE PackageLicenses\n+ USING @licenseNames l\n+ ON PackageLicenses.Name = l.Name\n+ WHEN NOT MATCHED THEN\n+ INSERT (Name) VALUES (l.Name)\n+ OUTPUT $action AS 'Action', 'PackageLicenses' AS 'Table', INSERTED.Name AS 'Value'\n+ INTO @returnTable([Action], [Table], Value);\n+\n+ -- Get license names keys\n+\n+ INSERT @licenseKeys\n+ SELECT PackageLicenses.[Key] FROM PackageLicenses\n+ JOIN @licenseNames l\n+ ON PackageLicenses.Name = l.Name\n+\n+ -- Is there already a report for this ID Version Sequence tuple? If so, delete it\n+ DELETE FROM PackageLicenseReports\n+ OUTPUT 'DELETE' AS 'Action', 'PackageLicenseReports' AS 'Table', deleted.[Key] AS 'Value'\n+ INTO @returnTable([Action], [Table], Value)\n+ WHERE PackageKey = @packageKey AND Sequence = @sequence\n+\n+ -- Add report\n+ INSERT PackageLicenseReports (PackageKey, CreatedUtc, Sequence, ReportUrl, Comment)\n+ OUTPUT 'INSERT' AS 'Action', 'PackageLicenseReports' AS 'Table', CONVERT(nvarchar(64), INSERTED.[Key]) + ' URL:' + INSERTED.ReportUrl AS 'Value'\n+ INTO @returnTable([Action], [Table], Value)\n+ VALUES (@packageKey, GETDATE(), @sequence, @reportUrl, @Comment)\n+\n+ SELECT @reportKey = SCOPE_IDENTITY()\n+\n+ -- Create relationship between report and licenses names\n+\n+ -- INSERT PackageLicenseReportLicenses (ReportKey, LicenseKey)\n+ INSERT PackageLicenseReportLicenses\n+ SELECT @reportKey AS ReportKey, [Key] FROM @licenseKeys\n+\n+ -- Add denormalized data for optimization\n+\n+ -- Creates a comma-separated list\n+ SELECT @licenseNamesStr = COALESCE(@licenseNamesStr + ',', '') + Name\n+ FROM @licenseNames\n+\n+ DECLARE @pid TABLE (PackageKey INT NOT NULL PRIMARY KEY)\n+ UPDATE Packages\n+ SET Packages.LicenseNames = @licenseNamesStr,\n+ Packages.LicenseReportUrl = @reportUrl\n+ OUTPUT INSERTED.[Key]\n+ INTO @pid(PackageKey)\n+ FROM Packages p\n+ INNER JOIN PackageRegistrations pr ON p.PackageRegistrationKey = pr.[Key]\n+ WHERE p.[Key] = @packageKey\n+\n+ INSERT INTO @returnTable([Action], [Table], [Value])\n+ SELECT 'UPDATE' AS 'Action', 'Packages' AS 'Table', pr.Id + ' ' + p.[Version] + ': Report=' + p.LicenseReportUrl + ' Names=' + p.LicenseNames\n+ FROM @pid pid\n+ INNER JOIN Packages p ON pid.PackageKey = p.[Key]\n+ INNER JOIN PackageRegistrations pr ON p.PackageRegistrationKey = pr.[Key]\n+\n+ -- Return results\n+ SELECT 0 AS 'ReturnCode'\n+ SELECT * FROM @returnTable\n+\n+ IF @whatIf <> 1 COMMIT TRANSACTION ELSE ROLLBACK TRANSACTION\n+ END\n+END\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/NuGetGallery/Migrations/201709072246362_AddPackageLicenseReport2Sproc.Designer.cs", "diff": "+// <auto-generated />\n+namespace NuGetGallery.Migrations\n+{\n+ using System.CodeDom.Compiler;\n+ using System.Data.Entity.Migrations;\n+ using System.Data.Entity.Migrations.Infrastructure;\n+ using System.Resources;\n+\n+ [GeneratedCode(\"EntityFramework.Migrations\", \"6.1.3-40302\")]\n+ public sealed partial class AddPackageLicenseReport2Sproc : IMigrationMetadata\n+ {\n+ private readonly ResourceManager Resources = new ResourceManager(typeof(AddPackageLicenseReport2Sproc));\n+\n+ string IMigrationMetadata.Id\n+ {\n+ get { return \"201709072246362_AddPackageLicenseReport2Sproc\"; }\n+ }\n+\n+ string IMigrationMetadata.Source\n+ {\n+ get { return null; }\n+ }\n+\n+ string IMigrationMetadata.Target\n+ {\n+ get { return Resources.GetString(\"Target\"); }\n+ }\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/NuGetGallery/Migrations/201709072246362_AddPackageLicenseReport2Sproc.cs", "diff": "+// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+\n+namespace NuGetGallery.Migrations\n+{\n+ public partial class AddPackageLicenseReport2Sproc : SqlResourceMigration\n+ {\n+ public AddPackageLicenseReport2Sproc()\n+ : base(\"NuGetGallery.Infrastructure.AddPackageLicenseReport2.Up.sql\", \"NuGetGallery.Infrastructure.AddPackageLicenseReport2.Down.sql\")\n+ {\n+ }\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Compile Include=\"Migrations\\201708241907124_PrefixReservation.Designer.cs\">\n<DependentUpon>201708241907124_PrefixReservation.cs</DependentUpon>\n</Compile>\n+ <Compile Include=\"Migrations\\201709072246362_AddPackageLicenseReport2Sproc.cs\" />\n+ <Compile Include=\"Migrations\\201709072246362_AddPackageLicenseReport2Sproc.Designer.cs\">\n+ <DependentUpon>201709072246362_AddPackageLicenseReport2Sproc.cs</DependentUpon>\n+ </Compile>\n<Compile Include=\"Security\\RequireSecurePushForCoOwnersPolicy.cs\" />\n<Compile Include=\"Security\\SecurePushSubscription.cs\" />\n<Compile Include=\"Security\\IUserSecurityPolicySubscription.cs\" />\n<Content Include=\"Content\\themes\\custom\\images\\ui-icons_888888_256x240.png\" />\n<Content Include=\"Content\\themes\\custom\\images\\ui-icons_cd0a0a_256x240.png\" />\n<Content Include=\"D3 LICENSE.txt\" />\n+ <EmbeddedResource Include=\"Infrastructure\\AddPackageLicenseReport2.Up.sql\" />\n+ <EmbeddedResource Include=\"Infrastructure\\AddPackageLicenseReport2.Down.sql\" />\n<Content Include=\"NuGetGallery.dll.config\">\n<CopyToOutputDirectory>Always</CopyToOutputDirectory>\n<SubType>Designer</SubType>\n<EmbeddedResource Include=\"Migrations\\201708241907124_PrefixReservation.resx\">\n<DependentUpon>201708241907124_PrefixReservation.cs</DependentUpon>\n</EmbeddedResource>\n+ <EmbeddedResource Include=\"Migrations\\201709072246362_AddPackageLicenseReport2Sproc.resx\">\n+ <DependentUpon>201709072246362_AddPackageLicenseReport2Sproc.cs</DependentUpon>\n+ </EmbeddedResource>\n<EmbeddedResource Include=\"OData\\QueryAllowed\\Data\\apiv1packages.json\" />\n<EmbeddedResource Include=\"OData\\QueryAllowed\\Data\\apiv1search.json\" />\n<EmbeddedResource Include=\"OData\\QueryAllowed\\Data\\apiv2getupdates.json\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add AddPackageLicenseReport2 which supports a larger Value field (#4633) Progress on https://github.com/NuGet/Engineering/issues/743
455,759
11.09.2017 11:13:27
-7,200
0e0ed75fd908ff1c039e23efeaf79edb32259144
Fix MvcBuildViews failure due to Razor syntax error
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/CuratedFeeds/CuratedFeed.cshtml", "new_path": "src/NuGetGallery/Views/CuratedFeeds/CuratedFeed.cshtml", "diff": "@section BottomScripts {\n<script>\n- var urlFormat = \"@Url.CuratedPackage(curatedFeedName: Model.Name, id: \"PACKAGE_ID\" })\";\n+ var urlFormat = \"@Url.CuratedPackage(curatedFeedName: Model.Name, id: \"PACKAGE_ID\")\";\nfunction deleteCuratedPackage(packageId) {\n$.ajax({\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix MvcBuildViews failure due to Razor syntax error
455,786
12.09.2017 23:11:24
-7,200
3e04263dd7539fd455e2e94c495415a63c54bc30
Add support for Paket CLI
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "CommandPrefix = \"> \",\nInstallPackageCommand = string.Format(\"dotnet add package {0} --version {1}\", Model.Id, Model.Version)\n},\n+\n+ new ThirdPartyPackageManagerViewModel()\n+ {\n+ Id = \"paket-cli\",\n+ Name = \"Paket CLI\",\n+ CommandPrefix = \"> \",\n+ InstallPackageCommand = string.Format(\"paket add {0} --version {1}\", Model.Id, Model.Version),\n+ ContactUrl = \"https://fsprojects.github.io/Paket/\"\n+ },\n};\n}\n@section SocialMeta {\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add support for Paket CLI (#4638)
455,775
13.09.2017 20:03:00
-7,200
79cae74834ad8494ac17e1d64f2cc26cd92f7cac
Link to new contact page for Paket
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "Name = \"Paket CLI\",\nCommandPrefix = \"> \",\nInstallPackageCommand = string.Format(\"paket add {0} --version {1}\", Model.Id, Model.Version),\n- ContactUrl = \"https://fsprojects.github.io/Paket/\"\n+ ContactUrl = \"https://fsprojects.github.io/Paket/contact.html\"\n},\n};\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Link to new contact page for Paket (#4671)
455,759
14.09.2017 10:02:26
-7,200
5fe915c3dae4b2db0efd2d28b422f44b1bf4b1b5
Functional test fix for NetFoundationBrandingValidationTest. (no more relative URL)
[ { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.WebUITests.P0/BasicPages/NetFoundationBrandingValidationTest.cs", "new_path": "tests/NuGetGallery.WebUITests.P0/BasicPages/NetFoundationBrandingValidationTest.cs", "diff": "@@ -25,8 +25,8 @@ public override IEnumerator<WebTestRequest> GetRequestEnumerator()\nvar pageRequest = new WebTestRequest(UrlHelper.BaseUrl);\nvar homePageTextValidationRuleLogo = AssertAndValidationHelper.GetValidationRuleForFindText(@\"<a href=\"\"https://www.dotnetfoundation.org\"\">\");\nvar homePageTextValidationRuleCopyright = AssertAndValidationHelper.GetValidationRuleForFindText(@\"&copy; \" + DateTime.UtcNow.Year + \" .NET Foundation\");\n- var homePageTextValidationRuleTOU = AssertAndValidationHelper.GetValidationRuleForFindText(@\"<a href=\"\"/policies/Terms\"\">Terms of Use</a>\");\n- var homePageTextValidationRulePrivacy = AssertAndValidationHelper.GetValidationRuleForFindText(@\"<a href=\"\"/policies/Privacy\"\">Privacy Policy</a>\");\n+ var homePageTextValidationRuleTOU = AssertAndValidationHelper.GetValidationRuleForFindText($@\"<a href=\"\"{UrlHelper.BaseUrl}/policies/Terms\"\">Terms of Use</a>\");\n+ var homePageTextValidationRulePrivacy = AssertAndValidationHelper.GetValidationRuleForFindText($@\"<a href=\"\"{UrlHelper.BaseUrl}/policies/Privacy\"\">Privacy Policy</a>\");\npageRequest.ValidateResponse += homePageTextValidationRuleLogo.Validate;\npageRequest.ValidateResponse += homePageTextValidationRuleCopyright.Validate;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Functional test fix for NetFoundationBrandingValidationTest. (no more relative URL)
455,759
14.09.2017 15:51:14
-7,200
51dea9882717200e2737491ff39a177d8e991e62
Functional test fix for NetFoundationBrandingValidationTest.
[ { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.WebUITests.P0/BasicPages/NetFoundationBrandingValidationTest.cs", "new_path": "tests/NuGetGallery.WebUITests.P0/BasicPages/NetFoundationBrandingValidationTest.cs", "diff": "@@ -25,8 +25,8 @@ public override IEnumerator<WebTestRequest> GetRequestEnumerator()\nvar pageRequest = new WebTestRequest(UrlHelper.BaseUrl);\nvar homePageTextValidationRuleLogo = AssertAndValidationHelper.GetValidationRuleForFindText(@\"<a href=\"\"https://www.dotnetfoundation.org\"\">\");\nvar homePageTextValidationRuleCopyright = AssertAndValidationHelper.GetValidationRuleForFindText(@\"&copy; \" + DateTime.UtcNow.Year + \" .NET Foundation\");\n- var homePageTextValidationRuleTOU = AssertAndValidationHelper.GetValidationRuleForFindText($@\"<a href=\"\"{UrlHelper.BaseUrl}/policies/Terms\"\">Terms of Use</a>\");\n- var homePageTextValidationRulePrivacy = AssertAndValidationHelper.GetValidationRuleForFindText($@\"<a href=\"\"{UrlHelper.BaseUrl}/policies/Privacy\"\">Privacy Policy</a>\");\n+ var homePageTextValidationRuleTOU = AssertAndValidationHelper.GetValidationRuleForFindText($@\"<a href=\"\"{UrlHelper.BaseUrl}policies/Terms\"\">Terms of Use</a>\");\n+ var homePageTextValidationRulePrivacy = AssertAndValidationHelper.GetValidationRuleForFindText($@\"<a href=\"\"{UrlHelper.BaseUrl}policies/Privacy\"\">Privacy Policy</a>\");\npageRequest.ValidateResponse += homePageTextValidationRuleLogo.Validate;\npageRequest.ValidateResponse += homePageTextValidationRuleCopyright.Validate;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Functional test fix for NetFoundationBrandingValidationTest.
455,736
14.09.2017 16:20:21
25,200
2712ae06e6c081570a3677661596e97d6b9a9551
Add package status column and migration Address
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Entities/Package.cs", "new_path": "src/NuGetGallery.Core/Entities/Package.cs", "diff": "@@ -209,6 +209,11 @@ public Package()\npublic bool Deleted { get; set; }\n+ /// <summary>\n+ /// The package status key, referring to the <see cref=\"PackageStatus\"/> enum.\n+ /// </summary>\n+ public PackageStatus PackageStatusKey { get; set; }\n+\npublic void ApplyEdit(PackageEdit edit, string hashAlgorithm, string hash, long packageFileSize)\n{\n// before we modify this package, record its state in history\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/NuGetGallery.Core.csproj", "new_path": "src/NuGetGallery.Core/NuGetGallery.Core.csproj", "diff": "<Compile Include=\"Infrastructure\\AzureEntityList.cs\" />\n<Compile Include=\"Infrastructure\\TableErrorLog.cs\" />\n<Compile Include=\"PackageReaderCoreExtensions.cs\" />\n+ <Compile Include=\"PackageStatus.cs\" />\n<Compile Include=\"Packaging\\InvalidPackageException.cs\" />\n<Compile Include=\"Packaging\\ManifestEdit.cs\" />\n<Compile Include=\"Packaging\\ManifestValidator.cs\" />\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/NuGetGallery/Migrations/201709111714021_AddPackageStatusKey.Designer.cs", "diff": "+// <auto-generated />\n+namespace NuGetGallery.Migrations\n+{\n+ using System.CodeDom.Compiler;\n+ using System.Data.Entity.Migrations;\n+ using System.Data.Entity.Migrations.Infrastructure;\n+ using System.Resources;\n+\n+ [GeneratedCode(\"EntityFramework.Migrations\", \"6.1.3-40302\")]\n+ public sealed partial class AddPackageStatusKey : IMigrationMetadata\n+ {\n+ private readonly ResourceManager Resources = new ResourceManager(typeof(AddPackageStatusKey));\n+\n+ string IMigrationMetadata.Id\n+ {\n+ get { return \"201709111714021_AddPackageStatusKey\"; }\n+ }\n+\n+ string IMigrationMetadata.Source\n+ {\n+ get { return null; }\n+ }\n+\n+ string IMigrationMetadata.Target\n+ {\n+ get { return Resources.GetString(\"Target\"); }\n+ }\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/NuGetGallery/Migrations/201709111714021_AddPackageStatusKey.cs", "diff": "+namespace NuGetGallery.Migrations\n+{\n+ using System;\n+ using System.Data.Entity.Migrations;\n+\n+ public partial class AddPackageStatusKey : DbMigration\n+ {\n+ public override void Up()\n+ {\n+ AddColumn(\"dbo.Packages\", \"PackageStatusKey\", c => c.Int(\n+ nullable: false,\n+ defaultValue: 0));\n+\n+ Sql(@\"\n+DECLARE @PerIteration INT = 1000;\n+DECLARE @Delay VARCHAR(8) = '00:00:01';\n+\n+DECLARE @UpdateCount INT = -1;\n+WHILE @UpdateCount <> 0\n+BEGIN\n+ UPDATE TOP (@PerIteration) dbo.Packages\n+ SET PackageStatusKey = 1\n+ WHERE Deleted = 1 AND PackageStatusKey = 0\n+\n+ SELECT @UpdateCount = @@ROWCOUNT\n+\n+ WAITFOR DELAY @Delay\n+END\n+\");\n+\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_PackageStatusKeyListed' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_PackageStatusKeyListed] ON [dbo].[Packages] ([PackageStatusKey] ASC, [Listed] ASC) INCLUDE ([Description], [FlattenedDependencies], [IsPrerelease], [PackageRegistrationKey], [Tags], [Version]) WITH (ONLINE = ON)\");\n+\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_IsListedPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_IsListedPackageStatusKey] ON [dbo].[Packages] ([IsLatest] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey], [Tags], [Title]) WITH (ONLINE = ON)\");\n+\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_IsLatestStablePackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_IsLatestStablePackageStatusKey] ON [dbo].[Packages] ([IsLatestStable] ASC, [PackageStatusKey] ASC) INCLUDE ([Description], [FlattenedAuthors], [Listed], [PackageRegistrationKey], [Published], [Tags]) WITH (ONLINE = ON)\");\n+\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_SemVerLevelKeyIsLatestPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_SemVerLevelKeyIsLatestPackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [IsLatest] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey]) WITH (ONLINE = ON)\");\n+\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_SemVerLevelKeyPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_SemVerLevelKeyPackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [PackageStatusKey] ASC) INCLUDE ([IsLatest], [IsLatestSemVer2]) WITH (ONLINE = ON)\");\n+\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_PackageStatusKeyIsPrereleasePackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_PackageStatusKeyIsPrereleasePackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [IsPrerelease] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey], [Description], [Tags]) WITH (ONLINE = ON)\");\n+ }\n+\n+ public override void Down()\n+ {\n+ DropIndex(table: \"Packages\", name: \"nci_wi_Packages_PackageStatusKeyListed\");\n+\n+ DropIndex(table: \"Packages\", name: \"nci_wi_Packages_IsListedPackageStatusKey\");\n+\n+ DropIndex(table: \"Packages\", name: \"nci_wi_Packages_IsLatestStablePackageStatusKey\");\n+\n+ DropIndex(table: \"Packages\", name: \"nci_wi_Packages_SemVerLevelKeyIsLatestPackageStatusKey\");\n+\n+ DropIndex(table: \"Packages\", name: \"nci_wi_Packages_SemVerLevelKeyPackageStatusKey\");\n+\n+ DropIndex(table: \"Packages\", name: \"nci_wi_Packages_PackageStatusKeyIsPrereleasePackageStatusKey\");\n+\n+ DropColumn(\"dbo.Packages\", \"PackageStatusKey\");\n+ }\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Compile Include=\"Migrations\\201709072246362_AddPackageLicenseReport2Sproc.Designer.cs\">\n<DependentUpon>201709072246362_AddPackageLicenseReport2Sproc.cs</DependentUpon>\n</Compile>\n+ <Compile Include=\"Migrations\\201709111714021_AddPackageStatusKey.cs\" />\n+ <Compile Include=\"Migrations\\201709111714021_AddPackageStatusKey.Designer.cs\">\n+ <DependentUpon>201709111714021_AddPackageStatusKey.cs</DependentUpon>\n+ </Compile>\n<Compile Include=\"Security\\RequireSecurePushForCoOwnersPolicy.cs\" />\n<Compile Include=\"Security\\SecurePushSubscription.cs\" />\n<Compile Include=\"Security\\IUserSecurityPolicySubscription.cs\" />\n<EmbeddedResource Include=\"Migrations\\201709072246362_AddPackageLicenseReport2Sproc.resx\">\n<DependentUpon>201709072246362_AddPackageLicenseReport2Sproc.cs</DependentUpon>\n</EmbeddedResource>\n+ <EmbeddedResource Include=\"Migrations\\201709111714021_AddPackageStatusKey.resx\">\n+ <DependentUpon>201709111714021_AddPackageStatusKey.cs</DependentUpon>\n+ </EmbeddedResource>\n<EmbeddedResource Include=\"OData\\QueryAllowed\\Data\\apiv1packages.json\" />\n<EmbeddedResource Include=\"OData\\QueryAllowed\\Data\\apiv1search.json\" />\n<EmbeddedResource Include=\"OData\\QueryAllowed\\Data\\apiv2getupdates.json\" />\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/PackageDeleteService.cs", "new_path": "src/NuGetGallery/Services/PackageDeleteService.cs", "diff": "@@ -85,6 +85,7 @@ public async Task SoftDeletePackagesAsync(IEnumerable<Package> packages, User de\n{\npackage.Listed = false;\npackage.Deleted = true;\n+ package.PackageStatusKey = PackageStatus.Deleted;\npackageDelete.Packages.Add(package);\nawait _auditingService.SaveAuditRecordAsync(CreateAuditRecord(package, package.PackageRegistration, AuditedPackageAction.SoftDelete, reason));\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Core.Facts/NuGetGallery.Core.Facts.csproj", "new_path": "tests/NuGetGallery.Core.Facts/NuGetGallery.Core.Facts.csproj", "diff": "<Compile Include=\"Entities\\PackageFacts.cs\" />\n<Compile Include=\"Entities\\UserFacts.cs\" />\n<Compile Include=\"Entities\\UserSecurityPolicyFacts.cs\" />\n+ <Compile Include=\"PackageStatusFacts.cs\" />\n<Compile Include=\"Packaging\\ManifestValidatorFacts.cs\" />\n<Compile Include=\"Packaging\\PackageIdValidatorTest.cs\" />\n<Compile Include=\"Packaging\\PackageMetadataFacts.cs\" />\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Services/PackageDeleteServiceFacts.cs", "new_path": "tests/NuGetGallery.Facts/Services/PackageDeleteServiceFacts.cs", "diff": "@@ -122,6 +122,7 @@ public async Task WillUpdateThePackage()\nAssert.False(package.Listed);\nAssert.True(package.Deleted);\n+ Assert.Equal(PackageStatus.Deleted, package.PackageStatusKey);\n}\n[Fact]\n@@ -156,6 +157,7 @@ public async Task WillUpdateThePackageRepository()\nawait service.SoftDeletePackagesAsync(new[] { package }, user, string.Empty, string.Empty);\nAssert.True(package.Deleted);\n+ Assert.Equal(PackageStatus.Deleted, package.PackageStatusKey);\npackageRepository.Verify(x => x.CommitChangesAsync());\npackageDeleteRepository.Verify(x => x.InsertOnCommit(It.IsAny<PackageDelete>()));\npackageDeleteRepository.Verify(x => x.CommitChangesAsync());\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add package status column and migration (#4664) Address https://github.com/NuGet/NuGetGallery/issues/4644
455,759
15.09.2017 10:09:07
-7,200
5d868b43d58cbda4bcef553b0b3026b4534713c9
Fix missing test containers on CuratedFeedsControllerFacts
[ { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/CuratedFeedsControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/CuratedFeedsControllerFacts.cs", "diff": "@@ -42,7 +42,6 @@ public TestableCuratedFeedsController()\nTestUtility.SetupHttpContextMockForUrlGeneration(httpContext, this);\nthis.SetCurrentUser(Fakes.User);\n-\n}\npublic CuratedFeed StubCuratedFeed { get; set; }\n@@ -61,6 +60,7 @@ protected internal override T GetService<T>()\n}\npublic class TheGetCuratedFeedAction\n+ : TestContainer\n{\n[Fact]\npublic void WillReturn404IfTheCuratedFeedDoesNotExist()\n@@ -178,6 +178,7 @@ public void WillPassTheExcludedPackagesToTheView()\n}\npublic class TheListPackagesAction\n+ : TestContainer\n{\n[Fact]\npublic async Task WillSearchForAPackage()\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix missing test containers on CuratedFeedsControllerFacts
455,773
28.07.2017 09:40:33
25,200
f1d02cdc37c0cd82c3826d31efa17a42da343b0c
Retrieval and Display for READMEs on Display Packages page
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Entities/Package.cs", "new_path": "src/NuGetGallery.Core/Entities/Package.cs", "diff": "@@ -127,7 +127,23 @@ public Package()\n/// <summary>\n/// Signifies whether or not ReadMe exists (optimization for pulling from blob storage)\n/// </summary>\n- public bool? HasReadMe { get; set; }\n+ [Column(\"HasReadMe\")]\n+ public bool? HasReadMeInternal { get; set; }\n+\n+ /// <summary>\n+ /// Signifies whether or not the ReadMe exists by treating falses as nulls to avoid updating existing rows in the DB\n+ /// </summary>\n+ [NotMapped]\n+ public bool HasReadMe {\n+ get\n+ {\n+ return HasReadMeInternal ?? false;\n+ }\n+ set\n+ {\n+ HasReadMeInternal = value ? (bool?)true : null;\n+ }\n+ }\npublic bool RequiresLicenseAcceptance { get; set; }\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Start/AppActivator.cs", "new_path": "src/NuGetGallery/App_Start/AppActivator.cs", "diff": "@@ -206,6 +206,7 @@ private static void BundlingPostStart()\nBundleTable.Bundles.Add(homeScriptBundle);\nvar displayPackageScriptBundle = new ScriptBundle(\"~/Scripts/gallery/page-display-package.min.js\")\n+ .Include(\"~/Scripts/gallery/clamp.js\")\n.Include(\"~/Scripts/gallery/page-display-package.js\");\nBundleTable.Bundles.Add(displayPackageScriptBundle);\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Constants.cs", "new_path": "src/NuGetGallery/Constants.cs", "diff": "@@ -37,13 +37,16 @@ public static class Constants\npublic const string OctetStreamContentType = \"application/octet-stream\";\npublic const string TextContentType = \"text/plain\";\npublic const string NuGetPackageFileExtension = \".nupkg\";\n+ public const string MarkdownFileExtension = \".md\";\n+ public const string HtmlFileExtension = \".html\";\npublic const string PackageFileDownloadUriTemplate = \"packages/{0}/{1}/download\";\npublic const string PackageFileSavePathTemplate = \"{0}.{1}{2}\";\n- public const string ReadMeFileSavePathTemplatePending = \"pending/{0}/{1}{2}\";\npublic const string ReadMeFileSavePathTemplateActive = \"active/{0}/{1}{2}\";\n+ public const string ReadMeFileSavePathTemplatePending = \"pending/{0}/{1}{2}\";\npublic const string PackageFileBackupSavePathTemplate = \"{0}/{1}/{2}.{3}\";\npublic const string PackagesFolderName = \"packages\";\n+ public const string PackagesReadMeFolderName = \"readmes\";\npublic const string PackageBackupsFolderName = \"package-backups\";\npublic const string DownloadsFolderName = \"downloads\";\npublic const string ContentFolderName = \"content\";\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/PackagesController.cs", "new_path": "src/NuGetGallery/Controllers/PackagesController.cs", "diff": "@@ -444,6 +444,25 @@ public virtual async Task<ActionResult> DisplayPackage(string id, string version\nvar model = new DisplayPackageViewModel(package, packageHistory);\n+ if (package.HasReadMe)\n+ {\n+ using (var readmeStream = await _packageFileService.DownloadReadmeFileAsync(package, Constants.HtmlFileExtension))\n+ {\n+ if (readmeStream != null)\n+ {\n+ // Reads the README file and push to the view\n+ using (var reader = new StreamReader(readmeStream, Encoding.UTF8))\n+ {\n+ model.ReadMeHtml = await reader.ReadToEndAsync();\n+ }\n+ }\n+ else if (User.IsInRole(Constants.AdminRoleName) || package.IsOwner(User))\n+ {\n+ TempData[\"Message\"] = \"The ReadMe for this package could not be found\";\n+ }\n+ }\n+ }\n+\nif (package.IsOwner(User))\n{\n// Tell logged-in package owners not to cache the package page,\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/page-display-package.js", "new_path": "src/NuGetGallery/Scripts/gallery/page-display-package.js", "diff": "@@ -15,6 +15,30 @@ $(function () {\n});\n}\n+ $clamp(document.getElementById(\"readme-clamped\"),\n+ { clamp: 10 });\n+ var readmeClamped = $(\"#readme-clamped\");\n+ $(\"#show-readme-original\").click(function () {\n+ readmeClamped.collapse(\"toggle\");\n+ });\n+\n+ readmeClamped.on('hide.bs.collapse', function (e) {\n+ e.stopPropagation();\n+ });\n+ readmeClamped.on('show.bs.collapse', function (e) {\n+ e.stopPropagation();\n+ });\n+\n+ window.nuget.configureExpander(\n+ \"readme-original\",\n+ \"CalculatorAddition\",\n+ \"Show less\",\n+ \"CalculatorSubtract\",\n+ \"Show more\");\n+\n+ window.nuget.configureExpanderHeading(\n+ \"readme-container\");\n+\nwindow.nuget.configureExpanderHeading(\"dependency-groups\");\nwindow.nuget.configureExpanderHeading(\"version-history\");\nwindow.nuget.configureExpander(\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/CloudBlobFileStorageService.cs", "new_path": "src/NuGetGallery/Services/CloudBlobFileStorageService.cs", "diff": "@@ -145,6 +145,7 @@ private async Task<ICloudBlobContainer> GetContainer(string folderName)\nswitch (folderName)\n{\ncase Constants.PackagesFolderName:\n+ case Constants.PackagesReadMeFolderName:\ncase Constants.PackageBackupsFolderName:\ncase Constants.DownloadsFolderName:\ncreationTask = PrepareContainer(folderName, isPublic: true);\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/IPackageFileService.cs", "new_path": "src/NuGetGallery/Services/IPackageFileService.cs", "diff": "@@ -45,5 +45,10 @@ public interface IPackageFileService\n/// Downloads the package from the file storage and reads it into a Stream asynchronously.\n/// </summary>\nTask<Stream> DownloadPackageFileAsync(Package packge);\n+\n+ /// <summary>\n+ /// Downloads the README from the file storage and reads it into a Stream asynchronously.\n+ /// </summary>\n+ Task<Stream> DownloadReadmeFileAsync(Package package, string extension);\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/PackageFileService.cs", "new_path": "src/NuGetGallery/Services/PackageFileService.cs", "diff": "@@ -109,7 +109,16 @@ public async Task<Stream> DownloadPackageFileAsync(Package package)\nreturn (await _fileStorageService.GetFileAsync(Constants.PackagesFolderName, fileName));\n}\n- private static string BuildFileName(string id, string version, string formatter, string fileExtension)\n+ public Task<Stream> DownloadReadmeFileAsync(Package package, string extension)\n+ {\n+ if (package == null)\n+ {\n+ throw new ArgumentNullException(\"Package cannot be null!\");\n+ }\n+ var fileName = BuildFileName(package, Constants.ReadMeFileSavePathTemplateActive, extension);\n+ return _fileStorageService.GetFileAsync(Constants.PackagesReadMeFolderName, fileName);\n+ }\n+ private static string BuildFileName(string id, string version, string pathTemplate, string extension)\n{\nif (id == null)\n{\n@@ -127,14 +136,14 @@ private static string BuildFileName(string id, string version, string formatter,\n// c) we don't want to hit the database just to look up the right case\n// and remember - version can contain letters too.\nreturn String.Format(\n- CultureInfo.InvariantCulture,\n- formatter,\n+ CultureInfo.InvariantCulture\n+ pathTemplate,\nid.ToLowerInvariant(),\nversion.ToLowerInvariant(),\n- fileExtension);\n+ extension);\n}\n- private static string BuildFileName(Package package, string formatter, string fileExtension)\n+ private static string BuildFileName(Package package, string formatter, string extension)\n{\nif (package == null)\n{\n@@ -150,9 +159,9 @@ private static string BuildFileName(Package package, string formatter, string fi\nreturn BuildFileName(\npackage.PackageRegistration.Id,\n- String.IsNullOrEmpty(package.NormalizedVersion) ?\n+ string.IsNullOrEmpty(package.NormalizedVersion) ?\nNuGetVersionFormatter.Normalize(package.Version) :\n- package.NormalizedVersion, formatter, fileExtension);\n+ package.NormalizedVersion, formatter, extension);\n}\nprivate static string BuildBackupFileName(string id, string version, string hash)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/DisplayPackageViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/DisplayPackageViewModel.cs", "diff": "@@ -70,7 +70,7 @@ public void SetPendingMetadata(PackageEdit pendingMetadata)\npublic DependencySetsViewModel Dependencies { get; set; }\npublic IEnumerable<DisplayPackageViewModel> PackageVersions { get; set; }\npublic string Copyright { get; set; }\n-\n+ public string ReadMeHtml { get; set; }\npublic bool HasPendingMetadata { get; private set; }\npublic bool IsLastEditFailed { get; private set; }\npublic DateTime? LastEdited { get; set; }\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "</div>\n</div>\n+ @if (Model.ReadMeHtml != null)\n+ {\n+ <div id=\"readme-collapser-container\">\n+ <h2>\n+ <a href=\"#\" role=\"button\" data-toggle=\"collapse\" data-target=\"#readme-container\"\n+ aria-expanded=\"true\" aria-controls=\"readme-container\" id=\"show-readme-container\">\n+ <i class=\"ms-Icon ms-Icon--ChevronDown\" aria-hidden=\"true\"></i>\n+ <span>Documentation</span>\n+ </a>\n+ </h2>\n+ </div>\n+ <div id=\"readme-container\" class=\"collapse in\">\n+ <div id=\"readme-clamped\" class=\"collapse in\">\n+ @Html.Raw(Model.ReadMeHtml)\n+ </div>\n+ <script type=\"text/javascript\">\n+ readmeClamp.setAttribute(\"class\", \"collapse in\");\n+ </script>\n+ <div id=\"readme-original\" class=\"collapse\">\n+ @Html.Raw(Model.ReadMeHtml)\n+ </div>\n+\n+ <button class=\"btn btn-link btn-expander\" id=\"show-readme-original\" aria-expanded=\"false\"\n+ aria-controls=\"readme-original\" type=\"button\" data-toggle=\"collapse\" data-target=\"#readme-original\">\n+ <i class=\"ms-Icon ms-Icon--CalculatorAddition\" aria-hidden=\"true\"></i>\n+ <span>Show more</span>\n+ </button>\n+ </div>\n+ }\n+\n+\n@if (!String.IsNullOrWhiteSpace(Model.ReleaseNotes))\n{\n<h2>Release Notes</h2>\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs", "diff": "using System.IO;\nusing System.Linq;\nusing System.Net.Mail;\n+using System.Text;\nusing System.Threading.Tasks;\nusing System.Web;\nusing System.Web.Mvc;\n@@ -486,6 +487,43 @@ public async Task GivenAValidPackageWithNoVersionThatTheCurrentUserDoesNotOwnItD\nAssert.Equal(\"Foo\", model.Id);\nAssert.Equal(\"1.1.1\", model.Version);\nAssert.Equal(\"A test package!\", model.Title);\n+ Assert.Null(model.ReadMeHtml);\n+ }\n+\n+ [Fact]\n+ public async Task GivenAValidPackageWithReadMeItDisplaysReadMe()\n+ {\n+ //Arrange\n+ var readMeStream = new MemoryStream(Encoding.UTF8.GetBytes(\"<p>Hello World!</p>\"));\n+\n+ //Act\n+ var result = await GetDisplayPackageResultWithReadMeStream(readMeStream, true);\n+\n+ // Assert\n+ var model = ResultAssert.IsView<DisplayPackageViewModel>(result);\n+ Assert.Equal(\"<p>Hello World!</p>\", model.ReadMeHtml);\n+ }\n+\n+ [Fact]\n+ public async Task GivenAPackageWithReadMeHandlesFailedDownload()\n+ {\n+ //Arrange and Act\n+ var result = await GetDisplayPackageResultWithReadMeStream((Stream)null, true);\n+\n+ //Assert\n+ var model = ResultAssert.IsView<DisplayPackageViewModel>(result);\n+ Assert.Null(model.ReadMeHtml);\n+ }\n+\n+ [Fact]\n+ public async Task GivenAPackageWithNoReadMeShowsThatReadMeIsEmpty()\n+ {\n+ // Arrange and Act\n+ var result = await GetDisplayPackageResultWithReadMeStream((Stream)null, false);\n+\n+ //Assert\n+ var model = ResultAssert.IsView<DisplayPackageViewModel>(result);\n+ Assert.Null(model.ReadMeHtml);\n}\n}\n@@ -2307,6 +2345,41 @@ public async Task IndexingAndPackageServicesAreUpdated()\nAssert.Equal(@\"~\\Bar.cshtml\", ((RedirectResult)result).Url);\n}\n}\n+\n+ private static async Task<ActionResult> GetDisplayPackageResultWithReadMeStream(Stream readMeHtmlStream, bool hasReadMe)\n+ {\n+ var packageService = new Mock<IPackageService>();\n+ var indexingService = new Mock<IIndexingService>();\n+ var fileService = new Mock<IPackageFileService>();\n+ var controller = CreateController(\n+ packageService: packageService, indexingService: indexingService, packageFileService: fileService);\n+ controller.SetCurrentUser(TestUtility.FakeUser);\n+\n+ var package = new Package()\n+ {\n+ PackageRegistration = new PackageRegistration()\n+ {\n+ Id = \"Foo\",\n+ Owners = new List<User>()\n+ },\n+ Version = \"01.1.01\",\n+ NormalizedVersion = \"1.1.1\",\n+ Title = \"A test package!\",\n+ HasReadMe = hasReadMe\n+ };\n+\n+ packageService.Setup(p => p.FindPackageByIdAndVersion(It.Is<string>(s => s == \"Foo\"), It.Is<string>(s => s == null), It.Is<int>(i => i == SemVerLevelKey.SemVer2), It.Is<bool>(b => b == true)))\n+ .Returns(package);\n+\n+ indexingService.Setup(i => i.GetLastWriteTime()).Returns(Task.FromResult((DateTime?)DateTime.UtcNow));\n+\n+ if (hasReadMe)\n+ {\n+ fileService.Setup(f => f.DownloadReadmeFileAsync(It.IsAny<Package>(), It.IsAny<string>())).Returns(Task.FromResult(readMeHtmlStream));\n+ }\n+\n+ return await controller.DisplayPackage(\"Foo\", /*version*/null);\n+ }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Services/PackageFileServiceFacts.cs", "new_path": "tests/NuGetGallery.Facts/Services/PackageFileServiceFacts.cs", "diff": "using System;\nusing System.Collections.Generic;\nusing System.IO;\n+using System.Text;\nusing System.Threading.Tasks;\nusing System.Web;\nusing System.Web.Mvc;\n@@ -59,7 +60,7 @@ public async Task WillDeleteTheFileViaTheFileStorageServiceUsingAFileNameWithIdA\n{\nvar fileStorageSvc = new Mock<IFileStorageService>();\nvar service = CreateService(fileStorageSvc: fileStorageSvc);\n- fileStorageSvc.Setup(x => x.DeleteFileAsync(It.IsAny<string>(), BuildFileName(\"theId\", \"theVersion\")))\n+ fileStorageSvc.Setup(x => x.DeleteFileAsync(It.IsAny<string>(), BuildFileName(\"theId\", \"theVersion\", Constants.NuGetPackageFileExtension, Constants.PackageFileSavePathTemplate)))\n.Completes()\n.Verifiable();\n@@ -138,7 +139,7 @@ public async Task WillGetAResultFromTheFileStorageServiceUsingAFileNameWithIdAnd\n{\nvar fileStorageSvc = new Mock<IFileStorageService>();\nvar service = CreateService(fileStorageSvc: fileStorageSvc);\n- fileStorageSvc.Setup(x => x.CreateDownloadFileActionResultAsync(new Uri(\"http://fake\"), It.IsAny<string>(), BuildFileName(\"theId\", \"theNormalizedVersion\")))\n+ fileStorageSvc.Setup(x => x.CreateDownloadFileActionResultAsync(new Uri(\"http://fake\"), It.IsAny<string>(), BuildFileName(\"theId\", \"theNormalizedVersion\", Constants.NuGetPackageFileExtension, Constants.PackageFileSavePathTemplate)))\n.CompletesWithNull()\n.Verifiable();\n@@ -154,7 +155,7 @@ public async Task WillUseNormalizedRegularVersionIfNormalizedVersionMissing()\nvar service = CreateService(fileStorageSvc: fileStorageSvc);\nvar packageRegistraion = new PackageRegistration { Id = \"theId\" };\nvar package = new Package { PackageRegistration = packageRegistraion, NormalizedVersion = null, Version = \"01.01.01\" };\n- fileStorageSvc.Setup(x => x.CreateDownloadFileActionResultAsync(new Uri(\"http://fake\"), It.IsAny<string>(), BuildFileName(\"theId\", \"1.1.1\")))\n+ fileStorageSvc.Setup(x => x.CreateDownloadFileActionResultAsync(new Uri(\"http://fake\"), It.IsAny<string>(), BuildFileName(\"theId\", \"1.1.1\",Constants.NuGetPackageFileExtension, Constants.PackageFileSavePathTemplate)))\n.CompletesWithNull()\n.Verifiable();\n@@ -246,7 +247,7 @@ public async Task WillUseNormalizedRegularVersionIfNormalizedVersionMissing()\nvar service = CreateService(fileStorageSvc: fileStorageSvc);\nvar packageRegistraion = new PackageRegistration { Id = \"theId\" };\nvar package = new Package { PackageRegistration = packageRegistraion, NormalizedVersion = null, Version = \"01.01.01\" };\n- fileStorageSvc.Setup(x => x.SaveFileAsync(It.IsAny<string>(), BuildFileName(\"theId\", \"1.1.1\"), It.IsAny<Stream>(), It.Is<bool>(b => !b)))\n+ fileStorageSvc.Setup(x => x.SaveFileAsync(It.IsAny<string>(), BuildFileName(\"theId\", \"1.1.1\",Constants.NuGetPackageFileExtension, Constants.PackageFileSavePathTemplate), It.IsAny<Stream>(), It.Is<bool>(b => !b)))\n.Completes()\n.Verifiable();\n@@ -274,7 +275,7 @@ public async Task WillSaveTheFileViaTheFileStorageServiceUsingAFileNameWithIdAnd\n{\nvar fileStorageSvc = new Mock<IFileStorageService>();\nvar service = CreateService(fileStorageSvc: fileStorageSvc);\n- fileStorageSvc.Setup(x => x.SaveFileAsync(It.IsAny<string>(), BuildFileName(\"theId\", \"theNormalizedVersion\"), It.IsAny<Stream>(), It.Is<bool>(b => !b)))\n+ fileStorageSvc.Setup(x => x.SaveFileAsync(It.IsAny<string>(), BuildFileName(\"theId\", \"theNormalizedVersion\", Constants.NuGetPackageFileExtension, Constants.PackageFileSavePathTemplate), It.IsAny<Stream>(), It.Is<bool>(b => !b)))\n.Completes()\n.Verifiable();\n@@ -432,15 +433,73 @@ public async Task WillSaveTheFileStreamViaTheFileStorageService()\n}\n}\n+ public class TheDownloadReadMeFileAsyncMethod\n+ {\n+ [Fact]\n+ public async Task WillDownloadReadMeAsync()\n+ {\n+ using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(\"<p>Hello World!</p>\")))\n+ {\n+ //Arrange\n+ var fileStorageSvc = new Mock<IFileStorageService>();\n+ var service = CreateService(fileStorageSvc: fileStorageSvc);\n+\n+ var package = new Package()\n+ {\n+ PackageRegistration = new PackageRegistration()\n+ {\n+ Id = \"Foo\",\n+ },\n+ Version = \"01.1.01\",\n+ };\n+ fileStorageSvc.Setup(f => f.GetFileAsync(It.IsAny<string>(), It.IsAny<string>())).Returns(Task.FromResult((Stream)stream)).Verifiable();\n+\n+ //Act\n+ var result = await service.DownloadReadmeFileAsync(package, Constants.HtmlFileExtension);\n+ using (var reader = new StreamReader(result))\n+ {\n+ //Assert\n+ Assert.Equal(\"<p>Hello World!</p>\", await reader.ReadToEndAsync());\n+ fileStorageSvc.Verify(f => f.GetFileAsync(Constants.PackagesReadMeFolderName, \"active/foo/1.1.1.html\"), Times.Once);\n+ }\n+ }\n+ }\n+\n+ [Fact]\n+ public async Task FailedDownloadOfReadMeResultsInNullValue()\n+ {\n+ //Arrange\n+ var fileStorageSvc = new Mock<IFileStorageService>();\n+ var service = CreateService(fileStorageSvc: fileStorageSvc);\n+\n+ var package = new Package()\n+ {\n+ PackageRegistration = new PackageRegistration()\n+ {\n+ Id = \"Foo\",\n+ },\n+ Version = \"01.1.01\",\n+ };\n+ fileStorageSvc.Setup(f => f.GetFileAsync(It.IsAny<string>(), It.IsAny<string>())).Returns(Task.FromResult((Stream)null)).Verifiable();\n+\n+ //Act\n+ var result = await service.DownloadReadmeFileAsync(package, Constants.HtmlFileExtension);\n+\n+ //Assert\n+ Assert.Null(result);\n+ fileStorageSvc.Verify(f => f.GetFileAsync(Constants.PackagesReadMeFolderName, \"active/foo/1.1.1.html\"), Times.Once);\n+ }\n+ }\n+\nstatic string BuildFileName(\nstring id,\n- string version)\n+ string version, string extension, string path)\n{\nreturn string.Format(\n- Constants.PackageFileSavePathTemplate,\n+ path,\nid.ToLowerInvariant(),\nNuGetVersionFormatter.Normalize(version).ToLowerInvariant(), // No matter what ends up getting passed in, the version should be normalized\n- Constants.NuGetPackageFileExtension);\n+ extension);\n}\nprivate static string BuildBackupFileName(string id, string version, string hash)\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Retrieval and Display for READMEs on Display Packages page (#4414)
455,737
15.09.2017 15:52:51
25,200
6433e5aac2fada3c322f0d037696dc4ff8aed6dc
Re-add build information to footer Adjust viewhelper for showing build information to a comment. Hide it in footer.
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "new_path": "src/NuGetGallery/App_Code/ViewHelpers.cshtml", "diff": "var config = DependencyResolver.Current.GetService<IGalleryConfigurationService>();\nstring brand = config == null ? \"\" : config.Current.Brand;\n- <p id=\"releaseTag\">\n- This is the @brand\n+<!--\n@if (ver.Present)\n{\n- @: version @ver.Version.\n+ @:This is the @brand version @ver.Version.\nif(!String.IsNullOrEmpty(ver.ShortCommit)) {\n- <text>\n- Deployed from\n- @if(ver.CommitUri != null) {\n- @: <a href=\"@ver.CommitUri.AbsoluteUri.Replace(\"git://github.com\", \"https://github.com\")\">@ver.ShortCommit</a>.\n- } else {\n- @: @ver.ShortCommit.\n- }\n- </text>\n+ @:Deployed from @ver.ShortCommit Link: @(ver.CommitUri != null ? ver.CommitUri.AbsoluteUri.Replace(\"git://github.com\", \"https://github.com\") : \"\")\n}\nif(!String.IsNullOrEmpty(ver.Branch)) {\n- <text>\n- Built on\n- @if(ver.BranchUri != null) {\n- @:<a href=\"@ver.BranchUri.AbsoluteUri\" title=\"View the branch.\">@ver.Branch</a>.\n- } else {\n- @: @ver.Branch.\n- }\n- </text>\n+ @:Built on @ver.Branch Link: @(ver.BranchUri != null ? ver.BranchUri.AbsoluteUri : \"\")\n}\nif(ver.BuildDateUtc != DateTime.MinValue) {\n- @: Built on <span class=\"s-localtime\" data-utc=\"@ver.BuildDateUtc.ToString(\"O\")\" title=\"@ver.BuildDateUtc.ToString(\"O\")\">@ver.BuildDateUtc.ToNuGetShortDateString()</span>.\n+ @:Built on @ver.BuildDateUtc.ToString(\"O\")\n}\n} else {\n- @:.\n+ @:This is the @brand\n}\n-\n+ You are on @HostMachine.Name.\n+-->\n@* A little quick-n-dirty code to display the current machine *@\n@* In Azure, we want the Instance ID. The Machine Name is total garbage *@\n- You are on @HostMachine.Name.\n- </p>\n}\n@helper AnalyticsScript()\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/Gallery/Footer.cshtml", "new_path": "src/NuGetGallery/Views/Shared/Gallery/Footer.cshtml", "diff": "</div>\n</div>\n</div>\n+@ViewHelpers.ReleaseTag()\n</footer>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Re-add build information to footer #4692 Adjust viewhelper for showing build information to a comment. Hide it in footer.
455,737
15.09.2017 15:53:19
25,200
4fc634138170974b2d3698cf82638dafcf5927cf
Fix an issue with a check on dependency set length that always failed.
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/_EditMetadata.cshtml", "new_path": "src/NuGetGallery/Views/Packages/_EditMetadata.cshtml", "diff": "<div class=\"verify-package-field form-group readonly\">\n<div class=\"verify-package-field-heading\">Dependencies</div>\n- <!-- ko if: $data.Dependencies && $data.Dependencies.DependencySets.length > 0 -->\n+ <!-- ko if: $data.Dependencies && Object.keys($data.Dependencies.DependencySets).length > 0 -->\n<div data-bind=\"template: {name: 'display-dependencysets', data: { DependencySets: Dependencies.DependencySets, OnlyHasAllFrameworks: Dependencies.OnlyHasAllFrameworks }}\"></div>\n<!-- /ko -->\n- <!-- ko ifnot: $data.Dependencies && $data.Dependencies.DependencySets.length > 0 -->\n+ <!-- ko ifnot: $data.Dependencies && Object.keys($data.Dependencies.DependencySets).length > 0 -->\n<p><i>(none specified)</i></p>\n<!-- /ko -->\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix an issue with a check on dependency set length that always failed. (#4685)
455,772
18.09.2017 14:47:26
25,200
ae962c79d2003e41bcbbc76e19b0f3f90c4e589f
Don't use Azure in web.config by default
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Web.config", "new_path": "src/NuGetGallery/Web.config", "diff": "<!-- DEPLOYMENT SPECIFIC -->\n<!-- ******************* -->\n<!-- These should change on every deployment (to rotate credentials, etc.) -->\n- <add key=\"Gallery.StorageType\" value=\"AzureStorage\" />\n+ <add key=\"Gallery.StorageType\" value=\"FileSystem\" />\n<!-- The storage type to use. Can be FileSystem (default) or AzureStorage -->\n- <!--<add key=\"Gallery.AzureStorageConnectionString\" value=\"UseDevelopmentStorage=true\" />-->\n- <add key=\"Gallery.AzureStorage.Auditing.ConnectionString\" value=\"UseDevelopmentStorage=true\" />\n- <add key=\"Gallery.AzureStorage.Content.ConnectionString\" value=\"UseDevelopmentStorage=true\" />\n- <add key=\"Gallery.AzureStorage.Errors.ConnectionString\" value=\"UseDevelopmentStorage=true\" />\n- <add key=\"Gallery.AzureStorage.NuGetExe.ConnectionString\" value=\"UseDevelopmentStorage=true\" />\n- <add key=\"Gallery.AzureStorage.Packages.ConnectionString\" value=\"UseDevelopmentStorage=true\" />\n- <add key=\"Gallery.AzureStorage.Statistics.ConnectionString\" value=\"UseDevelopmentStorage=true\" />\n- <add key=\"Gallery.AzureStorage.Uploads.ConnectionString\" value=\"UseDevelopmentStorage=true\" />\n+ <add key=\"Gallery.AzureStorage.Auditing.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Content.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Errors.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.NuGetExe.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Packages.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Statistics.ConnectionString\" value=\"\" />\n+ <add key=\"Gallery.AzureStorage.Uploads.ConnectionString\" value=\"\" />\n<!-- The various Azure Storage connection strings to use. If the Gallery.StorageType is AzureStorage, all must be defined. -->\n<add key=\"Gallery.AzureStorageReadAccessGeoRedundant\" value=\"false\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Don't use Azure in web.config by default (#4700)
455,759
19.09.2017 19:43:25
-7,200
4a70f23597465b6dc2233e2606744c0f881ee579
Pretty-print API key expiration time.
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Filters/ApiAuthorizeAttribute.cs", "new_path": "src/NuGetGallery/Filters/ApiAuthorizeAttribute.cs", "diff": "@@ -49,7 +49,7 @@ public override void OnAuthorization(AuthorizationContext filterContext)\n// about to expire warning\nfilterContext.HttpContext.Response.Headers.Add(\nConstants.WarningHeaderName,\n- string.Format(CultureInfo.InvariantCulture, Strings.WarningApiKeyAboutToExpire, expirationPeriod.TotalDays, accountUrl));\n+ string.Format(CultureInfo.InvariantCulture, Strings.WarningApiKeyAboutToExpire, Math.Round(expirationPeriod.TotalDays, 0), accountUrl));\n}\n}\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Pretty-print API key expiration time. (#4702)
455,736
19.09.2017 13:49:06
25,200
e662cfd4ad6d3171b2af15d672c0412b001870bd
Fix improper word breaking in long text fields Fix
[ { "change_type": "MODIFY", "old_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "new_path": "src/Bootstrap/dist/css/bootstrap-theme.css", "diff": "@@ -254,8 +254,11 @@ img.package-icon {\nmargin-left: 20px;\n}\n.break-word {\n- word-break: break-all;\n+ word-break: normal;\nword-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n#edit-metadata-form-container .loading:after {\ndisplay: inline-block;\n@@ -325,13 +328,16 @@ img.package-icon {\npadding-top: 15px;\npadding-bottom: 15px;\nfont-size: 15px;\n+ word-break: normal;\n+ word-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n.list-packages .package .package-header .package-title {\nfont-size: 24px;\nfont-weight: 300;\nline-height: .9;\n- word-break: break-all;\n- word-break: break-word;\n}\n.list-packages .package .package-header .reserved-indicator {\nwidth: 20px;\n@@ -361,8 +367,6 @@ img.package-icon {\nmargin-top: 8px;\nline-height: 20px;\ncolor: #000;\n- word-break: break-all;\n- word-break: break-word;\n}\n@media (min-width: 768px) {\n.list-packages .package .package-list {\n@@ -386,8 +390,11 @@ img.package-icon {\nvertical-align: middle;\n}\n.user-package-list .manage-package-listing .package-id {\n- word-break: break-all;\n+ word-break: normal;\nword-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n@media (min-width: 768px) {\n.user-package-list .manage-package-listing .package-controls {\n@@ -602,8 +609,11 @@ img.package-icon {\nwidth: 25px;\n}\n.page-package-details .package-details-main {\n- word-break: break-all;\n+ word-break: normal;\nword-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n.page-package-details .package-details-info .ms-Icon-ul li {\nmargin-bottom: 15px;\n@@ -796,8 +806,11 @@ img.package-icon {\nmargin-bottom: 33px;\n}\n.page-list-packages .row-heading .cell-heading h1 {\n- word-break: break-all;\n+ word-break: normal;\nword-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n@media (min-width: 992px) {\n.page-list-packages .row-heading {\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/base.less", "new_path": "src/Bootstrap/less/theme/base.less", "diff": "@@ -325,6 +325,8 @@ img.package-icon {\n}\n.break-word {\n- word-break: break-all;\n+ overflow-wrap: break-word;\n+ word-wrap: break-word;\n+ word-break: normal;\nword-break: break-word;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/Bootstrap/less/theme/common-list-packages.less", "new_path": "src/Bootstrap/less/theme/common-list-packages.less", "diff": ".list-packages {\n.package {\n+ .break-word;\npadding-top: (@padding-large-vertical * 1.5);\npadding-bottom: (@padding-large-vertical * 1.5);\nfont-size: 15px;\n.package-header {\n.package-title {\n- .break-word;\nfont-size: 24px;\nfont-weight: 300;\nline-height: 0.9;\n}\n.package-details {\n- .break-word;\nmargin-top: 8px;\ncolor: @text-color;\nline-height: 20px;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "new_path": "src/NuGetGallery/Content/gallery/css/bootstrap-theme.css", "diff": "@@ -254,8 +254,11 @@ img.package-icon {\nmargin-left: 20px;\n}\n.break-word {\n- word-break: break-all;\n+ word-break: normal;\nword-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n#edit-metadata-form-container .loading:after {\ndisplay: inline-block;\n@@ -325,13 +328,16 @@ img.package-icon {\npadding-top: 15px;\npadding-bottom: 15px;\nfont-size: 15px;\n+ word-break: normal;\n+ word-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n.list-packages .package .package-header .package-title {\nfont-size: 24px;\nfont-weight: 300;\nline-height: .9;\n- word-break: break-all;\n- word-break: break-word;\n}\n.list-packages .package .package-header .reserved-indicator {\nwidth: 20px;\n@@ -361,8 +367,6 @@ img.package-icon {\nmargin-top: 8px;\nline-height: 20px;\ncolor: #000;\n- word-break: break-all;\n- word-break: break-word;\n}\n@media (min-width: 768px) {\n.list-packages .package .package-list {\n@@ -386,8 +390,11 @@ img.package-icon {\nvertical-align: middle;\n}\n.user-package-list .manage-package-listing .package-id {\n- word-break: break-all;\n+ word-break: normal;\nword-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n@media (min-width: 768px) {\n.user-package-list .manage-package-listing .package-controls {\n@@ -602,8 +609,11 @@ img.package-icon {\nwidth: 25px;\n}\n.page-package-details .package-details-main {\n- word-break: break-all;\n+ word-break: normal;\nword-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n.page-package-details .package-details-info .ms-Icon-ul li {\nmargin-bottom: 15px;\n@@ -796,8 +806,11 @@ img.package-icon {\nmargin-bottom: 33px;\n}\n.page-list-packages .row-heading .cell-heading h1 {\n- word-break: break-all;\n+ word-break: normal;\nword-break: break-word;\n+ word-wrap: break-word;\n+\n+ overflow-wrap: break-word;\n}\n@media (min-width: 992px) {\n.page-list-packages .row-heading {\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix improper word breaking in long text fields (#4704) Fix https://github.com/NuGet/NuGetGallery/issues/4676
455,759
20.09.2017 20:07:39
-7,200
09426aba4f1437ce6bf059f1c43e5fce3d60dddf
Fix DisplayPackageViewModel.HasNewerPrerelease
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/DisplayPackageViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/DisplayPackageViewModel.cs", "diff": "@@ -82,7 +82,11 @@ public bool HasNewerPrerelease\n{\nget\n{\n- return PackageVersions.Any(pv => pv.LatestVersion && !pv.LatestStableVersion);\n+ var latestPrereleaseVersion = PackageVersions\n+ .Where(pv => pv.Prerelease)\n+ .Max(pv => pv.NuGetVersion);\n+\n+ return latestPrereleaseVersion > NuGetVersion;\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/ViewModels/PackageViewModel.cs", "new_path": "src/NuGetGallery/ViewModels/PackageViewModel.cs", "diff": "@@ -15,6 +15,8 @@ public class PackageViewModel : IPackageVersionModel\nprivate string _pendingTitle;\nprivate string _fullVersion;\n+ internal readonly NuGetVersion NuGetVersion;\n+\npublic PackageViewModel(Package package)\n{\n_package = package;\n@@ -26,7 +28,9 @@ public PackageViewModel(Package package)\nNuGetVersionFormatter.Normalize(package.Version) :\npackage.NormalizedVersion;\n- HasSemVer2Version = NuGetVersion.Parse(_fullVersion).IsSemVer2;\n+ NuGetVersion = NuGetVersion.Parse(_fullVersion);\n+\n+ HasSemVer2Version = NuGetVersion.IsSemVer2;\nHasSemVer2Dependency = package.Dependencies.ToList()\n.Where(pd => !string.IsNullOrEmpty(pd.VersionSpec))\n.Select(pd => VersionRange.Parse(pd.VersionSpec))\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs", "new_path": "tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs", "diff": "@@ -151,5 +151,51 @@ public void DownloadsPerDayLabelShowsOneWhenAverageBetweenOneAndOnePointFive(int\n// Assert\nAssert.Equal(\"1\", label);\n}\n+\n+ [Theory]\n+ [InlineData(\"1.0.0\", \"1.0.1-alpha\", true)]\n+ [InlineData(\"1.0.0\", \"1.0.1-alpha+metadata\", true)]\n+ [InlineData(\"1.0.0\", \"1.0.1-alpha.1\", true)]\n+ [InlineData(\"1.0.0\", \"1.0.1\", false)]\n+ [InlineData(\"1.0.0\", \"1.0.0-alpha\", false)]\n+ [InlineData(\"1.0.0\", \"1.0.0-alpha+metadata\", false)]\n+ [InlineData(\"1.0.0\", \"1.0.0-alpha.1\", false)]\n+ public void HasNewerPrereleaseReturnsTrueWhenNewerPrereleaseAvailable(\n+ string currentVersion,\n+ string otherVersion,\n+ bool expectedNewerPrereleaseAvailable)\n+ {\n+ // Arrange\n+ var dependencies = Enumerable.Empty<PackageDependency>().ToList();\n+ var packageRegistration = new PackageRegistration\n+ {\n+ Owners = Enumerable.Empty<User>().ToList(),\n+ };\n+\n+ var package = new Package\n+ {\n+ Dependencies = dependencies,\n+ PackageRegistration = packageRegistration,\n+ Version = currentVersion\n+ };\n+\n+ var otherPackage = new Package\n+ {\n+ Dependencies = dependencies,\n+ PackageRegistration = packageRegistration,\n+ IsPrerelease = NuGetVersion.Parse(otherVersion).IsPrerelease,\n+ Version = otherVersion\n+ };\n+\n+ package.PackageRegistration.Packages = new[] { package, otherPackage };\n+\n+ var viewModel = new DisplayPackageViewModel(package, package.PackageRegistration.Packages.OrderByDescending(p => new NuGetVersion(p.Version)));\n+\n+ // Act\n+ var hasNewerPrerelease = viewModel.HasNewerPrerelease;\n+\n+ // Assert\n+ Assert.Equal(expectedNewerPrereleaseAvailable, hasNewerPrerelease);\n+ }\n}\n}\n\\ No newline at end of file\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix DisplayPackageViewModel.HasNewerPrerelease (#4709)
455,794
21.09.2017 07:52:16
25,200
9c342848a2774016584da9cf45033cd326b5c9c2
Fix sec policy undefined addAjaxAntiForgeryToken
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml", "new_path": "src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml", "diff": "</section>\n@section BottomScripts {\n- <script src=\"@Url.Content(\"~/Scripts/knockout-2.2.1.js\")\"></script>\n+ @Scripts.Render(\"~/Scripts/gallery/site.min.js\")\n<script>\n$(document).ready(function () {\nvar viewModel = function () {\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Fix sec policy undefined addAjaxAntiForgeryToken (#4713)
455,794
21.09.2017 15:50:52
25,200
8c9a9c5da93c5543785d2aa22fec31f7b245aa68
Add model validation for package upload
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/PackagesController.cs", "new_path": "src/NuGetGallery/Controllers/PackagesController.cs", "diff": "@@ -1291,6 +1291,12 @@ internal virtual async Task<ActionResult> Edit(string id, string version, bool?\n[ValidateInput(false)] // Security note: Disabling ASP.Net input validation which does things like disallow angle brackets in submissions. See http://go.microsoft.com/fwlink/?LinkID=212874\npublic virtual async Task<JsonResult> VerifyPackage(VerifyPackageRequest formData)\n{\n+ if (!ModelState.IsValid)\n+ {\n+ var errorMessages = ModelState.Values.SelectMany(v => v.Errors.Select(e => e.ErrorMessage));\n+ return Json(400, errorMessages);\n+ }\n+\nvar currentUser = GetCurrentUser();\nPackage package;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add model validation for package upload (#4712)
455,794
25.09.2017 10:33:52
25,200
2ff68a0082a0dfbbfd5d7b484f632aa1d499d4b3
Hide readme form on validation errors
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/async-file-upload.js", "new_path": "src/NuGetGallery/Scripts/gallery/async-file-upload.js", "diff": "@@ -211,10 +211,8 @@ var AsyncFileUploadManager = new function () {\n$(\"#submit-block\").remove();\n$(\"#verify-collapser-container\").addClass(\"hidden\");\n$(\"#submit-collapser-container\").addClass(\"hidden\");\n- if (model == null) {\n- return;\n- }\n+ if (model != null) {\nvar reportContainerElement = document.createElement(\"div\");\n$(reportContainerElement).attr(\"id\", \"verify-package-block\");\n$(reportContainerElement).attr(\"class\", \"collapse in\");\n@@ -258,6 +256,7 @@ var AsyncFileUploadManager = new function () {\nwindow.nuget.configureExpanderHeading(\"verify-package-form\");\nwindow.nuget.configureExpanderHeading(\"submit-package-form\");\n+ }\nbindReadMeData(model);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Scripts/gallery/page-edit.js", "new_path": "src/NuGetGallery/Scripts/gallery/page-edit.js", "diff": "@@ -144,10 +144,8 @@ var EditViewManager = new function () {\nfunction bindData(model) {\n$(\"#verify-package-block\").remove();\n$(\"#verify-collapser-container\").addClass(\"hidden\");\n- if (model == null) {\n- return;\n- }\n+ if (model != null) {\nvar reportContainerElement = document.createElement(\"div\");\n$(reportContainerElement).attr(\"id\", \"verify-package-block\");\n$(reportContainerElement).attr(\"class\", \"collapse in\");\n@@ -182,6 +180,7 @@ var EditViewManager = new function () {\nwindow.nuget.configureExpanderHeading(\"verify-package-form\");\nwindow.nuget.configureExpanderHeading(\"submit-package-form\");\n+ }\nbindReadMeData(model);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/_EditMetadata.cshtml", "new_path": "src/NuGetGallery/Views/Packages/_EditMetadata.cshtml", "diff": "</div>\n</div>\n<!-- /ko -->\n- </form>\n+ @*</form>*@\n</div>\n<!-- ko if: $data.IsSemVer2 -->\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Hide readme form on validation errors (#4711)
455,736
25.09.2017 11:16:08
25,200
805a5da6368888f1f3b6fe33e2147c2f6541bd38
Remove WITH (ONLINE = ON) from queries so all SQL Servers are happy Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Migrations/201709111714021_AddPackageStatusKey.cs", "new_path": "src/NuGetGallery/Migrations/201709111714021_AddPackageStatusKey.cs", "diff": "@@ -28,17 +28,17 @@ public override void Up()\nEND\n\");\n- Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_PackageStatusKeyListed' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_PackageStatusKeyListed] ON [dbo].[Packages] ([PackageStatusKey] ASC, [Listed] ASC) INCLUDE ([Description], [FlattenedDependencies], [IsPrerelease], [PackageRegistrationKey], [Tags], [Version]) WITH (ONLINE = ON)\");\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_PackageStatusKeyListed' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_PackageStatusKeyListed] ON [dbo].[Packages] ([PackageStatusKey] ASC, [Listed] ASC) INCLUDE ([Description], [FlattenedDependencies], [IsPrerelease], [PackageRegistrationKey], [Tags], [Version])\");\n- Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_IsListedPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_IsListedPackageStatusKey] ON [dbo].[Packages] ([IsLatest] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey], [Tags], [Title]) WITH (ONLINE = ON)\");\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_IsListedPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_IsListedPackageStatusKey] ON [dbo].[Packages] ([IsLatest] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey], [Tags], [Title])\");\n- Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_IsLatestStablePackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_IsLatestStablePackageStatusKey] ON [dbo].[Packages] ([IsLatestStable] ASC, [PackageStatusKey] ASC) INCLUDE ([Description], [FlattenedAuthors], [Listed], [PackageRegistrationKey], [Published], [Tags]) WITH (ONLINE = ON)\");\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_IsLatestStablePackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_IsLatestStablePackageStatusKey] ON [dbo].[Packages] ([IsLatestStable] ASC, [PackageStatusKey] ASC) INCLUDE ([Description], [FlattenedAuthors], [Listed], [PackageRegistrationKey], [Published], [Tags])\");\n- Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_SemVerLevelKeyIsLatestPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_SemVerLevelKeyIsLatestPackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [IsLatest] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey]) WITH (ONLINE = ON)\");\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_SemVerLevelKeyIsLatestPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_SemVerLevelKeyIsLatestPackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [IsLatest] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey])\");\n- Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_SemVerLevelKeyPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_SemVerLevelKeyPackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [PackageStatusKey] ASC) INCLUDE ([IsLatest], [IsLatestSemVer2]) WITH (ONLINE = ON)\");\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_SemVerLevelKeyPackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_SemVerLevelKeyPackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [PackageStatusKey] ASC) INCLUDE ([IsLatest], [IsLatestSemVer2])\");\n- Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_PackageStatusKeyIsPrereleasePackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_PackageStatusKeyIsPrereleasePackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [IsPrerelease] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey], [Description], [Tags]) WITH (ONLINE = ON)\");\n+ Sql(\"IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Packages_PackageStatusKeyIsPrereleasePackageStatusKey' AND object_id = OBJECT_ID('Packages')) CREATE INDEX [nci_wi_Packages_PackageStatusKeyIsPrereleasePackageStatusKey] ON [dbo].[Packages] ([SemVerLevelKey] ASC, [IsPrerelease] ASC, [PackageStatusKey] ASC) INCLUDE ([PackageRegistrationKey], [Description], [Tags])\");\n}\npublic override void Down()\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Remove WITH (ONLINE = ON) from queries so all SQL Servers are happy (#4703) Fix https://github.com/NuGet/Engineering/issues/781
455,794
25.09.2017 11:20:59
25,200
6caee6a4191eb7756b63d6211059b1e71019fa0e
Use 'documentation' wording instead of 'readme'
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Strings.Designer.cs", "new_path": "src/NuGetGallery/Strings.Designer.cs", "diff": "@@ -891,7 +891,7 @@ public class Strings {\n}\n/// <summary>\n- /// Looks up a localized string similar to There is no ReadMe available to preview..\n+ /// Looks up a localized string similar to There is no Markdown Documentation available to preview..\n/// </summary>\npublic static string PreviewReadMe_ReadMeMissing {\nget {\n@@ -900,7 +900,7 @@ public class Strings {\n}\n/// <summary>\n- /// Looks up a localized string similar to &apos;{0}&apos; is not a valid ReadMe source type..\n+ /// Looks up a localized string similar to &apos;{0}&apos; is not a valid Markdown Documentation source type..\n/// </summary>\npublic static string ReadMeInvalidSourceType {\nget {\n@@ -909,7 +909,7 @@ public class Strings {\n}\n/// <summary>\n- /// Looks up a localized string similar to ReadMe file must be less than {0} bytes..\n+ /// Looks up a localized string similar to The Markdown Documentation file must be less than {0} bytes..\n/// </summary>\npublic static string ReadMeMaxLengthExceeded {\nget {\n@@ -918,7 +918,7 @@ public class Strings {\n}\n/// <summary>\n- /// Looks up a localized string similar to ReadMe file must end with markdown extension &apos;{0}&apos;..\n+ /// Looks up a localized string similar to The Documentation file must end with a Markdown extension &apos;{0}&apos;..\n/// </summary>\npublic static string ReadMePostedFileExtensionInvalid {\nget {\n@@ -927,7 +927,7 @@ public class Strings {\n}\n/// <summary>\n- /// Looks up a localized string similar to ReadMe URL must be a raw markdown file hosted on GitHub..\n+ /// Looks up a localized string similar to The Documentation URL must be a raw Markdown file hosted on GitHub..\n/// </summary>\npublic static string ReadMeUrlHostInvalid {\nget {\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Strings.resx", "new_path": "src/NuGetGallery/Strings.resx", "diff": "@@ -571,19 +571,19 @@ For more information, please contact '{2}'.</value>\n<value>Conversion of Markdown to HTML failed with '{0}'.</value>\n</data>\n<data name=\"PreviewReadMe_ReadMeMissing\" xml:space=\"preserve\">\n- <value>There is no ReadMe available to preview.</value>\n+ <value>There is no Markdown Documentation available to preview.</value>\n</data>\n<data name=\"ReadMeInvalidSourceType\" xml:space=\"preserve\">\n- <value>'{0}' is not a valid ReadMe source type.</value>\n+ <value>'{0}' is not a valid Markdown Documentation source type.</value>\n</data>\n<data name=\"ReadMeMaxLengthExceeded\" xml:space=\"preserve\">\n- <value>ReadMe file must be less than {0} bytes.</value>\n+ <value>The Markdown Documentation file must be less than {0} bytes.</value>\n</data>\n<data name=\"ReadMePostedFileExtensionInvalid\" xml:space=\"preserve\">\n- <value>ReadMe file must end with markdown extension '{0}'.</value>\n+ <value>The Documentation file must end with a Markdown extension '{0}'.</value>\n</data>\n<data name=\"ReadMeUrlHostInvalid\" xml:space=\"preserve\">\n- <value>ReadMe URL must be a raw markdown file hosted on GitHub.</value>\n+ <value>The Documentation URL must be a raw Markdown file hosted on GitHub.</value>\n</data>\n<data name=\"ReservedNamespace_OwnerAdded\" xml:space=\"preserve\">\n<value>The user '{0}' is now an owner of the prefix '{1}'.</value>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/_EditForm.cshtml", "new_path": "src/NuGetGallery/Views/Packages/_EditForm.cshtml", "diff": "<a href=\"#\" role=\"button\" data-toggle=\"collapse\" data-target=\"#readme-package-form\"\naria-expanded=\"false\" aria-controls=\"readme-package-form\" id=\"show-readme-package-form\">\n<i class=\"ms-Icon ms-Icon--ChevronDown\" aria-hidden=\"true\"></i>\n- <span>Import ReadMe</span>\n+ <span>Import Documentation</span>\n</a>\n</h2>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/_ImportReadMe.cshtml", "new_path": "src/NuGetGallery/Views/Packages/_ImportReadMe.cshtml", "diff": "<div class=\"tab-content\">\n@ReadMePanel(\n@<div class=\"form-group editable\">\n- <textarea class=\"form-control\" data-bind=\"value: Edit.ReadMe.SourceText\" name=\"Edit.ReadMe.SourceText\" id=\"ReadMeTextInput\" rows=\"30\" placeholder=\"Write your own ReadMe here...\"></textarea>\n+ <textarea class=\"form-control\" data-bind=\"value: Edit.ReadMe.SourceText\" name=\"Edit.ReadMe.SourceText\" id=\"ReadMeTextInput\" rows=\"30\" placeholder=\"Add Markdown Documentation here...\"></textarea>\n</div>,\n\"readme-written\", active: true)\n@ReadMePanel(\n@<div class=\"form-group editable\">\n- <input type=\"url\" data-bind=\"value: Edit.ReadMe.SourceUrl\" name=\"Edit.ReadMe.SourceUrl\" class=\"form-control\" id=\"ReadMeUrlInput\" placeholder=\"https://raw.githubusercontent.com/\" />\n+ <input type=\"url\" data-bind=\"value: Edit.ReadMe.SourceUrl\" name=\"Edit.ReadMe.SourceUrl\" class=\"form-control\" id=\"ReadMeUrlInput\" placeholder=\"https://raw.githubusercontent.com/*.md\" />\n<label id=\"ReadMeURLLabel\" class=\"input-group-btn\"></label>\n</div>,\n\"readme-url\", active: false)\n@ReadMePanel(\n@<div class=\"input-group\">\n- <input type=\"text\" id=\"ReadMeFileText\" class=\"form-control\" value=\"Browse or Drop files to select a ReadMe.md file...\" aria-label=\"Upload Your ReadMe.md\" readonly />\n+ <input type=\"text\" id=\"ReadMeFileText\" class=\"form-control\" value=\"Browse for a Markdown Documentation file...\" aria-label=\"Upload your Markdown Documentation file\" readonly />\n<label for=\"ReadMeFileInput\" id=\"ReadMeFileLabel\" class=\"input-group-btn\">\n- <span class=\"btn btn-primary form-control\" aria-label=\"Browse for ReadMe.md file\" role=\"button\">\n+ <span class=\"btn btn-primary form-control\" aria-label=\"Browse for a Markdown Documentation file\" role=\"button\">\nBrowse&hellip;<input type=\"file\" accept=\".md\" data-bind=\"value: Edit.ReadMe.SourceFile\" name=\"Edit.ReadMe.SourceFile\" aria-labelledby=\"ReadMeFileLabel\" id=\"ReadMeFileInput\" style=\"display:none;\" />\n</span>\n</label>\n<div class=\"text-center hidden\" id=\"edit-markdown\" style=\"padding-top:3em; padding-bottom:3em\">\n<div class=\"row\">\n- <input type=\"button\" value=\"Edit ReadMe\" id=\"edit-markdown-button\" class=\"btn btn-primary col-xs-10 col-xs-offset-1 col-lg-2 col-lg-offset-5\" />\n+ <input type=\"button\" value=\"Edit Documentation\" id=\"edit-markdown-button\" class=\"btn btn-primary col-xs-10 col-xs-offset-1 col-lg-2 col-lg-offset-5\" />\n</div>\n</div>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Use 'documentation' wording instead of 'readme' (#4733)
455,759
25.09.2017 20:45:18
-7,200
1151dee5fd86194083333f9db90764c25b69e3ea
The message stating "A newer prerelease version is available" should also be shown when currently displayed version is a prerelease
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": ")\n}\n- @if (Model.LatestStableVersionSemVer2 && Model.HasNewerPrerelease)\n+ @if (Model.HasNewerPrerelease)\n{\n@ViewHelpers.AlertInfo(\n@<text>\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs", "new_path": "tests/NuGetGallery.Facts/ViewModels/DisplayPackageViewModelFacts.cs", "diff": "@@ -160,6 +160,7 @@ public void DownloadsPerDayLabelShowsOneWhenAverageBetweenOneAndOnePointFive(int\n[InlineData(\"1.0.0\", \"1.0.0-alpha\", false)]\n[InlineData(\"1.0.0\", \"1.0.0-alpha+metadata\", false)]\n[InlineData(\"1.0.0\", \"1.0.0-alpha.1\", false)]\n+ [InlineData(\"1.0.0-alpha\", \"1.0.0-alpha.1\", true)]\npublic void HasNewerPrereleaseReturnsTrueWhenNewerPrereleaseAvailable(\nstring currentVersion,\nstring otherVersion,\n@@ -176,6 +177,7 @@ public void DownloadsPerDayLabelShowsOneWhenAverageBetweenOneAndOnePointFive(int\n{\nDependencies = dependencies,\nPackageRegistration = packageRegistration,\n+ IsPrerelease = NuGetVersion.Parse(currentVersion).IsPrerelease,\nVersion = currentVersion\n};\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
The message stating "A newer prerelease version is available" should also be shown when currently displayed version is a prerelease (#4732)
455,772
25.09.2017 15:36:11
25,200
0e025b456555bc3209be7c3ed55206526a66003a
Add support for X-NuGet-Protocol-Version header
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Constants.cs", "new_path": "src/NuGetGallery/Constants.cs", "diff": "@@ -74,7 +74,10 @@ public static class Constants\npublic const string UrlValidationErrorMessage = \"This doesn't appear to be a valid HTTP/HTTPS URL\";\ninternal const string ApiKeyHeaderName = \"X-NuGet-ApiKey\";\n+ // X-NuGet-Client-Version header was deprecated and replaced with X-NuGet-Protocol-Version header\n+ // It stays here for backwards compatibility\ninternal const string ClientVersionHeaderName = \"X-NuGet-Client-Version\";\n+ internal const string NuGetProtocolHeaderName = \"X-NuGet-Protocol-Version\";\ninternal const string WarningHeaderName = \"X-NuGet-Warning\";\ninternal const string UserAgentHeaderName = \"User-Agent\";\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Security/RequireMinClientVersionForPushPolicy.cs", "new_path": "src/NuGetGallery/Security/RequireMinClientVersionForPushPolicy.cs", "diff": "using Newtonsoft.Json;\nusing NuGet.Protocol;\nusing NuGet.Versioning;\n-using NuGetGallery.Filters;\nnamespace NuGetGallery.Security\n{\n@@ -64,6 +63,17 @@ private NuGetVersion GetClientVersion(UserSecurityPolicyEvaluationContext contex\nreturn NuGetVersion.TryParse(clientVersionString, out clientVersion) ? clientVersion : null;\n}\n+ /// <summary>\n+ /// Get the current protocol version from the request.\n+ /// </summary>\n+ private NuGetVersion GetProtocolVersion(UserSecurityPolicyEvaluationContext context)\n+ {\n+ var protocolVersionString = context.HttpContext.Request?.Headers[Constants.NuGetProtocolHeaderName];\n+\n+ NuGetVersion protocolVersion;\n+ return NuGetVersion.TryParse(protocolVersionString, out protocolVersion) ? protocolVersion : null;\n+ }\n+\n/// <summary>\n/// Evaluate if this security policy is met.\n/// </summary>\n@@ -76,8 +86,16 @@ public override SecurityPolicyResult Evaluate(UserSecurityPolicyEvaluationContex\nvar minClientVersion = GetMaxOfMinClientVersions(context);\n- var clientVersion = GetClientVersion(context);\n- if (clientVersion == null || clientVersion < minClientVersion)\n+ // Do we have X-NuGet-Protocol-Version header?\n+ var protocolVersion = GetProtocolVersion(context);\n+\n+ if (protocolVersion == null)\n+ {\n+ // Do we have X-NuGet-Client-Version header?\n+ protocolVersion = GetClientVersion(context);\n+ }\n+\n+ if (protocolVersion == null || protocolVersion < minClientVersion)\n{\nreturn SecurityPolicyResult.CreateErrorResult(string.Format(CultureInfo.CurrentCulture,\nStrings.SecurityPolicy_RequireMinClientVersionForPush, minClientVersion));\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/TelemetryService.cs", "new_path": "src/NuGetGallery/Services/TelemetryService.cs", "diff": "@@ -26,6 +26,7 @@ public class TelemetryService : ITelemetryService\npublic const string AuthenticationMethod = \"AuthenticationMethod\";\npublic const string AccountCreationDate = \"AccountCreationDate\";\npublic const string ClientVersion = \"ClientVersion\";\n+ public const string ProtocolVersion = \"ProtocolVersion\";\npublic const string IsScoped = \"IsScoped\";\npublic const string KeyCreationDate = \"KeyCreationDate\";\npublic const string PackageId = \"PackageId\";\n@@ -66,6 +67,7 @@ public void TrackPackagePushEvent(Package package, User user, IIdentity identity\nTrackEvent(PackagePushEvent, properties => {\nproperties.Add(ClientVersion, GetClientVersion());\n+ properties.Add(ProtocolVersion, GetProtocolVersion());\nproperties.Add(PackageId, package.PackageRegistration.Id);\nproperties.Add(PackageVersion, package.Version);\nproperties.Add(AuthenticationMethod, identity.GetAuthenticationType());\n@@ -89,6 +91,7 @@ public void TrackCreatePackageVerificationKeyEvent(string packageId, string pack\nTrackEvent(CreatePackageVerificationKeyEvent, properties => {\nproperties.Add(ClientVersion, GetClientVersion());\n+ properties.Add(ProtocolVersion, GetProtocolVersion());\nproperties.Add(PackageId, packageId);\nproperties.Add(PackageVersion, packageVersion);\nproperties.Add(AccountCreationDate, GetAccountCreationDate(user));\n@@ -124,6 +127,11 @@ private static string GetClientVersion()\nreturn HttpContext.Current?.Request?.Headers[Constants.ClientVersionHeaderName];\n}\n+ private static string GetProtocolVersion()\n+ {\n+ return HttpContext.Current?.Request?.Headers[Constants.NuGetProtocolHeaderName];\n+ }\n+\nprivate static string GetAccountCreationDate(User user)\n{\nreturn user.CreatedUtc?.ToString(\"O\") ?? \"N/A\";\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Telemetry/ClientInformationTelemetryEnricher.cs", "new_path": "src/NuGetGallery/Telemetry/ClientInformationTelemetryEnricher.cs", "diff": "@@ -10,7 +10,6 @@ namespace NuGetGallery\n{\npublic class ClientInformationTelemetryEnricher : ITelemetryInitializer\n{\n- public const string ClientVersionPropertyKey = \"ClientVersion\";\npublic const string ClientInfoPropertyKey = \"ClientInfo\";\npublic void Initialize(ITelemetry telemetry)\n@@ -22,11 +21,16 @@ public void Initialize(ITelemetry telemetry)\nvar httpContext = GetHttpContext();\nif (httpContext != null && httpContext.Request != null)\n{\n- // ClientVersion will be available for NuGet clients starting version 4.1.0\n+ // ClientVersion is available for NuGet clients starting version 4.1.0-~4.5.0\n+ // Was deprecated and replaced by Protocol version\ntelemetry.Context.Properties.Add(\n- ClientVersionPropertyKey,\n+ TelemetryService.ClientVersion,\nhttpContext.Request.Headers[Constants.ClientVersionHeaderName]);\n+ telemetry.Context.Properties.Add(\n+ TelemetryService.ProtocolVersion,\n+ httpContext.Request.Headers[Constants.NuGetProtocolHeaderName]);\n+\n// Best effort attempt to extract client information from the user-agent header.\n// According to documentation here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent\n// the common structure for user-agent header is:\n@@ -36,7 +40,6 @@ public void Initialize(ITelemetry telemetry)\ntelemetry.Context.Properties.Add(ClientInfoPropertyKey, GetProductInformation(userAgent));\n}\n}\n-\n}\nprotected virtual HttpContextBase GetHttpContext()\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Security/RequireMinClientVersionForPushPolicyFacts.cs", "new_path": "tests/NuGetGallery.Facts/Security/RequireMinClientVersionForPushPolicyFacts.cs", "diff": "@@ -20,7 +20,7 @@ public class RequireMinClientVersionForPushPolicyFacts\npublic void Evaluate_ReturnsSuccessIfClientVersionEqualOrHigherThanRequired(string minClientVersions)\n{\n// Arrange & Act\n- var result = Evaluate(minClientVersions, actualClientVersion: \"4.1.0\");\n+ var result = Evaluate(minClientVersions, actualClientVersion: \"4.1.0\", actualProtocolVersion: string.Empty);\n// Assert\nAssert.True(result.Success);\n@@ -35,31 +35,88 @@ public void Evaluate_ReturnsSuccessIfClientVersionEqualOrHigherThanRequired(stri\npublic void Evaluate_ReturnsFailureIfClientVersionLowerThanRequired(string minClientVersions)\n{\n// Arrange & Act\n- var result = Evaluate(minClientVersions, actualClientVersion: \"2.5.0-beta1\");\n+ var result = Evaluate(minClientVersions, actualClientVersion: \"2.5.0-beta1\", actualProtocolVersion: string.Empty);\n// Assert\nAssert.False(result.Success);\nAssert.NotNull(result.ErrorMessage);\n}\n+ [Theory]\n+ [InlineData(\"4.1.0\")]\n+ [InlineData(\"3.0.0\")]\n+ [InlineData(\"2.0.0,4.1.0\")]\n+ [InlineData(\"4.1.0-beta1\")]\n+ public void Evaluate_ReturnsSuccessIfProtocolVersionEqualOrHigherThanRequired(string minClientVersions)\n+ {\n+ // Arrange & Act\n+ var result = Evaluate(minClientVersions, actualClientVersion: string.Empty, actualProtocolVersion: \"4.1.0\");\n+\n+ // Assert\n+ Assert.True(result.Success);\n+ Assert.Null(result.ErrorMessage);\n+ }\n+\n+ [Theory]\n+ [InlineData(\"4.1.0\")]\n+ [InlineData(\"3.0.0\")]\n+ [InlineData(\"2.0.0,4.1.0\")]\n+ [InlineData(\"2.5.0\")]\n+ public void Evaluate_ReturnsFailureIfProtocolVersionLowerThanRequired(string minClientVersions)\n+ {\n+ // Arrange & Act\n+ var result = Evaluate(minClientVersions, actualClientVersion: string.Empty, actualProtocolVersion: \"2.5.0-beta1\");\n+\n+ // Assert\n+ Assert.False(result.Success);\n+ Assert.NotNull(result.ErrorMessage);\n+ }\n+\n+ [Fact]\n+ public void Evaluate_ReturnsFailureIfProtocolVersionLowerThenRequiredAndClientVersionHigher()\n+ {\n+ // Arrange & Act\n+ var result = Evaluate(\"4.1.0\", actualClientVersion: \"4.1.0\", actualProtocolVersion: \"2.5.0-beta1\");\n+\n+ // Assert\n+ Assert.False(result.Success);\n+ Assert.NotNull(result.ErrorMessage);\n+ }\n+\n+ [Fact]\n+ public void Evaluate_ReturnsSuccessIfProtocolVersionHigherThenRequiredAndClientVersionLower()\n+ {\n+ // Arrange & Act\n+ var result = Evaluate(\"4.1.0\", actualClientVersion: \"2.5.0-beta1\", actualProtocolVersion: \"4.1.0\");\n+\n+ // Assert\n+ Assert.True(result.Success);\n+ Assert.Null(result.ErrorMessage);\n+ }\n+\n[Fact]\npublic void Evaluate_ReturnsFailureIfClientVersionHeaderIsMissing()\n{\n// Arrange & Act\n- var result = Evaluate(minClientVersions: \"4.1.0\", actualClientVersion: \"\");\n+ var result = Evaluate(minClientVersions: \"4.1.0\", actualClientVersion: string.Empty, actualProtocolVersion: string.Empty);\n// Assert\nAssert.False(result.Success);\nAssert.NotNull(result.ErrorMessage);\n}\n- private SecurityPolicyResult Evaluate(string minClientVersions, string actualClientVersion)\n+ private SecurityPolicyResult Evaluate(string minClientVersions, string actualClientVersion, string actualProtocolVersion)\n{\nvar headers = new NameValueCollection();\nif (!string.IsNullOrEmpty(actualClientVersion))\n{\nheaders[Constants.ClientVersionHeaderName] = actualClientVersion;\n- };\n+ }\n+\n+ if (!string.IsNullOrEmpty(actualProtocolVersion))\n+ {\n+ headers[Constants.NuGetProtocolHeaderName] = actualProtocolVersion;\n+ }\nvar httpRequest = new Mock<HttpRequestBase>();\nhttpRequest.Setup(r => r.Headers).Returns(headers);\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Telemetry/ClientInformationTelemetryEnricherTests.cs", "new_path": "tests/NuGetGallery.Facts/Telemetry/ClientInformationTelemetryEnricherTests.cs", "diff": "@@ -41,6 +41,7 @@ public void EnrichesOnlyRequestsTelemetry(Type telemetryType)\nvar headers = new NameValueCollection\n{\n+ { Constants.NuGetProtocolHeaderName, \"1.0.0\" },\n{ Constants.ClientVersionHeaderName, \"1.0.0\" },\n{ Constants.UserAgentHeaderName, \"NuGet Command Line/4.1.0 (Microsoft Windows NT 6.2.9200.0)\" }\n};\n@@ -53,7 +54,7 @@ public void EnrichesOnlyRequestsTelemetry(Type telemetryType)\n// Assert\nif (telemetry is RequestTelemetry)\n{\n- Assert.Equal(3, telemetry.Context.Properties.Count);\n+ Assert.Equal(4, telemetry.Context.Properties.Count);\n}\nelse\n{\n@@ -78,7 +79,27 @@ public void EnrichesTelemetryWithClientVersion()\nenricher.Initialize(telemetry);\n// Assert\n- Assert.Equal(\"5.0.0\", telemetry.Properties[ClientInformationTelemetryEnricher.ClientVersionPropertyKey]);\n+ Assert.Equal(\"5.0.0\", telemetry.Properties[TelemetryService.ClientVersion]);\n+ }\n+\n+ [Fact]\n+ public void EnrichesTelemetryWithProtocolVersion()\n+ {\n+ // Arrange\n+ var telemetry = new RequestTelemetry();\n+\n+ var headers = new NameValueCollection\n+ {\n+ { Constants.NuGetProtocolHeaderName, \"5.0.0\" }\n+ };\n+\n+ var enricher = CreateTestEnricher(headers);\n+\n+ // Act\n+ enricher.Initialize(telemetry);\n+\n+ // Assert\n+ Assert.Equal(\"5.0.0\", telemetry.Properties[TelemetryService.ProtocolVersion]);\n}\n[Theory]\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add support for X-NuGet-Protocol-Version header (#4740)
455,776
25.09.2017 17:01:03
25,200
7590d5a87e9d8587eac6e7b5b5a46c99d8832d79
Remove redesign banner
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Configuration/AppConfiguration.cs", "new_path": "src/NuGetGallery/Configuration/AppConfiguration.cs", "diff": "@@ -16,9 +16,6 @@ public class AppConfiguration : IAppConfiguration\n[DefaultValue(\"\")]\npublic string WarningBanner { get; set; }\n- [DefaultValue(\"\")]\n- public string RedesignBanner { get; set; }\n-\n/// <summary>\n/// Gets a setting indicating if SSL is required for all operations once logged in.\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Configuration/IAppConfiguration.cs", "new_path": "src/NuGetGallery/Configuration/IAppConfiguration.cs", "diff": "@@ -23,11 +23,6 @@ public interface IAppConfiguration\n/// </summary>\nstring WarningBanner { get; set; }\n- /// <summary>\n- /// Gets the warning banner text\n- /// </summary>\n- string RedesignBanner { get; set; }\n-\n/// <summary>\n/// Gets a setting indicating if SSL is required for all operations once logged in.\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/Gallery/Header.cshtml", "new_path": "src/NuGetGallery/Views/Shared/Gallery/Header.cshtml", "diff": "</div>\n}\n-@if (!string.IsNullOrWhiteSpace(Config.Current.RedesignBanner))\n-{\n- <div class=\"container-fluid banner banner-notice text-center\">\n- <div class=\"row\">\n- <div class=\"col-sm-12\">\n- <i class=\"ms-Icon ms-Icon--Info\" aria-hidden=\"true\"></i>\n- <span>@Html.Raw(WebUtility.HtmlDecode(Config.Current.RedesignBanner))</span>\n- </div>\n- </div>\n- </div>\n-}\n-\n@if (CookieConsentMessage != null)\n{\n<div class=\"container-fluid banner banner-notice text-center\">\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Shared/Layout.cshtml", "new_path": "src/NuGetGallery/Views/Shared/Layout.cshtml", "diff": "<div class=\"banner-warning\">@Config.Current.WarningBanner</div>\n</div>\n}\n- @if (!string.IsNullOrEmpty(Config.Current.RedesignBanner))\n- {\n- <div id=\"service-alert\">\n- <div class=\"banner-redesign\">\n- <i class=\"ms-Icon ms-Icon--Warning\" aria-hidden=\"true\"></i>\n- @Html.Raw(WebUtility.HtmlDecode(Config.Current.RedesignBanner))\n- </div>\n- </div>\n- }\n<div id=\"outer-wrapper\">\n<div id=\"content-wrapper\">\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Web.config", "new_path": "src/NuGetGallery/Web.config", "diff": "<!-- banner warning on the top - leave blank to remove the banner from the site. -->\n<add key=\"Gallery.WarningBanner\" value=\"\" />\n- <!-- redesign banner on the top - leave blank to remove the banner from the site. -->\n- <add key=\"Gallery.RedesignBanner\" value=\"\" />\n<add key=\"Gallery.FacebookAppId\" value=\"\" />\n<!-- Set this if you have a Application Insights instrumentation key to use for your gallery deployment -->\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Remove redesign banner (#4741)
455,776
26.09.2017 11:55:28
25,200
a83a60702fab561724d434528597f1b18ae5cdff
remove ownerrequests.cshtml from csproj
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Content Include=\"Views\\Packages\\_ImportReadMe.cshtml\" />\n<Content Include=\"Views\\Packages\\_SubmitPackage.cshtml\" />\n<Content Include=\"Views\\Packages\\_EditForm.cshtml\" />\n- <Content Include=\"Views\\Users\\OwnerRequests.cshtml\" />\n<Content Include=\"Views\\Users\\_OwnerRequestsList.cshtml\" />\n</ItemGroup>\n<ItemGroup>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
remove ownerrequests.cshtml from csproj (#4752)
455,736
26.09.2017 15:39:32
25,200
2deb2aa9fd6c6da9e2f52ef226d27444cfec6c9a
Filter out unavailable packages in curated feed controller Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/ODataV2CuratedFeedController.cs", "new_path": "src/NuGetGallery/Controllers/ODataV2CuratedFeedController.cs", "diff": "@@ -56,7 +56,9 @@ public class ODataV2CuratedFeedController\nvar semVerLevelKey = SemVerLevelKey.ForSemVerLevel(semVerLevel);\n- var queryable = _curatedFeedService.GetPackages(curatedFeedName)\n+ var queryable = _curatedFeedService\n+ .GetPackages(curatedFeedName)\n+ .Where(p => p.PackageStatusKey == PackageStatus.Available)\n.Where(SemVerLevelKey.IsPackageCompliantWithSemVerLevelPredicate(semVerLevel))\n.ToV2FeedPackageQuery(\n_configurationService.GetSiteRoot(UseHttps()),\n@@ -124,7 +126,9 @@ public async Task<IHttpActionResult> Get(ODataQueryOptions<V2FeedPackage> option\nreturn NotFound();\n}\n- var packages = _curatedFeedService.GetPackages(curatedFeedName)\n+ var packages = _curatedFeedService\n+ .GetPackages(curatedFeedName)\n+ .Where(p => p.PackageStatusKey == PackageStatus.Available)\n.Where(SemVerLevelKey.IsPackageCompliantWithSemVerLevelPredicate(semVerLevel))\n.Where(p => p.PackageRegistration.Id.Equals(id, StringComparison.OrdinalIgnoreCase));\n@@ -239,6 +243,7 @@ public IHttpActionResult GetPropertyFromPackages(string propertyName, string id,\n// Perform actual search\nvar curatedFeed = _curatedFeedService.GetFeedByName(curatedFeedName, includePackages: false);\nvar packages = _curatedFeedService.GetPackages(curatedFeedName)\n+ .Where(p => p.PackageStatusKey == PackageStatus.Available)\n.Where(SemVerLevelKey.IsPackageCompliantWithSemVerLevelPredicate(semVerLevel))\n.OrderBy(p => p.PackageRegistration.Id).ThenBy(p => p.Version);\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/ODataFeedControllerFactsBase.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/ODataFeedControllerFactsBase.cs", "diff": "@@ -27,6 +27,8 @@ public abstract class ODataFeedControllerFactsBase<TController>\nprivate const string _siteRoot = \"https://nuget.localtest.me\";\nprotected const string TestPackageId = \"Some.Awesome.Package\";\n+ protected readonly IReadOnlyCollection<Package> AvailablePackages;\n+ protected readonly IReadOnlyCollection<Package> UnavailablePackages;\nprotected readonly IReadOnlyCollection<Package> NonSemVer2Packages;\nprotected readonly IReadOnlyCollection<Package> SemVer2Packages;\nprotected readonly IEntityRepository<Package> PackagesRepository;\n@@ -36,8 +38,10 @@ protected ODataFeedControllerFactsBase()\n{\n// Arrange\nAllPackages = CreatePackagesQueryable();\n- NonSemVer2Packages = AllPackages.Where(p => p.SemVerLevelKey == SemVerLevelKey.Unknown).ToList();\n- SemVer2Packages = AllPackages.Where(p => p.SemVerLevelKey == SemVerLevelKey.SemVer2).ToList();\n+ AvailablePackages = AllPackages.Where(p => p.PackageStatusKey == PackageStatus.Available).ToList();\n+ UnavailablePackages = AllPackages.Where(p => p.PackageStatusKey != PackageStatus.Available).ToList();\n+ NonSemVer2Packages = AvailablePackages.Where(p => p.SemVerLevelKey == SemVerLevelKey.Unknown).ToList();\n+ SemVer2Packages = AvailablePackages.Where(p => p.SemVerLevelKey == SemVerLevelKey.SemVer2).ToList();\nvar packagesRepositoryMock = new Mock<IEntityRepository<Package>>(MockBehavior.Strict);\npackagesRepositoryMock.Setup(m => m.GetAll()).Returns(AllPackages).Verifiable();\n@@ -118,6 +122,30 @@ private static IQueryable<Package> CreatePackagesQueryable()\nvar list = new List<Package>\n{\n+ new Package\n+ {\n+ PackageRegistration = packageRegistration,\n+ Version = \"0.9.0.0\",\n+ NormalizedVersion = \"0.9.0\",\n+ SemVerLevelKey = SemVerLevelKey.Unknown,\n+ PackageStatusKey = PackageStatus.Deleted,\n+ },\n+ new Package\n+ {\n+ PackageRegistration = packageRegistration,\n+ Version = \"0.8.0.0\",\n+ NormalizedVersion = \"0.8.0\",\n+ SemVerLevelKey = SemVerLevelKey.Unknown,\n+ PackageStatusKey = PackageStatus.Validating,\n+ },\n+ new Package\n+ {\n+ PackageRegistration = packageRegistration,\n+ Version = \"0.7.0.0\",\n+ NormalizedVersion = \"0.7.0\",\n+ SemVerLevelKey = SemVerLevelKey.Unknown,\n+ PackageStatusKey = PackageStatus.FailedValidation,\n+ },\nnew Package\n{\nPackageRegistration = packageRegistration,\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/ODataV2CuratedFeedControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/ODataV2CuratedFeedControllerFacts.cs", "diff": "@@ -30,6 +30,22 @@ public async Task Get_FiltersSemVerV2PackageVersions()\nAssert.Equal(NonSemVer2Packages.Count, resultSet.Count);\n}\n+ [Fact]\n+ public async Task Get_FiltersOutUnavailablePackages()\n+ {\n+ // Arrange\n+ var semVerLevel = \"2.0.0\";\n+\n+ // Act\n+ var resultSet = await GetCollection<V2FeedPackage>(\n+ (controller, options) => controller.Get(options, _curatedFeedName, semVerLevel),\n+ $\"/api/v2/curated-feed/{_curatedFeedName}/Packages?semVerLevel={semVerLevel}\");\n+\n+ // Assert\n+ AssertUnavailablePackagesFilteredFromResult(resultSet);\n+ Assert.Equal(AvailablePackages.Count, resultSet.Count);\n+ }\n+\n[Theory]\n[InlineData(\"2.0.0\")]\n[InlineData(\"2.0.1\")]\n@@ -44,7 +60,7 @@ public async Task Get_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigher(st\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet, includePrerelease: true);\n- Assert.Equal(AllPackages.Count(), resultSet.Count);\n+ Assert.Equal(AvailablePackages.Count, resultSet.Count);\n}\n[Fact]\n@@ -72,7 +88,7 @@ public async Task GetCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigh\n$\"/api/v2/curated-feed/{_curatedFeedName}/Packages/$count?semVerLevel={semVerLevel}\");\n// Assert\n- Assert.Equal(AllPackages.Count(), count);\n+ Assert.Equal(AvailablePackages.Count, count);\n}\n[Fact]\n@@ -102,7 +118,7 @@ public async Task FindPackagesById_IncludesSemVerV2PackageVersionsWhenSemVerLeve\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet, includePrerelease: true);\n- Assert.Equal(AllPackages.Count(), resultSet.Count);\n+ Assert.Equal(AvailablePackages.Count, resultSet.Count);\n}\n[Fact]\n@@ -149,7 +165,7 @@ public async Task Search_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigher\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet, includePrerelease: false);\n- Assert.Equal(AllPackages.Where(p => !p.IsPrerelease).Count(), resultSet.Count);\n+ Assert.Equal(AvailablePackages.Where(p => !p.IsPrerelease).Count(), resultSet.Count);\n}\n[Theory]\n@@ -171,7 +187,7 @@ public async Task Search_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigher\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet, includePrerelease: true);\n- Assert.Equal(AllPackages.Count(), resultSet.Count);\n+ Assert.Equal(AvailablePackages.Count, resultSet.Count);\n}\n[Fact]\n@@ -258,7 +274,7 @@ public async Task SearchCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrH\n$\"/api/v2/curated-feed/{_curatedFeedName}/Search/$count?searchTerm='{TestPackageId}'&includePrerelease=true&semVerLevel={semVerLevel}\");\n// Assert\n- Assert.Equal(AllPackages.Count(), searchCount);\n+ Assert.Equal(AvailablePackages.Count, searchCount);\n}\n[Theory]\n@@ -274,7 +290,7 @@ public async Task SearchCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrH\n$\"/api/v2/curated-feed/{_curatedFeedName}/Search/$count?searchTerm='{TestPackageId}'&semVerLevel={semVerLevel}\");\n// Assert\n- Assert.Equal(AllPackages.Where(p => !p.IsPrerelease).Count(), searchCount);\n+ Assert.Equal(AvailablePackages.Where(p => !p.IsPrerelease).Count(), searchCount);\n}\nprotected override ODataV2CuratedFeedController CreateController(\n@@ -312,6 +328,19 @@ public async Task SearchCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrH\nreturn dbSet.Object;\n}\n+ private void AssertUnavailablePackagesFilteredFromResult(IEnumerable<V2FeedPackage> resultSet)\n+ {\n+ foreach (var feedPackage in resultSet)\n+ {\n+ Assert.Empty(UnavailablePackages.Where(p => string.Equals(p.Version, feedPackage.Version)));\n+\n+ // Assert each of the items in the result set is a non-SemVer v2.0.0 package\n+ Assert.Single(AvailablePackages.Where(p =>\n+ string.Equals(p.Version, feedPackage.Version) &&\n+ string.Equals(p.PackageRegistration.Id, feedPackage.Id)));\n+ }\n+ }\n+\nprivate void AssertSemVer2PackagesFilteredFromResult(IEnumerable<V2FeedPackage> resultSet)\n{\nforeach (var feedPackage in resultSet)\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/ODataV2FeedControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/ODataV2FeedControllerFacts.cs", "diff": "@@ -41,7 +41,7 @@ public async Task Get_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigher(st\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet);\n- Assert.Equal(AllPackages.Count(), resultSet.Count);\n+ Assert.Equal(AvailablePackages.Count, resultSet.Count);\n}\n[Fact]\n@@ -69,7 +69,7 @@ public async Task GetCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigh\n$\"/api/v2/Packages/$count?semVerLevel={semVerLevel}\");\n// Assert\n- Assert.Equal(AllPackages.Count(), count);\n+ Assert.Equal(AvailablePackages.Count, count);\n}\n[Fact]\n@@ -99,7 +99,7 @@ public async Task FindPackagesById_IncludesSemVerV2PackageVersionsWhenSemVerLeve\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet);\n- Assert.Equal(AllPackages.Count(), resultSet.Count);\n+ Assert.Equal(AvailablePackages.Count, resultSet.Count);\n}\n[Fact]\n@@ -232,7 +232,7 @@ public async Task Search_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigher\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet);\n- Assert.Equal(AllPackages.Count(), resultSet.Count);\n+ Assert.Equal(AvailablePackages.Count, resultSet.Count);\n}\n[Fact]\n@@ -267,7 +267,7 @@ public async Task SearchCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrH\n$\"/api/v2/Search/$count?searchTerm='{TestPackageId}'&includePrerelease=true&semVerLevel={semVerLevel}\");\n// Assert\n- Assert.Equal(AllPackages.Count(), searchCount);\n+ Assert.Equal(AvailablePackages.Count, searchCount);\n}\n[Fact]\n@@ -298,7 +298,7 @@ public async Task GetUpdates_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHi\n// Arrange\nconst string currentVersionString = \"1.0.0\";\nvar currentVersion = NuGetVersion.Parse(currentVersionString);\n- var expected = AllPackages.Where(p => NuGetVersion.Parse(p.Version) > currentVersion);\n+ var expected = AvailablePackages.Where(p => NuGetVersion.Parse(p.Version) > currentVersion);\n// Act\nvar resultSet = await GetCollection<V2FeedPackage>(\n@@ -356,7 +356,7 @@ public async Task GetUpdatesCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel\n// Arrange\nconst string currentVersionString = \"1.0.0\";\nvar currentVersion = NuGetVersion.Parse(currentVersionString);\n- var expected = AllPackages.Where(p => NuGetVersion.Parse(p.Version) > currentVersion);\n+ var expected = AvailablePackages.Where(p => NuGetVersion.Parse(p.Version) > currentVersion);\n// Act\nvar searchCount = await GetInt<V2FeedPackage>(\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Filter out unavailable packages in curated feed controller (#4755) Fix https://github.com/NuGet/NuGetGallery/issues/4750
455,736
26.09.2017 15:41:38
25,200
f662ffe6dba7f80e6f4dec178a3c0bd335feb0b6
Implement "revalidate" gesture for asynchronous validation Address
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/PackagesController.cs", "new_path": "src/NuGetGallery/Controllers/PackagesController.cs", "diff": "@@ -61,6 +61,7 @@ public partial class PackagesController\nprivate readonly IReservedNamespaceService _reservedNamespaceService;\nprivate readonly IPackageUploadService _packageUploadService;\nprivate readonly IReadMeService _readMeService;\n+ private readonly IValidationService _validationService;\npublic PackagesController(\nIPackageService packageService,\n@@ -83,7 +84,8 @@ public partial class PackagesController\nISecurityPolicyService securityPolicyService,\nIReservedNamespaceService reservedNamespaceService,\nIPackageUploadService packageUploadService,\n- IReadMeService readMeService)\n+ IReadMeService readMeService,\n+ IValidationService validationService)\n{\n_packageService = packageService;\n_packageOwnerRequestService = packageOwnerRequestService;\n@@ -106,6 +108,7 @@ public partial class PackagesController\n_reservedNamespaceService = reservedNamespaceService;\n_packageUploadService = packageUploadService;\n_readMeService = readMeService;\n+ _validationService = validationService;\n}\n[HttpGet]\n@@ -956,6 +959,33 @@ public virtual async Task<ActionResult> Reflow(string id, string version)\nreturn SafeRedirect(Url.Package(id, version));\n}\n+ [Authorize(Roles = \"Admins\")]\n+ [RequiresAccountConfirmation(\"revalidate a package\")]\n+ public virtual async Task<ActionResult> Revalidate(string id, string version)\n+ {\n+ var package = _packageService.FindPackageByIdAndVersion(id, version);\n+\n+ if (package == null)\n+ {\n+ return HttpNotFound();\n+ }\n+\n+ try\n+ {\n+ await _validationService.RevalidateAsync(package);\n+\n+ TempData[\"Message\"] = \"The package is being revalidated.\";\n+ }\n+ catch (Exception ex)\n+ {\n+ QuietLog.LogHandledException(ex);\n+\n+ TempData[\"Message\"] = $\"An error occurred while revalidating the package. {ex.Message}\";\n+ }\n+\n+ return SafeRedirect(Url.Package(id, version));\n+ }\n+\n[Authorize(Roles = \"Admins\")]\n[HttpPost]\n[RequiresAccountConfirmation(\"delete a package\")]\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/IValidationService.cs", "new_path": "src/NuGetGallery/Services/IValidationService.cs", "diff": "@@ -11,10 +11,17 @@ namespace NuGetGallery\npublic interface IValidationService\n{\n/// <summary>\n- /// Starts the asynchronous validation for the provided package and puts the package in the correct state. The\n- /// commit to the database is the responsibility of the caller.\n+ /// Starts the asynchronous validation for the provided new package and puts the package in the correct\n+ /// <see cref=\"Package.PackageStatusKey\"/>. The commit to the database is the responsibility of the caller.\n/// </summary>\n/// <param name=\"package\">The package to start validation for.</param>\nTask StartValidationAsync(Package package);\n+\n+ /// <summary>\n+ /// Starts the asynchronous validation for the provided new package but does not change the package's\n+ /// <see cref=\"Package.PackageStatusKey\"/>.\n+ /// </summary>\n+ /// <param name=\"package\">The package to start validation for.</param>\n+ Task RevalidateAsync(Package package);\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/ValidationService.cs", "new_path": "src/NuGetGallery/Services/ValidationService.cs", "diff": "@@ -28,5 +28,10 @@ public async Task StartValidationAsync(Package package)\npackageStatus,\ncommitChanges: false);\n}\n+\n+ public async Task RevalidateAsync(Package package)\n+ {\n+ await _initiator.StartValidationAsync(package);\n+ }\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/UrlExtensions.cs", "new_path": "src/NuGetGallery/UrlExtensions.cs", "diff": "@@ -486,7 +486,24 @@ public static string UploadPackageProgress(this UrlHelper url, bool relativeUrl\n{\nreturn GetActionLink(\nurl,\n- \"Reflow\",\n+ nameof(PackagesController.Reflow),\n+ \"Packages\",\n+ relativeUrl,\n+ routeValues: new RouteValueDictionary\n+ {\n+ { \"id\", package.Id },\n+ { \"version\", package.Version }\n+ });\n+ }\n+\n+ public static string RevalidatePackage(\n+ this UrlHelper url,\n+ IPackageVersionModel package,\n+ bool relativeUrl = true)\n+ {\n+ return GetActionLink(\n+ url,\n+ nameof(PackagesController.Revalidate),\n\"Packages\",\nrelativeUrl,\nrouteValues: new RouteValueDictionary\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "<a href=\"@Url.ReflowPackage(Model)\">Reflow package</a>\n</li>\n}\n+\n+ @if (!Model.Deleted && User.IsAdministrator() && Config.Current.AsynchronousPackageValidationEnabled)\n+ {\n+ <li>\n+ <i class=\"ms-Icon ms-Icon--Refresh\" aria-hidden=\"true\"></i>\n+ <a href=\"@Url.RevalidatePackage(Model)\">Revalidate package</a>\n+ </li>\n+ }\n</ul>\n@if (Model.LicenseNames.AnySafe())\n{\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs", "diff": "@@ -53,7 +53,8 @@ public class PackagesControllerFacts\nMock<ITelemetryService> telemetryService = null,\nMock<ISecurityPolicyService> securityPolicyService = null,\nMock<IReservedNamespaceService> reservedNamespaceService = null,\n- Mock<IPackageUploadService> packageUploadService = null)\n+ Mock<IPackageUploadService> packageUploadService = null,\n+ Mock<IValidationService> validationService = null)\n{\npackageService = packageService ?? new Mock<IPackageService>();\npackageOwnerRequestService = packageOwnerRequestService ?? new Mock<IPackageOwnerRequestService>();\n@@ -109,6 +110,8 @@ public class PackagesControllerFacts\nreturn packageService.Object.CreatePackageAsync(nugetPackage, packageStreamMetadata, user, isVerified: false);\n});\n+ validationService = validationService ?? new Mock<IValidationService>();\n+\nvar controller = new Mock<PackagesController>(\npackageService.Object,\npackageOwnerRequestService.Object,\n@@ -130,7 +133,8 @@ public class PackagesControllerFacts\nsecurityPolicyService.Object,\nreservedNamespaceService.Object,\npackageUploadService.Object,\n- new ReadMeService(packageFileService.Object));\n+ new ReadMeService(packageFileService.Object),\n+ validationService.Object);\ncontroller.CallBase = true;\ncontroller.Object.SetOwinContextOverride(Fakes.CreateOwinContext());\n@@ -2833,6 +2837,91 @@ public async Task IndexingAndPackageServicesAreUpdated()\nAssert.Equal(@\"~\\Bar.cshtml\", ((RedirectResult)result).Url);\n}\n}\n+\n+ public class TheRevalidateMethod : TestContainer\n+ {\n+ private Package _package;\n+ private readonly Mock<IPackageService> _packageService;\n+ private readonly Mock<IValidationService> _validationService;\n+ private readonly TestGalleryConfigurationService _configurationService;\n+ private readonly PackagesController _target;\n+\n+ public TheRevalidateMethod()\n+ {\n+ _package = new Package\n+ {\n+ PackageRegistration = new PackageRegistration { Id = \"NuGet.Versioning\" },\n+ Version = \"3.4.0\",\n+ };\n+\n+ _packageService = new Mock<IPackageService>();\n+ _packageService\n+ .Setup(svc => svc.FindPackageByIdAndVersion(\n+ It.IsAny<string>(),\n+ It.IsAny<string>(),\n+ It.IsAny<int?>(),\n+ It.IsAny<bool>()))\n+ .Returns(_package);\n+\n+ _validationService = new Mock<IValidationService>();\n+\n+ _configurationService = GetConfigurationService();\n+\n+ _target = CreateController(\n+ _configurationService,\n+ packageService: _packageService,\n+ validationService: _validationService);\n+ }\n+\n+ [Fact]\n+ public async Task RevalidateIsCalledWithTheExistingPackage()\n+ {\n+ // Arrange & Act\n+ await _target.Revalidate(\n+ _package.PackageRegistration.Id,\n+ _package.Version);\n+\n+ // Assert\n+ _validationService.Verify(\n+ x => x.RevalidateAsync(_package),\n+ Times.Once);\n+ }\n+\n+ [Fact]\n+ public async Task RedirectsAfterRevalidatingPackage()\n+ {\n+ // Arrange & Act\n+ var result = await _target.Revalidate(\n+ _package.PackageRegistration.Id,\n+ _package.Version);\n+\n+ // Assert\n+ var redirect = Assert.IsType<SafeRedirectResult>(result);\n+ Assert.Equal($\"/?id={_package.PackageRegistration.Id}&version={_package.Version}\", redirect.Url);\n+ Assert.Equal(\"/\", redirect.SafeUrl);\n+ }\n+\n+ [Fact]\n+ public async Task ReturnsNotFoundForUnknownPackage()\n+ {\n+ // Arrange\n+ _packageService\n+ .Setup(svc => svc.FindPackageByIdAndVersion(\n+ It.IsAny<string>(),\n+ It.IsAny<string>(),\n+ It.IsAny<int?>(),\n+ It.IsAny<bool>()))\n+ .Returns<Package>(null);\n+\n+ // Act\n+ var result = await _target.Revalidate(\n+ _package.PackageRegistration.Id,\n+ _package.Version);\n+\n+ // Assert\n+ Assert.IsType<HttpNotFoundResult>(result);\n+ }\n+ }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Services/ValidationServiceFacts.cs", "new_path": "tests/NuGetGallery.Facts/Services/ValidationServiceFacts.cs", "diff": "@@ -45,6 +45,42 @@ public async Task UpdatesThePackageStatus()\n}\n}\n+ public class TheRevalidateMethod : FactsBase\n+ {\n+ [Fact]\n+ public async Task InitiatesTheValidation()\n+ {\n+ // Arrange & Act\n+ await _target.RevalidateAsync(_package);\n+\n+ // Assert\n+ _initiator.Verify(x => x.StartValidationAsync(_package), Times.Once);\n+ }\n+\n+ [Fact]\n+ public async Task DoesNotChangeThePackageStatus()\n+ {\n+ // Arrange\n+ var packageStatus = PackageStatus.Validating;\n+ _package.PackageStatusKey = PackageStatus.Available;\n+ _initiator\n+ .Setup(x => x.StartValidationAsync(It.IsAny<Package>()))\n+ .ReturnsAsync(packageStatus);\n+\n+ // Act\n+ await _target.RevalidateAsync(_package);\n+\n+ // Assert\n+ _packageService.Verify(\n+ x => x.UpdatePackageStatusAsync(It.IsAny<Package>(), It.IsAny<PackageStatus>(), It.IsAny<bool>()),\n+ Times.Never);\n+\n+ /// The implementation should not change the package status on its own. It should depend on\n+ /// <see cref=\"IPackageService\"/> to do this.\n+ Assert.Equal(PackageStatus.Available, _package.PackageStatusKey);\n+ }\n+ }\n+\npublic class FactsBase\n{\nprotected readonly Mock<IPackageService> _packageService;\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/TestUtils/TestUtility.cs", "new_path": "tests/NuGetGallery.Facts/TestUtils/TestUtility.cs", "diff": "@@ -45,6 +45,7 @@ public static Mock<HttpContextBase> SetupHttpContextMockForUrlGeneration(Mock<Ht\ncontroller.ControllerContext = controllerContext;\nvar routeCollection = new RouteCollection();\nrouteCollection.MapRoute(\"catch-all\", \"{*catchall}\");\n+ routeCollection.MapRoute(RouteName.Home, \"\");\nrouteCollection.MapRoute(RouteName.DisplayPackage, \"\");\ncontroller.Url = new UrlHelper(requestContext, routeCollection);\nreturn httpContext;\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Implement "revalidate" gesture for asynchronous validation (#4747) Address https://github.com/NuGet/Engineering/issues/765
455,736
27.09.2017 17:09:08
25,200
e46a585fbfa53f42333dffc4ad98b3cc7829eb6c
Add APIs to upload, download, and delete a package from the validation container Progress on
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/CoreConstants.cs", "new_path": "src/NuGetGallery.Core/CoreConstants.cs", "diff": "@@ -21,5 +21,6 @@ public static class CoreConstants\npublic const string PackageReadMesFolderName = \"readmes\";\npublic const string PackagesFolderName = \"packages\";\npublic const string UploadsFolderName = \"uploads\";\n+ public const string ValidationFolderName = \"validation\";\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs", "new_path": "src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs", "diff": "@@ -130,6 +130,7 @@ protected async Task<ICloudBlobContainer> GetContainer(string folderName)\ncase CoreConstants.ContentFolderName:\ncase CoreConstants.UploadsFolderName:\ncase CoreConstants.PackageReadMesFolderName:\n+ case CoreConstants.ValidationFolderName:\ncreationTask = PrepareContainer(folderName, isPublic: false);\nbreak;\n@@ -199,6 +200,7 @@ private static string GetContentType(string folderName)\ncase CoreConstants.PackagesFolderName:\ncase CoreConstants.PackageBackupsFolderName:\ncase CoreConstants.UploadsFolderName:\n+ case CoreConstants.ValidationFolderName:\nreturn CoreConstants.PackageContentType;\ncase CoreConstants.DownloadsFolderName:\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Services/CorePackageFileService.cs", "new_path": "src/NuGetGallery.Core/Services/CorePackageFileService.cs", "diff": "@@ -34,6 +34,52 @@ public Task<Stream> DownloadPackageFileAsync(Package package)\nreturn _fileStorageService.GetFileAsync(CoreConstants.PackagesFolderName, fileName);\n}\n+ public Task SaveValidationPackageFileAsync(Package package, Stream packageFile)\n+ {\n+ if (packageFile == null)\n+ {\n+ throw new ArgumentNullException(nameof(packageFile));\n+ }\n+\n+ var fileName = BuildFileName(\n+ package,\n+ CoreConstants.PackageFileSavePathTemplate,\n+ CoreConstants.NuGetPackageFileExtension);\n+\n+ return _fileStorageService.SaveFileAsync(\n+ CoreConstants.ValidationFolderName,\n+ fileName,\n+ packageFile,\n+ overwrite: false);\n+ }\n+\n+ public Task<Stream> DownloadValidationPackageFileAsync(Package package)\n+ {\n+ var fileName = BuildFileName(\n+ package,\n+ CoreConstants.PackageFileSavePathTemplate,\n+ CoreConstants.NuGetPackageFileExtension);\n+\n+ return _fileStorageService.GetFileAsync(CoreConstants.ValidationFolderName, fileName);\n+ }\n+\n+ public Task DeleteValidationPackageFileAsync(string id, string version)\n+ {\n+ if (version == null)\n+ {\n+ throw new ArgumentNullException(nameof(version));\n+ }\n+\n+ var normalizedVersion = NuGetVersionFormatter.Normalize(version);\n+ var fileName = BuildFileName(\n+ id,\n+ normalizedVersion,\n+ CoreConstants.PackageFileSavePathTemplate,\n+ CoreConstants.NuGetPackageFileExtension);\n+\n+ return _fileStorageService.DeleteFileAsync(CoreConstants.ValidationFolderName, fileName);\n+ }\n+\nprotected static string BuildFileName(Package package, string format, string extension)\n{\nif (package == null)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Services/ICorePackageFileService.cs", "new_path": "src/NuGetGallery.Core/Services/ICorePackageFileService.cs", "diff": "@@ -17,5 +17,28 @@ public interface ICorePackageFileService\n/// Downloads the package from the file storage and reads it into a stream.\n/// </summary>\nTask<Stream> DownloadPackageFileAsync(Package package);\n+\n+ /// <summary>\n+ /// Saves the contents of the package to the private container for packages that are being validated. If the\n+ /// file already exists, an exception will be thrown.\n+ /// </summary>\n+ /// <param name=\"package\">The package metadata.</param>\n+ /// <param name=\"packageFile\">The stream containing the package itself (the .nupkg).</param>\n+ Task SaveValidationPackageFileAsync(Package package, Stream packageFile);\n+\n+ /// <summary>\n+ /// Downloads the validating package from the file storage and reads it into a stream. If the file does not\n+ /// exist, an exception will be thrown.\n+ /// </summary>\n+ /// <param name=\"package\">The package metadata.</param>\n+ Task<Stream> DownloadValidationPackageFileAsync(Package package);\n+\n+ /// <summary>\n+ /// Deletes the validating package from the file storage. If the file does not exist this method will not throw\n+ /// any exception.\n+ /// </summary>\n+ /// <param name=\"id\">The package ID. This value is case-insensitive.</param>\n+ /// <param name=\"version\">The package version. This value is case-insensitive and need not be normalized.</param>\n+ Task DeleteValidationPackageFileAsync(string id, string version);\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Core.Facts/Services/CloudBlobCoreFileStorageServiceFacts.cs", "new_path": "tests/NuGetGallery.Core.Facts/Services/CloudBlobCoreFileStorageServiceFacts.cs", "diff": "@@ -32,24 +32,47 @@ public class CloudBlobCoreFileStorageServiceFacts\nprivate class FolderNamesDataAttribute : DataAttribute\n{\n- public FolderNamesDataAttribute(bool includePermissions = false)\n+ public FolderNamesDataAttribute(bool includePermissions = false, bool includeContentTypes = false)\n{\nIncludePermissions = includePermissions;\n+ IncludeContentTypes = includeContentTypes;\n}\n- private bool IncludePermissions { get; set; }\n+ private bool IncludePermissions { get; }\n+\n+ private bool IncludeContentTypes { get; }\npublic override IEnumerable<object[]> GetData(MethodInfo testMethod)\n{\nvar folderNames = new List<object[]>\n{\n- new object[] { CoreConstants.PackagesFolderName, true },\n- new object[] { CoreConstants.UploadsFolderName, false }\n+ new object[] { CoreConstants.ContentFolderName, false, null, },\n+ new object[] { CoreConstants.DownloadsFolderName, true, CoreConstants.OctetStreamContentType },\n+ new object[] { CoreConstants.PackageBackupsFolderName, true, CoreConstants.PackageContentType },\n+ new object[] { CoreConstants.PackageReadMesFolderName, false, CoreConstants.TextContentType },\n+ new object[] { CoreConstants.PackagesFolderName, true, CoreConstants.PackageContentType },\n+ new object[] { CoreConstants.UploadsFolderName, false, CoreConstants.PackageContentType },\n+ new object[] { CoreConstants.ValidationFolderName, false, CoreConstants.PackageContentType },\n};\n- if (!IncludePermissions)\n+ if (!IncludePermissions && !IncludeContentTypes)\n+ {\n+ folderNames = folderNames\n+ .Select(fn => new[] { fn.ElementAt(0) })\n+ .ToList();\n+ }\n+ else if (IncludePermissions && !IncludeContentTypes)\n+ {\n+ folderNames = folderNames\n+ .Select(fn => new[] { fn[0], fn[1] })\n+ .ToList();\n+ }\n+ else if (!IncludePermissions && IncludeContentTypes)\n{\n- folderNames = folderNames.Select(fn => new[] { fn.ElementAt(0) }).ToList();\n+ folderNames = folderNames\n+ .Where(fn => fn[2] != null)\n+ .Select(fn => new[] { fn[0], fn[2] })\n+ .ToList();\n}\nreturn folderNames;\n@@ -343,8 +366,8 @@ public async Task WillSetTheStreamPositionToZero(string folderName)\npublic class TheSaveFileMethod\n{\n[Theory]\n- [FolderNamesData]\n- public async Task WillGetTheBlobFromTheCorrectFolderContainer(string folderName)\n+ [FolderNamesData(includeContentTypes: true)]\n+ public async Task WillGetTheBlobFromTheCorrectFolderContainer(string folderName, string contentType)\n{\nvar fakeBlobClient = new Mock<ICloudBlobClient>();\nvar fakeBlobContainer = new Mock<ICloudBlobContainer>();\n@@ -450,8 +473,8 @@ public async Task WillUploadThePackageFileToTheBlob()\n}\n[Theory]\n- [FolderNamesData]\n- public async Task WillSetTheBlobContentType(string folderName)\n+ [FolderNamesData(includeContentTypes: true)]\n+ public async Task WillSetTheBlobContentType(string folderName, string contentType)\n{\nvar fakeBlobClient = new Mock<ICloudBlobClient>();\nvar fakeBlobContainer = new Mock<ICloudBlobContainer>();\n@@ -483,7 +506,7 @@ public async Task WillSetTheBlobContentType(string folderName)\nawait service.SaveFileAsync(folderName, \"theFileName\", new MemoryStream());\n- Assert.Equal(CoreConstants.PackageContentType, fakeBlob.Object.Properties.ContentType);\n+ Assert.Equal(contentType, fakeBlob.Object.Properties.ContentType);\nfakeBlob.Verify(x => x.SetPropertiesAsync());\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Core.Facts/Services/CorePackageFileServiceFacts.cs", "new_path": "tests/NuGetGallery.Core.Facts/Services/CorePackageFileServiceFacts.cs", "diff": "@@ -12,6 +12,14 @@ namespace NuGetGallery\n{\npublic class CorePackageFileServiceFacts\n{\n+ private const string ValidationFolderName = \"validation\";\n+ private const string Id = \"NuGet.Versioning\";\n+ private const string Version = \"4.3.0.0-BETA+1\";\n+ private const string NormalizedVersion = \"4.3.0-BETA\";\n+ private const string LowercaseId = \"nuget.versioning\";\n+ private const string LowercaseVersion = \"4.3.0-beta\";\n+ private static readonly string ValidationFileName = $\"{LowercaseId}.{LowercaseVersion}.nupkg\";\n+\npublic class TheSavePackageFileMethod\n{\n[Fact]\n@@ -76,7 +84,7 @@ public void WillThrowIfPackageIsMissingNormalizedVersionAndVersion()\npublic async Task WillUseNormalizedRegularVersionIfNormalizedVersionMissing()\n{\nvar fileStorageSvc = new Mock<ICoreFileStorageService>();\n- var service = CreateService(fileStorageSvc: fileStorageSvc);\n+ var service = CreateService(fileStorageService: fileStorageSvc);\nvar packageRegistraion = new PackageRegistration { Id = \"theId\" };\nvar package = new Package { PackageRegistration = packageRegistraion, NormalizedVersion = null, Version = \"01.01.01\" };\n@@ -93,7 +101,7 @@ public async Task WillUseNormalizedRegularVersionIfNormalizedVersionMissing()\npublic async Task WillSaveTheFileViaTheFileStorageServiceUsingThePackagesFolder()\n{\nvar fileStorageSvc = new Mock<ICoreFileStorageService>();\n- var service = CreateService(fileStorageSvc: fileStorageSvc);\n+ var service = CreateService(fileStorageService: fileStorageSvc);\nfileStorageSvc.Setup(x => x.SaveFileAsync(CoreConstants.PackagesFolderName, It.IsAny<string>(), It.IsAny<Stream>(), It.Is<bool>(b => !b)))\n.Completes()\n.Verifiable();\n@@ -107,7 +115,7 @@ public async Task WillSaveTheFileViaTheFileStorageServiceUsingThePackagesFolder(\npublic async Task WillSaveTheFileViaTheFileStorageServiceUsingAFileNameWithIdAndNormalizedersion()\n{\nvar fileStorageSvc = new Mock<ICoreFileStorageService>();\n- var service = CreateService(fileStorageSvc: fileStorageSvc);\n+ var service = CreateService(fileStorageService: fileStorageSvc);\nfileStorageSvc.Setup(x => x.SaveFileAsync(It.IsAny<string>(), BuildFileName(\"theId\", \"theNormalizedVersion\", CoreConstants.NuGetPackageFileExtension, CoreConstants.PackageFileSavePathTemplate), It.IsAny<Stream>(), It.Is<bool>(b => !b)))\n.Completes()\n.Verifiable();\n@@ -122,7 +130,7 @@ public async Task WillSaveTheFileStreamViaTheFileStorageService()\n{\nvar fileStorageSvc = new Mock<ICoreFileStorageService>();\nvar fakeStream = new MemoryStream();\n- var service = CreateService(fileStorageSvc: fileStorageSvc);\n+ var service = CreateService(fileStorageService: fileStorageSvc);\nfileStorageSvc.Setup(x => x.SaveFileAsync(It.IsAny<string>(), It.IsAny<string>(), fakeStream, It.Is<bool>(b => !b)))\n.Completes()\n.Verifiable();\n@@ -133,6 +141,213 @@ public async Task WillSaveTheFileStreamViaTheFileStorageService()\n}\n}\n+ public class TheSaveValidationPackageFileMethod : FactsBase\n+ {\n+ [Fact]\n+ public async Task WillThrowIfPackageIsNull()\n+ {\n+ _package = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentNullException>(\n+ () => _service.SaveValidationPackageFileAsync(_package, _packageFile));\n+\n+ Assert.Equal(\"package\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfPackageFileIsNull()\n+ {\n+ _packageFile = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentNullException>(\n+ () => _service.SaveValidationPackageFileAsync(_package, _packageFile));\n+\n+ Assert.Equal(\"packageFile\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfPackageIsMissingPackageRegistration()\n+ {\n+ _package.PackageRegistration = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentException>(\n+ () => _service.SaveValidationPackageFileAsync(_package, _packageFile));\n+\n+ Assert.StartsWith(\"The package is missing required data.\", ex.Message);\n+ Assert.Equal(\"package\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfPackageIsMissingPackageRegistrationId()\n+ {\n+ _package.PackageRegistration.Id = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentException>(\n+ () => _service.SaveValidationPackageFileAsync(_package, _packageFile));\n+\n+ Assert.StartsWith(\"The package is missing required data.\", ex.Message);\n+ Assert.Equal(\"package\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfPackageIsMissingNormalizedVersionAndVersion()\n+ {\n+ _package.Version = null;\n+ _package.NormalizedVersion = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentException>(\n+ () => _service.SaveValidationPackageFileAsync(_package, _packageFile));\n+\n+ Assert.StartsWith(\"The package is missing required data.\", ex.Message);\n+ Assert.Equal(\"package\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillUseNormalizedRegularVersionIfNormalizedVersionMissing()\n+ {\n+ _package.NormalizedVersion = null;\n+\n+ await _service.SaveValidationPackageFileAsync(_package, _packageFile);\n+\n+ _fileStorageService.Verify(\n+ x => x.SaveFileAsync(ValidationFolderName, ValidationFileName, _packageFile, false),\n+ Times.Once);\n+ _fileStorageService.Verify(\n+ x => x.SaveFileAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Stream>(), It.IsAny<bool>()),\n+ Times.Once);\n+ }\n+\n+ [Fact]\n+ public async Task WillSaveTheFileViaTheFileStorageService()\n+ {\n+ await _service.SaveValidationPackageFileAsync(_package, _packageFile);\n+\n+ _fileStorageService.Verify(\n+ x => x.SaveFileAsync(ValidationFolderName, ValidationFileName, _packageFile, false),\n+ Times.Once);\n+ _fileStorageService.Verify(\n+ x => x.SaveFileAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Stream>(), It.IsAny<bool>()),\n+ Times.Once);\n+ }\n+ }\n+\n+ public class TheDownloadValidationPackageFileMethod : FactsBase\n+ {\n+ [Fact]\n+ public async Task WillThrowIfPackageIsNull()\n+ {\n+ _package = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentNullException>(\n+ () => _service.DownloadValidationPackageFileAsync(_package));\n+\n+ Assert.Equal(\"package\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfPackageIsMissingPackageRegistration()\n+ {\n+ _package.PackageRegistration = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentException>(\n+ () => _service.DownloadValidationPackageFileAsync(_package));\n+\n+ Assert.StartsWith(\"The package is missing required data.\", ex.Message);\n+ Assert.Equal(\"package\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfPackageIsMissingPackageRegistrationId()\n+ {\n+ _package.PackageRegistration.Id = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentException>(\n+ () => _service.DownloadValidationPackageFileAsync(_package));\n+\n+ Assert.StartsWith(\"The package is missing required data.\", ex.Message);\n+ Assert.Equal(\"package\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfPackageIsMissingNormalizedVersionAndVersion()\n+ {\n+ _package.Version = null;\n+ _package.NormalizedVersion = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentException>(\n+ () => _service.DownloadValidationPackageFileAsync(_package));\n+\n+ Assert.StartsWith(\"The package is missing required data.\", ex.Message);\n+ Assert.Equal(\"package\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillUseNormalizedRegularVersionIfNormalizedVersionMissing()\n+ {\n+ _package.NormalizedVersion = null;\n+\n+ await _service.DownloadValidationPackageFileAsync(_package);\n+\n+ _fileStorageService.Verify(\n+ x => x.GetFileAsync(ValidationFolderName, ValidationFileName),\n+ Times.Once);\n+ _fileStorageService.Verify(\n+ x => x.GetFileAsync(It.IsAny<string>(), It.IsAny<string>()),\n+ Times.Once);\n+ }\n+\n+ [Fact]\n+ public async Task WillDownloadTheFileViaTheFileStorageService()\n+ {\n+ await _service.DownloadValidationPackageFileAsync(_package);\n+\n+ _fileStorageService.Verify(\n+ x => x.GetFileAsync(ValidationFolderName, ValidationFileName),\n+ Times.Once);\n+ _fileStorageService.Verify(\n+ x => x.GetFileAsync(It.IsAny<string>(), It.IsAny<string>()),\n+ Times.Once);\n+ }\n+ }\n+\n+ public class TheDeletePackageFileMethod : FactsBase\n+ {\n+ [Fact]\n+ public async Task WillThrowIfIdIsNull()\n+ {\n+ string id = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentNullException>(\n+ () => _service.DeleteValidationPackageFileAsync(id, Version));\n+\n+ Assert.Equal(\"id\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfVersionIsNull()\n+ {\n+ string version = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentNullException>(\n+ () => _service.DeleteValidationPackageFileAsync(Id, version));\n+\n+ Assert.Equal(\"version\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillDeleteTheFileViaTheFileStorageService()\n+ {\n+ await _service.DeleteValidationPackageFileAsync(Id, Version);\n+\n+ _fileStorageService.Verify(\n+ x => x.DeleteFileAsync(ValidationFolderName, ValidationFileName),\n+ Times.Once);\n+ _fileStorageService.Verify(\n+ x => x.DeleteFileAsync(It.IsAny<string>(), It.IsAny<string>()),\n+ Times.Once);\n+ }\n+ }\n+\nstatic string BuildFileName(\nstring id,\nstring version, string extension, string path)\n@@ -157,12 +372,36 @@ static MemoryStream CreatePackageFileStream()\nreturn new MemoryStream(new byte[] { 0, 0, 1, 0, 1, 0, 1, 0 }, 0, 8, true, true);\n}\n- static CorePackageFileService CreateService(Mock<ICoreFileStorageService> fileStorageSvc = null)\n+ static CorePackageFileService CreateService(Mock<ICoreFileStorageService> fileStorageService = null)\n{\n- fileStorageSvc = fileStorageSvc ?? new Mock<ICoreFileStorageService>();\n+ fileStorageService = fileStorageService ?? new Mock<ICoreFileStorageService>();\nreturn new CorePackageFileService(\n- fileStorageSvc.Object);\n+ fileStorageService.Object);\n+ }\n+\n+ public abstract class FactsBase\n+ {\n+ protected readonly Mock<ICoreFileStorageService> _fileStorageService;\n+ protected readonly CorePackageFileService _service;\n+ protected Package _package;\n+ protected Stream _packageFile;\n+\n+ public FactsBase()\n+ {\n+ _fileStorageService = new Mock<ICoreFileStorageService>();\n+ _service = CreateService(fileStorageService: _fileStorageService);\n+ _package = new Package\n+ {\n+ PackageRegistration = new PackageRegistration\n+ {\n+ Id = Id,\n+ },\n+ Version = Version,\n+ NormalizedVersion = NormalizedVersion,\n+ };\n+ _packageFile = Stream.Null;\n+ }\n}\n}\n}\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add APIs to upload, download, and delete a package from the validation container (#4761) Progress on https://github.com/NuGet/NuGetGallery/issues/4646
455,736
28.09.2017 09:45:00
25,200
ec33899a14ff914a3a63eaf45cb0c584c975edee
Write to the validation container if the package starts in the Validating status Progress on
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/PackageUploadService.cs", "new_path": "src/NuGetGallery/Services/PackageUploadService.cs", "diff": "@@ -66,10 +66,25 @@ public class PackageUploadService : IPackageUploadService\npublic async Task<PackageCommitResult> CommitPackageAsync(Package package, Stream packageFile)\n{\n+ if (package.PackageStatusKey != PackageStatus.Available\n+ && package.PackageStatusKey != PackageStatus.Validating)\n+ {\n+ throw new ArgumentException(\n+ $\"The package to commit must have either the {PackageStatus.Available} or {PackageStatus.Validating} package status.\",\n+ nameof(package));\n+ }\n+\ntry\n+ {\n+ if (package.PackageStatusKey == PackageStatus.Validating)\n+ {\n+ await _packageFileService.SaveValidationPackageFileAsync(package, packageFile);\n+ }\n+ else\n{\nawait _packageFileService.SavePackageFileAsync(package, packageFile);\n}\n+ }\ncatch (InvalidOperationException ex)\n{\nex.Log();\n@@ -84,9 +99,18 @@ public async Task<PackageCommitResult> CommitPackageAsync(Package package, Strea\ncatch\n{\n// If saving to the DB fails for any reason we need to delete the package we just saved.\n+ if (package.PackageStatusKey == PackageStatus.Validating)\n+ {\n+ await _packageFileService.DeleteValidationPackageFileAsync(\n+ package.PackageRegistration.Id,\n+ package.Version);\n+ }\n+ else\n+ {\nawait _packageFileService.DeletePackageFileAsync(\npackage.PackageRegistration.Id,\npackage.Version);\n+ }\nthrow;\n}\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Services/PackageUploadServiceFacts.cs", "new_path": "tests/NuGetGallery.Facts/Services/PackageUploadServiceFacts.cs", "diff": "@@ -173,9 +173,52 @@ public async Task WillMarkPackageRegistrationNotVerifiedIfIdMatchesNonOwnedShare\npublic class TheCommitPackageMethod : FactsBase\n{\n+ public static IEnumerable<object[]> SupportedPackageStatuses => new[]\n+ {\n+ new object[] { PackageStatus.Available },\n+ new object[] { PackageStatus.Validating },\n+ };\n+\n+ public static IEnumerable<object[]> UnsupportedPackageStatuses => Enum\n+ .GetValues(typeof(PackageStatus))\n+ .Cast<PackageStatus>()\n+ .Concat(new[] { (PackageStatus)(-1) })\n+ .Where(s => !SupportedPackageStatuses.Any(o => s.Equals(o[0])))\n+ .Select(s => new object[] { s });\n+\n+ [Theory]\n+ [MemberData(nameof(SupportedPackageStatuses))]\n+ public async Task CommitsAfterSavingSupportedPackageStatuses(PackageStatus packageStatus)\n+ {\n+ _package.PackageStatusKey = packageStatus;\n+\n+ var result = await _target.CommitPackageAsync(_package, _packageFile);\n+\n+ _entitiesContext.Verify(\n+ x => x.SaveChangesAsync(),\n+ Times.Once);\n+ Assert.Equal(PackageCommitResult.Success, result);\n+ }\n+\n+ [Theory]\n+ [MemberData(nameof(UnsupportedPackageStatuses))]\n+ public async Task RejectsUnsupportedPackageStatuses(PackageStatus packageStatus)\n+ {\n+ _package.PackageStatusKey = packageStatus;\n+\n+ await Assert.ThrowsAsync<ArgumentException>(\n+ () => _target.CommitPackageAsync(_package, _packageFile));\n+\n+ _entitiesContext.Verify(\n+ x => x.SaveChangesAsync(),\n+ Times.Never);\n+ }\n+\n[Fact]\n- public async Task SavesPackageToStorageAndDatabase()\n+ public async Task SavesPackageToStorageAndDatabaseWhenAvailable()\n{\n+ _package.PackageStatusKey = PackageStatus.Available;\n+\nvar result = await _target.CommitPackageAsync(_package, _packageFile);\n_packageFileService.Verify(\n@@ -190,6 +233,25 @@ public async Task SavesPackageToStorageAndDatabase()\nAssert.Equal(PackageCommitResult.Success, result);\n}\n+ [Fact]\n+ public async Task SavesPackageToStorageAndDatabaseWhenValidating()\n+ {\n+ _package.PackageStatusKey = PackageStatus.Validating;\n+\n+ var result = await _target.CommitPackageAsync(_package, _packageFile);\n+\n+ _packageFileService.Verify(\n+ x => x.SaveValidationPackageFileAsync(_package, _packageFile),\n+ Times.Once);\n+ _packageFileService.Verify(\n+ x => x.SaveValidationPackageFileAsync(It.IsAny<Package>(), It.IsAny<Stream>()),\n+ Times.Once);\n+ _entitiesContext.Verify(\n+ x => x.SaveChangesAsync(),\n+ Times.Once);\n+ Assert.Equal(PackageCommitResult.Success, result);\n+ }\n+\n[Fact]\npublic async Task DoesNotCommitToDatabaseWhenSavingTheFileFails()\n{\n@@ -223,8 +285,10 @@ public async Task DoesNotCommitToDatabaseWhenTheFileConflicts()\n}\n[Fact]\n- public async Task DeletesPackageIfDatabaseCommitFails()\n+ public async Task DeletesPackageIfDatabaseCommitFailsWhenAvailable()\n{\n+ _package.PackageStatusKey = PackageStatus.Available;\n+\n_entitiesContext\n.Setup(x => x.SaveChangesAsync())\n.Throws(_unexpectedException);\n@@ -241,6 +305,28 @@ public async Task DeletesPackageIfDatabaseCommitFails()\nTimes.Once);\nAssert.Same(_unexpectedException, exception);\n}\n+\n+ [Fact]\n+ public async Task DeletesPackageIfDatabaseCommitFailsWhenValidating()\n+ {\n+ _package.PackageStatusKey = PackageStatus.Validating;\n+\n+ _entitiesContext\n+ .Setup(x => x.SaveChangesAsync())\n+ .Throws(_unexpectedException);\n+\n+ var exception = await Assert.ThrowsAsync(\n+ _unexpectedException.GetType(),\n+ () => _target.CommitPackageAsync(_package, _packageFile));\n+\n+ _packageFileService.Verify(\n+ x => x.DeleteValidationPackageFileAsync(Id, Version),\n+ Times.Once);\n+ _packageFileService.Verify(\n+ x => x.DeleteValidationPackageFileAsync(It.IsAny<string>(), It.IsAny<string>()),\n+ Times.Once);\n+ Assert.Same(_unexpectedException, exception);\n+ }\n}\npublic abstract class FactsBase\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Write to the validation container if the package starts in the Validating status (#4766) Progress on https://github.com/NuGet/NuGetGallery/issues/4646
455,736
29.09.2017 12:22:26
25,200
238b215c818499c39abf459fc1dabd01c3e65b55
Update NuGet.Services.Validation to 2.3.0 (stable, signed)
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<HintPath>..\\..\\packages\\NuGet.Protocol.4.3.0-preview1-2524\\lib\\net45\\NuGet.Protocol.dll</HintPath>\n</Reference>\n<Reference Include=\"NuGet.Services.Contracts, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\NuGet.Services.Contracts.2.3.0-dev-14813\\lib\\net45\\NuGet.Services.Contracts.dll</HintPath>\n+ <HintPath>..\\..\\packages\\NuGet.Services.Contracts.2.3.0\\lib\\net45\\NuGet.Services.Contracts.dll</HintPath>\n</Reference>\n<Reference Include=\"NuGet.Services.KeyVault, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL\">\n<HintPath>..\\..\\packages\\NuGet.Services.KeyVault.1.0.0.0\\lib\\net45\\NuGet.Services.KeyVault.dll</HintPath>\n<Private>True</Private>\n</Reference>\n<Reference Include=\"NuGet.Services.ServiceBus, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\NuGet.Services.ServiceBus.2.3.0-dev-14813\\lib\\net45\\NuGet.Services.ServiceBus.dll</HintPath>\n+ <HintPath>..\\..\\packages\\NuGet.Services.ServiceBus.2.3.0\\lib\\net45\\NuGet.Services.ServiceBus.dll</HintPath>\n</Reference>\n<Reference Include=\"NuGet.Services.Validation, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\NuGet.Services.Validation.2.3.0-dev-14813\\lib\\net45\\NuGet.Services.Validation.dll</HintPath>\n+ <HintPath>..\\..\\packages\\NuGet.Services.Validation.2.3.0\\lib\\net45\\NuGet.Services.Validation.dll</HintPath>\n</Reference>\n<Reference Include=\"NuGet.Versioning, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL\">\n<HintPath>..\\..\\packages\\NuGet.Versioning.4.3.0-preview1-2524\\lib\\net45\\NuGet.Versioning.dll</HintPath>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/packages.config", "new_path": "src/NuGetGallery/packages.config", "diff": "<package id=\"NuGet.Packaging\" version=\"4.3.0-preview1-2524\" targetFramework=\"net46\" />\n<package id=\"NuGet.Packaging.Core\" version=\"4.3.0-preview1-2524\" targetFramework=\"net46\" />\n<package id=\"NuGet.Protocol\" version=\"4.3.0-preview1-2524\" targetFramework=\"net46\" />\n- <package id=\"NuGet.Services.Contracts\" version=\"2.3.0-dev-14813\" targetFramework=\"net46\" />\n+ <package id=\"NuGet.Services.Contracts\" version=\"2.3.0\" targetFramework=\"net46\" />\n<package id=\"NuGet.Services.KeyVault\" version=\"1.0.0.0\" targetFramework=\"net46\" />\n<package id=\"NuGet.Services.Logging\" version=\"2.2.3.0\" targetFramework=\"net46\" />\n<package id=\"NuGet.Services.Owin\" version=\"2.2.3\" targetFramework=\"net46\" />\n<package id=\"NuGet.Services.Platform.Client\" version=\"3.0.29-r-master\" targetFramework=\"net46\" />\n- <package id=\"NuGet.Services.ServiceBus\" version=\"2.3.0-dev-14813\" targetFramework=\"net46\" />\n- <package id=\"NuGet.Services.Validation\" version=\"2.3.0-dev-14813\" targetFramework=\"net46\" />\n+ <package id=\"NuGet.Services.ServiceBus\" version=\"2.3.0\" targetFramework=\"net46\" />\n+ <package id=\"NuGet.Services.Validation\" version=\"2.3.0\" targetFramework=\"net46\" />\n<package id=\"NuGet.Versioning\" version=\"4.3.0-preview1-2524\" targetFramework=\"net46\" />\n<package id=\"ODataNullPropagationVisitor\" version=\"0.5.4237.2641\" targetFramework=\"net46\" />\n<package id=\"Owin\" version=\"1.0\" targetFramework=\"net46\" />\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "new_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "diff": "<HintPath>..\\..\\packages\\NuGet.Protocol.4.3.0-preview1-2524\\lib\\net45\\NuGet.Protocol.dll</HintPath>\n</Reference>\n<Reference Include=\"NuGet.Services.Contracts, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\NuGet.Services.Contracts.2.3.0-dev-14813\\lib\\net45\\NuGet.Services.Contracts.dll</HintPath>\n+ <HintPath>..\\..\\packages\\NuGet.Services.Contracts.2.3.0\\lib\\net45\\NuGet.Services.Contracts.dll</HintPath>\n</Reference>\n<Reference Include=\"NuGet.Services.KeyVault, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL\">\n<HintPath>..\\..\\packages\\NuGet.Services.KeyVault.1.0.0.0\\lib\\net45\\NuGet.Services.KeyVault.dll</HintPath>\n<Private>True</Private>\n</Reference>\n<Reference Include=\"NuGet.Services.ServiceBus, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\NuGet.Services.ServiceBus.2.3.0-dev-14813\\lib\\net45\\NuGet.Services.ServiceBus.dll</HintPath>\n+ <HintPath>..\\..\\packages\\NuGet.Services.ServiceBus.2.3.0\\lib\\net45\\NuGet.Services.ServiceBus.dll</HintPath>\n</Reference>\n<Reference Include=\"NuGet.Services.Validation, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\NuGet.Services.Validation.2.3.0-dev-14813\\lib\\net45\\NuGet.Services.Validation.dll</HintPath>\n+ <HintPath>..\\..\\packages\\NuGet.Services.Validation.2.3.0\\lib\\net45\\NuGet.Services.Validation.dll</HintPath>\n</Reference>\n<Reference Include=\"NuGet.Versioning, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL\">\n<HintPath>..\\..\\packages\\NuGet.Versioning.4.3.0-preview1-2524\\lib\\net45\\NuGet.Versioning.dll</HintPath>\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/packages.config", "new_path": "tests/NuGetGallery.Facts/packages.config", "diff": "<package id=\"NuGet.Packaging\" version=\"4.3.0-preview1-2524\" targetFramework=\"net46\" />\n<package id=\"NuGet.Packaging.Core\" version=\"4.3.0-preview1-2524\" targetFramework=\"net46\" />\n<package id=\"NuGet.Protocol\" version=\"4.3.0-preview1-2524\" targetFramework=\"net46\" />\n- <package id=\"NuGet.Services.Contracts\" version=\"2.3.0-dev-14813\" targetFramework=\"net46\" />\n+ <package id=\"NuGet.Services.Contracts\" version=\"2.3.0\" targetFramework=\"net46\" />\n<package id=\"NuGet.Services.KeyVault\" version=\"1.0.0.0\" targetFramework=\"net46\" />\n- <package id=\"NuGet.Services.ServiceBus\" version=\"2.3.0-dev-14813\" targetFramework=\"net46\" />\n- <package id=\"NuGet.Services.Validation\" version=\"2.3.0-dev-14813\" targetFramework=\"net46\" />\n+ <package id=\"NuGet.Services.ServiceBus\" version=\"2.3.0\" targetFramework=\"net46\" />\n+ <package id=\"NuGet.Services.Validation\" version=\"2.3.0\" targetFramework=\"net46\" />\n<package id=\"NuGet.Versioning\" version=\"4.3.0-preview1-2524\" targetFramework=\"net46\" />\n<package id=\"Owin\" version=\"1.0\" targetFramework=\"net46\" />\n<package id=\"PoliteCaptcha\" version=\"0.4.0.1\" targetFramework=\"net46\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Update NuGet.Services.Validation to 2.3.0 (stable, signed) (#4777)
455,794
02.10.2017 13:30:28
25,200
b4189ae7dc5bf18c64e4271b8aba26840610831c
Package documentation telemetry
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/PackagesController.cs", "new_path": "src/NuGetGallery/Controllers/PackagesController.cs", "diff": "@@ -1126,6 +1126,10 @@ public virtual async Task<JsonResult> Edit(string id, string version, VerifyPack\n{\n// Update pending readme.md file, if modified.\nvar hasReadMe = await _readMeService.SavePendingReadMeMdIfChanged(package, formData.Edit, Request.ContentEncoding);\n+ if (hasReadMe)\n+ {\n+ _telemetryService.TrackPackageReadMeChangeEvent(package, formData.Edit.ReadMe.SourceType, formData.Edit.ReadMeState);\n+ }\n// Queue package edit in database for processing in background (HandlePackageEdits job).\nvar user = GetCurrentUser();\n@@ -1464,7 +1468,11 @@ public virtual async Task<JsonResult> VerifyPackage(VerifyPackageRequest formDat\nvar pendEdit = false;\nif (formData.Edit != null)\n{\n- pendEdit = await _readMeService.SavePendingReadMeMdIfChanged(package, formData.Edit, Request.ContentEncoding);\n+ if (await _readMeService.SavePendingReadMeMdIfChanged(package, formData.Edit, Request.ContentEncoding))\n+ {\n+ pendEdit = true;\n+ _telemetryService.TrackPackageReadMeChangeEvent(package, formData.Edit.ReadMe.SourceType, formData.Edit.ReadMeState);\n+ }\npendEdit = pendEdit || formData.Edit.RequiresLicenseAcceptance != packageMetadata.RequireLicenseAcceptance;\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/ITelemetryService.cs", "new_path": "src/NuGetGallery/Services/ITelemetryService.cs", "diff": "@@ -11,6 +11,8 @@ public interface ITelemetryService\nvoid TrackPackagePushEvent(Package package, User user, IIdentity identity);\n+ void TrackPackageReadMeChangeEvent(Package package, string readMeSourceType, PackageEditReadMeState readMeState);\n+\nvoid TrackCreatePackageVerificationKeyEvent(string packageId, string packageVersion, User user, IIdentity identity);\nvoid TrackVerifyPackageKeyEvent(string packageId, string packageVersion, User user, IIdentity identity, int statusCode);\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/TelemetryService.cs", "new_path": "src/NuGetGallery/Services/TelemetryService.cs", "diff": "@@ -15,6 +15,7 @@ public class TelemetryService : ITelemetryService\npublic const string PackagePushEvent = \"PackagePush\";\npublic const string CreatePackageVerificationKeyEvent = \"CreatePackageVerificationKeyEvent\";\npublic const string VerifyPackageKeyEvent = \"VerifyPackageKeyEvent\";\n+ public const string PackageReadMeChangeEvent = \"PackageReadMeChanged\";\n// ODataQueryFilter properties\npublic const string CallContext = \"CallContext\";\n@@ -36,6 +37,10 @@ public class TelemetryService : ITelemetryService\npublic const string IsVerificationKeyUsed = \"IsVerificationKeyUsed\";\npublic const string VerifyPackageKeyStatusCode = \"VerifyPackageKeyStatusCode\";\n+ // Package ReadMe properties\n+ public const string ReadMeSourceType = \"ReadMeSourceType\";\n+ public const string ReadMeState = \"ReadMeState\";\n+\npublic void TrackODataQueryFilterEvent(string callContext, bool isEnabled, bool isAllowed, string queryPattern)\n{\nTrackEvent(ODataQueryFilterEvent, properties =>\n@@ -48,6 +53,26 @@ public void TrackODataQueryFilterEvent(string callContext, bool isEnabled, bool\n});\n}\n+ public void TrackPackageReadMeChangeEvent(Package package, string readMeSourceType, PackageEditReadMeState readMeState)\n+ {\n+ if (package == null)\n+ {\n+ throw new ArgumentNullException(nameof(package));\n+ }\n+\n+ if (string.IsNullOrWhiteSpace(readMeSourceType))\n+ {\n+ throw new ArgumentNullException(nameof(readMeSourceType));\n+ }\n+\n+ TrackEvent(PackagePushEvent, properties => {\n+ properties.Add(PackageId, package.PackageRegistration.Id);\n+ properties.Add(PackageVersion, package.Version);\n+ properties.Add(ReadMeSourceType, readMeSourceType);\n+ properties.Add(ReadMeState, Enum.GetName(typeof(PackageEditReadMeState), readMeState));\n+ });\n+ }\n+\npublic void TrackPackagePushEvent(Package package, User user, IIdentity identity)\n{\nif (package == null)\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "new_path": "src/NuGetGallery/Views/Packages/DisplayPackage.cshtml", "diff": "@if (Model.ReadMeHtmlClamped.Length < Model.ReadMeHtml.Length)\n{\n<a href=\"#\" role=\"button\" data-toggle=\"collapse\" class=\"icon-link\" data-target=\".readme\"\n- aria-expanded=\"false\" aria-controls=\".readme\" id=\"show-readme-full\">\n+ aria-expanded=\"false\" aria-controls=\".readme\" id=\"show-readme-full\" data-track=\"show-package-documentation\" >\n<i class=\"ms-Icon ms-Icon--CalculatorAddition\" aria-hidden=\"true\"></i>\n<span>Show more</span>\n</a>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Package documentation telemetry (#4789)
455,772
02.10.2017 16:58:18
25,200
2162ec99b678e17b1d72d28dfc15834ae7eeb6a0
Disable custom pages for 400 errors
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Web.config", "new_path": "src/NuGetGallery/Web.config", "diff": "<customErrors mode=\"RemoteOnly\" defaultRedirect=\"~/Errors/500\" redirectMode=\"ResponseRedirect\">\n<!-- Adding ? at the end of the redirect URL prevents the illegal request to be passed\nas a query parameter to the redirect URL and causing additional failures -->\n- <error statusCode=\"400\" redirect=\"~/Errors/400?\" />\n<error statusCode=\"404\" redirect=\"~/Errors/404\" />\n<error statusCode=\"500\" redirect=\"~/Errors/500\" />\n</customErrors>\n</modules>\n<validation validateIntegratedModeConfiguration=\"false\" />\n<httpErrors errorMode=\"DetailedLocalOnly\">\n- <remove statusCode=\"400\" />\n<remove statusCode=\"404\" />\n<remove statusCode=\"500\" />\n- <error statusCode=\"400\" path=\"/Errors/400?\" responseMode=\"ExecuteURL\" />\n<error statusCode=\"404\" path=\"/Errors/404\" responseMode=\"ExecuteURL\" />\n<error statusCode=\"500\" path=\"/Errors/500\" responseMode=\"ExecuteURL\" />\n</httpErrors>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Disable custom pages for 400 errors (#4794)
455,794
03.10.2017 09:55:35
25,200
52a1c0478742eeb5565ce594adb7d39f14f008f7
Log user safe exceptions
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/PackagesController.cs", "new_path": "src/NuGetGallery/Controllers/PackagesController.cs", "diff": "using System.Web.Mvc;\nusing NuGet.Packaging;\nusing NuGet.Versioning;\n-using NuGetGallery;\nusing NuGetGallery.Areas.Admin;\nusing NuGetGallery.AsyncFileUpload;\nusing NuGetGallery.Auditing;\n@@ -211,6 +210,8 @@ public async virtual Task<ActionResult> UploadPackage()\n}\ncatch (Exception ex)\n{\n+ _telemetryService.TraceException(ex);\n+\nTempData[\"Message\"] = ex.GetUserSafeMessage();\nreturn View(model);\n}\n@@ -413,6 +414,8 @@ public virtual async Task<JsonResult> UploadPackage(HttpPostedFileBase uploadFil\n}\ncatch (Exception ex)\n{\n+ _telemetryService.TraceException(ex);\n+\nTempData[\"Message\"] = ex.GetUserSafeMessage();\nreturn Json(400, new[] { ex.GetUserSafeMessage() });\n@@ -953,7 +956,7 @@ public virtual async Task<ActionResult> Reflow(string id, string version)\nTempData[\"Message\"] =\n$\"An error occurred while reflowing the package. {ex.Message}\";\n- QuietLog.LogHandledException(ex);\n+ ex.Log();\n}\nreturn SafeRedirect(Url.Package(id, version));\n@@ -978,7 +981,7 @@ public virtual async Task<ActionResult> Revalidate(string id, string version)\n}\ncatch (Exception ex)\n{\n- QuietLog.LogHandledException(ex);\n+ ex.Log();\nTempData[\"Message\"] = $\"An error occurred while revalidating the package. {ex.Message}\";\n}\n@@ -1349,9 +1352,10 @@ private async Task<bool> SubscribeToSecurePushAsync(User user)\n{\nreturn await _securityPolicyService.SubscribeAsync(user, SecurePushSubscription.Name);\n}\n- catch (Exception e)\n+ catch (Exception ex)\n{\n- QuietLog.LogHandledException(e);\n+ ex.Log();\n+\nthrow;\n}\n}\n@@ -1460,6 +1464,8 @@ public virtual async Task<JsonResult> VerifyPackage(VerifyPackageRequest formDat\n}\ncatch (InvalidPackageException ex)\n{\n+ _telemetryService.TraceException(ex);\n+\nTempData[\"Message\"] = ex.Message;\nreturn Json(400, new[] { ex.GetUserSafeMessage() });\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/OData/QueryAllowed/ODataQueryVerifier.cs", "new_path": "src/NuGetGallery/OData/QueryAllowed/ODataQueryVerifier.cs", "diff": "namespace NuGetGallery.OData.QueryFilter\n{\n- public class ODataQueryVerifier\n+ public static class ODataQueryVerifier\n{\nprivate static Lazy<ODataQueryFilter> _v2GetUpdates =\nnew Lazy<ODataQueryFilter>(() => { return new ODataQueryFilter(\"apiv2getupdates.json\"); }, isThreadSafe: true);\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/TelemetryService.cs", "new_path": "src/NuGetGallery/Services/TelemetryService.cs", "diff": "using System.Collections.Generic;\nusing System.Security.Principal;\nusing System.Web;\n+using NuGetGallery.Diagnostics;\nnamespace NuGetGallery\n{\npublic class TelemetryService : ITelemetryService\n{\n+ private IDiagnosticsSource _trace;\n+\n// Event types\npublic const string ODataQueryFilterEvent = \"ODataQueryFilter\";\npublic const string PackagePushEvent = \"PackagePush\";\n@@ -41,6 +44,31 @@ public class TelemetryService : ITelemetryService\npublic const string ReadMeSourceType = \"ReadMeSourceType\";\npublic const string ReadMeState = \"ReadMeState\";\n+ public TelemetryService(IDiagnosticsService diagnosticsService)\n+ {\n+ if (diagnosticsService == null)\n+ {\n+ throw new ArgumentNullException(nameof(diagnosticsService));\n+ }\n+\n+ _trace = diagnosticsService.GetSource(\"TelemetryService\");\n+ }\n+\n+ // Used by ODataQueryVerifier. Should consider refactoring to make this non-static.\n+ internal TelemetryService() : this(new DiagnosticsService())\n+ {\n+ }\n+\n+ public void TraceException(Exception exception)\n+ {\n+ if (exception == null)\n+ {\n+ throw new ArgumentNullException(nameof(exception));\n+ }\n+\n+ _trace.Warning(exception.ToString());\n+ }\n+\npublic void TrackODataQueryFilterEvent(string callContext, bool isEnabled, bool isAllowed, string queryPattern)\n{\nTrackEvent(ODataQueryFilterEvent, properties =>\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "new_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "diff": "<Compile Include=\"Services\\ReservedNamespaceServiceFacts.cs\" />\n<Compile Include=\"Services\\ScopeEvaluatorFacts.cs\" />\n<Compile Include=\"Services\\SearchAdaptorFacts.cs\" />\n+ <Compile Include=\"Services\\TelemetryServiceFacts.cs\" />\n<Compile Include=\"Services\\ValidationServiceFacts.cs\" />\n<Compile Include=\"Telemetry\\ClientInformationTelemetryEnricherTests.cs\" />\n<Compile Include=\"TestUtils\\Infrastructure\\TestableV1Feed.cs\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Log user safe exceptions (#4763)
455,736
02.10.2017 15:12:47
25,200
a3a6a7032212e3ff4c9c2716f739535df881aa73
Specify the empty string area in UrlExtensions unless otherwise specified Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/AdminAreaRegistration.cs", "new_path": "src/NuGetGallery/Areas/Admin/AdminAreaRegistration.cs", "diff": "@@ -9,13 +9,9 @@ namespace NuGetGallery.Areas.Admin\n{\npublic class AdminAreaRegistration : AreaRegistration\n{\n- public override string AreaName\n- {\n- get\n- {\n- return \"Admin\";\n- }\n- }\n+ public const string Name = \"Admin\";\n+\n+ public override string AreaName => Name;\npublic override void RegisterArea(AreaRegistrationContext context)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Areas/Admin/Controllers/DeleteController.cs", "new_path": "src/NuGetGallery/Areas/Admin/Controllers/DeleteController.cs", "diff": "@@ -117,7 +117,7 @@ private DeleteSearchResult CreateDeleteSearchResult(Package package)\n.Select(username => new UserViewModel\n{\nUsername = username,\n- ProfileUrl = Url.User(username, area: string.Empty),\n+ ProfileUrl = Url.User(username),\n})\n.ToList()\n};\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/UrlExtensions.cs", "new_path": "src/NuGetGallery/UrlExtensions.cs", "diff": "using System.Web;\nusing System.Web.Mvc;\nusing System.Web.Routing;\n+using NuGetGallery.Areas.Admin;\nnamespace NuGetGallery\n{\npublic static class UrlExtensions\n{\n+ private const string Area = \"area\";\nprivate static IGalleryConfigurationService _configuration;\nprivate const string PackageExplorerDeepLink = @\"https://npe.codeplex.com/releases/clickonce/NuGetPackageExplorer.application?url={0}&id={1}&version={2}\";\n@@ -367,7 +369,7 @@ public static string LogOff(this UrlHelper url, bool relativeUrl = true)\n{\nstring returnUrl = url.Current();\n// If we're logging off from the Admin Area, don't set a return url\n- if (string.Equals(url.RequestContext.RouteData.DataTokens[\"area\"].ToStringOrNull(), \"Admin\", StringComparison.OrdinalIgnoreCase))\n+ if (string.Equals(url.RequestContext.RouteData.DataTokens[Area].ToStringOrNull(), AdminAreaRegistration.Name, StringComparison.OrdinalIgnoreCase))\n{\nreturnUrl = string.Empty;\n}\n@@ -379,8 +381,7 @@ public static string LogOff(this UrlHelper url, bool relativeUrl = true)\nrelativeUrl,\nrouteValues: new RouteValueDictionary\n{\n- { \"returnUrl\", returnUrl },\n- { \"area\", string.Empty }\n+ { \"returnUrl\", returnUrl }\n});\n}\n@@ -434,25 +435,18 @@ public static string UploadPackageProgress(this UrlHelper url, bool relativeUrl\nthis UrlHelper url,\nstring username,\nstring scheme = null,\n- string area = null,\nbool relativeUrl = true)\n{\n- var routeValues = new RouteValueDictionary\n- {\n- { \"username\", username },\n- };\n-\n- if (area != null)\n- {\n- routeValues[\"area\"] = area;\n- }\n-\nreturn GetActionLink(\nurl,\n\"Profiles\",\n\"Users\",\nrelativeUrl,\n- routeValues);\n+ routeValues:\n+ new RouteValueDictionary\n+ {\n+ { \"username\", username },\n+ });\n}\npublic static string EditPackage(\n@@ -776,10 +770,7 @@ public static string Admin(this UrlHelper url, bool relativeUrl = true)\n\"Index\",\n\"Home\",\nrelativeUrl,\n- routeValues: new RouteValueDictionary\n- {\n- { \"area\", \"Admin\" }\n- });\n+ area: AdminAreaRegistration.Name);\n}\npublic static string Authenticate(this UrlHelper url, string providerName, string returnUrl, bool relativeUrl = true)\n@@ -845,12 +836,19 @@ internal static string EnsureTrailingSlash(string url)\nstring controllerName,\nbool relativeUrl,\nRouteValueDictionary routeValues = null,\n- bool interceptReturnUrl = true\n+ bool interceptReturnUrl = true,\n+ string area = \"\" // Default to no area. Admin links should specify the \"Admin\" area explicitly.\n)\n{\nvar protocol = GetProtocol(url);\nvar hostName = GetConfiguredSiteHostName();\n+ routeValues = routeValues ?? new RouteValueDictionary();\n+ if (!routeValues.ContainsKey(Area))\n+ {\n+ routeValues[Area] = area;\n+ }\n+\nif (interceptReturnUrl && routeValues != null && routeValues.ContainsKey(\"ReturnUrl\"))\n{\nrouteValues[\"ReturnUrl\"] = GetAbsoluteReturnUrl(\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Specify the empty string area in UrlExtensions unless otherwise specified (#4792) Fix https://github.com/NuGet/NuGetGallery/issues/4786
455,736
02.10.2017 11:34:29
25,200
abfea8dbb919246f3c30d1872df3d435aa32fc0d
Add $count support to FindPackagesById() OData endpoints Fix This bug occurred in commit
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/ODataV1FeedController.cs", "new_path": "src/NuGetGallery/Controllers/ODataV1FeedController.cs", "diff": "@@ -84,6 +84,15 @@ public async Task<IHttpActionResult> FindPackagesById(ODataQueryOptions<V1FeedPa\nreturn await GetCore(options, id, version: null, return404NotFoundWhenNoResults: false);\n}\n+ // /api/v1/FindPackagesById()/$count?id=\n+ [HttpGet]\n+ [CacheOutput(ServerTimeSpan = NuGetODataConfig.GetByIdAndVersionCacheTimeInSeconds, Private = true, ClientTimeSpan = NuGetODataConfig.GetByIdAndVersionCacheTimeInSeconds)]\n+ public async Task<IHttpActionResult> FindPackagesByIdCount(ODataQueryOptions<V1FeedPackage> options, [FromODataUri]string id)\n+ {\n+ var result = await FindPackagesById(options, id);\n+ return result.FormattedAsCountResult<V1FeedPackage>();\n+ }\n+\nprivate async Task<IHttpActionResult> GetCore(ODataQueryOptions<V1FeedPackage> options, string id, string version, bool return404NotFoundWhenNoResults)\n{\nvar packages = _packagesRepository.GetAll()\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/ODataV2CuratedFeedController.cs", "new_path": "src/NuGetGallery/Controllers/ODataV2CuratedFeedController.cs", "diff": "@@ -112,6 +112,19 @@ public async Task<IHttpActionResult> Get(ODataQueryOptions<V2FeedPackage> option\nreturn await GetCore(options, curatedFeedName, id, normalizedVersion: null, return404NotFoundWhenNoResults: false, semVerLevel: semVerLevel);\n}\n+ // /api/v2/curated-feed/curatedFeedName/FindPackagesById()/$count?id=&semVerLevel=\n+ [HttpGet]\n+ [CacheOutput(NoCache = true)]\n+ public async Task<IHttpActionResult> FindPackagesByIdCount(\n+ ODataQueryOptions<V2FeedPackage> options,\n+ string curatedFeedName,\n+ [FromODataUri] string id,\n+ [FromUri] string semVerLevel = null)\n+ {\n+ var result = await FindPackagesById(options, curatedFeedName, id, semVerLevel);\n+ return result.FormattedAsCountResult<V2FeedPackage>();\n+ }\n+\nprivate async Task<IHttpActionResult> GetCore(\nODataQueryOptions<V2FeedPackage> options,\nstring curatedFeedName,\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/ODataV2FeedController.cs", "new_path": "src/NuGetGallery/Controllers/ODataV2FeedController.cs", "diff": "@@ -179,6 +179,17 @@ public class ODataV2FeedController\nreturn404NotFoundWhenNoResults: false);\n}\n+ // /api/v2/FindPackagesById()/$count?semVerLevel=\n+ [HttpGet]\n+ [CacheOutput(NoCache = true)]\n+ public async Task<IHttpActionResult> FindPackagesByIdCount(\n+ ODataQueryOptions<V2FeedPackage> options,\n+ [FromODataUri]string id,\n+ [FromUri]string semVerLevel = null)\n+ {\n+ return (await FindPackagesById(options, id, semVerLevel)).FormattedAsCountResult<V2FeedPackage>();\n+ }\n+\nprivate async Task<IHttpActionResult> GetCore(\nODataQueryOptions<V2FeedPackage> options,\nstring id,\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/ODataV1FeedControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/ODataV1FeedControllerFacts.cs", "diff": "@@ -51,6 +51,18 @@ public async Task FindPackagesById_FiltersSemVerV2PackageVersions()\nAssert.Equal(NonSemVer2Packages.Where(p => !p.IsPrerelease).Count(), resultSet.Count);\n}\n+ [Fact]\n+ public async Task FindPackagesByIdCount_FiltersSemVerV2PackageVersions()\n+ {\n+ // Act\n+ var count = await GetInt<V1FeedPackage>(\n+ async (controller, options) => await controller.FindPackagesByIdCount(options, TestPackageId),\n+ $\"/api/v1/FindPackagesById/$count?id='{TestPackageId}'\");\n+\n+ // Assert\n+ Assert.Equal(NonSemVer2Packages.Where(p => !p.IsPrerelease).Count(), count);\n+ }\n+\n[Fact]\npublic async Task Search_FiltersSemVerV2PackageVersions()\n{\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/ODataV2CuratedFeedControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/ODataV2CuratedFeedControllerFacts.cs", "diff": "@@ -114,13 +114,41 @@ public async Task FindPackagesById_IncludesSemVerV2PackageVersionsWhenSemVerLeve\n// Act\nvar resultSet = await GetCollection<V2FeedPackage>(\nasync (controller, options) => await controller.FindPackagesById(options, _curatedFeedName, id: TestPackageId, semVerLevel: semVerLevel),\n- $\"/api/v2/curated-feed/{_curatedFeedName}/FindPackagesById?id='{TestPackageId}'?semVerLevel={semVerLevel}\");\n+ $\"/api/v2/curated-feed/{_curatedFeedName}/FindPackagesById?id='{TestPackageId}'&semVerLevel={semVerLevel}\");\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet, includePrerelease: true);\nAssert.Equal(AvailablePackages.Count, resultSet.Count);\n}\n+ [Fact]\n+ public async Task FindPackagesByIdCount_FiltersSemVerV2PackageVersions()\n+ {\n+ // Act\n+ var count = await GetInt<V2FeedPackage>(\n+ async (controller, options) => await controller.FindPackagesByIdCount(options, _curatedFeedName, TestPackageId),\n+ $\"/api/v2/curated-feed/{_curatedFeedName}/FindPackagesById/$count?id='{TestPackageId}'\");\n+\n+ // Assert\n+ Assert.Equal(NonSemVer2Packages.Count, count);\n+ }\n+\n+ [Theory]\n+ [InlineData(\"2.0.0\")]\n+ [InlineData(\"2.0.1\")]\n+ [InlineData(\"3.0.0-alpha\")]\n+ [InlineData(\"3.0.0\")]\n+ public async Task FindPackagesByIdCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigher(string semVerLevel)\n+ {\n+ // Act\n+ var count = await GetInt<V2FeedPackage>(\n+ async (controller, options) => await controller.FindPackagesByIdCount(options, _curatedFeedName, id: TestPackageId, semVerLevel: semVerLevel),\n+ $\"/api/v2/curated-feed/{_curatedFeedName}/FindPackagesById/$count?id='{TestPackageId}'&semVerLevel={semVerLevel}\");\n+\n+ // Assert\n+ Assert.Equal(AvailablePackages.Count, count);\n+ }\n+\n[Fact]\npublic async Task Search_FiltersSemVerV2PackageVersions_ExcludePrerelease()\n{\n@@ -183,7 +211,7 @@ public async Task Search_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigher\nsearchTerm: TestPackageId,\nincludePrerelease: true,\nsemVerLevel: semVerLevel),\n- $\"/api/v2/curated-feed/{_curatedFeedName}/Search?searchTerm='{TestPackageId}'?semVerLevel={semVerLevel}&includePrerelease=true\");\n+ $\"/api/v2/curated-feed/{_curatedFeedName}/Search?searchTerm='{TestPackageId}'&semVerLevel={semVerLevel}&includePrerelease=true\");\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet, includePrerelease: true);\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/ODataV2FeedControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/ODataV2FeedControllerFacts.cs", "diff": "@@ -95,13 +95,41 @@ public async Task FindPackagesById_IncludesSemVerV2PackageVersionsWhenSemVerLeve\n// Act\nvar resultSet = await GetCollection<V2FeedPackage>(\n(controller, options) => controller.FindPackagesById(options, id: TestPackageId, semVerLevel: semVerLevel),\n- $\"/api/v2/FindPackagesById?id='{TestPackageId}'?semVerLevel={semVerLevel}\");\n+ $\"/api/v2/FindPackagesById?id='{TestPackageId}'&semVerLevel={semVerLevel}\");\n// Assert\nAssertSemVer2PackagesIncludedInResult(resultSet);\nAssert.Equal(AvailablePackages.Count, resultSet.Count);\n}\n+ [Fact]\n+ public async Task FindPackagesByIdCount_FiltersSemVerV2PackageVersionsByDefault()\n+ {\n+ // Act\n+ var count = await GetInt<V2FeedPackage>(\n+ (controller, options) => controller.FindPackagesByIdCount(options, id: TestPackageId),\n+ $\"/api/v2/FindPackagesById/$count?id='{TestPackageId}'\");\n+\n+ // Assert\n+ Assert.Equal(NonSemVer2Packages.Count, count);\n+ }\n+\n+ [Theory]\n+ [InlineData(\"2.0.0\")]\n+ [InlineData(\"2.0.1\")]\n+ [InlineData(\"3.0.0-alpha\")]\n+ [InlineData(\"3.0.0\")]\n+ public async Task FindPackagesByIdCount_IncludesSemVerV2PackageVersionsWhenSemVerLevel2OrHigher(string semVerLevel)\n+ {\n+ // Act\n+ var count = await GetInt<V2FeedPackage>(\n+ (controller, options) => controller.FindPackagesByIdCount(options, id: TestPackageId, semVerLevel: semVerLevel),\n+ $\"/api/v2/FindPackagesById/$count?id='{TestPackageId}'&semVerLevel={semVerLevel}\");\n+\n+ // Assert\n+ Assert.Equal(AvailablePackages.Count, count);\n+ }\n+\n[Fact]\npublic async Task Search_FiltersSemVerV2PackageVersionsByDefault_IncludePrerelease()\n{\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Add $count support to FindPackagesById() OData endpoints (#4790) Fix https://github.com/NuGet/NuGetGallery/issues/4760 This bug occurred in commit 3f92c55e42f2905dd415a8bb765fe4adef714c5a.
455,744
03.10.2017 15:49:08
25,200
1b086f30b796a5eda8d873161672d75c9abb1c7e
Moved CloudBlob* wrappers to NuGetGallery.Core
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/NuGetGallery.Core.csproj", "new_path": "src/NuGetGallery.Core/NuGetGallery.Core.csproj", "diff": "<Compile Include=\"Properties\\AssemblyInfo.*.cs\" />\n<Compile Include=\"NuGetVersionExtensions.cs\" />\n<Compile Include=\"SemVerLevelKey.cs\" />\n+ <Compile Include=\"Services\\CloudBlobClientWrapper.cs\" />\n+ <Compile Include=\"Services\\CloudBlobContainerWrapper.cs\" />\n<Compile Include=\"Services\\CloudBlobCoreFileStorageService.cs\" />\n+ <Compile Include=\"Services\\CloudBlobWrapper.cs\" />\n<Compile Include=\"Services\\CloudFileReference.cs\" />\n<Compile Include=\"Services\\CorePackageFileService.cs\" />\n<Compile Include=\"Services\\CorePackageService.cs\" />\n" }, { "change_type": "RENAME", "old_path": "src/NuGetGallery/Services/CloudBlobClientWrapper.cs", "new_path": "src/NuGetGallery.Core/Services/CloudBlobClientWrapper.cs", "diff": "" }, { "change_type": "RENAME", "old_path": "src/NuGetGallery/Services/CloudBlobContainerWrapper.cs", "new_path": "src/NuGetGallery.Core/Services/CloudBlobContainerWrapper.cs", "diff": "" }, { "change_type": "RENAME", "old_path": "src/NuGetGallery/Services/CloudBlobWrapper.cs", "new_path": "src/NuGetGallery.Core/Services/CloudBlobWrapper.cs", "diff": "" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Compile Include=\"Services\\HttpContextCacheService.cs\" />\n<Compile Include=\"Services\\ICacheService.cs\" />\n<Compile Include=\"Services\\IStatisticsService.cs\" />\n- <Compile Include=\"Services\\CloudBlobClientWrapper.cs\" />\n- <Compile Include=\"Services\\CloudBlobContainerWrapper.cs\" />\n- <Compile Include=\"Services\\CloudBlobWrapper.cs\" />\n<Compile Include=\"Services\\FileSystemFileStorageService.cs\" />\n<Compile Include=\"Services\\IIndexingService.cs\" />\n<Compile Include=\"Services\\INuGetExeDownloaderService.cs\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Moved CloudBlob* wrappers to NuGetGallery.Core (#4797)
455,759
05.10.2017 19:53:55
-7,200
d10dfbaf92f8229843e82021b0cf58e022256301
Latest Version on Manage Packages does not show SemVer 2.0.0 packages
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "new_path": "src/NuGetGallery/Views/Users/_UserPackagesList.cshtml", "diff": "}\n</td>\n<td class=\"align-middle text-nowrap\">@package.TotalDownloadCount.ToNuGetNumberString()</td>\n- <td class=\"align-middle text-nowrap\">@package.Version</td>\n+ <td class=\"align-middle text-nowrap\">@package.FullVersion.Abbreviate(25)</td>\n<td class=\"text-right align-middle package-controls\">\n<a href=\"@Url.EditPackage(package.Id, package.Version)\" class=\"btn\" title=\"Edit Package\" aria-label=\"Edit Package @package.Id Version @package.Version\">\n<i class=\"ms-Icon ms-Icon--Edit\" aria-hidden=\"true\"></i>\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Latest Version on Manage Packages does not show SemVer 2.0.0 packages #4782 (#4796)
455,737
06.10.2017 15:46:31
25,200
a1429d9f3e53c88b4f88d54cc317bafa826b1c8a
Adding configurable test for branding. falls back to default branding.
[ { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.FunctionalTests.Core/EnvironmentSettings.cs", "new_path": "tests/NuGetGallery.FunctionalTests.Core/EnvironmentSettings.cs", "diff": "@@ -14,6 +14,12 @@ public class EnvironmentSettings\n{\nprivate static string _baseurl;\nprivate static string _searchServiceBaseurl;\n+ private static string _externalBrandingMessage;\n+ private static string _externalBrandingUrl;\n+ private static string _externalAboutUrl;\n+ private static string _externalPrivacyPolicyUrl;\n+ private static string _externalTermsOfUseUrl;\n+ private static string _externalTrademarksUrl;\nprivate static string _testAccountName;\nprivate static string _testAccountPassword;\nprivate static string _testAccountApiKey;\n@@ -126,6 +132,81 @@ public static string SearchServiceBaseUrl\n}\n}\n+ /// <summary>\n+ /// External branding settings\n+ /// </summary>\n+ public static string ExternalBrandingMessage\n+ {\n+ get\n+ {\n+ if (string.IsNullOrEmpty(_externalBrandingMessage))\n+ {\n+ _externalBrandingMessage = Environment.GetEnvironmentVariable(\"ExternalBrandingMessage\");\n+ }\n+ return _externalBrandingMessage;\n+ }\n+ }\n+\n+ public static string ExternalBrandingUrl\n+ {\n+ get\n+ {\n+ if (string.IsNullOrEmpty(_externalBrandingUrl))\n+ {\n+ _externalBrandingUrl = Environment.GetEnvironmentVariable(\"ExternalBrandingUrl\");\n+ }\n+ return _externalBrandingUrl;\n+ }\n+ }\n+\n+ public static string ExternalAboutUrl\n+ {\n+ get\n+ {\n+ if (string.IsNullOrEmpty(_externalAboutUrl))\n+ {\n+ _externalAboutUrl = Environment.GetEnvironmentVariable(\"ExternalAboutUrl\");\n+ }\n+ return _externalAboutUrl;\n+ }\n+ }\n+\n+ public static string ExternalPrivacyPolicyUrl\n+ {\n+ get\n+ {\n+ if (string.IsNullOrEmpty(_externalPrivacyPolicyUrl))\n+ {\n+ _externalPrivacyPolicyUrl = Environment.GetEnvironmentVariable(\"ExternalPrivacyPolicyUrl\");\n+ }\n+ return _externalPrivacyPolicyUrl;\n+ }\n+ }\n+\n+ public static string ExternalTermsOfUseUrl\n+ {\n+ get\n+ {\n+ if (string.IsNullOrEmpty(_externalTermsOfUseUrl))\n+ {\n+ _externalTermsOfUseUrl = Environment.GetEnvironmentVariable(\"ExternalTermsOfUseUrl\");\n+ }\n+ return _externalTermsOfUseUrl;\n+ }\n+ }\n+\n+ public static string ExternalTrademarksUrl\n+ {\n+ get\n+ {\n+ if (string.IsNullOrEmpty(_externalTrademarksUrl))\n+ {\n+ _externalTrademarksUrl = Environment.GetEnvironmentVariable(\"ExternalTrademarksUrl\");\n+ }\n+ return _externalTrademarksUrl;\n+ }\n+ }\n+\n/// <summary>\n/// The test nuget account name to be used for functional tests.\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.WebUITests.P0/NuGetGallery.WebUITests.P0.csproj", "new_path": "tests/NuGetGallery.WebUITests.P0/NuGetGallery.WebUITests.P0.csproj", "diff": "<Compile Include=\"AccountManagement\\LogonTest.cs\" />\n<Compile Include=\"AccountManagement\\RegisterNewUserTest.cs\" />\n<Compile Include=\"AssertAndValidationHelper.cs\" />\n+ <Compile Include=\"BasicPages\\BrandingValidationTest.cs\" />\n<Compile Include=\"BasicPages\\HomePageValidationTest.cs\" />\n<Compile Include=\"Properties\\AssemblyInfo.cs\" />\n<Compile Include=\"UploadAndDownload\\UploadPackageFromUI.cs\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Adding configurable test for branding. falls back to default branding. (#4809)
455,744
09.10.2017 13:50:39
25,200
6686259913dcb5f71266c8209a84986ec7d7a562
Moved the DeletePackageFileAsync from IPackageFileService to ICorePackageFileService
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Services/CorePackageFileService.cs", "new_path": "src/NuGetGallery.Core/Services/CorePackageFileService.cs", "diff": "@@ -80,6 +80,24 @@ public Task DeleteValidationPackageFileAsync(string id, string version)\nreturn _fileStorageService.DeleteFileAsync(CoreConstants.ValidationFolderName, fileName);\n}\n+ public Task DeletePackageFileAsync(string id, string version)\n+ {\n+ if (String.IsNullOrWhiteSpace(id))\n+ {\n+ throw new ArgumentNullException(nameof(id));\n+ }\n+\n+ if (String.IsNullOrWhiteSpace(version))\n+ {\n+ throw new ArgumentNullException(nameof(version));\n+ }\n+\n+ var normalizedVersion = NuGetVersionFormatter.Normalize(version);\n+\n+ var fileName = BuildFileName(id, normalizedVersion, CoreConstants.PackageFileSavePathTemplate, CoreConstants.NuGetPackageFileExtension);\n+ return _fileStorageService.DeleteFileAsync(CoreConstants.PackagesFolderName, fileName);\n+ }\n+\npublic Task<Uri> GetValidationPackageReadUriAsync(Package package, DateTimeOffset endOfAccess)\n{\npackage = package ?? throw new ArgumentNullException(nameof(package));\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Services/ICorePackageFileService.cs", "new_path": "src/NuGetGallery.Core/Services/ICorePackageFileService.cs", "diff": "@@ -49,5 +49,12 @@ public interface ICorePackageFileService\n/// <param name=\"id\">The package ID. This value is case-insensitive.</param>\n/// <param name=\"version\">The package version. This value is case-insensitive and need not be normalized.</param>\nTask DeleteValidationPackageFileAsync(string id, string version);\n+\n+ /// <summary>\n+ /// Deletes the nupkg from the publicly available package storage.\n+ /// </summary>\n+ /// <param name=\"id\">The package ID. This value is case-insensitive.</param>\n+ /// <param name=\"version\">The package version. This value is case-insensitive and need not be normalized.</param>\n+ Task DeletePackageFileAsync(string id, string version);\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/IPackageFileService.cs", "new_path": "src/NuGetGallery/Services/IPackageFileService.cs", "diff": "@@ -20,11 +20,6 @@ public interface IPackageFileService : ICorePackageFileService\n/// </summary>\nTask<ActionResult> CreateDownloadPackageActionResultAsync(Uri requestUrl, string unsafeId, string unsafeVersion);\n- /// <summary>\n- /// Deletes the nupkg from the file storage.\n- /// </summary>\n- Task DeletePackageFileAsync(string id, string version);\n-\n/// <summary>\n/// Copies the contents of the package represented by the stream into the file storage backup location.\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Services/PackageFileService.cs", "new_path": "src/NuGetGallery/Services/PackageFileService.cs", "diff": "@@ -44,22 +44,6 @@ public Task<ActionResult> CreateDownloadPackageActionResultAsync(Uri requestUrl,\nreturn _fileStorageService.CreateDownloadFileActionResultAsync(requestUrl, CoreConstants.PackagesFolderName, fileName);\n}\n- public Task DeletePackageFileAsync(string id, string version)\n- {\n- if (String.IsNullOrWhiteSpace(id))\n- {\n- throw new ArgumentNullException(nameof(id));\n- }\n-\n- if (String.IsNullOrWhiteSpace(version))\n- {\n- throw new ArgumentNullException(nameof(version));\n- }\n-\n- var fileName = BuildFileName(id, version, CoreConstants.PackageFileSavePathTemplate, CoreConstants.NuGetPackageFileExtension);\n- return _fileStorageService.DeleteFileAsync(CoreConstants.PackagesFolderName, fileName);\n- }\n-\npublic Task StorePackageFileInBackupLocationAsync(Package package, Stream packageFile)\n{\nif (package == null)\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Core.Facts/Services/CorePackageFileServiceFacts.cs", "new_path": "tests/NuGetGallery.Core.Facts/Services/CorePackageFileServiceFacts.cs", "diff": "@@ -13,6 +13,7 @@ namespace NuGetGallery\npublic class CorePackageFileServiceFacts\n{\nprivate const string ValidationFolderName = \"validation\";\n+ private const string PackagesFolderName = \"packages\";\nprivate const string Id = \"NuGet.Versioning\";\nprivate const string Version = \"4.3.0.0-BETA+1\";\nprivate const string NormalizedVersion = \"4.3.0-BETA\";\n@@ -310,7 +311,7 @@ public async Task WillDownloadTheFileViaTheFileStorageService()\n}\n}\n- public class TheDeletePackageFileMethod : FactsBase\n+ public class TheDeleteValidationPackageFileMethod : FactsBase\n{\n[Fact]\npublic async Task WillThrowIfIdIsNull()\n@@ -348,6 +349,44 @@ public async Task WillDeleteTheFileViaTheFileStorageService()\n}\n}\n+ public class TheDeletePackageFileMethod : FactsBase\n+ {\n+ [Fact]\n+ public async Task WillThrowIfIdIsNull()\n+ {\n+ string id = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentNullException>(\n+ () => _service.DeletePackageFileAsync(id, Version));\n+\n+ Assert.Equal(\"id\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillThrowIfVersionIsNull()\n+ {\n+ string version = null;\n+\n+ var ex = await Assert.ThrowsAsync<ArgumentNullException>(\n+ () => _service.DeletePackageFileAsync(Id, version));\n+\n+ Assert.Equal(\"version\", ex.ParamName);\n+ }\n+\n+ [Fact]\n+ public async Task WillDeleteTheFileViaTheFileStorageService()\n+ {\n+ await _service.DeletePackageFileAsync(Id, Version);\n+\n+ _fileStorageService.Verify(\n+ x => x.DeleteFileAsync(PackagesFolderName, ValidationFileName),\n+ Times.Once);\n+ _fileStorageService.Verify(\n+ x => x.DeleteFileAsync(It.IsAny<string>(), It.IsAny<string>()),\n+ Times.Once);\n+ }\n+ }\n+\npublic class TheGetValidationPackageReadUriAsyncMethod : FactsBase\n{\n[Fact]\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Moved the DeletePackageFileAsync from IPackageFileService to ICorePackageFileService (#4817)
455,746
04.10.2017 01:05:34
-7,200
efb23fcd310080e99b02f115ec9ee82c822bca8d
4701: Return 404, not 200, when package doesn't exist. Fix
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Controllers/StatisticsController.cs", "new_path": "src/NuGetGallery/Controllers/StatisticsController.cs", "diff": "@@ -171,14 +171,21 @@ public virtual async Task<ActionResult> PackageDownloadsByVersion(string id, str\n//\n// GET: /stats/reports/packages/{id}\n- public virtual async Task<ActionResult> PackageDownloadsByVersionReport(string id, string[] groupby)\n+ public virtual async Task<JsonResult> PackageDownloadsByVersionReport(string id, string[] groupby)\n{\nif (_statisticsService == NullStatisticsService.Instance)\n{\n- return new HttpStatusCodeResult(HttpStatusCode.NotFound);\n+ return Json(404, new[] {new object() }, JsonRequestBehavior.AllowGet);\n+ }\n+\n+ var packageStatisticsReport = await GetPackageDownloadsByVersionReport(id, groupby);\n+\n+ if (packageStatisticsReport == null)\n+ {\n+ return Json(404, new[] { Strings.PackageWithIdDoesNotExist }, JsonRequestBehavior.AllowGet);\n}\n- return Json(await GetPackageDownloadsByVersionReport(id, groupby), JsonRequestBehavior.AllowGet);\n+ return Json(200, packageStatisticsReport, JsonRequestBehavior.AllowGet);\n}\n//\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/Controllers/StatisticsControllerFacts.cs", "new_path": "tests/NuGetGallery.Facts/Controllers/StatisticsControllerFacts.cs", "diff": "@@ -624,6 +624,42 @@ public async Task Statistics_By_Client_Operation_ValidateReportStructureAndAvail\nAssert.Equal(updatedUtc, actualReport.LastUpdatedUtc.Value);\n}\n+ [Fact]\n+ public async Task StatisticsDownloadByVersionAction_ReturnsHttpNotFoundIfPackageDoesntExist()\n+ {\n+ const string PackageId = \"A\";\n+\n+ var fakeStatisticsService = new Mock<IStatisticsService>();\n+ fakeStatisticsService\n+ .Setup(service => service.GetPackageDownloadsByVersion(PackageId))\n+ .Throws<StatisticsReportNotFoundException>();\n+\n+ var controller = new StatisticsController(fakeStatisticsService.Object);\n+ TestUtility.SetupUrlHelperForUrlGeneration(controller);\n+\n+ await controller.PackageDownloadsByVersionReport(PackageId, It.IsAny<string[]>());\n+\n+ Assert.Equal(404, controller.Response.StatusCode);\n+ }\n+\n+ [Fact]\n+ public async Task StatisticsDownloadByVersionAction_ReturnsHttpOkIfPackageExists()\n+ {\n+ const string PackageId = \"A\";\n+\n+ var fakeStatisticsService = new Mock<IStatisticsService>();\n+ fakeStatisticsService\n+ .Setup(service => service.GetPackageDownloadsByVersion(PackageId))\n+ .Returns(Task.FromResult(new StatisticsPackagesReport()));\n+\n+ var controller = new StatisticsController(fakeStatisticsService.Object);\n+ TestUtility.SetupUrlHelperForUrlGeneration(controller);\n+\n+ await controller.PackageDownloadsByVersionReport(PackageId, It.IsAny<string[]>());\n+\n+ Assert.Equal(200, controller.Response.StatusCode);\n+ }\n+\npublic class TheTotalsAllAction\n{\n[Fact]\n@@ -732,8 +768,6 @@ public async Task IgnoresUserCultureAndReturnsStatisticsAsNumbers()\n}\n}\n-\n-\npublic static StatisticsController CreateController(Mock<IAggregateStatsService> aggregateStatsService, Mock<HttpRequestBase> request = null)\n{\nrequest = request ?? new Mock<HttpRequestBase>();\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
4701: Return 404, not 200, when package doesn't exist. (#4798) Fix https://github.com/NuGet/NuGetGallery/issues/4701
455,772
13.10.2017 14:15:33
25,200
820924cd81105ce32442cb8cba2bfdce474edd3f
Added credential key to AuditActor
[ { "change_type": "MODIFY", "old_path": "src/NuGetGallery.Core/Auditing/AuditActor.cs", "new_path": "src/NuGetGallery.Core/Auditing/AuditActor.cs", "diff": "using System.Net.NetworkInformation;\nusing System.Net.Sockets;\nusing System.Threading.Tasks;\n-using System.Web;\nnamespace NuGetGallery.Auditing\n{\n@@ -18,70 +17,25 @@ public class AuditActor\npublic string MachineIP { get; set; }\npublic string UserName { get; set; }\npublic string AuthenticationType { get; set; }\n+ public string CredentialKey { get; set; }\npublic DateTime TimestampUtc { get; set; }\npublic AuditActor OnBehalfOf { get; set; }\n- public AuditActor(string machineName, string machineIP, string userName, string authenticationType, DateTime timeStampUtc)\n- : this(machineName, machineIP, userName, authenticationType, timeStampUtc, null) { }\n+ public AuditActor(string machineName, string machineIP, string userName, string authenticationType, string credentialKey, DateTime timeStampUtc)\n+ : this(machineName, machineIP, userName, authenticationType, credentialKey, timeStampUtc, null) { }\n- public AuditActor(string machineName, string machineIP, string userName, string authenticationType, DateTime timeStampUtc, AuditActor onBehalfOf)\n+ public AuditActor(string machineName, string machineIP, string userName, string authenticationType, string credentialKey, DateTime timeStampUtc, AuditActor onBehalfOf)\n{\nMachineName = machineName;\nMachineIP = machineIP;\nUserName = userName;\nAuthenticationType = authenticationType;\n+ CredentialKey = credentialKey;\nTimestampUtc = timeStampUtc;\nOnBehalfOf = onBehalfOf;\n}\n- public static Task<AuditActor> GetAspNetOnBehalfOfAsync()\n- {\n- // Use HttpContext to build an actor representing the user performing the action\n- var context = HttpContext.Current;\n- if (context == null)\n- {\n- return Task.FromResult<AuditActor>(null);\n- }\n-\n- return GetAspNetOnBehalfOfAsync(new HttpContextWrapper(context));\n- }\n-\n- public static Task<AuditActor> GetAspNetOnBehalfOfAsync(HttpContextBase context)\n- {\n- // Try to identify the client IP using various server variables\n- var clientIpAddress = context.Request.ServerVariables[\"HTTP_X_FORWARDED_FOR\"];\n- if (string.IsNullOrEmpty(clientIpAddress)) // Try REMOTE_ADDR server variable\n- {\n- clientIpAddress = context.Request.ServerVariables[\"REMOTE_ADDR\"];\n- }\n-\n- if (string.IsNullOrEmpty(clientIpAddress)) // Try UserHostAddress property\n- {\n- clientIpAddress = context.Request.UserHostAddress;\n- }\n-\n- if (!string.IsNullOrEmpty(clientIpAddress) && clientIpAddress.IndexOf(\".\", StringComparison.Ordinal) > 0)\n- {\n- clientIpAddress = clientIpAddress.Substring(0, clientIpAddress.LastIndexOf(\".\", StringComparison.Ordinal)) + \".0\";\n- }\n-\n- string user = null;\n- string authType = null;\n- if (context.User != null)\n- {\n- user = context.User.Identity.Name;\n- authType = context.User.Identity.AuthenticationType;\n- }\n-\n- return Task.FromResult(new AuditActor(\n- null,\n- clientIpAddress,\n- user,\n- authType,\n- DateTime.UtcNow));\n- }\n-\npublic static Task<AuditActor> GetCurrentMachineActorAsync()\n{\nreturn GetCurrentMachineActorAsync(null);\n@@ -97,6 +51,7 @@ public static async Task<AuditActor> GetCurrentMachineActorAsync(AuditActor onBe\nipAddress,\n$@\"{Environment.UserDomainName}\\{Environment.UserName}\",\n\"MachineUser\",\n+ string.Empty,\nDateTime.UtcNow,\nonBehalfOf);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/App_Start/DefaultDependenciesModule.cs", "new_path": "src/NuGetGallery/App_Start/DefaultDependenciesModule.cs", "diff": "@@ -472,7 +472,7 @@ private static IAuditingService GetAuditingServiceForLocalFileSystem(IGalleryCon\nFileSystemFileStorageService.ResolvePath(configuration.Current.FileStorageDirectory),\nFileSystemAuditingService.DefaultContainerName);\n- return new FileSystemAuditingService(auditingPath, AuditActor.GetAspNetOnBehalfOfAsync);\n+ return new FileSystemAuditingService(auditingPath, AuditingHelper.GetAspNetOnBehalfOfAsync);\n}\nprivate static void ConfigureForAzureStorage(ContainerBuilder builder, IGalleryConfigurationService configuration)\n@@ -567,7 +567,7 @@ private static IAuditingService GetAuditingServiceForAzureStorage(ContainerBuild\nvar localIp = AuditActor.GetLocalIpAddressAsync().Result;\n- var service = new CloudAuditingService(instanceId, localIp, configuration.Current.AzureStorage_Auditing_ConnectionString, AuditActor.GetAspNetOnBehalfOfAsync);\n+ var service = new CloudAuditingService(instanceId, localIp, configuration.Current.AzureStorage_Auditing_ConnectionString, AuditingHelper.GetAspNetOnBehalfOfAsync);\nbuilder.RegisterInstance(service)\n.As<ICloudStorageStatusDependency>()\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Authentication/NuGetClaims.cs", "new_path": "src/NuGetGallery/Authentication/NuGetClaims.cs", "diff": "@@ -10,5 +10,8 @@ public static class NuGetClaims\npublic const string ApiKey = \"https://claims.nuget.org/apikey\";\npublic const string Scope = \"https://claims.nuget.org/scope\";\n+\n+ // Allows identifying the credential that was used by his DB key.\n+ public const string CredentialKey = \"https://claims.nuget.org/credentialkey\";\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/Authentication/Providers/ApiKey/ApiKeyAuthenticationHandler.cs", "new_path": "src/NuGetGallery/Authentication/Providers/ApiKey/ApiKeyAuthenticationHandler.cs", "diff": "@@ -109,7 +109,8 @@ protected override async Task<AuthenticationTicket> AuthenticateCoreAsync()\nauthUser.User,\nAuthenticationTypes.ApiKey,\nnew Claim(NuGetClaims.ApiKey, apiKey),\n- new Claim(NuGetClaims.Scope, scopes)),\n+ new Claim(NuGetClaims.Scope, scopes),\n+ new Claim(NuGetClaims.CredentialKey, authUser.CredentialUsed.Key.ToString())),\nnew AuthenticationProperties());\n}\nelse\n" }, { "change_type": "MODIFY", "old_path": "src/NuGetGallery/NuGetGallery.csproj", "new_path": "src/NuGetGallery/NuGetGallery.csproj", "diff": "<Compile Include=\"Controllers\\PagesController.cs\" />\n<Compile Include=\"Filters\\ApiScopeRequiredAttribute.cs\" />\n<Compile Include=\"GlobalSuppressions.cs\" />\n+ <Compile Include=\"Helpers\\AuditingHelper.cs\" />\n<Compile Include=\"Helpers\\GravatarHelper.cs\" />\n<Compile Include=\"Helpers\\RegexEx.cs\" />\n<Compile Include=\"Services\\AsynchronousPackageValidationInitiator.cs\" />\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Core.Facts/Auditing/AuditActorTests.cs", "new_path": "tests/NuGetGallery.Core.Facts/Auditing/AuditActorTests.cs", "diff": "using System;\nusing System.Collections.Generic;\n-using System.Collections.Specialized;\nusing System.Linq;\nusing System.Net;\nusing System.Net.NetworkInformation;\nusing System.Net.Sockets;\n-using System.Security.Principal;\nusing System.Threading.Tasks;\n-using System.Web;\n-using Moq;\nusing Xunit;\nnamespace NuGetGallery.Auditing\n@@ -26,6 +22,7 @@ public void Constructor_WithoutOnBehalfOf_AcceptsNullValues()\nmachineIP: null,\nuserName: null,\nauthenticationType: null,\n+ credentialKey: null,\ntimeStampUtc: DateTime.MinValue);\nAssert.Null(actor.MachineName);\n@@ -41,6 +38,7 @@ public void Constructor_WithOnBehalfOf_AcceptsNullValues()\nmachineIP: null,\nuserName: null,\nauthenticationType: null,\n+ credentialKey: null,\ntimeStampUtc: DateTime.MinValue,\nonBehalfOf: null);\n@@ -55,33 +53,35 @@ public void Constructor_WithOnBehalfOf_AcceptsNullValues()\npublic void Constructor_WithoutOnBehalfOf_AcceptsEmptyStringValues()\n{\nvar actor = new AuditActor(\n- machineName: \"\",\n- machineIP: \"\",\n- userName: \"\",\n- authenticationType: \"\",\n+ machineName: string.Empty,\n+ machineIP: string.Empty,\n+ userName: string.Empty,\n+ authenticationType: string.Empty,\n+ credentialKey: string.Empty,\ntimeStampUtc: DateTime.MinValue);\n- Assert.Equal(\"\", actor.MachineName);\n- Assert.Equal(\"\", actor.MachineIP);\n- Assert.Equal(\"\", actor.UserName);\n- Assert.Equal(\"\", actor.AuthenticationType);\n+ Assert.Equal(string.Empty, actor.MachineName);\n+ Assert.Equal(string.Empty, actor.MachineIP);\n+ Assert.Equal(string.Empty, actor.UserName);\n+ Assert.Equal(string.Empty, actor.AuthenticationType);\n}\n[Fact]\npublic void Constructor_WithOnBehalfOf_AcceptsEmptyStringValues()\n{\nvar actor = new AuditActor(\n- machineName: \"\",\n- machineIP: \"\",\n- userName: \"\",\n- authenticationType: \"\",\n+ machineName: string.Empty,\n+ machineIP: string.Empty,\n+ userName: string.Empty,\n+ authenticationType: string.Empty,\n+ credentialKey: string.Empty,\ntimeStampUtc: DateTime.MinValue,\nonBehalfOf: null);\n- Assert.Equal(\"\", actor.MachineName);\n- Assert.Equal(\"\", actor.MachineIP);\n- Assert.Equal(\"\", actor.UserName);\n- Assert.Equal(\"\", actor.AuthenticationType);\n+ Assert.Equal(string.Empty, actor.MachineName);\n+ Assert.Equal(string.Empty, actor.MachineIP);\n+ Assert.Equal(string.Empty, actor.UserName);\n+ Assert.Equal(string.Empty, actor.AuthenticationType);\n}\n[Fact]\n@@ -92,12 +92,14 @@ public void Constructor_WithoutOnBehalfOf_SetsProperties()\nmachineIP: \"b\",\nuserName: \"c\",\nauthenticationType: \"d\",\n+ credentialKey: \"e\",\ntimeStampUtc: DateTime.MinValue);\nAssert.Equal(\"a\", actor.MachineName);\nAssert.Equal(\"b\", actor.MachineIP);\nAssert.Equal(\"c\", actor.UserName);\nAssert.Equal(\"d\", actor.AuthenticationType);\n+ Assert.Equal(\"e\", actor.CredentialKey);\nAssert.Equal(DateTime.MinValue, actor.TimestampUtc);\n}\n@@ -109,12 +111,14 @@ public void Constructor_WithOnBehalfOf_SetsProperties()\nmachineIP: null,\nuserName: null,\nauthenticationType: null,\n+ credentialKey: null,\ntimeStampUtc: DateTime.MinValue);\nvar actor = new AuditActor(\nmachineName: \"a\",\nmachineIP: \"b\",\nuserName: \"c\",\nauthenticationType: \"d\",\n+ credentialKey: \"e\",\ntimeStampUtc: DateTime.MinValue,\nonBehalfOf: onBehalfOfActor);\n@@ -122,172 +126,11 @@ public void Constructor_WithOnBehalfOf_SetsProperties()\nAssert.Equal(\"b\", actor.MachineIP);\nAssert.Equal(\"c\", actor.UserName);\nAssert.Equal(\"d\", actor.AuthenticationType);\n+ Assert.Equal(\"e\", actor.CredentialKey);\nAssert.Equal(DateTime.MinValue, actor.TimestampUtc);\nAssert.Same(onBehalfOfActor, actor.OnBehalfOf);\n}\n- [Fact]\n- public async Task GetAspNetOnBehalfOfAsync_WithoutContext_ReturnsNullForNullHttpContext()\n- {\n- var actor = await AuditActor.GetAspNetOnBehalfOfAsync();\n-\n- Assert.Null(actor);\n- }\n-\n- [Fact]\n- public async Task GetAspNetOnBehalfOfAsync_WithContext_ReturnsActor_WithHttpXForwardedForHeader()\n- {\n- var request = new Mock<HttpRequestBase>();\n- var identity = new Mock<IIdentity>();\n- var user = new Mock<IPrincipal>();\n- var context = new Mock<HttpContextBase>();\n-\n- request.SetupGet(x => x.ServerVariables)\n- .Returns(new NameValueCollection() { { \"HTTP_X_FORWARDED_FOR\", \"a\" } });\n- identity.Setup(x => x.Name)\n- .Returns(\"b\");\n- identity.Setup(x => x.AuthenticationType)\n- .Returns(\"c\");\n- user.Setup(x => x.Identity)\n- .Returns(identity.Object);\n- context.Setup(x => x.Request)\n- .Returns(request.Object);\n- context.Setup(x => x.User)\n- .Returns(user.Object);\n-\n- var actor = await AuditActor.GetAspNetOnBehalfOfAsync(context.Object);\n-\n- Assert.NotNull(actor);\n- Assert.Equal(\"c\", actor.AuthenticationType);\n- Assert.Equal(\"a\", actor.MachineIP);\n- Assert.Null(actor.MachineName);\n- Assert.Null(actor.OnBehalfOf);\n- Assert.InRange(actor.TimestampUtc, DateTime.UtcNow.AddMinutes(-1), DateTime.UtcNow.AddMinutes(1));\n- Assert.Equal(\"b\", actor.UserName);\n- }\n-\n- [Fact]\n- public async Task GetAspNetOnBehalfOfAsync_WithContext_ReturnsActor_WithRemoteAddrHeader()\n- {\n- var request = new Mock<HttpRequestBase>();\n- var identity = new Mock<IIdentity>();\n- var user = new Mock<IPrincipal>();\n- var context = new Mock<HttpContextBase>();\n-\n- request.SetupGet(x => x.ServerVariables)\n- .Returns(new NameValueCollection() { { \"REMOTE_ADDR\", \"a\" } });\n- identity.Setup(x => x.Name)\n- .Returns(\"b\");\n- identity.Setup(x => x.AuthenticationType)\n- .Returns(\"c\");\n- user.Setup(x => x.Identity)\n- .Returns(identity.Object);\n- context.Setup(x => x.Request)\n- .Returns(request.Object);\n- context.Setup(x => x.User)\n- .Returns(user.Object);\n-\n- var actor = await AuditActor.GetAspNetOnBehalfOfAsync(context.Object);\n-\n- Assert.NotNull(actor);\n- Assert.Equal(\"c\", actor.AuthenticationType);\n- Assert.Equal(\"a\", actor.MachineIP);\n- Assert.Null(actor.MachineName);\n- Assert.Null(actor.OnBehalfOf);\n- Assert.InRange(actor.TimestampUtc, DateTime.UtcNow.AddMinutes(-1), DateTime.UtcNow.AddMinutes(1));\n- Assert.Equal(\"b\", actor.UserName);\n- }\n-\n- [Fact]\n- public async Task GetAspNetOnBehalfOfAsync_WithContext_ReturnsActor_WithUserHostAddress()\n- {\n- var request = new Mock<HttpRequestBase>();\n- var identity = new Mock<IIdentity>();\n- var user = new Mock<IPrincipal>();\n- var context = new Mock<HttpContextBase>();\n-\n- request.SetupGet(x => x.ServerVariables)\n- .Returns(new NameValueCollection());\n- request.SetupGet(x => x.UserHostAddress)\n- .Returns(\"a\");\n- identity.Setup(x => x.Name)\n- .Returns(\"b\");\n- identity.Setup(x => x.AuthenticationType)\n- .Returns(\"c\");\n- user.Setup(x => x.Identity)\n- .Returns(identity.Object);\n- context.Setup(x => x.Request)\n- .Returns(request.Object);\n- context.Setup(x => x.User)\n- .Returns(user.Object);\n-\n- var actor = await AuditActor.GetAspNetOnBehalfOfAsync(context.Object);\n-\n- Assert.NotNull(actor);\n- Assert.Equal(\"c\", actor.AuthenticationType);\n- Assert.Equal(\"a\", actor.MachineIP);\n- Assert.Null(actor.MachineName);\n- Assert.Null(actor.OnBehalfOf);\n- Assert.InRange(actor.TimestampUtc, DateTime.UtcNow.AddMinutes(-1), DateTime.UtcNow.AddMinutes(1));\n- Assert.Equal(\"b\", actor.UserName);\n- }\n-\n- [Fact]\n- public async Task GetAspNetOnBehalfOfAsync_WithContext_ObfuscatesLastIpAddressOctet()\n- {\n- var request = new Mock<HttpRequestBase>();\n- var identity = new Mock<IIdentity>();\n- var user = new Mock<IPrincipal>();\n- var context = new Mock<HttpContextBase>();\n-\n- request.SetupGet(x => x.ServerVariables)\n- .Returns(new NameValueCollection() { { \"HTTP_X_FORWARDED_FOR\", \"1.2.3.4\" } });\n- identity.Setup(x => x.Name)\n- .Returns(\"b\");\n- identity.Setup(x => x.AuthenticationType)\n- .Returns(\"c\");\n- user.Setup(x => x.Identity)\n- .Returns(identity.Object);\n- context.Setup(x => x.Request)\n- .Returns(request.Object);\n- context.Setup(x => x.User)\n- .Returns(user.Object);\n-\n- var actor = await AuditActor.GetAspNetOnBehalfOfAsync(context.Object);\n-\n- Assert.NotNull(actor);\n- Assert.Equal(\"c\", actor.AuthenticationType);\n- Assert.Equal(\"1.2.3.0\", actor.MachineIP);\n- Assert.Null(actor.MachineName);\n- Assert.Null(actor.OnBehalfOf);\n- Assert.InRange(actor.TimestampUtc, DateTime.UtcNow.AddMinutes(-1), DateTime.UtcNow.AddMinutes(1));\n- Assert.Equal(\"b\", actor.UserName);\n- }\n-\n- [Fact]\n- public async Task GetAspNetOnBehalfOfAsync_WithContext_SupportsNullUser()\n- {\n- var request = new Mock<HttpRequestBase>();\n- var context = new Mock<HttpContextBase>();\n-\n- request.SetupGet(x => x.ServerVariables)\n- .Returns(new NameValueCollection() { { \"HTTP_X_FORWARDED_FOR\", \"1.2.3.4\" } });\n- context.Setup(x => x.Request)\n- .Returns(request.Object);\n- context.Setup(x => x.User)\n- .Returns((IPrincipal)null);\n-\n- var actor = await AuditActor.GetAspNetOnBehalfOfAsync(context.Object);\n-\n- Assert.NotNull(actor);\n- Assert.Null(actor.AuthenticationType);\n- Assert.Equal(\"1.2.3.0\", actor.MachineIP);\n- Assert.Null(actor.MachineName);\n- Assert.Null(actor.OnBehalfOf);\n- Assert.InRange(actor.TimestampUtc, DateTime.UtcNow.AddMinutes(-1), DateTime.UtcNow.AddMinutes(1));\n- Assert.Null(actor.UserName);\n- }\n-\n[Fact]\npublic async Task GetCurrentMachineActorAsync_WithoutOnBehalfOf()\n{\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Core.Facts/Auditing/AuditEntryTests.cs", "new_path": "tests/NuGetGallery.Core.Facts/Auditing/AuditEntryTests.cs", "diff": "@@ -27,6 +27,7 @@ public void Constructor_SetsProperties()\nmachineIP: null,\nuserName: null,\nauthenticationType: null,\n+ credentialKey: null,\ntimeStampUtc: DateTime.MinValue);\nvar entry = new AuditEntry(record.Object, actor);\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Core.Facts/Auditing/FileSystemAuditingServiceTests.cs", "new_path": "tests/NuGetGallery.Core.Facts/Auditing/FileSystemAuditingServiceTests.cs", "diff": "@@ -36,7 +36,7 @@ public async Task SaveAuditRecord_ThrowsForNull()\n{\nvar service = new FileSystemAuditingService(\nauditingPath: \"a\",\n- getOnBehalfOf: AuditActor.GetAspNetOnBehalfOfAsync);\n+ getOnBehalfOf: GetOnBehalfOf);\nawait Assert.ThrowsAsync<ArgumentNullException>(async () =>\nawait service.SaveAuditRecordAsync(record: null));\n@@ -141,6 +141,7 @@ private static Task<AuditActor> GetOnBehalfOf()\nmachineIP: \"b\",\nuserName: \"c\",\nauthenticationType: \"d\",\n+ credentialKey: \"e\",\ntimeStampUtc: DateTime.MinValue);\nreturn Task.FromResult<AuditActor>(actor);\n" }, { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "new_path": "tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj", "diff": "<Compile Include=\"Controllers\\StatisticsControllerFacts.cs\" />\n<Compile Include=\"Controllers\\UsersControllerFacts.cs\" />\n<Compile Include=\"Framework\\TestGalleryConfigurationService.cs\" />\n+ <Compile Include=\"Helpers\\AuditingHelperFacts.cs\" />\n<Compile Include=\"Helpers\\HtmlExtensionsFacts.cs\" />\n<Compile Include=\"Security\\RequireMinProtocolVersionForPushPolicyFacts.cs\" />\n<Compile Include=\"Services\\PackageOwnerRequestServiceFacts.cs\" />\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Added credential key to AuditActor (#4844)
455,772
13.10.2017 14:25:28
25,200
0de47a79968b0e1846de726c9cfc75187c81b364
Task 724 PR feedback
[ { "change_type": "MODIFY", "old_path": "tests/NuGetGallery.Core.Facts/Auditing/AuditActorTests.cs", "new_path": "tests/NuGetGallery.Core.Facts/Auditing/AuditActorTests.cs", "diff": "@@ -47,6 +47,7 @@ public void Constructor_WithOnBehalfOf_AcceptsNullValues()\nAssert.Null(actor.UserName);\nAssert.Null(actor.AuthenticationType);\nAssert.Null(actor.OnBehalfOf);\n+ Assert.Null(actor.CredentialKey);\n}\n[Fact]\n@@ -64,6 +65,7 @@ public void Constructor_WithoutOnBehalfOf_AcceptsEmptyStringValues()\nAssert.Equal(string.Empty, actor.MachineIP);\nAssert.Equal(string.Empty, actor.UserName);\nAssert.Equal(string.Empty, actor.AuthenticationType);\n+ Assert.Equal(string.Empty, actor.CredentialKey);\n}\n[Fact]\n@@ -82,6 +84,7 @@ public void Constructor_WithOnBehalfOf_AcceptsEmptyStringValues()\nAssert.Equal(string.Empty, actor.MachineIP);\nAssert.Equal(string.Empty, actor.UserName);\nAssert.Equal(string.Empty, actor.AuthenticationType);\n+ Assert.Equal(string.Empty, actor.CredentialKey);\n}\n[Fact]\n" } ]
C#
Apache License 2.0
nuget/nugetgallery
Task 724 PR feedback (#4845)