Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Fixed issue related with search query. Now, we reset all filters when…
Browse files Browse the repository at this point in the history
… a query is run.
  • Loading branch information
soniacq committed May 31, 2017
1 parent 536e8b6 commit a895f7d
Showing 1 changed file with 31 additions and 16 deletions.
47 changes: 31 additions & 16 deletions client/src/components/SearchTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,23 @@ class SearchTabs extends React.Component {
this.setState({ slideIndex: value, });
};

resetAllFilters(session){
session['newPageRetrievalCriteria'] = "one";
session['pageRetrievalCriteria'] = "Queries";
session['selected_morelike'] = "";
session['selected_queries']="";
session['selected_tlds']="";
session['selected_aterms']="";
session['selected_tags']="";
session['selected_model_tags']="";
session['filter'] = null;
return session;
}
//Submits a web query for a list of terms, e.g. 'ebola disease'
RunQuery(){
var session =this.props.session;
session['search_engine']=this.state.search_engine;
session = this.resetAllFilters(session);
this.props.getQueryPages(this.state.valueQuery);

$.post(
Expand All @@ -71,7 +84,8 @@ class SearchTabs extends React.Component {
runSeedFinderQuery(){
console.log("run seedQuery");
var session =this.props.session;
session['search_engine']=this.state.search_engine;
session['search_engine']=this.state.search_engine;
session = this.resetAllFilters(session);
$.post(
'/runSeedFinder',
{'terms': this.state.valueQuery, 'session': JSON.stringify(session)},
Expand All @@ -86,21 +100,22 @@ class SearchTabs extends React.Component {

// Download the pages of uploaded urls
runLoadUrls(valueLoadUrls){
var session =this.props.session;
session['search_engine']=this.state.search_engine;
this.props.getQueryPages("uploaded");
$.post(
'/uploadUrls',
{'urls': valueLoadUrls, 'session': JSON.stringify(session)},
function(data) {
this.props.queryPagesDone();
this.props.updateStatusMessage(false, "process*concluded" );
}.bind(this)).fail(function() {
console.log("Something is wrong. Try again.");
this.props.updateStatusMessage(false, "uploaded");
}.bind(this));
this.props.updateStatusMessage(true, "Uploading URLs");
}
var session =this.props.session;
session['search_engine']=this.state.search_engine;
session = this.resetAllFilters(session);
this.props.getQueryPages("uploaded");
$.post(
'/uploadUrls',
{'urls': valueLoadUrls, 'session': JSON.stringify(session)},
function(data) {
this.props.queryPagesDone();
this.props.updateStatusMessage(false, "process*concluded" );
}.bind(this)).fail(function() {
console.log("Something is wrong. Try again.");
this.props.updateStatusMessage(false, "uploaded");
}.bind(this));
this.props.updateStatusMessage(true, "Uploading URLs");
}

// Download the pages of uploaded urls from textfield
runLoadUrlsQuery(){
Expand Down

0 comments on commit a895f7d

Please sign in to comment.