This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin 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 89109a1 [chart] fix, datasource link in listview (#9247)
89109a1 is described below
commit 89109a16c68919d9c1688d0777351125adec9210
Author: ʈᵃᵢ <[email protected]>
AuthorDate: Sat Mar 7 14:46:17 2020 -0800
[chart] fix, datasource link in listview (#9247)
---
superset-frontend/src/views/chartList/ChartList.tsx | 7 ++-----
superset/models/slice.py | 6 ++++++
superset/views/chart/api.py | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/superset-frontend/src/views/chartList/ChartList.tsx
b/superset-frontend/src/views/chartList/ChartList.tsx
index e5ec774..7ff2710 100644
--- a/superset-frontend/src/views/chartList/ChartList.tsx
+++ b/superset-frontend/src/views/chartList/ChartList.tsx
@@ -140,12 +140,9 @@ class ChartList extends React.PureComponent<Props, State> {
{
Cell: ({
row: {
- original: {
- datasource_name_text: dsNameTxt,
- datasource_link: dsLink,
- },
+ original: { datasource_name_text: dsNameTxt, datasource_url: dsUrl },
},
- }: any) => <a href={dsLink}>{dsNameTxt}</a>,
+ }: any) => <a href={dsUrl}>{dsNameTxt}</a>,
Header: t('Datasource'),
accessor: 'datasource_name',
sortable: true,
diff --git a/superset/models/slice.py b/superset/models/slice.py
index 46ebf30..104ef34 100644
--- a/superset/models/slice.py
+++ b/superset/models/slice.py
@@ -113,6 +113,12 @@ class Slice(
datasource = self.datasource
return datasource.link if datasource else None
+ @renders("datasource_url")
+ def datasource_url(self) -> Optional[str]:
+ # pylint: disable=no-member
+ datasource = self.datasource
+ return datasource.explore_url if datasource else None
+
def datasource_name_text(self) -> Optional[str]:
# pylint: disable=no-member
datasource = self.datasource
diff --git a/superset/views/chart/api.py b/superset/views/chart/api.py
index ca0a37e..da72f9b 100644
--- a/superset/views/chart/api.py
+++ b/superset/views/chart/api.py
@@ -154,7 +154,7 @@ class ChartRestApi(SliceMixin, BaseOwnedModelRestApi):
"changed_by_url",
"changed_on",
"datasource_name_text",
- "datasource_link",
+ "datasource_url",
"viz_type",
"params",
"cache_timeout",