-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[Marketplace] Feature - Dashboards for multiple shops #2429
Conversation
* Modifies Shops publication to return all shops with matching domain by removing limit * Rewrite of shop selector dropdown * Use Shops publication instead of SellerShops publication in dropdown * Remove requirement for marketplace ownership to see shop selector * Change Reaction.ShopId when shop selector is changed * TODO: Convert shop selector to React
* Eliminates console warnings
@impactmass |
…etShopId now checks for user selected shop
These are the items I see in the dropdown with the permissions set as listed in above description (shown on the side). Taken while on the secondary shop too. I added the permissions directly on the user in the DB as going through the Accounts dashboard wasn't adding the permissions under the secondary shop. Is this the right way to test the PR? |
@impactmass While we don't have identical permissions available, I think we probably went about setting it up slightly differently. I don't think that's an issue as what this PR is trying to accomplish is changing the dashboard contextually based on the active shop and enabled permissions. It looks like that is working for you as well. If you can do a code review for me as well, I think we can probably go ahead and merge this one in. We can figure out why the same set of permissions are granting different options for the dashboard later, but my guess would be something that changed in the base |
ok, I'll do a code review, plus test it while stepping back that last commit. Will update in a shortly |
…d rely on the implicit shopId
# Conflicts: # server/publications/collections/packages.js
… on the fly when a new shop is created
This PR got out of hand, and is a lot bigger than I'd like, but the issues kept cascading. This solves a number of issues now:
@impactmass - If you could give this another review asap, we can merge it and get cranking on the rest of marketplace |
@@ -59,6 +59,10 @@ Template.registerHelper("hasDashboardAccess", function () { | |||
return Reaction.hasDashboardAccess(); | |||
}); | |||
|
|||
Template.registerHelper("hasDashboardAccessForAnyShop", function () { | |||
return Reaction.hasPermissionsForAnyShop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I searched for this function hasPermissionsForAnyShop
and couldn't find it. Is it already on the marketplace branch? Or there's some typo here? Is it meant to be
Template.registerHelper("hasDashboardAccessForAnyShop", function () {
return Reaction.hasDashboardAccessForAnyShop();
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I think I added this before the navbar was fully converted to react and have since removed the rest of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed now.
Pretty sure this is ready to merge. Waiting on a final 'ok' from @impactmass, which I'll get whenever he gets back. We're planning to walk through the PR at that point, anyone is welcome to join. Will be some time next week. (Monday hopefully). In the mean time if anyone else wants to review, we can go ahead and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Tested the dashboard context switching, when different shops are selected. Works as the PR said.
- Also worked through parts of the PR that I wasn't familiar with yet with Spencer.
- This is good to merge
Change the context of a users dashboard shortcuts and user dropdown shortcuts based on active shop.
For a user with the following roles for the secondary shop:
Their dashboard and shortcuts dropdown looks like the following:
