Skip to content

Commit 64d210f

Browse files
authored
Merge pull request #8047 from NuGet/dev
[ReleasePrep][2020.06.15]RI of dev into master
2 parents eb15a10 + 5019705 commit 64d210f

14 files changed

Lines changed: 411 additions & 40 deletions

File tree

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

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

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
font-weight: 400;
181181
}
182182
}
183+
184+
.reserved-indicator {
185+
width: 14px;
186+
margin-bottom: 3px;
187+
margin-left: 2px;
188+
vertical-align: middle;
189+
}
183190
}
184191

185192
.used-by-adjust-table-head {

src/NuGetGallery.Services/Models/PackageDependent.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ public class PackageDependent
1010
public string Id { get; set; }
1111
public int DownloadCount { get; set; }
1212
public string Description { get; set; }
13-
14-
// TODO Add verify checkmark
15-
// https://github.com/NuGet/NuGetGallery/issues/4718
13+
public bool IsVerified { get; set; }
1614
}
1715
}
1816

src/NuGetGallery.Services/PackageManagement/PackageService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ private IReadOnlyCollection<PackageDependent> GetListOfDependents(string id)
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
169-
group 1 by new { pr.Id, pr.DownloadCount, p.Description } into ng
169+
group 1 by new { pr.Id, pr.DownloadCount, pr.IsVerified, p.Description } into ng
170170
orderby ng.Key.DownloadCount descending
171-
select new PackageDependent { Id = ng.Key.Id, DownloadCount = ng.Key.DownloadCount, Description = ng.Key.Description }
171+
select new PackageDependent { Id = ng.Key.Id, DownloadCount = ng.Key.DownloadCount, IsVerified = ng.Key.IsVerified, Description = ng.Key.Description }
172172
).Take(packagesDisplayed).ToList();
173173

174174
return listPackages;
788 Bytes
Loading

src/NuGetGallery/Migrations/202006011927336_AddIndexToPackageDependencies.Designer.cs

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
namespace NuGetGallery.Migrations
2+
{
3+
using System.Data.Entity.Migrations;
4+
5+
public partial class AddIndexToPackageDependencies : DbMigration
6+
{
7+
public override void Up()
8+
{
9+
// "WITH (ONLINE = ON)" is not supported on all editions of SQL Server. We want to create the index in the background
10+
// when we are deploying to our live environment on Azure (which supports online index creation).
11+
// Editions: https://docs.microsoft.com/en-us/sql/t-sql/functions/serverproperty-transact-sql?view=sql-server-ver15#arguments
12+
// We used sp_executesql because it is blocked on SQL that does not support "WITH (ONLINE = ON)".
13+
Sql(@"IF SERVERPROPERTY ('edition') = 'SQL Azure'
14+
BEGIN
15+
EXECUTE sp_executesql N'CREATE NONCLUSTERED INDEX [IX_PackageDependencies_Id] ON [dbo].[PackageDependencies] ([Id])
16+
INCLUDE ([PackageKey])
17+
WITH (ONLINE = ON)'
18+
END
19+
ELSE
20+
BEGIN
21+
CREATE NONCLUSTERED INDEX [IX_PackageDependencies_Id] ON [dbo].[PackageDependencies] ([Id])
22+
INCLUDE ([PackageKey])
23+
END");
24+
}
25+
26+
public override void Down()
27+
{
28+
DropIndex(table: "PackageDependencies", name: "IX_PackageDependencies_Id");
29+
}
30+
}
31+
}

src/NuGetGallery/Migrations/202006011927336_AddIndexToPackageDependencies.resx

Lines changed: 126 additions & 0 deletions
Large diffs are not rendered by default.

src/NuGetGallery/NuGetGallery.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@
294294
<Compile Include="Migrations\202004030548285_AddPackageRename.designer.cs">
295295
<DependentUpon>202004030548285_AddPackageRename.cs</DependentUpon>
296296
</Compile>
297+
<Compile Include="Migrations\202006011927336_AddIndexToPackageDependencies.cs" />
298+
<Compile Include="Migrations\202006011927336_AddIndexToPackageDependencies.designer.cs">
299+
<DependentUpon>202006011927336_AddIndexToPackageDependencies.cs</DependentUpon>
300+
</Compile>
297301
<Compile Include="Services\ConfigurationIconFileProvider.cs" />
298302
<Compile Include="Services\IconUrlDeprecationValidationMessage.cs" />
299303
<Compile Include="Services\GravatarProxyResult.cs" />
@@ -1337,6 +1341,7 @@
13371341
<Content Include="Content\gallery\img\orange-circle.svg" />
13381342
<Content Include="Content\gallery\img\purple-circle-225x225.png" />
13391343
<Content Include="Content\gallery\img\purple-circle.svg" />
1344+
<Content Include="Content\gallery\img\reserved-indicator-14x14.png" />
13401345
<Content Include="Content\gallery\img\reserved-indicator-20x20.png" />
13411346
<Content Include="Content\gallery\img\reserved-indicator-256x256.png" />
13421347
<Content Include="Content\gallery\img\reserved-indicator-25x25.png" />
@@ -1614,6 +1619,9 @@
16141619
<EmbeddedResource Include="Migrations\202004030548285_AddPackageRename.resx">
16151620
<DependentUpon>202004030548285_AddPackageRename.cs</DependentUpon>
16161621
</EmbeddedResource>
1622+
<EmbeddedResource Include="Migrations\202006011927336_AddIndexToPackageDependencies.resx">
1623+
<DependentUpon>202006011927336_AddIndexToPackageDependencies.cs</DependentUpon>
1624+
</EmbeddedResource>
16171625
<EmbeddedResource Include="OData\QueryAllowed\Data\apiv1packages.json" />
16181626
<EmbeddedResource Include="OData\QueryAllowed\Data\apiv1search.json" />
16191627
<EmbeddedResource Include="OData\QueryAllowed\Data\apiv2getupdates.json" />

src/NuGetGallery/Scripts/gallery/page-api-keys.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
this.PackageOwners = packageOwners;
7373
this.packageViewModels = [];
74-
74+
7575
// Generic API key properties.
7676
this._SetPackageSelection = function (packages) {
7777
$.each(self.packageViewModels, function (i, m) {
@@ -107,10 +107,12 @@
107107
}
108108

109109
this.PackageOwner(existingOwner);
110-
} else {
110+
111+
} else if (this.PackageOwners.length == 1) {
111112
this.PackageOwner(this.PackageOwners[0]);
112-
}
113+
}
113114
};
115+
114116
this.Key = ko.observable(0);
115117
this.Type = ko.observable();
116118
this.Value = ko.observable();
@@ -123,7 +125,7 @@
123125
this.Scopes = ko.observableArray();
124126
this.Packages = ko.observableArray();
125127
this.GlobPattern = ko.observable();
126-
128+
127129
// Properties used for the form
128130
this.PendingDescription = ko.observable();
129131

@@ -133,6 +135,10 @@
133135
return self.PackageOwner() && self.PackageOwner().Owner;
134136
}, this);
135137
this.PackageOwner.subscribe(function (newOwner) {
138+
if (newOwner == null) {
139+
return;
140+
}
141+
136142
// When the package owner scope is changed, update the selected action scopes to those that are allowed on behalf of the new package owner.
137143
var isPushNewSelected = function () {
138144
return self.PushScope() === initialData.PackagePushScope;
@@ -328,6 +334,10 @@
328334
this.PackageOwner.subscribe(function (newValue) {
329335
// Initialize each package ID as a view model. This view model is used to track manual checkbox checks
330336
// and whether the glob pattern matches the ID.
337+
if (newValue == null) {
338+
return;
339+
}
340+
331341
var packageIdToViewModel = {};
332342
self.packageViewModels = [];
333343
$.each(newValue.PackageIds, function (i, packageId) {

0 commit comments

Comments
 (0)