Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Prefix] List reserved namespaces in the manage packages page #4901

Merged
merged 7 commits into from
Oct 25, 2017

Conversation

shishirx34
Copy link
Contributor

@shishirx34 shishirx34 commented Oct 25, 2017

The view looks like this:

image

@shishirx34 shishirx34 changed the title [Prefix] List reserved namespaces in the manage package page [Prefix] List reserved namespaces in the manage packages page Oct 25, 2017
}

<div class="row user-package-list">
<div class="col-md-12">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

col-xs-12

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like col-md-12 behaves correctly across different dimensions. Will leave as is.

<a href="#" role="button" data-toggle="collapse" data-target="#reservednamespaces"
aria-expanded="true" aria-controls="reservednamespaces" id="show-reservednamespaces">
<i class="ms-Icon ms-Icon--ChevronDown" aria-hidden="true"></i>
<span>My Reserved Package Ids</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDs not Ids

Copy link
Member

@joelverhagen joelverhagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address comments then :shipit:. Make sure to try it on various browsers (IE, Edge, Chrome, FF), various screen sizes (resize the window), and high contrast.

public ReservedNamespaceViewModel(ICollection<ReservedNamespace> reservedNamespacesList)
{
ReservedNamespaces = reservedNamespacesList
.ToList()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ToList should be after the Select, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need it actually, leftover from previous change. removed.

<a target="_blank" href="@Url.User(owner.Username)">@owner.Username</a>
}
</td>
@if(reservedNamespace.IsPublic)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a space between @if and (

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatted the document.

Copy link
Contributor

@scottbommarito scottbommarito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 more question:

<a href="#" role="button" data-toggle="collapse" data-target="#reservednamespaces"
aria-expanded="true" aria-controls="reservednamespaces" id="show-reservednamespaces">
<i class="ms-Icon ms-Icon--ChevronDown" aria-hidden="true"></i>
<span>My Reserved Package Ids</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO I'd prefer

My Reserved Packages

or even

My Reserved Package Namespaces

I don't think we explicitly say IDs prominently in the UI anywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is as per @diverdan92 's spec. I think IDs clearly articulates the message here.


namespace NuGetGallery
{
public class ReservedNamespaceViewModel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To follow the pattern of all of our other list view models this should be ReservedNamespaceListViewModel

@@ -20,6 +20,10 @@
}

@{
@Html.Partial("_ReservedNamespacesList", Model.ReservedNamespaces)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: No need to wrap this in @{ ... }

Value = reservedNamespace.Value;
IsPublic = reservedNamespace.IsSharedNamespace;
IsPrefix = reservedNamespace.IsPrefix;
Owners = reservedNamespace.Owners.Select(owner => owner);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this Select?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need it, reminiscent of some view model changes I was making. removed it.

}
}

<div class="row user-package-list">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this is the second clone of _UserPackagesList.cshtml that we've implemented, can we create some sort of ViewHelpers function that can create a list like this? Every time one page changes, we have to change every other page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can, but I wouldn't want to make it for this PR given that its a much bigger change for refactoring and affecting other components for thorough testing.

{
<tr class="manage-package-listing">
<td class="align-middle hidden-xs">
<img class="reserved-indicator-icon img-responsive"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Do we have this same chunk of code everywhere we embed the reserved package icon? Is there some way we could put it in a shared place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should refactor the view elements much, this isn't exactly the same piece of code, the fallback urls are different, its easier to change the view elements that are aggregated together.

@@ -161,11 +161,13 @@ public virtual ActionResult Packages()
var outgoing = _packageOwnerRequestService.GetPackageOwnershipRequests(requestingOwner: user);

var ownerRequests = new OwnerRequestsViewModel(incoming, outgoing, user, _packageService);
var reservedPrefixes = new ReservedNamespaceViewModel(user.ReservedNamespaces);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we concerned we're adding too many lists to ManagePackages? It has the user's packages, their owner requests, and now their reserved namespaces. It's ok now, but it just seems like we're dumping tons of content there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't a better place for this, I don't think this warrants another page either. Also, given that this would show up only if you have a reserved namespace and same goes with owner requests I think its fine.

@shishirx34 shishirx34 merged commit 5b32ce3 into dev Oct 25, 2017
@shishirx34 shishirx34 deleted the account-page-prefixes branch October 25, 2017 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants