Skip to content

Commit 740e652

Browse files
authored
Merge pull request #8027 from NuGet/dev
[ReleasePrep][2020-06-08] RI dev to master
2 parents 6d955d1 + 95da6d9 commit 740e652

16 files changed

Lines changed: 255 additions & 150 deletions

File tree

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

Lines changed: 30 additions & 7 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: 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/input-groups.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// -------------------------
99
.input-group {
1010
position: relative; // For dropdowns
11-
display: table;
11+
display: table-row;
1212
border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
1313

1414
// Undo padding and float of grid classes

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

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
}
122122
}
123123

124-
.gh-desc {
124+
.used-by-desc {
125125
font-family: @font-family-base;
126126
font-size: 14px;
127127
color: #333333;
@@ -137,37 +137,58 @@
137137
-webkit-line-clamp: 2;
138138
/* number of lines to show */
139139
-webkit-box-orient: vertical;
140-
}
140+
}
141141

142-
.gh-link {
142+
.used-by-link {
143143
font-family: @font-family-base;
144144
font-size: 16px;
145145
line-height: 19px;
146146
color: @brand-primary;
147147
width: auto;
148-
}
148+
}
149149

150-
.gh-star-count {
150+
.gh-link, .ngp-link {
151+
font-family: @font-family-base;
152+
font-size: 16px;
153+
line-height: 19px;
154+
color: @brand-primary;
155+
width: auto;
156+
}
157+
158+
.used-by-download-icon {
159+
font-size: 14px;
160+
line-height: 12px;
161+
}
162+
163+
.used-by-count {
151164
font-family: @font-family-base;
152165
font-size: 14px;
153166
line-height: 16px;
154167
font-weight: 400;
155168
color: #586069;
156-
}
169+
}
157170

158-
.gh-star {
171+
.gh-star {
159172
font-size: 14px;
160173
line-height: 12px;
161174
color: @brand-warning;
162-
}
175+
}
163176

164-
.gh-repo-column {
165-
width: 70%;
166-
}
177+
.used-by {
178+
h3 {
179+
strong {
180+
font-weight: 400;
181+
}
182+
}
183+
}
167184

168-
.gh-empty-column {
169-
width: 15%;
170-
}
185+
.used-by-adjust-table-head {
186+
word-break: normal;
187+
}
188+
189+
.used-by-desc-column {
190+
width: 85%;
191+
}
171192

