Skip to content

Commit ee8b51e

Browse files
author
Scott Bommarito
authored
Consolidate Edit, Delete, and Manage Owners into a single page (#6805)
1 parent 7b485f7 commit ee8b51e

49 files changed

Lines changed: 1479 additions & 1634 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

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

src/Bootstrap/less/theme/common-list-packages.less

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,44 @@
77
font-size: 15px;
88

99
.package-header {
10-
.package-title {
11-
font-size: 24px;
12-
font-weight: 300;
13-
line-height: 0.9;
14-
}
10+
display: flex;
11+
justify-content: space-between;
12+
13+
.package-title-container {
14+
white-space: nowrap;
1515

16-
.reserved-indicator {
17-
margin-top: 3px;
18-
margin-left: 3px;
19-
vertical-align: top;
20-
width: 20px;
16+
.package-title {
17+
font-size: 24px;
18+
font-weight: 300;
19+
line-height: 0.9;
20+
}
21+
22+
.edit-button {
23+
vertical-align: text-bottom;
24+
margin-left: 10px;
25+
}
26+
27+
.reserved-indicator {
28+
margin-top: 3px;
29+
margin-left: 3px;
30+
vertical-align: top;
31+
width: 20px;
32+
}
2133
}
2234

23-
.package-by {
24-
margin-left: @padding-small-horizontal;
25-
color: @text-color;
35+
.package-by-container {
36+
white-space: nowrap;
37+
overflow: hidden;
38+
text-overflow: ellipsis;
2639

27-
@media (max-width: @screen-xs-min) {
28-
margin-left: 0;
29-
display: block;
40+
.package-by {
41+
margin-left: @padding-small-horizontal;
42+
color: @text-color;
43+
44+
@media (max-width: @screen-xs-min) {
45+
margin-left: 0;
46+
display: block;
47+
}
3048
}
3149
}
3250
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.page-delete-package {
2-
h1 {
3-
margin-bottom: 0;
2+
b {
3+
margin-top: 40px;
4+
margin-bottom: 15px;
5+
display: inline-block;
46
}
57

68
#show-delete-package {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.page-edit-package {
2+
.readme-tabs {
3+
margin-top: 40px;
4+
}
5+
26
.readonly {
37
display: none;
48
}

src/Bootstrap/less/theme/page-manage-owners.less

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
.page-manage-owners {
2-
h2 {
3-
.ms-Icon {
4-
font-size: 0.6em;
5-
position: relative;
6-
top: -2px;
7-
}
8-
9-
a {
10-
color: @text-color;
11-
text-decoration: none;
12-
}
2+
b {
3+
margin-top: 40px;
4+
margin-bottom: 15px;
5+
display: inline-block;
6+
}
137

14-
a:hover {
15-
text-decoration: none;
16-
}
8+
b:first-of-type {
9+
margin-top: 0;
1710
}
1811

1912
.current-owner {

src/NuGetGallery/App_Code/ViewHelpers.cshtml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,6 @@
9898
}
9999
}
100100

101-
@helper AlertPackageEditRecommendation()
102-
{
103-
@AlertWarning(
104-
@<text>
105-
Editing package metadata is not supported.<br/>
106-
<em>
107-
To make edits to the package metadata, we recommend uploading a new version of the package created using the updated nuspec.
108-
<a href="https://docs.microsoft.com/en-us/nuget/policies/nuget-faq#managing-packages-on-nugetorg" alt="Read more">Read more</a><br />
109-
</em>
110-
</text>
111-
)
112-
}
113-
114101
@helper AlertPasswordDeprecation()
115102
{
116103
@AlertWarning(

src/NuGetGallery/App_Start/AppActivator.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ private static void BundlingPostStart()
177177
.Include("~/Scripts/gallery/page-manage-owners.js");
178178
BundleTable.Bundles.Add(manageOwnersScriptBundle);
179179

180+
var deletePackageScriptBundle = new ScriptBundle("~/Scripts/gallery/page-delete-package.min.js")
181+
.Include("~/Scripts/gallery/page-delete-package.js");
182+
BundleTable.Bundles.Add(deletePackageScriptBundle);
183+
184+
var editReadMeScriptBundle = new ScriptBundle("~/Scripts/gallery/page-edit-readme.min.js")
185+
.Include("~/Scripts/gallery/page-edit-readme.js");
186+
BundleTable.Bundles.Add(editReadMeScriptBundle);
187+
180188
var aboutScriptBundle = new ScriptBundle("~/Scripts/gallery/page-about.min.js")
181189
.Include("~/Scripts/gallery/page-about.js");
182190
BundleTable.Bundles.Add(aboutScriptBundle);

src/NuGetGallery/App_Start/Routes.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -602,16 +602,6 @@ public static void RegisterUIRoutes(RouteCollection routes)
602602
new { controller = "Packages", action = "ReportAbuse" }),
603603
permanent: true).To(packageVersionActionRoute);
604604

605-
routes.Redirect(
606-
r => r.MapRoute(
607-
"PackageActions",
608-
"Package/{action}/{id}/{version}",
609-
new { controller = "Packages", action = "ContactOwners" },
610-
// This next bit looks bad, but it's not. It will never change because
611-
// it's mapping the legacy routes to the new better routes.
612-
new { action = "ContactOwners|ManagePackageOwners" }),
613-
permanent: true).To(packageActionRoute);
614-
615605
routes.Redirect(
616606
r => r.MapRoute(
617607
RouteName.ListPackages,

src/NuGetGallery/Areas/Admin/ViewModels/ValidatedPackageViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace NuGetGallery.Areas.Admin.ViewModels
1010
{
11-
public class ValidatedPackageViewModel
11+
public class ValidatedPackageViewModel : IPackageVersionModel
1212
{
1313
public ValidatedPackageViewModel(IReadOnlyList<PackageValidationSet> validationSets, PackageDeletedStatus deletedStatus, ValidatingType validatingType)
1414
{
@@ -23,6 +23,7 @@ public ValidatedPackageViewModel(IReadOnlyList<PackageValidationSet> validationS
2323

2424
public int PackageKey { get; }
2525
public string Id { get; }
26+
public string Version => NormalizedVersion;
2627
public string NormalizedVersion { get; }
2728
public PackageDeletedStatus DeletedStatus { get; }
2829
public IReadOnlyList<PackageValidationSet> ValidationSets { get; }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,5 @@
126126
ko.applyBindings(new viewModel(), $('#stage').get(0));
127127
});
128128
</script>
129-
@Scripts.Render("~/Scripts/gallery/page-delete-package.js")
129+
@Scripts.Render("~/Scripts/gallery/page-delete-package.min.js")
130130
}

0 commit comments

Comments
 (0)