This is an automated email from the ASF dual-hosted git repository. dpgaspar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push: new 2b061fc fix: modified by column on charts and dashboards (#10340) 2b061fc is described below commit 2b061fc64b88831574878b6bd470d700a1527dec Author: Daniel Vaz Gaspar <danielvazgas...@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 9f5f92e..6c8635b 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 a62f67e..7afecc2 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")