Skip to content

Commit 5d2a67e

Browse files
author
Scott Bommarito
authored
Merge pull request #6995 from NuGet/dev
[2019.03.13] FI NuGetGallery DEV into MASTER
2 parents e696ef6 + 5972daf commit 5d2a67e

13 files changed

Lines changed: 48 additions & 49 deletions

File tree

src/Bootstrap/dist/css/bootstrap-theme.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/less/theme/common-multi-select-dropdown.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
border-top: 0px;
2828

2929
.dropdown-selector {
30-
height: 300px;
30+
max-height: 300px;
3131
overflow: auto;
3232

3333
.dropdown-filter {

src/NuGetGallery/Controllers/PackagesController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ public virtual ActionResult ContactOwners(string id, string version)
13871387
PackageId = id,
13881388
PackageVersion = package.Version,
13891389
ProjectUrl = package.ProjectUrl,
1390-
Owners = package.PackageRegistration.Owners.Where(u => u.EmailAllowed),
1390+
Owners = package.PackageRegistration.Owners.Where(u => u.EmailAllowed).Select(u => u.Username),
13911391
CopySender = true,
13921392
HasOwners = hasOwners
13931393
};
@@ -2141,7 +2141,7 @@ public virtual async Task<JsonResult> VerifyPackage(VerifyPackageRequest formDat
21412141
}
21422142
}
21432143

2144-
public virtual async Task<JsonResult> VerifySymbolsPackageInternal(
2144+
protected virtual async Task<JsonResult> VerifySymbolsPackageInternal(
21452145
VerifyPackageRequest formData,
21462146
Stream uploadFile,
21472147
PackageArchiveReader packageArchiveReader,
@@ -2241,7 +2241,7 @@ await _auditingService.SaveAuditRecordAsync(
22412241
}
22422242
}
22432243

2244-
public virtual async Task<JsonResult> VerifyPackageInternal(
2244+
protected virtual async Task<JsonResult> VerifyPackageInternal(
22452245
VerifyPackageRequest formData,
22462246
Stream uploadFile,
22472247
PackageArchiveReader packageArchiveReader,

src/NuGetGallery/Scripts/gallery/common.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@
222222
return false;
223223
}
224224

225+
// Elements with tabindex set to a value besides -1 are focusable.
226+
var tabIndex = element.attr('tabindex');
227+
if (!!tabIndex && tabIndex >= 0) {
228+
return true;
229+
}
230+
225231
// See https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Interactive_content
226232
var alwaysInteractiveElements = ['a', 'button', 'details', 'embed', 'iframe', 'keygen', 'label', 'select', 'textarea'];
227233
var i;

src/NuGetGallery/Scripts/gallery/page-manage-deprecation.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function ManageDeprecationViewModel(id, versionDeprecationStateDictionary, defau
234234
// Show a warning if multiple versions are selected and at least one has an existing deprecation
235235
// The user should be aware they are replacing existing deprecations
236236
// Don't show an alert if a single version is selected because it is clear that the deprecation is being replaced
237-
warningMessage = "Some of the package versions you selected have already been deprecated. These versions will have their deprecation information overriden or removed based on your actions.";
237+
warningMessage = "Some of the package versions you selected have already been deprecated. All selected versions will have their deprecation information overridden or removed when you submit this form.";
238238
}
239239
} else if (hasVersionsWithExistingDeprecationState) {
240240
// Show a warning if no reasons are selected and at least one selected version has an existing deprecation
@@ -572,5 +572,10 @@ function ManageDeprecationViewModel(id, versionDeprecationStateDictionary, defau
572572
// Load the state for the default version.
573573
loadDeprecationFormState(defaultVersion);
574574

575-
ko.applyBindings(this, $(".page-manage-deprecation")[0]);
575+
var section = $(".page-manage-deprecation")[0];
576+
// Only apply bindings if the form exists.
577+
// In certain situations (the package is locked, user doesn't have permissions, etc) we do not render the form.
578+
if (section) {
579+
ko.applyBindings(this, section);
580+
}
576581
}

src/NuGetGallery/ViewModels/ContactOwnersViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class ContactOwnersViewModel
1717

1818
public string ProjectUrl { get; set; }
1919

20-
public IEnumerable<User> Owners { get; set; }
20+
public IEnumerable<string> Owners { get; set; }
2121

2222
[Display(Name = "Send me a copy")]
2323
public bool CopySender { get; set; }

src/NuGetGallery/Views/Packages/ContactOwners.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<p>
3333
@foreach (var owner in Model.Owners)
3434
{
35-
<a href="@Url.User(owner)" title="View @owner.Username's profile" class="ms-font-xl">@owner.Username</a>
35+
<a href="@Url.User(owner)" title="View @owner's profile" class="ms-font-xl">@owner</a>
3636
}
3737
</p>
3838
</div>

src/NuGetGallery/Views/Packages/Manage.cshtml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
ViewBag.MdPageColumns = GalleryConstants.ColumnsFormMd;
66
}
77

8+
@Html.Partial("_MultiSelectDropdown")
9+
810
<section role="main" class="container main-container">
911
@ViewHelpers.AjaxAntiForgeryToken(Html)
1012
<div class="row">
@@ -16,6 +18,15 @@
1618
"Manage",
1719
linkIdOnly: true))
1820

