[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:
Maxime Beauchemin
2017-08-01 12:08:00 -07:00
committed by GitHub
parent 48821b5101
commit 62fcdf2a92
18 changed files with 257 additions and 126 deletions

View File

@@ -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: {