Skip to content

Commit

Permalink
Add tooltips and refresh button to custom queries
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed May 18, 2017
1 parent 7920309 commit 6fe6178
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/Float/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ export default class Login extends Component {
this.setState({
url: c.url,
user: c.user,
password: c.password
password: c.password,
save: true
})
}
}
Expand Down
20 changes: 19 additions & 1 deletion src/components/SearchContainer/Tabs/PrebuiltQueriesDisplay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ export default class PrebuiltQueriesDisplay extends Component {
exec(this.getCommandLine() + ' ' + path.join(app.getPath('userData'),'/customqueries.json'));
}

refreshCustom(){
$.ajax({
url: path.join(app.getPath('userData'),'/customqueries.json'),
type: 'GET',
success: function(response){
var x = JSON.parse(response)
var y = []

$.each(x.queries, function(index, el) {
y.push(el)
});

this.setState({custom: y})
}.bind(this)
})
}

componentWillMount() {
$.ajax({
url: path.join(app.getPath('userData'),'/customqueries.json'),
Expand Down Expand Up @@ -75,7 +92,8 @@ export default class PrebuiltQueriesDisplay extends Component {
</div>
<h3>
Custom Queries
<i className="glyphicon glyphicon-pencil customQueryGlyph" onClick={this.editCustom.bind(this)}></i>
<i className="glyphicon glyphicon-pencil customQueryGlyph" data-toggle="tooltip" title="Edit Queries" onClick={this.editCustom.bind(this)}></i>
<i className="glyphicon glyphicon-refresh customQueryGlyph" onClick={this.refreshCustom.bind(this)} style={{"padding-left": "5px"}} data-toggle="tooltip" title="Refresh Queries"></i>
</h3>
<div className="query-box">
<If condition={ this.state.custom.length == 0}>
Expand Down

0 comments on commit 6fe6178

Please sign in to comment.