diff --git a/explore/src/app/home/home.component.html b/explore/src/app/home/home.component.html index 702ad74f..4c24e24f 100644 --- a/explore/src/app/home/home.component.html +++ b/explore/src/app/home/home.component.html @@ -1,4 +1,3 @@ -
@@ -23,7 +22,7 @@
@@ -47,7 +46,7 @@ - FOS logo + FOS logo Browse by FOS @@ -66,7 +65,7 @@
-
+
    @@ -77,7 +76,7 @@ {{numbers.publicationsSize.number|number}}{{numbers.publicationsSize.size}} - publications deduplicated + {{openaireEntities.PUBLICATIONS}} deduplicated @@ -87,18 +86,17 @@ datasets interlinked with publications {{numbers.datasetsSize.number|number}}{{numbers.datasetsSize.size}} - research data + {{openaireEntities.DATASETS}} {{numbers.softwareLinkedSize.number|number}}{{numbers.softwareLinkedSize.size}} - research - software interlinked with publications + {{openaireEntities.SOFTWARE}} interlinked with publications {{numbers.softwareSize.number|number}}{{numbers.softwareSize.size}} - research software + {{openaireEntities.SOFTWARE}} Persistent identifiers and registries @@ -173,10 +171,9 @@
    - - ipad + style="height:50vh">
    @@ -261,7 +258,7 @@

    - Lorem ipsum. + Lorem ipsum.

    -
    - - - - - - +
    \ No newline at end of file diff --git a/explore/src/app/home/home.component.ts b/explore/src/app/home/home.component.ts index 10e3349d..cd7fd622 100644 --- a/explore/src/app/home/home.component.ts +++ b/explore/src/app/home/home.component.ts @@ -1,5 +1,6 @@ import { AfterViewInit, + ChangeDetectorRef, Component, ElementRef, OnDestroy, @@ -8,7 +9,7 @@ import { ViewChild, ViewChildren } from '@angular/core'; -import {Subscriber, Subscription} from 'rxjs'; +import {Observable, of, Subscriber, zip} from 'rxjs'; import {ActivatedRoute, Router} from '@angular/router'; import {Location} from '@angular/common'; import {Meta, Title} from '@angular/platform-browser'; @@ -17,7 +18,7 @@ import {SearchDataprovidersService} from '../openaireLibrary/services/searchData 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 {OpenaireEntities, SearchFields} from '../openaireLibrary/utils/properties/searchFields'; import {RouterHelper} from '../openaireLibrary/utils/routerHelper.class'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; @@ -30,6 +31,7 @@ import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperCla import {properties} from "../../environments/environment"; import {Numbers, NumbersComponent} from "../openaireLibrary/sharedComponents/numbers/numbers.component"; import {StringUtils} from "../openaireLibrary/utils/string-utils.class"; +import { NumberUtils } from '../openaireLibrary/utils/number-utils.class'; @Component({ selector: 'home', @@ -123,7 +125,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit{ public searchFields: SearchFields = new SearchFields(); public errorCodes: ErrorCodes = new ErrorCodes(); public routerHelper: RouterHelper = new RouterHelper(); - public numbers: Numbers; + public numbers: Numbers = {}; showPublications: boolean = false; showDatasets: boolean = false; showSoftware: boolean = false; @@ -132,6 +134,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit{ showDataProviders: boolean = false; showOrganizations: boolean = false; properties: EnvProperties = properties; + public openaireEntities = OpenaireEntities; public readMore: boolean = false; subscriptions: any[] = []; @@ -182,14 +185,15 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit{ constructor( private route: ActivatedRoute, private _router: Router, - private _searchResearchResultsService: SearchResearchResultsService, - private _searchDataprovidersService: SearchDataprovidersService, - private _searchProjectsService: SearchProjectsService, - private _searchOrganizationsService: SearchOrganizationsService, - private _refineFieldResultsService: RefineFieldResultsService, + private searchResearchResultsService: SearchResearchResultsService, + private searchDataprovidersService: SearchDataprovidersService, + private searchProjectsService: SearchProjectsService, + private searchOrganizationsService: SearchOrganizationsService, + 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 cdr: ChangeDetectorRef ) { let description = "OpenAIRE Explore: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide."; let title = "OpenAIRE | Find and Share research"; @@ -266,7 +270,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit{ if (this.showOrp) { this.resultTypes.values.push({name: "Other research products", id: "other", selected: true, number: 0}); } - this.numbersComponent.init(this.showDatasets, this.showSoftware, this.showPublications, this.showDatasets, this.showSoftware, this.showOrp, this.showProjects, this.showDataProviders); + this.init(this.showDatasets, this.showSoftware, this.showPublications, this.showDatasets, this.showSoftware, this.showOrp, this.showProjects, this.showDataProviders); } }, error => { @@ -275,6 +279,8 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit{ )); } } + + public ngOnDestroy() { this.clear(); @@ -354,4 +360,53 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit{ getSubjectParameter(param){ return {'f0':'resultsubject','fv0':'"' +(param)+'"', size:50}; } + + init(getDatasetsLinked = false, getSoftwareLinked = false, getPublications = true, getDatasets = true, + getSoftware = true, getOther = true, getProjects = true, getDataProviders = true, refineValue: string = null) { + this.subscriptions.push(zip( + (getPublications) ? this.searchResearchResultsService.numOfSearchResults('publication', '', this.properties, null) : of(0), + (getDatasets) ? this.searchResearchResultsService.numOfSearchResults('dataset', '', this.properties, null) : of(0), + (getDatasetsLinked) ? this.searchResearchResultsService.numOfSearchResultsLinkedToPub("dataset", this.properties) : of(0), + (getSoftware) ? this.searchResearchResultsService.numOfSearchResults('software', '', this.properties, null) : of(0), + (getSoftwareLinked) ? this.searchResearchResultsService.numOfSearchResultsLinkedToPub("software", this.properties) : of(0), + (getOther) ? this.searchResearchResultsService.numOfSearchResults('other', '', this.properties, null) : of(0), + (getProjects) ? this.refineFieldResultsService.getRefineFieldsResultsByEntityName(['funder'], 'project', this.properties, null) : of(0), + (getDataProviders) ? this.searchDataprovidersService.numOfSearchDataproviders('', this.properties, null) : of(0) + ).subscribe((data: any[]) => { + if (data[0] && data[0] > 0) { + this.numbers.publicationsSize = NumberUtils.roundNumber(data[0]); + } + if (data[1] && data[1] > 0) { + this.numbers.datasetsSize = NumberUtils.roundNumber(data[1]); + } + if (data[2] && data[2] > 0) { + this.numbers.datasetsLinkedSize = NumberUtils.roundNumber(data[2]); + } + if (data[3] && data[3] > 0) { + this.numbers.softwareSize = NumberUtils.roundNumber(data[3]); + } + if (data[4] && data[4] > 0) { + this.numbers.softwareLinkedSize = NumberUtils.roundNumber(data[4]); + } + if (data[5] && data[5] > 0) { + this.numbers.otherSize = NumberUtils.roundNumber(data[5]); + } + if (data[6][0] && data[6][0] > 0) { + this.numbers.projectsSize = NumberUtils.roundNumber(data[6][0]); + } + if (data[6][1] && data[6][1].length > 0 && data[6][1][0].filterId == 'funder' && data[6][1][0].values) { + this.numbers.fundersSize = NumberUtils.roundNumber(data[6][1][0].values.length); + } + if (data[7] && data[7] > 0) { + this.numbers.datasourcesSize = NumberUtils.roundNumber(data[7]); + } + }, err => { + this.handleError('Error getting numbers', err); + })); + } + + disableSelectChange(event: boolean) { + this.disableSelect = event; + this.cdr.detectChanges(); + } } diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index a40dfa01..07d3c040 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit a40dfa0165e87c28083a14faad194dfe259a3674 +Subproject commit 07d3c0407d5d98b863f76e2a13be0d5a54747d31 diff --git a/explore/src/app/sdg/sdg.component.css b/explore/src/app/sdg/sdg.component.css index e3e45110..914733f0 100644 --- a/explore/src/app/sdg/sdg.component.css +++ b/explore/src/app/sdg/sdg.component.css @@ -16,54 +16,54 @@ height: 40px; width: auto; } -.sdg-1, .sdg-1.uk-card-hover:hover { - background-color: #E6233D; +.sdg-1 { + background-color: #E6233D !important; } .sdg-2 { - background-color: #DF9F00; + background-color: #DF9F00 !important; } .sdg-3 { - background-color: #19A220; + background-color: #19A220 !important; } .sdg-4 { - background-color: #D70023; + background-color: #D70023 !important; } .sdg-5 { - background-color: #FF0B00; + background-color: #FF0B00 !important; } .sdg-6 { - background-color: #00BFE8; + background-color: #00BFE8 !important; } .sdg-7 { - background-color: #FFC300; + background-color: #FFC300 !important; } .sdg-8 { - background-color: #B10240; + background-color: #B10240 !important; } .sdg-9 { - background-color: #FF5D00; + background-color: #FF5D00 !important; } .sdg-10 { - background-color: #F50D86; + background-color: #F50D86 !important; } .sdg-11 { - background-color: #FF8A00; + background-color: #FF8A00 !important; } .sdg-12 { - background-color: #CA8A03; + background-color: #CA8A03 !important; } .sdg-13 { - background-color: #2B772B; + background-color: #2B772B !important; } .sdg-14 { - background-color: #0098DF; + background-color: #0098DF !important; } .sdg-15 { - background-color: #00B91C; + background-color: #00B91C !important; } .sdg-16 { - background-color: #0069A2; + background-color: #0069A2 !important; } .sdg-17 { - background-color: #1C336A; + background-color: #1C336A !important; } \ No newline at end of file diff --git a/explore/src/assets/explore-assets/fos-icon.svg b/explore/src/assets/explore-assets/fos-icon.svg new file mode 100644 index 00000000..c9e0b624 --- /dev/null +++ b/explore/src/assets/explore-assets/fos-icon.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/explore/src/assets/explore-assets/home/graph.svg b/explore/src/assets/explore-assets/home/graph.svg index 167e5a75..a86312f3 100644 --- a/explore/src/assets/explore-assets/home/graph.svg +++ b/explore/src/assets/explore-assets/home/graph.svg @@ -55,10 +55,7 @@ - - - diff --git a/explore/src/assets/explore-assets/home/ipad.png b/explore/src/assets/explore-assets/home/ipad.png deleted file mode 100644 index 92a63edc..00000000 Binary files a/explore/src/assets/explore-assets/home/ipad.png and /dev/null differ diff --git a/explore/src/assets/explore-assets/home/landscape.png b/explore/src/assets/explore-assets/home/landscape.png new file mode 100644 index 00000000..2e0395b1 Binary files /dev/null and b/explore/src/assets/explore-assets/home/landscape.png differ diff --git a/explore/src/assets/explore-assets/home/mask.svg b/explore/src/assets/explore-assets/home/mask.svg index 88a4b2bc..11e6f1e8 100644 --- a/explore/src/assets/explore-assets/home/mask.svg +++ b/explore/src/assets/explore-assets/home/mask.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file