suddjian commented on a change in pull request #9211: show edit modal on
dashboards list view
URL:
https://github.com/apache/incubator-superset/pull/9211#discussion_r389955371
##########
File path: superset-frontend/src/views/dashboardList/DashboardList.tsx
##########
@@ -251,8 +250,33 @@ class DashboardList extends React.PureComponent<Props,
State> {
return Boolean(this.state.permissions.find(p => p === perm));
};
- handleDashboardEdit = ({ id }: { id: number }) => {
- window.location.assign(`/dashboard/edit/${id}`);
+ openDashboardEditModal = (dashboard: Dashboard) => {
+ this.setState({
+ dashboardToEdit: dashboard,
+ });
+ };
+
+ handleDashboardEdit = (edits: any, original: Dashboard) => {
+ this.setState({ loading: true });
+ return SupersetClient.get({
+ endpoint: `/api/v1/dashboard/${original.id}`,
Review comment:
I remember this now. The data they return uses the `edit_model_schema`
Marshmallow schema which is the same as the one used to parse incoming edited
fields from the client. IMO a better design would be to return the entire
object as it would from the `GET` endpoint, but that's a larger scale API
design decision.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]