You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2021/02/16 20:01:56 UTC
[superset] branch hugh/overwrite-ds created (now 517f1a8)
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a change to branch hugh/overwrite-ds
in repository https://gitbox.apache.org/repos/asf/superset.git.
at 517f1a8 grab dataset intially on mount
This branch includes the following new commits:
new 517f1a8 grab dataset intially on mount
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[superset] 01/01: grab dataset intially on mount
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a commit to branch hugh/overwrite-ds
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 517f1a8c8a35792b17d51e574c38b62a544867cb
Author: hughhhh <hu...@gmail.com>
AuthorDate: Tue Feb 16 15:00:56 2021 -0500
grab dataset intially on mount
---
superset-frontend/src/SqlLab/components/ResultSet.tsx | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/src/SqlLab/components/ResultSet.tsx b/superset-frontend/src/SqlLab/components/ResultSet.tsx
index 7daae5f..69e67bc 100644
--- a/superset-frontend/src/SqlLab/components/ResultSet.tsx
+++ b/superset-frontend/src/SqlLab/components/ResultSet.tsx
@@ -159,9 +159,23 @@ export default class ResultSet extends React.PureComponent<
this.handleExploreBtnClick = this.handleExploreBtnClick.bind(this);
}
- componentDidMount() {
+ async componentDidMount() {
// only do this the first time the component is rendered/mounted
this.reRunQueryIfSessionTimeoutErrorOnMount();
+
+ const response = await makeApi({
+ method: 'GET',
+ endpoint: '/api/v1/dataset',
+ })(``);
+
+ const userDatasetsOwned = response.result.map(
+ (r: { table_name: string; id: number }) => ({
+ value: r.table_name,
+ datasetId: r.id,
+ }),
+ );
+
+ this.setState({ userDatasetOptions: userDatasetsOwned });
}
UNSAFE_componentWillReceiveProps(nextProps: ResultSetProps) {