From 9c0c821b5074068afc31bd3887d568a8ecb0358c Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 13 Feb 2020 14:45:55 +0000 Subject: [PATCH] [Explore|Trunk] New Search: 1. update home page with new search form git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@58094 d315682c-612b-4755-9ff5-7f18f6832af3 --- explore/src/app/home/home.component.html | 36 +++++++++++++++- explore/src/app/home/home.component.ts | 55 +++++++++++++++++++++++- explore/src/app/home/home.module.ts | 4 +- explore/src/assets/env-properties.json | 2 +- 4 files changed, 93 insertions(+), 4 deletions(-) diff --git a/explore/src/app/home/home.component.html b/explore/src/app/home/home.component.html index 0d87d6ae..45170285 100644 --- a/explore/src/app/home/home.component.html +++ b/explore/src/app/home/home.component.html @@ -20,7 +20,41 @@
- + +
+
+
+ +
+
+
+ + +
+
+ + +
+
+
+ + + +
+
+
diff --git a/explore/src/app/home/home.component.ts b/explore/src/app/home/home.component.ts index 306e26fb..0b1b31dc 100644 --- a/explore/src/app/home/home.component.ts +++ b/explore/src/app/home/home.component.ts @@ -20,6 +20,7 @@ import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; import { SEOService } from '../openaireLibrary/sharedComponents/SEO/SEO.service'; import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service"; import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; +import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class"; @Component({ selector: 'home', @@ -144,6 +145,16 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr; trelloImg: string = 'trello.svg'; trelloImg2: string = 'trello.svg'; + resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { + filter: null, + selected: true, + filterId: "resultbestaccessright", + value: "Open Access" + }; + selectedEntity = "all"; + selectedEntitySimpleUrl; + selectedEntityAdvancedUrl; + resultTypes = {publication:true, dataset:true, software:true, other:true}; public pageContents = null; constructor ( @@ -156,7 +167,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr; private _refineFieldResultsService:RefineFieldResultsService, private location: Location, private _piwikService:PiwikService, private config: ConfigurationService, private _meta: Meta, private _title: Title, private seoService: SEOService, - private helper: HelperService + private helper: HelperService, private router: Router ) { var description = "openAIRE explore, open access, publications, research results, European commission, search"; @@ -380,4 +391,46 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr; private handleError(message: string, error) { console.error("Home Page: "+message, error); } + entityChanged($event){ + this.selectedEntity = $event.entity; + this.selectedEntitySimpleUrl = $event.simpleUrl; + this.selectedEntityAdvancedUrl = $event.advancedUrl; + } + goTo(simple:boolean){ + let url = (simple)?this.selectedEntitySimpleUrl:this.selectedEntityAdvancedUrl; + let parameterNames = []; + let parameterValues = []; + if (this.selectedEntity == "result") { + if (this.resultTypes) { + let values = []; + if (this.resultTypes.publication) { + values.push("publications"); + } + 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) { + parameterNames.push("type"); + parameterValues.push(values.join(",")); + } + if (this.resultsQuickFilter) { + parameterNames.push("qf"); + parameterValues.push("" + this.resultsQuickFilter.selected); + } + } + } + if(this.keyword.length > 0) { + parameterNames.push("q"); + parameterValues.push(this.keyword); + parameterNames.push("op"); + parameterValues.push("and"); + } + this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)}); + } } diff --git a/explore/src/app/home/home.module.ts b/explore/src/app/home/home.module.ts index 5a468b0d..f53da1ef 100644 --- a/explore/src/app/home/home.module.ts +++ b/explore/src/app/home/home.module.ts @@ -24,6 +24,8 @@ import { SEOServiceModule } from '../openaireLibrary/sharedComponents/SEO/SEOSer import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module'; import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module"; +import {EntitiesSelectionModule} from "../openaireLibrary/searchPages/searchUtils/entitiesSelection.module"; +import {QuickSelectionsModule} from "../openaireLibrary/searchPages/searchUtils/quick-selections.module"; @NgModule({ imports: [ @@ -36,7 +38,7 @@ import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-port HomeRoutingModule, HelperModule, ErrorMessagesModule, - Schema2jsonldModule, SEOServiceModule, OtherPortalsModule + Schema2jsonldModule, SEOServiceModule, OtherPortalsModule, EntitiesSelectionModule, QuickSelectionsModule ], declarations: [ HomeComponent diff --git a/explore/src/assets/env-properties.json b/explore/src/assets/env-properties.json index 14dc0e15..38cf0d26 100644 --- a/explore/src/assets/env-properties.json +++ b/explore/src/assets/env-properties.json @@ -8,7 +8,7 @@ "statisticsAPIURL" : "http://vatopedi.di.uoa.gr:8080/stats/", "statisticsFrameAPIURL":"https://beta.openaire.eu/stats/", "claimsAPIURL" : "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/", - "searchAPIURLLAst" : "https://beta.services.openaire.eu/search/v2/api/", + "searchAPIURLLAst" : "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/", "searchResourcesAPIURL" : "https://beta.services.openaire.eu/search/v2/api/resources", "openCitationsAPIURL" : "https://services.openaire.eu/opencitations/getCitations?id=", "csvAPIURL" : "https://beta.services.openaire.eu/search/v2/api/reports",