mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
#views users for created dashboards on profile page (#1667)
* Add #views and #distinct users to created dashboard on profile page * Added index on logs to speed up query * Added #views and #users for slice table * Add a views column to dashboards and slices, prepopulate them with Log data * Remove index on Log model * Remove unused index * Update 1b2c3f7c96f9_.py fix multiple heads * Exclude postgres in prepopulating views column
This commit is contained in:
@@ -19,6 +19,7 @@ class CreatedContent extends React.PureComponent {
|
||||
renderSliceTable() {
|
||||
const mutator = (data) => data.map(slice => ({
|
||||
slice: <a href={slice.url}>{slice.title}</a>,
|
||||
views: slice.views,
|
||||
favorited: moment.utc(slice.dttm).fromNow(),
|
||||
_favorited: slice.dttm,
|
||||
}));
|
||||
@@ -26,7 +27,7 @@ class CreatedContent extends React.PureComponent {
|
||||
<TableLoader
|
||||
dataEndpoint={`/superset/created_slices/${this.props.user.userId}/`}
|
||||
className="table table-condensed"
|
||||
columns={['slice', 'favorited']}
|
||||
columns={['slice', 'favorited', 'views']}
|
||||
mutator={mutator}
|
||||
noDataText="No slices"
|
||||
sortable
|
||||
@@ -36,6 +37,7 @@ class CreatedContent extends React.PureComponent {
|
||||
renderDashboardTable() {
|
||||
const mutator = (data) => data.map(dash => ({
|
||||
dashboard: <a href={dash.url}>{dash.title}</a>,
|
||||
views: dash.views,
|
||||
favorited: moment.utc(dash.dttm).fromNow(),
|
||||
_favorited: dash.dttm,
|
||||
}));
|
||||
@@ -45,7 +47,7 @@ class CreatedContent extends React.PureComponent {
|
||||
mutator={mutator}
|
||||
dataEndpoint={`/superset/created_dashboards/${this.props.user.userId}/`}
|
||||
noDataText="No dashboards"
|
||||
columns={['dashboard', 'favorited']}
|
||||
columns={['dashboard', 'favorited', 'views']}
|
||||
sortable
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user