-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Alerting: Indicate panels without identifier #74746
Conversation
@@ -73,11 +74,12 @@ export const DashboardPicker = ({ dashboardUid, panelId, isOpen, onChange, onDis | |||
|
|||
const filteredPanels = | |||
dashboardResult?.dashboard?.panels | |||
?.filter((panel): panel is PanelDTO => typeof panel.id === 'number' && typeof panel.type === 'string') |
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 removed the filter here, omitting the panels from the selection seemed confusing for the user
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.
The solution works great!
I'm just wondering, does it make sense that a panel ID is optional though? Why wouldn't a panel have an ID?
It doesn't to me, no. However it seems like the API does allow dashboards to be created with panels that have no identifiers so we just have to roll with it :D |
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.
LGTM!
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.
💯
What is this feature?
Panel IDs are optional. This wasn't taken in to account in the
DashboardPicker
and when opening the selector and choosing a dashboard that had any panels withoutid
the front-end would crash.The typings were both incorrect and also not correctly applied (
dashboardDTO.panels
is typed asany
😖)This change shows the panels without identifiers but disables it from being selected and adds an indicator that those cannot be selected.