Skip to content

Commit

Permalink
Merge pull request #8664 from NuGet/dev
Browse files Browse the repository at this point in the history
[ReleasePrep][2021.06.28]RI of dev into main
  • Loading branch information
drewgillies authored Jun 30, 2021
2 parents 908da7f + 8dfad62 commit 2aebc2d
Show file tree
Hide file tree
Showing 20 changed files with 307 additions and 144 deletions.
6 changes: 3 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ param (
[string]$PackageSuffix,
[string]$Branch,
[string]$CommitSHA,
[string]$BuildBranch = '948e06b7e5dc320eccd1f44a15a5faeb60384ed6',
[string]$BuildBranchCommit = 'ade39b693d49b266ec5cac5d939edac7dda2fd92',
[string]$VerifyMicrosoftPackageVersion = $null
)

Expand All @@ -32,8 +32,8 @@ if (-not (Test-Path "$PSScriptRoot/build")) {
# Enable TLS 1.2 since GitHub requires it.
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

wget -UseBasicParsing -Uri "https://raw.githubusercontent.com/NuGet/ServerCommon/$BuildBranch/build/init.ps1" -OutFile "$PSScriptRoot/build/init.ps1"
. "$PSScriptRoot/build/init.ps1" -BuildBranch "$BuildBranch"
wget -UseBasicParsing -Uri "https://raw.githubusercontent.com/NuGet/ServerCommon/$BuildBranchCommit/build/init.ps1" -OutFile "$PSScriptRoot/build/init.ps1"
. "$PSScriptRoot/build/init.ps1" -BuildBranchCommit $BuildBranchCommit

Function Clean-Tests {
[CmdletBinding()]
Expand Down
82 changes: 73 additions & 9 deletions src/Bootstrap/dist/css/bootstrap-theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 27 additions & 1 deletion src/Bootstrap/less/theme/common-readme.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,36 @@
img {
max-width: 100%;
}

ul.contains-task-list, li.task-list-item {
list-style-type: none;
}
}

#readme-more {
img {
max-width: 100%;
}
}

ul.contains-task-list, li.task-list-item {
list-style-type: none;
}
}

#readme-preview {
padding-top: 0.25em;

ul.contains-task-list, li.task-list-item {
list-style-type: none;
}
}

#edit-markdown {
padding-top: 3em;
padding-bottom: 3em;
}

#preview-html {
padding-top: 3em;
padding-bottom: 3em;
}
63 changes: 53 additions & 10 deletions src/Bootstrap/less/theme/page-display-package-v2.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,63 @@
border-bottom: 1px solid lightgray;
}

.package-header {
margin-bottom: 36px;
}

.package-title {
margin-bottom: 24px;
margin-bottom: 30px;

div {
margin-top: 2px;
h1 {

.title {
font-size: 32px;
margin-top: 40px;
font-weight: 400;
margin-right: 18px;
}

.version-title {
font-size: 16px;
font-weight: 400;
color: @gray-light;
margin-right: 14px;
vertical-align: middle;
}

.package-icon {
height: 32px;
width: 32px;
margin-top: 8px;
margin-right: 12px;
}

.prefix-reserve-title {
background-color: #F3F2F1;
display: inline-flex;
align-items: center;
border-radius: 100px;
vertical-align: middle;

.reserved-indicator {
width: 18px;
margin-right: 5px;
margin-left: 2px;
}

.prefix-reserve-label {
font-size: 14px;
font-weight: 400;
color: #2F6FA7;
margin-top: 2px;
margin-bottom: 2px;
margin-right: 10px;
}
}
}

.reserved-indicator {
width: 25px;
div {
margin-top: 2px;
}
}

Expand Down Expand Up @@ -120,11 +168,6 @@
padding-left: 0;
padding-right: 0;
text-align: right;

.package-icon {
padding-left: 6px;
padding-right: 6px;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Bootstrap/less/theme/page-edit-package.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.page-edit-package {
.readme-tabs {
margin-top: 40px;
margin-top: 0.5em;
}

.readonly {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ Package FilterLatestPackage(
Package FilterLatestPackageBySuffix(IReadOnlyCollection<Package> packages,
string version, bool prerelease);

IEnumerable<Package> FindPackagesByOwner(User user, bool includeUnlisted, bool includeVersions = false, bool includeVulnerabilities = false);
IEnumerable<Package> FindPackagesByOwner(User user, bool includeUnlisted, bool includeVersions = false);

IEnumerable<Package> FindPackagesByAnyMatchingOwner(User user, bool includeUnlisted, bool includeVersions = false, bool includeVulnerabilities = false);
IEnumerable<Package> FindPackagesByAnyMatchingOwner(User user, bool includeUnlisted, bool includeVersions = false);

IQueryable<PackageRegistration> FindPackageRegistrationsByOwner(User user);

Expand Down
27 changes: 8 additions & 19 deletions src/NuGetGallery.Services/PackageManagement/PackageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,9 @@ private static Package FilterLatestPackageHelper(
return package;
}

public IEnumerable<Package> FindPackagesByOwner(User user,
bool includeUnlisted,
bool includeVersions = false,
bool includeVulnerabilities = false)
public IEnumerable<Package> FindPackagesByOwner(User user, bool includeUnlisted, bool includeVersions = false)
{
return GetPackagesForOwners(new[] { user.Key }, includeUnlisted, includeVersions, includeVulnerabilities);
return GetPackagesForOwners(new[] { user.Key }, includeUnlisted, includeVersions);
}

/// <summary>
Expand All @@ -420,17 +417,15 @@ public IEnumerable<Package> FindPackagesByOwner(User user,
public IEnumerable<Package> FindPackagesByAnyMatchingOwner(
User user,
bool includeUnlisted,
bool includeVersions = false,
bool includeVulnerabilities = false)
bool includeVersions = false)
{
var ownerKeys = user.Organizations.Select(org => org.OrganizationKey).ToList();
ownerKeys.Insert(0, user.Key);

return GetPackagesForOwners(ownerKeys, includeUnlisted, includeVersions, includeVulnerabilities);
return GetPackagesForOwners(ownerKeys, includeUnlisted, includeVersions);
}

private IEnumerable<Package> GetPackagesForOwners(IEnumerable<int> ownerKeys, bool includeUnlisted,
bool includeVersions, bool includeVulnerabilities)
private IEnumerable<Package> GetPackagesForOwners(IEnumerable<int> ownerKeys, bool includeUnlisted, bool includeVersions)
{
IQueryable<Package> packages = _packageRepository.GetAll()
.Where(p => p.PackageRegistration.Owners.Any(o => ownerKeys.Contains(o.Key)));
Expand Down Expand Up @@ -458,17 +453,11 @@ private IEnumerable<Package> GetPackagesForOwners(IEnumerable<int> ownerKeys, bo
.FirstOrDefault());
}

var result = packages
return packages
.Include(p => p.PackageRegistration)
.Include(p => p.PackageRegistration.Owners)
.Include(p => p.PackageRegistration.RequiredSigners);

if (includeVulnerabilities && _featureFlagService.IsManagePackagesVulnerabilitiesEnabled())
{
result = result.Include($"{nameof(Package.VulnerablePackageRanges)}.{nameof(VulnerablePackageVersionRange.Vulnerability)}");
}

return result.ToList();
.Include(p => p.PackageRegistration.RequiredSigners)
.ToList();
}

public IQueryable<PackageRegistration> FindPackageRegistrationsByOwner(User user)
Expand Down
3 changes: 1 addition & 2 deletions src/NuGetGallery/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,7 @@ public virtual ActionResult Packages()

var wasAADLoginOrMultiFactorAuthenticated = User.WasMultiFactorAuthenticated() || User.WasAzureActiveDirectoryAccountUsedForSignin();

var packages = PackageService.FindPackagesByAnyMatchingOwner(
currentUser, includeUnlisted: true, includeVulnerabilities: true);
var packages = PackageService.FindPackagesByAnyMatchingOwner(currentUser, includeUnlisted: true);

var listedPackages = GetPackages(packages, currentUser, wasAADLoginOrMultiFactorAuthenticated,
p => p.Listed && p.PackageStatusKey == PackageStatus.Available);
Expand Down
Loading

0 comments on commit 2aebc2d

Please sign in to comment.