mirror of
https://github.com/apache/superset.git
synced 2026-05-12 03:15:55 +00:00
[explore] DatasourceControl to pick datasource in modal (#3210)
* [explore] DatasourceControl to pick datasource in modal Makes it easier to change datasource, also makes it such that the list of all datasources doesn't need to be loaded upfront. * Adding more metadata
This commit is contained in:
committed by
GitHub
parent
48821b5101
commit
62fcdf2a92
@@ -30,23 +30,13 @@ export const D3_TIME_FORMAT_OPTIONS = [
|
||||
|
||||
export const controls = {
|
||||
datasource: {
|
||||
type: 'SelectControl',
|
||||
type: 'DatasourceControl',
|
||||
label: 'Datasource',
|
||||
isLoading: true,
|
||||
clearable: false,
|
||||
default: null,
|
||||
validators: [v.nonEmpty],
|
||||
mapStateToProps: (state) => {
|
||||
const datasources = state.datasources || [];
|
||||
return {
|
||||
choices: datasources,
|
||||
isLoading: datasources.length === 0,
|
||||
rightNode: state.datasource ?
|
||||
<a href={state.datasource.edit_url}>edit</a>
|
||||
: null,
|
||||
};
|
||||
},
|
||||
description: '',
|
||||
description: null,
|
||||
mapStateToProps: state => ({
|
||||
datasource: state.datasource,
|
||||
}),
|
||||
},
|
||||
|
||||
viz_type: {
|
||||
|
||||
Reference in New Issue
Block a user