Skip to content

Commit

Permalink
fix(dashboard-list): change name of dashboard is not reflected instan…
Browse files Browse the repository at this point in the history
…tly (#15186)

* fix: change name of dashboard is not reflected instantly

* fix: id

* fix: update info

* fix: add changed_on_delta_humanized
  • Loading branch information
stephenLYZ authored Jul 9, 2021
1 parent 2be52c0 commit 1d572ca
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,26 @@ function DashboardList(props: DashboardListProps) {
({ json = {} }) => {
setDashboards(
dashboards.map(dashboard => {
if (dashboard.id === json.id) {
return json.result;
if (dashboard.id === json?.result?.id) {
const {
changed_by_name,
changed_by_url,
changed_by,
dashboard_title = '',
slug = '',
json_metadata = '',
changed_on_delta_humanized,
} = json.result;
return {
...dashboard,
changed_by_name,
changed_by_url,
changed_by,
dashboard_title,
slug,
json_metadata,
changed_on_delta_humanized,
};
}
return dashboard;
}),
Expand Down

0 comments on commit 1d572ca

Please sign in to comment.