-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dashboard] Show empty screen with error message if no permissions #58584
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
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.
Didn't run locally but code changes look pretty straight forward — LGTM
!getShouldShowEditHelp() && | ||
!getShouldShowViewHelp() && | ||
dashboardConfig.getHideWriteControls(); | ||
const getIsEmptyInReadonlyModeOrUserHasNoPermissions = () => { |
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 method name is getting long enough that it's difficult to read...
Would changing it to something like shouldShowErrorMessage()
be an accurate alternative?
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.
Hm, it's not an error state though, it's a valid state, somewhat edge-casey, but still valid.
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.
Maybe shouldShowUnauthorizedEmptyState
?
Also, not really critical to make this change if you like longer function names 🤷♂
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…58584) (#58761) * Show empty screen with error message if no permissions * Renaming function Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Summary
Fix for: #55118.
If the user has only permissions to create the dashboard but not the visualizations, the new empty panel is confusing. This PR hides the panel if user doesn't have permissions and shows an existing empty screen:
Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] Unit or functional tests were updated or added to match the most common scenarios- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers