Skip to content

Commit 6136fc9

Browse files
authored
Merge pull request #9064 from NuGet/dev
Merge branch 'dev' into main
2 parents f9913c9 + 13ac2a1 commit 6136fc9

37 files changed

Lines changed: 1267 additions & 286 deletions

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

Lines changed: 24 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/less/theme/base.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ img.reserved-indicator-icon {
426426
cursor: pointer;
427427
}
428428

429+
.form-group label.required::after {
430+
color: red;
431+
content: " *";
432+
}
433+
429434
// Workaround. See https://github.com/NuGet/NuGetGallery/issues/8264
430435
@media (max-width: 767.9px) {
431436
.hidden-xs {

src/Bootstrap/less/theme/page-display-package.less

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -370,23 +370,18 @@
370370

371371
.tab-content {
372372
.tab-pane {
373-
> div {
374-
display: table;
375-
height: 1px;
376-
}
377-
373+
378374
.install-script-row {
379-
display: table-row;
375+
display: flex;
380376
height: 100%;
377+
width: 100%;
381378

382379
.install-script {
383-
display: table-cell;
384380
background-color: @panel-footer-bg;
385381
font-family: @font-family-monospace;
386382
font-size: 1em;
387383
color: #fff;
388-
width: 100%;
389-
max-width: 1px;
384+
width: calc(100% - 40px);
390385
line-height: 1.5;
391386
white-space: pre-wrap;
392387
// Add a border with the same color as the background to support visual callout
@@ -396,16 +391,13 @@
396391
border-width: 1px 0 1px 1px;
397392
vertical-align: middle;
398393
word-break: break-word;
394+
margin: 0px;
399395
}
400396

401-
.copy-button {
402-
height: 100%;
403-
404-
button {
397+
.copy-button button {
405398
height: 100%;
406399
min-height: 42px;
407400
line-height: 1.5;
408-
}
409401
}
410402
}
411403

src/Bootstrap/less/theme/page-home.less

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
.circuit-board {
4343
margin-top: 20px;
44-
width: 768px;
44+
width: 900px;
4545
height: 396px;
4646
position: relative;
4747
margin: 0 auto;
@@ -52,6 +52,8 @@
5252
.circuit-board-label {
5353
position: absolute;
5454
height: 75px;
55+
padding-left: 25px;
56+
padding-right: 25px;
5557
background-color: #fff;
5658
color: @text-color;
5759
box-shadow: 0 0 3px black;
@@ -62,35 +64,32 @@
6264
}
6365

6466
.circuit-board-pd {
65-
left: 377px;
67+
left: 443px;
6668
top: 10px;
6769
float: left;
68-
width: 230px;
6970

7071
&.triangle:after {
7172
left: 20px;
7273
}
7374
}
7475

7576
.circuit-board-pv {
76-
left: 0;
77+
right: 675px;
7778
top: 63px;
7879
float: left;
79-
width: 144px;
8080

8181
&.triangle:after {
82-
right: 30px;
82+
right: 45px;
8383
}
8484
}
8585

8686
.circuit-board-up {
87-
right: 0;
88-
top: 87px;
87+
left: 675px;
88+
top: 105px;
8989
float: right;
90-
width: 144px;
9190

9291
&.triangle:after {
93-
left: 30px;
92+
left: 45px;
9493
}
9594
}
9695
}

src/Bootstrap/less/theme/page-statistics-per-package.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,8 @@
7272
margin-bottom: none;
7373
}
7474
}
75+
76+
.statistics-report-title {
77+
overflow-wrap: break-word;
78+
}
7579
}

src/NuGetGallery/Areas/Admin/Controllers/ReservedNamespaceController.cs

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Data.Entity;
56
using System.Linq;
67
using System.Web.Mvc;
78
using System.Threading.Tasks;
@@ -13,19 +14,23 @@ namespace NuGetGallery.Areas.Admin.Controllers
1314
{
1415
public class ReservedNamespaceController : AdminControllerBase
1516
{
16-
private IReservedNamespaceService _reservedNamespaceService;
17+
private readonly IReservedNamespaceService _reservedNamespaceService;
18+
private readonly IEntityRepository<PackageRegistration> _packageRegistrations;
1719

1820
protected ReservedNamespaceController() { }
1921

20-
public ReservedNamespaceController(IReservedNamespaceService reservedNamespaceService)
22+
public ReservedNamespaceController(
23+
IReservedNamespaceService reservedNamespaceService,
24+
IEntityRepository<PackageRegistration> packageRegistrations)
2125
{
2226
_reservedNamespaceService = reservedNamespaceService ?? throw new ArgumentNullException(nameof(reservedNamespaceService));
27+
_packageRegistrations = packageRegistrations ?? throw new ArgumentNullException(nameof(packageRegistrations));
2328
}
2429

2530
[HttpGet]
2631
public ActionResult Index()
2732
{
28-
return View();
33+
return View(new ReservedNamespaceViewModel());
2934
}
3035

3136
[HttpGet]
@@ -49,6 +54,37 @@ public JsonResult SearchPrefix(string query)
4954
return Json(results, JsonRequestBehavior.AllowGet);
5055
}
5156

57+
[HttpGet]
58+
public ActionResult FindNamespacesByPrefix(string prefix)
59+
{
60+
var namespaces = _reservedNamespaceService
61+
.FindAllReservedNamespacesForPrefix(prefix, getExactMatches: false)
62+
.OrderBy(x => x.Value)
63+
.ThenBy(x => x.IsPrefix)
64+
.ToList();
65+
var model = new ReservedNamespaceViewModel { ReservedNamespacesQuery = prefix, ReservedNamespaces = namespaces };
66+
return View(nameof(Index), model);
67+
}
68+
69+
[HttpGet]
70+
public ActionResult FindPackagesByPrefix(string prefix)
71+
{
72+
if (string.IsNullOrWhiteSpace(prefix))
73+
{
74+
return RedirectToAction(nameof(Index));
75+
}
76+
77+
var packageRegistrations = _packageRegistrations
78+
.GetAll()
79+
.Include(x => x.Owners)
80+
.Include(x => x.ReservedNamespaces)
81+
.Where(x => x.Id.StartsWith(prefix))
82+
.OrderBy(x => x.Id)
83+
.ToList();
84+
var model = new ReservedNamespaceViewModel { PackageRegistrationsQuery = prefix, PackageRegistrations = packageRegistrations };
85+
return View(nameof(Index), model);
86+
}
87+
5288
[HttpPost]
5389
[ValidateAntiForgeryToken]
5490
public async Task<JsonResult> AddNamespace(ReservedNamespace newNamespace)
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4+
using System.Collections.Generic;
5+
using NuGet.Services.Entities;
6+
47
namespace NuGetGallery.Areas.Admin.ViewModels
58
{
69
public sealed class ReservedNamespaceViewModel
710
{
8-
/// <summary>
9-
/// Prefix search query.
10-
/// </summary>
11-
public string PrefixSearchQuery { get; set; }
11+
public string ReservedNamespacesQuery { get; set; }
12+
public IReadOnlyList<ReservedNamespace> ReservedNamespaces { get; set; }
13+
public string PackageRegistrationsQuery { get; set; }
14+
public IReadOnlyList<PackageRegistration> PackageRegistrations { get; set; }
1215
}
1316
}

src/NuGetGallery/Areas/Admin/Views/ApiKeys/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@using (Html.BeginForm("Revoke", "ApiKeys", new { area = "Admin" }, FormMethod.Post))
2222
{
2323
@Html.AntiForgeryToken()
24-
<table class="table break-word" style="display: none" data-bind="visible: verifiedResults().length > 0">
24+
<table class="table break-word" style="display: none" data-bind="visible: verifiedResults().length > 0" aria-label="API Keys">
2525
<thead>
2626
<tr>
2727
<th class="col-sm-1">

src/NuGetGallery/Areas/Admin/Views/Delete/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
@using (Html.BeginForm("Delete", "Packages", new { area = "" }, FormMethod.Post, new { id = "delete-form" }))
2020
{
21-
<table class="table" id="searchResults" style="display: none" data-bind="visible: searchResults().length > 0">
21+
<table class="table" id="searchResults" style="display: none" data-bind="visible: searchResults().length > 0" aria-label="Search results">
2222
<thead>
2323
<tr>
2424
<th><input type="checkbox" data-bind="click: toggleSelectAll, checked: selectAllState" /></th>

src/NuGetGallery/Areas/Admin/Views/Features/Index.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
@<text>Features</text>,
3737
@<text><p>View and edit features.</p></text>,
3838
@<text>
39-
<table class="table">
39+
<table class="table" aria-label="Features">
4040
<tr>
4141
<th>Name</th>
4242
<th>Current Status</th>
@@ -61,7 +61,7 @@
6161
@<text>Flights</text>,
6262
@<text><p>View and edit flights.</p></text>,
6363
@<text>
64-
<table class="table">
64+
<table class="table" aria-label="Flights">
6565
<tr>
6666
<th>Name</th>
6767
<th>All</th>

0 commit comments

Comments
 (0)