172193
.install-tabs {
173194
font-size: 0.8em;

src/NuGetGallery.Core/GitHub/NuGetPackageGitHubInformation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace NuGetGallery
99
{
1010
public class NuGetPackageGitHubInformation
1111
{
12-
public const int ReposPerPackage = 10;
12+
public const int ReposPerPackage = 5;
1313

1414
public readonly static NuGetPackageGitHubInformation Empty = new NuGetPackageGitHubInformation(new List<RepositoryInformation>());
1515

src/NuGetGallery.Services/PackageManagement/PackageService.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class PackageService : CorePackageService, IPackageService
2626
private readonly ITelemetryService _telemetryService;
2727
private readonly ISecurityPolicyService _securityPolicyService;
2828
private readonly IEntitiesContext _entitiesContext;
29+
private const int packagesDisplayed = 5;
2930

3031
public PackageService(
3132
IEntityRepository<PackageRegistration> packageRegistrationRepository,
@@ -161,25 +162,16 @@ public PackageDependents GetPackageDependents(string id)
161162

162163
private IReadOnlyCollection<PackageDependent> GetListOfDependents(string id)
163164
{
164-
var packageDependentsList = new List<PackageDependent>();
165165
var listPackages = (from pd in _entitiesContext.PackageDependencies
166166
join p in _entitiesContext.Packages on pd.PackageKey equals p.Key
167167
join pr in _entitiesContext.PackageRegistrations on p.PackageRegistrationKey equals pr.Key
168168
where p.IsLatestSemVer2 && pd.Id == id
169169
group 1 by new { pr.Id, pr.DownloadCount, p.Description } into ng
170170
orderby ng.Key.DownloadCount descending
171-
select new { ng.Key.Id, ng.Key.DownloadCount, ng.Key.Description }
172-
).Take(5).ToList();
171+
select new PackageDependent { Id = ng.Key.Id, DownloadCount = ng.Key.DownloadCount, Description = ng.Key.Description }
172+
).Take(packagesDisplayed).ToList();
173173

174-
foreach(var pd in listPackages)
175-
{
176-
var packageDependent = new PackageDependent();
177-
packageDependent.Description = pd.Description;
178-
packageDependent.DownloadCount = pd.DownloadCount;
179-
packageDependent.Id = pd.Id;
180-
packageDependentsList.Add(packageDependent);
181-
}
182-
return packageDependentsList;
174+
return listPackages;
183175
}
184176

185177
private int GetDependentCount(string id)

src/NuGetGallery/Controllers/PackagesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ private PackageDependents GetPackageDependents(string id)
960960
cacheDependentsCacheKey,
961961
dependents,
962962
null,
963-
DateTime.UtcNow.AddMinutes(5),
963+
DateTime.UtcNow.AddMinutes(60),
964964
Cache.NoSlidingExpiration,
965965
CacheItemPriority.Default, null);
966966
}

src/NuGetGallery/GalleryConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class GalleryConstants
2727
public const int GravatarCacheDurationSeconds = 300;
2828

2929
public const int MaxEmailSubjectLength = 255;
30-
internal static readonly NuGetVersion MaxSupportedMinClientVersion = new NuGetVersion("5.6.0.0");
30+
internal static readonly NuGetVersion MaxSupportedMinClientVersion = new NuGetVersion("5.7.0.0");
3131
public const string PackageFileDownloadUriTemplate = "packages/{0}/{1}/download";
3232

3333
public const string ReadMeFileSavePathTemplateActive = "active/{0}/{1}{2}";

src/NuGetGallery/Scripts/gallery/page-display-package.js

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ $(function () {
6464

6565
// Configure expanders
6666
window.nuget.configureExpanderHeading("dependency-groups");
67-
window.nuget.configureExpanderHeading("github-usage");
67+
window.nuget.configureExpanderHeading("used-by");
6868
window.nuget.configureExpanderHeading("version-history");
6969
window.nuget.configureExpander(
7070
"hidden-versions",
@@ -121,12 +121,12 @@ $(function () {
121121
ga('send', 'event', 'dependencies', e.type);
122122
});
123123

124-
// Emit a Google Analytics event when the user expands or collapses the GitHub Usage section.
125-
$("#github-usage").on('hide.bs.collapse show.bs.collapse', function (e) {
126-
ga('send', 'event', 'github-usage', e.type);
124+
// Emit a Google Analytics event when the user expands or collapses the Used By section.
125+
$("#used-by").on('hide.bs.collapse show.bs.collapse', function (e) {
126+
ga('send', 'event', 'used-by', e.type);
127127
});
128128

129-
// Emit a Google Analytics event when the user clicks on a repo link in the GitHub Usage section.
129+
// Emit a Google Analytics event when the user clicks on a repo link in the GitHub Repos area of the Used By section.
130130
$(".gh-link").on('click', function (elem) {
131131
if (!elem.delegateTarget.dataset.indexNumber) {
132132
console.error("indexNumber property doesn't exist!");
@@ -135,28 +135,15 @@ $(function () {
135135
ga('send', 'event', 'github-usage', 'link-click-' + linkIndex);
136136
}
137137
});
138-
}
139-
140-
// Add smooth scrolling to dependent-repos-link
141-
$("#dependent-repos-link").on('click', function (event) {
142-
// Emit a Google Analytics event
143-
if (window.nuget.isGaAvailable()) {
144-
ga('send', 'event', 'github-usage', 'sidebar-link-click');
145-
}
146138

147-
if (this.hash !== "") {
148-
event.preventDefault();
149-
var hash = this.hash;
150-
var hashElem = $(hash);
151-
if (hashElem.attr("aria-expanded") == "false") {
152-
hashElem.click();
139+
// Emit a Google Analytics event when the user clicks on a package link in the NuGet Packages area of the Used By section.
140+
$(".ngp-link").on('click', function (elem) {
141+
if (!elem.delegateTarget.dataset.indexNumber) {
142+
console.error("indexNumber property doesn't exist!");
143+
} else {
144+
var linkIndex = elem.delegateTarget.dataset.indexNumber;
145+
ga('send', 'event', 'used-by-packages', 'link-click-' + linkIndex);
153146
}
154-
$('html, body').animate({
155-
scrollTop: hashElem.offset().top
156-
}, 400, function () {
157-
// Add hash (#) to URL when done scrolling (default click behavior)
158-
window.location.hash = hash;
159-
});
160-
}
161-
});
147+
});
148+
}
162149
});

0 commit comments

Comments
 (0)