From 6a94908622244135168f831da40abd5b45f489c2 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 19 May 2020 15:59:20 +0000 Subject: [PATCH] [Trunk | Library]: 1. searchResult.component: Removed field 'dividerNotCard' added to show results in card or not (added in r58717) - result-preview is used instead. 2. tabs.component.ts: Removed class 'uk-width-3-4' from 'main-tabs'. 3. project.component: [Landing redesign]: a. Add field 'public searchNuumber: number = 5;' to set how many results to search and display. b. Use '
- Top 10{{getEntityName(type, true, true)}} + Top {{searchNuumber}}{{getEntityName(type, true, true)}}
- - + + @@ -132,8 +138,8 @@ class="loading-gif uk-align-center"> -
-
+
+
@@ -167,7 +173,7 @@ Special Clause 39 {{" "}}
-
    +
    • Funder: @@ -230,18 +236,20 @@
      -
    • +
    • Open Access mandate
      - + Publications: - Yes - No + + No - + Research Data: - Yes - No + + No
    • @@ -438,8 +446,8 @@
-
-
    +
    + -
    - Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} -
    + + + @@ -957,6 +965,9 @@
    Powered by OpenAIRE Open Research Graph + + Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} +
    diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 4b630bf6..580e5986 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -22,6 +22,10 @@ import {HelperService} from "../../utils/helper/helper.service"; import {Location} from "@angular/common"; import {HtmlProjectReportService} from "../htmlProjectReport/htmlProjectReport.service"; import {StringUtils} from "../../utils/string-utils.class"; +import {ResultLandingInfo} from "../../utils/entities/resultLandingInfo"; +import {ResultPreview} from "../../utils/result-preview/result-preview"; +import {SearchResult} from "../../utils/entities/searchResult"; +import {IndexInfoService} from "../../utils/indexInfo.service"; @Component({ selector: 'project', @@ -89,13 +93,10 @@ export class ProjectComponent { // Variables for publications, research data, software tabs public fetchPublications: FetchResearchResults; - public linkToSearchPublications = ""; public fetchDatasets: FetchResearchResults; - public linkToSearchDatasets = ""; public fetchSoftware: FetchResearchResults; - public linkToSearchSoftware = ""; public fetchOrps: FetchResearchResults; - public linkToSearchOrps = ""; + public searchNuumber: number = 5; public routerHelper: RouterHelper = new RouterHelper(); public errorCodes: ErrorCodes = new ErrorCodes(); @@ -140,15 +141,20 @@ export class ProjectComponent { private _projectService: ProjectService, private _searchResearchResultsService: SearchResearchResultsService, private _reportsService: ReportsService, - private htmlService: HtmlProjectReportService) {} + private htmlService: HtmlProjectReportService, + private indexInfoService: IndexInfoService) {} ngOnInit() { this.route.data .subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; - if(this.properties.lastIndexUpdate) { - this.indexUpdateDate = new Date(this.properties.lastIndexUpdate); - } + this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { + if(lastIndexUpdate) { + this.indexUpdateDate = new Date(lastIndexUpdate); + } else if(this.properties.lastIndexUpdate) { + this.indexUpdateDate = new Date(this.properties.lastIndexUpdate); + } + }); //this.getDivContents(); this.getPageContents(); this.updateUrl(data.envSpecific.baseLink + this._router.url); @@ -277,28 +283,23 @@ export class ProjectComponent { } private searchPublications() { - this.fetchPublications.getResultsForEntity("publication", "project", this.projectId, 1, 10, this.properties); - this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;// + "?project=" + this.projectId+"&pr=and"; + this.fetchPublications.getResultsForEntity("publication", "project", this.projectId, 1, this.searchNuumber, this.properties); this.reloadPublications = false; } private searchDatasets() { - this.fetchDatasets.getResultsForEntity("dataset", "project", this.projectId, 1, 10, this.properties); - this.linkToSearchDatasets = this.properties.searchLinkToAdvancedDatasets;// + "?project=" + this.projectId+"&pr=and"; - + this.fetchDatasets.getResultsForEntity("dataset", "project", this.projectId, 1, this.searchNuumber, this.properties); this.reloadDatasets = false; //this.activeTab = "Research Data"; } private searchSoftware() { - this.fetchSoftware.getResultsForEntity("software", "project", this.projectId, 1, 10, this.properties); - this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware; + this.fetchSoftware.getResultsForEntity("software", "project", this.projectId, 1, this.searchNuumber, this.properties); this.reloadSoftware = false; } private searchOrps() { - this.fetchOrps.getResultsForEntity("other", "project", this.projectId, 1, 10, this.properties); - this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps; + this.fetchOrps.getResultsForEntity("other", "project", this.projectId, 1, this.searchNuumber, this.properties); this.reloadOrps = false; } @@ -761,4 +762,8 @@ export class ProjectComponent { return entityType + (plural ? "s" : ""); } } + + public getResultPreview(result: SearchResult, type: string): ResultPreview { + return ResultPreview.searchResultConvert(result, type); + } } diff --git a/landingPages/project/project.module.ts b/landingPages/project/project.module.ts index a26ee17b..c37fe33a 100644 --- a/landingPages/project/project.module.ts +++ b/landingPages/project/project.module.ts @@ -29,6 +29,7 @@ import {FeedbackModule} from "../feedback/feedback.module"; import {AltMetricsModule} from "../../utils/altmetrics.module"; import {TabsModule} from "../../utils/tabs/tabs.module"; import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.module"; +import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module"; @NgModule({ imports: [ @@ -38,7 +39,7 @@ import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.m SearchResearchResultsServiceModule, ProjectServiceModule, Schema2jsonldModule, SEOServiceModule, HelperModule, LandingHeaderModule, MatSelectModule, FeedbackModule, AltMetricsModule, - TabsModule, SearchResultsModule + TabsModule, ResultPreviewModule ], declarations: [ ProjectComponent diff --git a/searchPages/searchUtils/searchResult.component.html b/searchPages/searchUtils/searchResult.component.html index 9c6efe93..407f6386 100644 --- a/searchPages/searchUtils/searchResult.component.html +++ b/searchPages/searchUtils/searchResult.component.html @@ -1,7 +1,7 @@ -
      +
      • -
        +
        diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index d2fa5c69..e02942df 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -19,8 +19,7 @@ export class SearchResultComponent implements OnInit, OnChanges { @Input() custom_class: string = "search-results"; @Input() properties: EnvProperties; @Input() showImpactFactors: boolean = false; - @Input() dividerNotCard: boolean = false; - + constructor( private http: HttpClient/*ATHENA CODE*/) { } diff --git a/utils/tabs/tabs.component.ts b/utils/tabs/tabs.component.ts index 135099de..08b83923 100644 --- a/utils/tabs/tabs.component.ts +++ b/utils/tabs/tabs.component.ts @@ -15,7 +15,7 @@ import { TabComponent } from './tab.component'; @Component({ selector: 'my-tabs', template: ` -