[Trunk|Library]:

1. searchPage.component & advancedSearchPage.component: 
	goTo() function: use router.navigate instead of location.go (bug fix: error in paging because of false routerLinkActive class)
2. In all search (simple & dataproviders) and advanced search pages:
	In queryChanged() function do not call getResuls() functions which queries api (goTo() of searchPage/advancedSearchPage.component reloads the page anyway).


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55371 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-04-15 23:32:07 +00:00
parent 1bb6fbe7ca
commit 992a245ed0
19 changed files with 29 additions and 21 deletions

View File

@ -174,7 +174,7 @@ export class AdvancedSearchDataProvidersComponent {
this.loadPaging = true;
var parameters = $event.value;
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
//this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
//console.info("queryChanged: Execute search query "+parameters);
}

View File

@ -186,7 +186,7 @@ export class AdvancedSearchDatasetsComponent {
this.loadPaging = true;
var parameters = $event.value;
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size, this.searchUtils.sortBy);
//this.getResults(parameters, this.searchUtils.page,this.searchUtils.size, this.searchUtils.sortBy);
//console.info("queryChanged: Execute search query "+parameters);
}

View File

@ -179,7 +179,7 @@ public resourcesQuery = "(oaftype exact organization)";
this.loadPaging = true;
var parameters = $event.value;
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
//this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
//console.info("queryChanged: Execute search query "+parameters);
}

View File

@ -177,7 +177,7 @@ export class AdvancedSearchOrpsComponent {
this.loadPaging = true;
var parameters = $event.value;
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size, this.searchUtils.sortBy);
//this.getResults(parameters, this.searchUtils.page,this.searchUtils.size, this.searchUtils.sortBy);
//console.info("queryChanged: Execute search query "+parameters);
}

View File

@ -181,7 +181,7 @@ export class AdvancedSearchProjectsComponent {
this.loadPaging = true;
var parameters = $event.value;
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
//this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
//console.info("queryChanged: Execute search query "+parameters);
}

View File

@ -188,7 +188,7 @@ export class AdvancedSearchPublicationsComponent {
this.loadPaging = true;
var parameters = $event.value;
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size, this.searchUtils.sortBy);
//this.getResults(parameters, this.searchUtils.page,this.searchUtils.size, this.searchUtils.sortBy);
//console.info("queryChanged: Execute search query "+parameters);
}

View File

@ -187,7 +187,7 @@ export class AdvancedSearchSoftwareComponent {
this.loadPaging = true;
var parameters = $event.value;
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size, this.searchUtils.sortBy);
//this.getResults(parameters, this.searchUtils.page,this.searchUtils.size, this.searchUtils.sortBy);
//console.info("queryChanged: Execute search query "+parameters);
}

View File

