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
Browse: Hide dashboard actions if user does not have enough permission #55218
Conversation
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.
Great work Leo 🎉 Also love that you added tests, just got one question about the test
|
||
const { rerender, store } = await setup(); | ||
|
||
expect(screen.queryByRole('button', { name: /new/i })).not.toBeInTheDocument(); |
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.
Nitpicky but I didn't notice that this one test was both testing for having permissions and not having permissions, should we separate this into 2 tests so its easier to understand what each of them does? Or alternatively change the title to reflect that it is testing both scenarios
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 looks great @lpskdl 👏🏾 , thanks for fixing this, and awesome job with the unit test!!
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/33692 |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-55218-to-v9.1.x origin/v9.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 896d684065bad1fb21fc39afb9f101bf76dd1a37
# Push it to GitHub
git push --set-upstream origin backport-55218-to-v9.1.x
git switch main
# Remove the local backport branch
git branch -D backport-55218-to-v9.1.x Then, create a pull request where the |
What this PR does / why we need it:
This PR will hide the dashboard actions when user doesn't have enough permission.
Screen.Recording.2022-09-15.at.10.48.36.mov
Which issue(s) this PR fixes:
Fixes #55216
Special notes for your reviewer: