Skip to content

Commit d693ade

Browse files
authored
Merge pull request #8299 from NuGet/dev
[ReleasePrep][2020.10.27]NuGetGallery of dev into master
2 parents d7aaa8d + e719a41 commit d693ade

33 files changed

Lines changed: 309 additions & 228 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
99
## Build and Run the Gallery in (arbitrary number) easy steps
1010

1111
1. Prerequisites:
12-
1. Visual Studio 2017 - Install the following `Workloads`:
12+
1. Visual Studio 2019 - Install the following `Workloads`:
1313
* ASP.NET and web development
1414
* Azure development
1515
2. PowerShell 4.0

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

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

src/Bootstrap/dist/css/bootstrap.css

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

src/Bootstrap/less/mixins/tab-focus.less

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
// WebKit-specific. Other browsers will keep their default outline style.
55
// (Initially tried to also force default via `outline: initial`,
66
// but that seems to erroneously remove the outline in Firefox altogether.)
7-
// The next line came from: https://stackoverflow.com/a/38571103
8-
outline: 2px auto Highlight;
97
outline: 5px auto -webkit-focus-ring-color;
108
outline-offset: -2px;
119
}

src/Bootstrap/less/theme/base.less

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//== Theme Variables
22
@panel-footer-color: @navbar-inverse-color;
33
@default-margin-bottom: 24px;
4+
@package-list-line-height: 20px;
45

56
//== Theme Definition
67
html, body {
@@ -321,12 +322,11 @@ img.reserved-indicator-icon {
321322
.package-list {
322323
margin-top: 8px;
323324
margin-bottom: 8px;
324-
margin-left: -5px;
325325
padding-left: 0;
326-
line-height: 20px;
326+
line-height: @package-list-line-height;
327327
color: @gray-light;
328328

329-
a {
329+
a:not(.more-tags) {
330330
color: @gray-light;
331331
}
332332

@@ -338,14 +338,10 @@ img.reserved-indicator-icon {
338338
@media (min-width: @screen-sm-min) {
339339
li {
340340
display: inline-block;
341-
}
342-
343-
li + li {
344-
margin-left: @padding-small-horizontal;
345-
padding-left: @padding-small-horizontal;
346-
border-left-style: solid;
347-
border-width: 1px;
348-
border-color: @gray-lighter;
341+
line-height: @package-list-line-height;
342+
max-height: (@package-list-line-height * 5 + 1px);
343+
overflow-y: hidden;
344+
padding-right: @padding-small-horizontal;
349345
}
350346
}
351347
}

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@
5151
color: @text-color;
5252
line-height: 20px;
5353
}
54-
55-
56-
.package-list {
57-
@media (min-width: @screen-sm-min) {
58-
white-space: nowrap;
59-
overflow: hidden;
60-
text-overflow: ellipsis;
61-
62-
li {
63-
display: inline;
64-
}
65-
}
66-
}
6754
}
6855
}
6956

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@
171171
.gh-star {
172172
font-size: 14px;
173173
line-height: 12px;
174-
color: @brand-warning;
174+
/* Use a slightly darker orange color to increase contrast for accessibility */
175+
color: darken(@brand-warning, 4.5%);
175176
}
176177

177178
.used-by {

src/GitHubVulnerabilities2Db/Gallery/ThrowingTelemetryService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void TrackABTestEnrollmentInitialized(int schemaVersion, int previewSearc
2626
throw new NotImplementedException();
2727
}
2828

29-
public void TrackABTestEnrollmentUpgraded(int schemaVersion, int previewSearchBucket, int packageDepentsBucket)
29+
public void TrackABTestEnrollmentUpgraded(int oldSchemaVersion, int newSchemaVersion, int previewSearchBucket, int packageDepentsBucket)
3030
{
3131
throw new NotImplementedException();
3232
}

src/NuGetGallery.Core/Cookies/CookieExpirationService.cs

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,29 @@ public class CookieExpirationService : ICookieExpirationService
1313
private static readonly DateTime CookieExpirationTime = new DateTime(2010, 1, 1);
1414

1515
// Google Analytics cookies
16-
private static readonly IReadOnlyList<string> GoogleAnalyticsCookies = new[]
16+
private static readonly string[] GoogleAnalyticsCookies = new[]
1717
{
1818
"_ga",
1919
"_gid",
2020
"_gat",
2121
};
2222

2323
// Application Insights cookies
24-
private static readonly IReadOnlyList<string> ApplicationInsightsCookies = new[]
24+
private static readonly string[] ApplicationInsightsCookies = new[]
2525
{
2626
"ai_user",
2727
"ai_session",
2828
};
2929

30-
private readonly string _domain;
31-
private readonly string _rootDomain;
32-
33-
public CookieExpirationService(string domain)
34-
{
35-
if (string.IsNullOrEmpty(domain))
36-
{
37-
throw new ArgumentException(CoreStrings.ArgumentCannotBeNullOrEmpty, nameof(domain));
38-
}
39-
40-
_domain = domain;
41-
_rootDomain = GetRootDomain(_domain);
42-
}
43-
4430
public void ExpireAnalyticsCookies(HttpContextBase httpContext)
4531
{
4632
if (httpContext == null)
4733
{
4834
throw new ArgumentNullException(nameof(httpContext));
4935
}
5036

51-
GoogleAnalyticsCookies.ToList().ForEach(cookieName => ExpireCookieByName(httpContext, cookieName, _rootDomain));
52-
ApplicationInsightsCookies.ToList().ForEach(cookieName => ExpireCookieByName(httpContext, cookieName));
37+
Array.ForEach(GoogleAnalyticsCookies, cookieName => ExpireCookieByName(httpContext, cookieName));
38+
Array.ForEach(ApplicationInsightsCookies, cookieName => ExpireCookieByName(httpContext, cookieName));
5339
}
5440

5541
public void ExpireSocialMediaCookies(HttpContextBase httpContext) { }
@@ -84,22 +70,5 @@ public void ExpireCookieByName(HttpContextBase httpContext, string cookieName, s
8470
}
8571
}
8672
}
87-
88-
private string GetRootDomain(string domain)
89-
{
90-
var index1 = domain.LastIndexOf('.');
91-
if (index1 < 0)
92-
{
93-
return domain;
94-
}
95-
96-
var index2 = domain.LastIndexOf('.', index1 - 1);
97-
if (index2 < 0)
98-
{
99-
return domain;
100-
}
101-
102-
return domain.Substring(index2 + 1);
103-
}
10473
}
10574
}

src/NuGetGallery.Services/Telemetry/ITelemetryService.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,13 @@ void TrackABTestEnrollmentInitialized(
378378
/// <summary>
379379
/// Track when an A/B test enrollment is upgraded
380380
/// </summary>
381-
/// <param name="schemaVersion">The schema version.</param>
381+
/// <param name="oldSchemaVersion">The old schema version.</param>
382+
/// <param name="newSchemaVersion">The new schema version.</param>
382383
/// <param name="previewSearchBucket">The bucket for the preview search test.</param>
383384
/// <param name="packageDependentBucket">The bucket for the package dependents test</param>
384385
void TrackABTestEnrollmentUpgraded(
385-
int schemaVersion,
386+
int oldSchemaVersion,
387+
int newSchemaVersion,
386388
int previewSearchBucket,
387389
int packageDependentBucket);
388390

0 commit comments

Comments
 (0)