From 3135d4418032aa239dc5c856c0086929fb2f0b10 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Sun, 18 Apr 2021 11:36:41 +0000 Subject: [PATCH] [Explore | Trunk]: Fix boolean variables for entities git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@60903 d315682c-612b-4755-9ff5-7f18f6832af3 --- explore/src/app/home/home.component.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/explore/src/app/home/home.component.ts b/explore/src/app/home/home.component.ts index 9b23029a..7477d332 100644 --- a/explore/src/app/home/home.component.ts +++ b/explore/src/app/home/home.component.ts @@ -3,14 +3,13 @@ import {Subscription} from 'rxjs'; import {ActivatedRoute, Router} from '@angular/router'; import {Location} from '@angular/common'; import "rxjs/add/observable/zip"; -import {Title, Meta} from '@angular/platform-browser'; +import {Meta, Title} from '@angular/platform-browser'; import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service'; import {SearchDataprovidersService} from '../openaireLibrary/services/searchDataproviders.service'; import {SearchProjectsService} from '../openaireLibrary/services/searchProjects.service'; import {SearchOrganizationsService} from '../openaireLibrary/services/searchOrganizations.service'; import {RefineFieldResultsService} from '../openaireLibrary/services/refineFieldResults.service'; import {SearchFields} from '../openaireLibrary/utils/properties/searchFields'; -import {NumberUtils} from '../openaireLibrary/utils/number-utils.class'; import {RouterHelper} from '../openaireLibrary/utils/routerHelper.class'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; @@ -208,13 +207,13 @@ export class HomeComponent { for (var i = 0; i < data['entities'].length; i++) { showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"]; } - this.showPublications = showEntity["publication"]; - this.showDatasets = showEntity["dataset"]; - this.showSoftware = showEntity["software"]; - this.showOrp = showEntity["orp"]; - this.showProjects = showEntity["project"]; - this.showDataProviders = showEntity["datasource"]; - this.showOrganizations = showEntity["organization"]; + this.showPublications = !!showEntity["publication"]; + this.showDatasets = !!showEntity["dataset"]; + this.showSoftware = !!showEntity["software"]; + this.showOrp = !!showEntity["orp"]; + 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}); } @@ -286,7 +285,6 @@ export class HomeComponent { parameterNames.push("f0"); parameterValues.push("q"); } - console.log(this.routerHelper.createQueryParams(parameterNames, parameterValues)) this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)}); } }