mirror of
https://github.com/apache/superset.git
synced 2026-04-22 09:35:23 +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:
@@ -24,6 +24,12 @@ class QuerySearch extends React.Component {
|
||||
this.fetchUsers();
|
||||
this.refreshQueries();
|
||||
}
|
||||
onUserClicked(userId) {
|
||||
this.setState({ userId }, () => { this.refreshQueries(); });
|
||||
}
|
||||
onDbClicked(dbId) {
|
||||
this.setState({ databaseId: dbId }, () => { this.refreshQueries(); });
|
||||
}
|
||||
onChange(db) {
|
||||
const val = (db) ? db.value : null;
|
||||
this.setState({ databaseId: val });
|
||||
@@ -74,9 +80,6 @@ class QuerySearch extends React.Component {
|
||||
}
|
||||
});
|
||||
}
|
||||
search() {
|
||||
this.refreshQueries(this.props);
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
@@ -93,7 +96,10 @@ class QuerySearch extends React.Component {
|
||||
/>
|
||||
</div>
|
||||
<div className="col-sm-2">
|
||||
<DatabaseSelect onChange={this.onChange.bind(this)} />
|
||||
<DatabaseSelect
|
||||
onChange={this.onChange.bind(this)}
|
||||
databaseId={this.state.databaseId}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-sm-4">
|
||||
<input
|
||||
@@ -114,15 +120,17 @@ class QuerySearch extends React.Component {
|
||||
onChange={this.changeStatus.bind(this)}
|
||||
/>
|
||||
</div>
|
||||
<Button bsSize="small" bsStyle="success" onClick={this.search.bind(this)}>
|
||||
<Button bsSize="small" bsStyle="success" onClick={this.refreshQueries.bind(this)}>
|
||||
Search
|
||||
</Button>
|
||||
</div>
|
||||
<QueryTable
|
||||
columns={[
|
||||
'state', 'dbId', 'userId',
|
||||
'progress', 'rows', 'sql',
|
||||
'progress', 'rows', 'sql', 'querylink',
|
||||
]}
|
||||
onUserClicked={this.onUserClicked.bind(this)}
|
||||
onDbClicked={this.onDbClicked.bind(this)}
|
||||
queries={this.state.queriesArray}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user