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:
vera-liu
2016-10-05 11:43:05 -07:00
committed by GitHub
parent 140a055e4e
commit 421a86ade5
6 changed files with 70 additions and 18 deletions

View File

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