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

Navigation is included only for super admin users #8556

Merged
merged 1 commit into from
Dec 11, 2021
Merged

Navigation is included only for super admin users #8556

merged 1 commit into from
Dec 11, 2021

Conversation

sinansonmez
Copy link
Contributor

@sinansonmez sinansonmez commented Dec 2, 2021

What? Why?

Closes #8546

I previously added navigation for pages (#8395). This created another issue that navigation is shown also to regular users. In this PR I am checking if the user is super admin then shows the navigation. In addition pages mentioned in the issue, I included the super admin user check to all pages which I previously added navigation.

Release notes

Show navigation if user is super admin

Changelog Category: User facing changes

Before

Screen.Recording.2021-12-02.at.11.43.13.mov

After

Screen.Recording.2021-12-02.at.11.43.51.mov

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Okay, that looks good to me.

Since it's inherent to the menu that it should only be displayed to admin users, I'm wondering if the if should have gone inside the partial. Less code and less room for error in the future. But this is okay, too.

Copy link
Contributor

@jibees jibees left a comment

Choose a reason for hiding this comment

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

LGTM.
I'd add some specs, but we should merge quickly this one.

@filipefurtad0 filipefurtad0 self-assigned this Dec 10, 2021
@filipefurtad0 filipefurtad0 added pr-staged-uk staging.openfoodnetwork.org.uk and removed pr-staged-uk staging.openfoodnetwork.org.uk labels Dec 10, 2021
@filipefurtad0
Copy link
Contributor

Hey @sinansonmez,

After staging, we can see, that in the BO:

  • as an admin (i.e., as a Hub, or producer), the navigation menu is not displayed anymore when editing shipping- and payment-methods
    Below: left, before this PR; right, after this PR

image

  • as a superadmin
    i) the navigation menu is displayed when editing shipping- and payment-methods

image

ii) the navigation menu is displayed in the Configuration page and in all sub-pages (as introduced by #8395):

Peek 2021-12-11 16-31

Thanks for fixing this ❤️

@filipefurtad0 filipefurtad0 removed the pr-staged-uk staging.openfoodnetwork.org.uk label Dec 11, 2021
@filipefurtad0 filipefurtad0 merged commit f708784 into openfoodfoundation:master Dec 11, 2021
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.

Super admin navigation showing for regular enterprises
4 participants