[Explore|Trunk]

Home component: updates after changing quick-selection component



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@59633 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-10-20 09:17:15 +00:00
parent 37813a6519
commit fdcd508a21
2 changed files with 24 additions and 17 deletions

View File

@ -41,8 +41,7 @@
<div class=" quickSelectionsBox uk-width-xlarge@l uk-width-large@m uk-width-medium">
<quick-selections *ngIf="selectedEntity == 'result'" [resultTypes]="resultTypes"
[quickFilter]="resultsQuickFilter"
[QFselected]="(resultsQuickFilter)?resultsQuickFilter.selected:null"
[properties]="properties" [delayTime]="0">
[properties]="properties" >
</quick-selections>
</div>
</div>
@ -576,8 +575,7 @@
<div class=" quickSelectionsBox uk-width-xlarge@l uk-width-large@m uk-width-medium">
<quick-selections *ngIf="selectedEntity == 'result'" [resultTypes]="resultTypes"
[quickFilter]="resultsQuickFilter"
[QFselected]="(resultsQuickFilter)?resultsQuickFilter.selected:null"
[properties]="properties" [delayTime]="0">
[properties]="properties">
</quick-selections>
</div>
</div>

View File

@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {Component, Input} from '@angular/core';
import {Subscription} from 'rxjs';
import {ActivatedRoute, Router} from '@angular/router';
import {Location} from '@angular/common';
@ -149,7 +149,7 @@ export class HomeComponent {
selectedEntity = "all";
selectedEntitySimpleUrl;
selectedEntityAdvancedUrl;
resultTypes = {publication:true, dataset:true, software:true, other:true};
resultTypes:Filter = {values:[],filterId:"type", countSelectedValues: 0, filterType: 'checkbox', originalFilterId: "", valueIsExact: true, title: "Result Types",filterOperator:"or"};
public pageContents = null;
useHelpText: boolean = true;
@ -229,6 +229,18 @@ export class HomeComponent {
this.showProjects = showEntity["project"];
this.showDataProviders = showEntity["datasource"];
this.showOrganizations = showEntity["organization"];
if(this.showPublications){
this.resultTypes.values.push({name: "Publications" , id:"publications",selected:true, number:0});
}
if(this.showDatasets){
this.resultTypes.values.push({name: "Research data" , id:"datasets",selected:true, number:0});
}
if(this.showSoftware){
this.resultTypes.values.push({name: "Software" , id:"software",selected:true, number:0});
}
if(this.showOrp){
this.resultTypes.values.push({name: "Other research products" , id:"other",selected:true, number:0});
}
this.getNumbers();
// if(this.showDataProviders) {
// this.fetchDataproviders.getResultsForHome(this.numResults, this.properties);
@ -376,22 +388,18 @@ export class HomeComponent {
if (this.selectedEntity == "result") {
if (this.resultTypes) {
let values = [];
if (this.resultTypes.publication) {
values.push("publications");
console.log(this.resultTypes.values)
for(let value of this.resultTypes.values){
if (value.selected) {
values.push(value.id);
}
if (this.resultTypes.dataset) {
values.push("datasets");
}
if (this.resultTypes.software) {
values.push("software");
}
if (this.resultTypes.other) {
values.push("other");
}
if (values.length > 0 && values.length !=4) {
parameterNames.push("type");
parameterValues.push(values.join(","));
}
console.log(parameterNames)
console.log(parameterValues)
if (this.resultsQuickFilter) {
parameterNames.push("qf");
parameterValues.push("" + this.resultsQuickFilter.selected);
@ -404,6 +412,7 @@ export class HomeComponent {
parameterNames.push("op");
parameterValues.push("and");
}
console.log( this.routerHelper.createQueryParams(parameterNames, parameterValues))
this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)});
}
}