Skip to content

Commit bfd3cae

Browse files
author
Scott Bommarito
authored
Add Deprecation section of the Manage Package page (#6912)
1 parent 28a8fb3 commit bfd3cae

40 files changed

Lines changed: 3214 additions & 97 deletions

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

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

src/Bootstrap/less/theme/all.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@import "common-high-contrast.less";
55
@import "common-licenses.less";
66
@import "common-list-packages.less";
7+
@import "common-multi-select-dropdown.less";
78
@import "common-user-package-list.less";
89
@import "page-about.less";
910
@import "page-account-settings.less";
@@ -17,6 +18,7 @@
1718
@import "page-forgot-password.less";
1819
@import "page-home.less";
1920
@import "page-list-packages.less";
21+
@import "page-manage-deprecation.less";
2022
@import "page-manage-organizations.less";
2123
@import "page-manage-owners.less";
2224
@import "page-manage-packages.less";

src/Bootstrap/less/theme/base.less

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,20 @@ h2, h3 {
273273
}
274274

275275
@media screen and (max-width: @screen-sm) {
276+
.container {
277+
// Bootstrap doesn't set the container width when the screen is xs.
278+
// This works fine when there are no elements in the container that are wider than the viewport,
279+
// however, if there are elements in the container that are wider than the viewport,
280+
// their overflow properties will not work properly because they are not bound by the size of the container.
281+
// To fix this, we need to set the container width to be the width of the viewport minus the row margin on xs screens.
282+
// This way, those elements that are larger than the viewport are properly bound by the size of the container and overflow properly.
283+
width: calc(100vw - 15px);
284+
}
285+
286+
.navbar-toggle {
287+
margin-right: 0;
288+
}
289+
276290
img.package-icon {
277291
max-width: 60px;
278292
max-height: 60px;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.multi-select-dropdown {
2+
position: relative;
3+
display: block;
4+
5+
.dropdown-btn {
6+
width: 100%;
7+
display: flex;
8+
justify-content: space-between;
9+
align-items: center;
10+
padding: 5px;
11+
margin-bottom: 0px;
12+
background-color: white;
13+
border-style: inset;
14+
border: 1px solid #7f7f7f;
15+
16+
span {
17+
white-space: nowrap;
18+
overflow: hidden;
19+
text-overflow: ellipsis;
20+
}
21+
}
22+
23+
.dropdown-content {
24+
position: absolute;
25+
z-index: 1;
26+
width: 100%;
27+
border-top: 0px;
28+
29+
.dropdown-selector {
30+
height: 300px;
31+
overflow: auto;
32+
33+
.dropdown-filter {
34+
display: flex;
35+
margin-bottom: 5px;
36+
37+
input {
38+
border: 0;
39+
margin-left: 10px;
40+
width: 100%;
41+
}
42+
}
43+
}
44+
}
45+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
.page-manage-deprecation {
2+
.full-line {
3+
display: block;
4+
width: 100%;
5+
}
6+
7+
.deprecation-section {
8+
margin-top: 40px;
9+
10+
.deprecation-section-header {
11+
margin-bottom: 15px;
12+
}
13+
14+
.unbolded-label {
15+
label {
16+
font-weight: normal;
17+
}
18+
}
19+
20+
.deprecation-subsection {
21+
margin: 25px;
22+
23+
.security-detail {
24+
padding: 10px;
25+
26+
.security-detail-input-label {
27+
display: block;
28+
margin-bottom: 0px;
29+
font-weight: normal;
30+
}
31+
32+
.security-detail-input {
33+
margin-top: 10px;
34+
35+
.cvss-input {
36+
display: inline-block;
37+
width: 65px;
38+
margin-right: 15px;
39+
}
40+
}
41+
42+
.security-detail-list-input {
43+
display: flex;
44+
justify-content: space-between;
45+
46+
button {
47+
margin-left: 15px;
48+
}
49+
}
50+
51+
.security-detail-list {
52+
margin-top: 10px;
53+
54+
.security-detail-list-item {
55+
display: flex;
56+
justify-content: space-between;
57+
padding: 10px;
58+
margin-top: 10px;
59+
}
60+
}
61+
}
62+
63+
.alternate-package-container {
64+
@media (max-width: @screen-sm-min) {
65+
margin-top: 40px;
66+
}
67+
}
68+
}
69+
}
70+
}

src/NuGetGallery/App_Data/Files/Content/flags.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
"SiteAdmins": false,
1010
"Accounts": [],
1111
"Domains": []
12+
},
13+
"NuGetGallery.ManageDeprecation": {
14+
"All": false,
15+
"SiteAdmins": true,
16+
"Accounts": [],
17+
"Domains": []
1218
}
1319
}
1420
}

src/NuGetGallery/App_Start/AppActivator.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ private static void BundlingPostStart()
156156
.Include("~/Scripts/gallery/stats-dimensions.js");
157157
BundleTable.Bundles.Add(d3ScriptBundle);
158158

159+
var multiSelectDropdownBundle = new ScriptBundle("~/Scripts/gallery/common-multi-select-dropdown.min.js")
160+
.Include("~/Scripts/gallery/common-multi-select-dropdown.js");
161+
BundleTable.Bundles.Add(multiSelectDropdownBundle);
162+
159163
var homeScriptBundle = new ScriptBundle("~/Scripts/gallery/page-home.min.js")
160164
.Include("~/Scripts/gallery/page-home.js");
161165
BundleTable.Bundles.Add(homeScriptBundle);
@@ -177,6 +181,10 @@ private static void BundlingPostStart()
177181
.Include("~/Scripts/gallery/page-manage-owners.js");
178182
BundleTable.Bundles.Add(manageOwnersScriptBundle);
179183

184+
var manageDeprecationScriptBundle = new ScriptBundle("~/Scripts/gallery/page-manage-deprecation.min.js")
185+
.Include("~/Scripts/gallery/page-manage-deprecation.js");
186+
BundleTable.Bundles.Add(manageDeprecationScriptBundle);
187+
180188
var deletePackageScriptBundle = new ScriptBundle("~/Scripts/gallery/page-delete-package.min.js")
181189
.Include("~/Scripts/gallery/page-delete-package.js");
182190
BundleTable.Bundles.Add(deletePackageScriptBundle);

src/NuGetGallery/App_Start/DefaultDependenciesModule.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,21 @@ protected override void Load(ContainerBuilder builder)
216216
.As<IEntityRepository<SymbolPackage>>()
217217
.InstancePerLifetimeScope();
218218

219+
builder.RegisterType<EntityRepository<PackageDeprecation>>()
220+
.AsSelf()
221+
.As<IEntityRepository<PackageDeprecation>>()
222+
.InstancePerLifetimeScope();
223+
224+
builder.RegisterType<EntityRepository<Cve>>()
225+
.AsSelf()
226+
.As<IEntityRepository<Cve>>()
227+
.InstancePerLifetimeScope();
228+
229+
builder.RegisterType<EntityRepository<Cwe>>()
230+
.AsSelf()
231+
.As<IEntityRepository<Cwe>>()
232+
.InstancePerLifetimeScope();
233+
219234
var supportDbConnectionFactory = CreateDbConnectionFactory(
220235
diagnosticsService,
221236
nameof(SupportRequestDbContext),
@@ -356,6 +371,10 @@ protected override void Load(ContainerBuilder builder)
356371
.As<ILicenseExpressionSegmentator>()
357372
.InstancePerLifetimeScope();
358373

374+
builder.RegisterType<PackageDeprecationService>()
375+
.As<IPackageDeprecationService>()
376+
.InstancePerLifetimeScope();
377+
359378
RegisterFeatureFlagsService(builder, configuration);
360379
RegisterMessagingService(builder, configuration);
361380

src/NuGetGallery/App_Start/Routes.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ public static void RegisterUIRoutes(RouteCollection routes)
145145
new { controller = "Packages", action = "VerifyPackage" });
146146

147147
routes.MapRoute(
148-
RouteName.PreviewReadMe,
149-
"packages/manage/preview-readme",
150-
new { controller = "Packages", action = "PreviewReadMe" });
148+
RouteName.PreviewReadMe,
149+
"packages/manage/preview-readme",
150+
new { controller = "Packages", action = "PreviewReadMe" });
151151

152152
routes.MapRoute(
153153
RouteName.CancelUpload,

0 commit comments

Comments
 (0)