mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
Some polish on query search (#1222)
* Some polish - Changed query search icon - CopyToClipboard in action bar * Added dbId as linked-button, made modifications based on comments * Fix duplicated import (linting)
This commit is contained in:
@@ -11,15 +11,12 @@ class DatabaseSelect extends React.Component {
|
||||
this.state = {
|
||||
databaseLoading: false,
|
||||
databaseOptions: [],
|
||||
databaseId: null,
|
||||
};
|
||||
}
|
||||
componentDidMount() {
|
||||
this.fetchDatabaseOptions();
|
||||
}
|
||||
changeDb(db) {
|
||||
const val = (db) ? db.value : null;
|
||||
this.setState({ databaseId: val });
|
||||
this.props.onChange(db);
|
||||
}
|
||||
fetchDatabaseOptions() {
|
||||
@@ -38,7 +35,7 @@ class DatabaseSelect extends React.Component {
|
||||
name="select-db"
|
||||
placeholder={`Select a database (${this.state.databaseOptions.length})`}
|
||||
options={this.state.databaseOptions}
|
||||
value={this.state.databaseId}
|
||||
value={this.props.databaseId}
|
||||
isLoading={this.state.databaseLoading}
|
||||
autosize={false}
|
||||
onChange={this.changeDb.bind(this)}
|
||||
@@ -51,6 +48,12 @@ class DatabaseSelect extends React.Component {
|
||||
DatabaseSelect.propTypes = {
|
||||
onChange: React.PropTypes.func,
|
||||
actions: React.PropTypes.object,
|
||||
databaseId: React.PropTypes.number,
|
||||
};
|
||||
|
||||
DatabaseSelect.defaultProps = {
|
||||
onChange: () => {},
|
||||
databaseId: null,
|
||||
};
|
||||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
|
||||
Reference in New Issue
Block a user