Skip to content

Commit

Permalink
MIQ-2274: Add datasource info for published slices (#277)
Browse files Browse the repository at this point in the history
When replicating dashboards with charts, the subscriber layer lists charts with duplicated names which makes harder for the user to link the publisher and subsciber correctly. While motive of replication of dashboards is to use it with different datasources, so adding the datasource of the slices in the filterbox selector would improve experience of the administrator who's working the dashboards.

This commit adds datasource info appended with the slice's name in the subscriber layer's "Select chart" filter.
  • Loading branch information
shmsr authored Mar 9, 2020
1 parent 280977e commit da92293
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion superset/assets/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2149,7 +2149,7 @@ export const controls = {
return (slice.id != state.slice.slice_id && isPublishColumnExists);
}
return isPublishColumnExists;
}).map(slice => ({ label: slice.title, value: slice.id, columns: slice.column_names }));
}).map(slice => ({ label: slice.title + " (" + slice.datasource + ")" , value: slice.id, columns: slice.column_names }));
}
return newState;
},
Expand Down
1 change: 1 addition & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2045,6 +2045,7 @@ def user_slices(self, user_id=None):
publish_columns = o.Slice.form_data['publish_columns']
obj = {
'id': o.Slice.id,
'datasource': '%s' % o.Slice.datasource,
'title': o.Slice.slice_name,
'url': o.Slice.slice_url,
'column_names': publish_columns,
Expand Down

0 comments on commit da92293

Please sign in to comment.