You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2020/07/26 11:51:41 UTC
[incubator-superset] 01/05: fix: modified by column on charts and
dashboards (#10340)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch 0.37
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit f13629abd570893c2582cb51c1075f8a0d428525
Author: Daniel Vaz Gaspar <da...@gmail.com>
AuthorDate: Thu Jul 16 23:15:47 2020 +0100
fix: modified by column on charts and dashboards (#10340)
---
superset-frontend/src/views/chartList/ChartList.tsx | 4 ++--
superset-frontend/src/views/dashboardList/DashboardList.tsx | 4 ++--
superset-frontend/src/welcome/DashboardTable.tsx | 4 ++--
superset/charts/api.py | 6 ++----
superset/dashboards/api.py | 4 ++--
superset/models/helpers.py | 4 ++--
6 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/superset-frontend/src/views/chartList/ChartList.tsx b/superset-frontend/src/views/chartList/ChartList.tsx
index fc5f992..5f96eef 100644
--- a/superset-frontend/src/views/chartList/ChartList.tsx
+++ b/superset-frontend/src/views/chartList/ChartList.tsx
@@ -146,8 +146,8 @@ class ChartList extends React.PureComponent<Props, State> {
},
},
}: any) => <a href={changedByUrl}>{changedByName}</a>,
- Header: t('Creator'),
- accessor: 'changed_by_fk',
+ Header: t('Modified By'),
+ accessor: 'changed_by.first_name',
},
{
Cell: ({
diff --git a/superset-frontend/src/views/dashboardList/DashboardList.tsx b/superset-frontend/src/views/dashboardList/DashboardList.tsx
index 95de66a..09c3cc5 100644
--- a/superset-frontend/src/views/dashboardList/DashboardList.tsx
+++ b/superset-frontend/src/views/dashboardList/DashboardList.tsx
@@ -161,8 +161,8 @@ class DashboardList extends React.PureComponent<Props, State> {
},
},
}: any) => <a href={changedByUrl}>{changedByName}</a>,
- Header: t('Creator'),
- accessor: 'changed_by_fk',
+ Header: t('Modified By'),
+ accessor: 'changed_by.first_name',
},
{
Cell: ({
diff --git a/superset-frontend/src/welcome/DashboardTable.tsx b/superset-frontend/src/welcome/DashboardTable.tsx
index 430548a..971b54f 100644
--- a/superset-frontend/src/welcome/DashboardTable.tsx
+++ b/superset-frontend/src/welcome/DashboardTable.tsx
@@ -77,8 +77,8 @@ class DashboardTable extends React.PureComponent<
}) => <a href={url}>{dashboardTitle}</a>,
},
{
- accessor: 'changed_by_fk',
- Header: 'Creator',
+ accessor: 'changed_by.first_name',
+ Header: 'Modified By',
Cell: ({
row: {
original: { changed_by_name: changedByName, changedByUrl },
diff --git a/superset/charts/api.py b/superset/charts/api.py
index da4f0ff..a59ce73 100644
--- a/superset/charts/api.py
+++ b/superset/charts/api.py
@@ -106,8 +106,6 @@ class ChartRestApi(BaseSupersetModelRestApi):
"slice_name",
"url",
"description",
- "changed_by_fk",
- "created_by_fk",
"changed_by_name",
"changed_by_url",
"changed_by.first_name",
@@ -124,12 +122,12 @@ class ChartRestApi(BaseSupersetModelRestApi):
"params",
"cache_timeout",
]
- list_select_columns = list_columns + ["changed_on"]
+ list_select_columns = list_columns + ["changed_on", "changed_by_fk"]
order_columns = [
"slice_name",
"viz_type",
"datasource_name",
- "changed_by_fk",
+ "changed_by.first_name",
"changed_on_delta_humanized",
]
search_columns = (
diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py
index 3310998..03fded4 100644
--- a/superset/dashboards/api.py
+++ b/superset/dashboards/api.py
@@ -119,12 +119,12 @@ class DashboardRestApi(BaseSupersetModelRestApi):
"owners.first_name",
"owners.last_name",
]
- list_select_columns = list_columns + ["changed_on"]
+ list_select_columns = list_columns + ["changed_on", "changed_by_fk"]
order_columns = [
"dashboard_title",
"changed_on_delta_humanized",
"published",
- "changed_by_fk",
+ "changed_by.first_name",
]
add_columns = [
diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index 969669c..d903d27 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -366,8 +366,8 @@ class AuditMixinNullable(AuditMixin):
@property
def changed_by_name(self) -> str:
- if self.created_by:
- return escape("{}".format(self.created_by))
+ if self.changed_by:
+ return escape("{}".format(self.changed_by))
return ""
@renders("created_by")