-
Notifications
You must be signed in to change notification settings - Fork 14k
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
feat(explore): Fill dashboard name when adding new chart from dashboard view #20129
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
/* header has mysterious extra margin */ | ||
header.top { | ||
margin-bottom: 2px; | ||
z-index: 10; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main menu items on the right were not clickable because in edit mode the right panel was covering them (they were visible but unclickable because of invisible part of that panel covering them) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can test that by opening dashboard in edit mode and then try to click the "+" icon in top right corner |
||
} | ||
|
||
body { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -678,12 +678,17 @@ function mapStateToProps(state) { | |
const chartKey = Object.keys(charts)[0]; | ||
const chart = charts[chartKey]; | ||
|
||
let dashboardId = Number(explore.form_data?.dashboardId); | ||
if (Number.isNaN(dashboardId)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
dashboardId = undefined; | ||
} | ||
|
||
return { | ||
isDatasourceMetaLoading: explore.isDatasourceMetaLoading, | ||
datasource: explore.datasource, | ||
datasource_type: explore.datasource.type, | ||
datasourceId: explore.datasource_id, | ||
dashboardId: explore.form_data ? explore.form_data.dashboardId : undefined, | ||
dashboardId, | ||
controls: explore.controls, | ||
can_overwrite: !!explore.can_overwrite, | ||
can_add: !!explore.can_add, | ||
|
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 a cool function, why nullish?
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.
!dashboardId
would excludedashboardId === 0
, which is a valid id 😄