@ -167,7 +167,7 @@ properties:EnvProperties;
//console.info("queryChanged: Execute search query "+parameters);
this._getResults(parameters, csv_parameters, false, this.searchUtils.page, this.searchUtils.size);
//this._getResults(parameters, csv_parameters, false, this.searchUtils.page, this.searchUtils.size);
}
private createFilters():Filter[] {
var filter_names=["Type","Compatibility Level"];

View File

@ -166,7 +166,7 @@ properties:EnvProperties;
//console.info("queryChanged: Execute search query "+parameters);
var csv_parameters = $event.value;
this._getResults(parameters, csv_parameters, false, this.searchUtils.page, this.searchUtils.size);
//this._getResults(parameters, csv_parameters, false, this.searchUtils.page, this.searchUtils.size);
}
private createFilters():Filter[] {
var filter_names=["Type","Compatibility Level"];

View File

@ -166,7 +166,7 @@ properties:EnvProperties;
//console.info("queryChanged: Execute search query "+parameters);
var csv_parameters = $event.value;
this._getResults(parameters,csv_parameters, false, this.searchUtils.page, this.searchUtils.size);
//this._getResults(parameters,csv_parameters, false, this.searchUtils.page, this.searchUtils.size);
}
private createFilters():Filter[] {
var filter_names=["Type","Compatibility Level"];

View File

@ -13,6 +13,7 @@ import {SearchUtilsClass} from './searchUtils.class';
import {ModalLoading} from '../../utils/modal/loading.component';
import {StringUtils, Dates} from '../../utils/string-utils.class';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
@ -55,6 +56,7 @@ export class AdvancedSearchPageComponent {
public resultsPerPage: number = 0;
isPiwikEnabled = false;
properties:EnvProperties;
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
url = null;
@ -265,7 +267,9 @@ export class AdvancedSearchPageComponent {
this.searchUtils.page = page;
var urlParameters = this.createUrlParameters(true);
var queryParameters = this.createQueryParameters();
this.location.go(location.pathname,urlParameters);
//this.location.go(location.pathname,urlParameters);
this.router.navigate( [this.searchUtils.baseUrl], { queryParams: this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues) } );
this.queryChange.emit({
value: queryParameters
});

View File

@ -6,14 +6,15 @@ import {Router, ActivatedRoute} from '@angular/router';
import {Title, Meta} from '@angular/platform-browser';
import {Filter, Value} from './searchHelperClasses.class';
import {SearchFields} from '../../utils/properties/searchFields';
import {SearchFields} from '../../utils/properties/searchFields';
import {SearchUtilsClass} from './searchUtils.class';
import {DOI, StringUtils} from '../../utils/string-utils.class';
import {RouterHelper} from '../../utils/routerHelper.class';
import {ModalLoading} from '../../utils/modal/loading.component';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import {PiwikService} from '../../utils/piwik/piwik.service';
import {EnvProperties} from '../../utils/properties/env-properties';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
@Component({
selector: 'search-page',
@ -70,6 +71,7 @@ export class SearchPageComponent {
public resultsPerPage: number = 10;
public isPiwikEnabled;
properties:EnvProperties;
public routerHelper:RouterHelper = new RouterHelper();
public errorCodes:ErrorCodes = new ErrorCodes();
constructor (private route: ActivatedRoute,
@ -532,7 +534,9 @@ export class SearchPageComponent {
//console.info("queryParams : "+queryParameters);
var indexQuery = this.createIndexQueryParameters(this.filters);
this.location.go(location.pathname,urlParameters);
//this.location.go(location.pathname,urlParameters);
this.router.navigate( [this.baseUrl], { queryParams: this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues) } );
/* Code For Piwik*/
if (typeof localStorage !== 'undefined') {
localStorage.setItem('previousRoute', this.router.url);

View File

@ -389,7 +389,7 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
this.loadPaging = true;
var parameters = $event.value;
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
//this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
}
private handleError(message: string, error) {

View File

@ -309,7 +309,7 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
var parameters = $event.value;
//this.getResults(parameters, this.searchUtils.page, this.searchUtils.size, "searchPage");
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
//this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
}
private handleError(message: string, error) {

View File

@ -190,7 +190,7 @@ properties: EnvProperties;
var parameters = $event.value;
//console.info("queryChanged: Execute search query "+parameters);
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
//this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
}
private handleError(message: string, error) {

View File

@ -286,7 +286,7 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
this.loadPaging = true;
var parameters = $event.value;
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
//this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
}
private handleError(message: string, error) {

View File

@ -229,7 +229,7 @@ properties: EnvProperties;
this.urlParams = undefined;
var parameters = $event.value;
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
//this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
}
private handleError(message: string, error) {

View File

@ -338,7 +338,7 @@ public getAggregatorResults(id:string, page: number, size: number){
var parameters = $event.value;
//console.info("queryChanged: Execute search query "+parameters);
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
//this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
}

View File

@ -309,7 +309,7 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
var parameters = $event.value;
//this.getResults(parameters, this.searchUtils.page, this.searchUtils.size, "searchPage");
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
//this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);
}
private handleError(message: string, error) {