21+
@if (Model.IsLocked)
22+
{
23+
@ViewHelpers.AlertDanger(
24+
@<text>
25+
Package '@Model.Id' has been locked. Please contact
26+
<a href="mailto:[email protected][email protected](string.Format("Requesting support for a locked package - '{0}'", Model.Id))">support@nuget.org</a>
27+
</text>)
28+
}
29+
1930
@ViewHelpers.Section(
2031
this,
2132
"Owners",
@@ -103,7 +114,7 @@
103114
var state = versionListedState[version];
104115
// Update the listed checkbox to match the state of the package.
105116
var listed = state.Listed;
106-
$(".page-delete-package input#Listed")[0].checked = listed;
117+
$(".page-delete-package input#Listed").prop('checked', listed);
107118
// Update the text stating the download count on the delete form.
108119
var downloadCount = state.DownloadCount;
109120
$(".page-delete-package #downloadCount").text(downloadCount);

src/NuGetGallery/Views/Packages/_DisplayPackageDeprecation.cshtml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<div class="deprecation-container">
3333
<div class="icon-text alert alert-warning">
3434
<div id="show-deprecation-content-container" class="deprecation-expander" tabindex="0" data-toggle="collapse" data-target="#deprecation-content-container" aria-expanded="false" aria-controls="deprecation-content-container" aria-labelledby="deprecation-container-label">
35-
<div class="deprecation-expander">
35+
<div class="deprecation-expander" role="button">
3636
<div class="deprecation-expander-container">
3737
<i class="deprecation-expander-icon ms-Icon ms-Icon--Warning" aria-hidden="true"></i>
3838

@@ -93,14 +93,12 @@
9393
}
9494

9595
<b>Suggested Alternatives</b>
96-
<p>
97-
Consider using <a href="@alternateUrl">@alternateText</a> instead of this package.
98-
</p>
96+
<p><a href="@alternateUrl">@alternateText</a></p>
9997
}
10098

10199
@if (!string.IsNullOrEmpty(Model.CustomMessage))
102100
{
103-
<b>Package owner message</b>
101+
<b>Additional Details</b>
104102
<p>@Model.CustomMessage</p>
105103
}
106104
</div>

src/NuGetGallery/Views/Packages/_ManageDeprecation.cshtml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
@model ManagePackageViewModel
22

33
<div class="page-manage-deprecation">
4-
<span>Deprecating a package will warn all consumers of the package who use it in their projects.</span>
5-
64
@if (!Model.VersionSelectList.Any())
75
{
8-
@ViewHelpers.AlertInfo(
9-
@<text>
10-
<span>There are no versions that can be deprecated.</span>
11-
</text>)
6+
@ViewHelpers.AlertInfo(@<text>There are no versions that can be deprecated.</text>)
127
}
138
else if (!Model.CanDeprecate)
149
{
15-
@ViewHelpers.AlertWarning(@<text>You do not have permission to deprecate this package.</text>)
10+
@ViewHelpers.AlertDanger(@<text>You do not have permission to deprecate this package.</text>)
11+
}
12+
else if (Model.IsLocked)
13+
{
14+
@ViewHelpers.AlertDanger(@<text>Locked packages cannot be deprecated.</text>)
1615
}
1716
else
1817
{
18+
<span>Deprecating a package will warn all consumers of the package who use it in their projects.</span>
19+
1920
<div data-bind="template: { name: 'add-deprecation-template' }"></div>
2021
}
2122
</div>
2223

23-
@Html.Partial("_MultiSelectDropdown")
24-
2524
<script type="text/html" id="add-deprecation-template">
2625
<div class="deprecation-section form-group">
2726
<label id="dropdown-label" class="deprecation-section-header">Select version(s)</label>
@@ -150,7 +149,7 @@
150149
<div class="security-detail-list-item alert-info">
151150
<div class="security-detail-list-item-header">
152151
<div>
153-
<a data-bind="text: id, attr: { href: $parent.getUrlFromId(id) }, css: { 'security-detail-list-item-existing': fromAutocomplete, 'security-detail-list-item-missing': !fromAutocomplete }"></a>
152+
<a data-bind="text: id, attr: { href: $parent.getUrlFromId(id) }, css: { 'security-detail-list-item-existing': fromAutocomplete, 'security-detail-list-item-missing': !fromAutocomplete }" target="_blank"></a>
154153
<span data-bind="visible: name || !fromAutocomplete">
155154
&nbsp;-&nbsp;
156155
<span data-bind="visible: name, text: name"></span>

0 commit comments

Comments
 (0)