From cbc32aaa46a7b90b1c42dcfefaa16b1861089296 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 20 May 2020 20:34:29 +0000 Subject: [PATCH] [Library | Trunk]: Some changes on result landing page base on new mocks. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58735 d315682c-612b-4755-9ff5-7f18f6832af3 --- landingPages/feedback/feedback.component.html | 8 +- .../landing-utils/availableOn.component.ts | 9 +- .../citeThis/citeThis.component.ts | 41 ++-- .../landing-utils/fundedBy.component.ts | 53 ++--- .../landing-header.component.ts | 3 +- .../landing-utils/relatedTo.component.ts | 43 ++-- .../landing-utils/showSubjects.component.ts | 4 +- landingPages/project/project.component.ts | 2 +- .../result/resultLanding.component.html | 190 ++++++++++-------- .../result/resultLanding.component.ts | 8 + landingPages/result/resultLanding.module.ts | 3 +- .../result-preview.component.html | 58 +++--- utils/tabs/tabs.component.ts | 2 +- 13 files changed, 228 insertions(+), 196 deletions(-) diff --git a/landingPages/feedback/feedback.component.html b/landingPages/feedback/feedback.component.html index 0edb4186..349b0d9f 100644 --- a/landingPages/feedback/feedback.component.html +++ b/landingPages/feedback/feedback.component.html @@ -1,9 +1,3 @@ -
- -
@@ -87,4 +81,4 @@
- \ No newline at end of file + diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 5d2e7098..87e39618 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -5,7 +5,6 @@ import {EnvProperties} from "../../utils/properties/env-properties"; @Component({ selector: 'availableOn', template: ` -
Download from
-
- + -
+
View more diff --git a/landingPages/landing-utils/citeThis/citeThis.component.ts b/landingPages/landing-utils/citeThis/citeThis.component.ts index dcef8d84..0976d687 100644 --- a/landingPages/landing-utils/citeThis/citeThis.component.ts +++ b/landingPages/landing-utils/citeThis/citeThis.component.ts @@ -1,25 +1,35 @@ -import {Component, ElementRef, Input} from '@angular/core'; +import {Component, ElementRef, Input, OnDestroy, OnInit} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; import {Citation, CitationData} from './citation.class'; import {ResultLandingInfo} from "../../../utils/entities/resultLandingInfo"; declare var CSL:any; declare var Sys:any; +declare var UIkit: any; // @Component({ selector: 'citeThis', template: ` -
+
select a citation style {{style}} -
+
+
+ +
` }) -export class CiteThisComponent { +export class CiteThisComponent implements OnInit, OnDestroy{ private sub:any; public selectedStyle:string="0"; public citationText:string; @@ -30,24 +40,29 @@ export class CiteThisComponent { @Input() type: string="article"; public citeproc; public data; - - - constructor(private route: ActivatedRoute) { - // this.selectedStyle = this.citation.templates[0]; - } - + public clipboard; + ngOnInit() { if(typeof window !== 'undefined') { // this.citeproc = require('./citeproc.js'); // console.log(this.citeproc); this.parseData(); this.updateCitation(); + this.createClipboard(); } } - public opened() { - let divElement: HTMLDivElement = document.getElementsByClassName('cdk-overlay-container')[0]; - divElement.classList.add('modal-select'); + ngOnDestroy() { + delete this.clipboard; + } + + private createClipboard() { + if (typeof window !== 'undefined') { + delete this.clipboard; + let Clipboard; + Clipboard = require('clipboard'); + this.clipboard = new Clipboard('.clipboard_btn'); + } } parseData(){ diff --git a/landingPages/landing-utils/fundedBy.component.ts b/landingPages/landing-utils/fundedBy.component.ts index feaf131f..7f8a3aff 100644 --- a/landingPages/landing-utils/fundedBy.component.ts +++ b/landingPages/landing-utils/fundedBy.component.ts @@ -3,21 +3,24 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {Project} from "../../utils/result-preview/result-preview"; @Component({ - selector: 'fundedBy', - template: ` -
  • - Funded by: - + selector: 'fundedBy', + template: ` +
    Funded by
    + - {{item['funderShortname']?item['funderShortname']:item['funderName']}} + {{item['funderShortname'] ? item['funderShortname'] : item['funderName']}} [no funder available] - | {{ item['acronym']?item['acronym']:item['title']}} + | {{ item['acronym'] ? item['acronym'] : item['title']}} - {{item['funderShortname']?item['funderShortname']:item['funderName']}} + {{item['funderShortname'] ? item['funderShortname'] : item['funderName']}} [no funder available] - | {{ item['acronym']?item['acronym']:item['title']}} + | {{ item['acronym'] ? item['acronym'] : item['title']}}
    - {{item['acronym']?item['acronym']:item['title']}} + {{item['acronym'] ? item['acronym'] : item['title']}} - {{item['acronym']?item['acronym']:item['title']}} + {{item['acronym'] ? item['acronym'] : item['title']}}
    {{item.title}} @@ -38,7 +41,7 @@ import {Project} from "../../utils/result-preview/result-preview";
    • Funder: - {{item.funderName?item.funderName:item.funderShortname}} + {{item.funderName ? item.funderName : item.funderShortname}} ({{item.funderShortname}}) @@ -56,19 +59,19 @@ import {Project} from "../../utils/result-preview/result-preview";
    , - - -
  • - ` - }) + + + ` +}) export class FundedByComponent { @Input() fundedByProjects: Project[]; diff --git a/landingPages/landing-utils/landing-header/landing-header.component.ts b/landingPages/landing-utils/landing-header/landing-header.component.ts index 31e667be..cef5aa08 100644 --- a/landingPages/landing-utils/landing-header/landing-header.component.ts +++ b/landingPages/landing-utils/landing-header/landing-header.component.ts @@ -6,7 +6,7 @@ import {AlertModal} from "../../../utils/modal/alert"; @Component({ selector: 'landing-header', template: ` -
    +
    {{entityType}} @@ -74,6 +74,7 @@ export class LandingHeaderComponent { @Input() showAllAuthors: boolean = true; @Input() underCuration: boolean = false; @Input() modal: AlertModal; + @Input() titleClass: string = null; public removeUnknown(array: string[], type: boolean = false): string[] { if (type) { diff --git a/landingPages/landing-utils/relatedTo.component.ts b/landingPages/landing-utils/relatedTo.component.ts index 571986de..21f4e334 100644 --- a/landingPages/landing-utils/relatedTo.component.ts +++ b/landingPages/landing-utils/relatedTo.component.ts @@ -4,36 +4,33 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class"; @Component({ selector: 'relatedTo', template: ` -
    -
    -
    - Communities: -
    -
    +
    +
    Communities
    +
    - {{item['labelContext']}} - {{item['labelCategory']}} - : {{item['labelConcept']}} - - {{item['labelContext']}} {{item['labelCategory']}} : {{item['labelConcept']}} - -
    -
    - -
    - - View more - + + + {{item['labelContext']}} + {{item['labelCategory']}} + : {{item['labelConcept']}} +
    + + ` }) diff --git a/landingPages/landing-utils/showSubjects.component.ts b/landingPages/landing-utils/showSubjects.component.ts index 31c2448a..a975cd3c 100644 --- a/landingPages/landing-utils/showSubjects.component.ts +++ b/landingPages/landing-utils/showSubjects.component.ts @@ -17,9 +17,9 @@ import {Component, Input} from '@angular/core';
    -
    - Subjects: +
    Subjects
    {{subjects.join(', ')}} , diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 471e80c3..365be75a 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -665,7 +665,7 @@ export class ProjectComponent { // } public onSelectActiveTab(activeTabId) { - if(this.activeTab != "activaTabId") { // tab really changed + if(this.activeTab != activeTabId) { // tab really changed if (activeTabId == 'summary') { this.activeTab = 'summary'; } else if (activeTabId == 'publications') { diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index a0343530..8eddcce9 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -11,7 +11,7 @@ class="loading-gif uk-align-center">
    -
    +
    @@ -24,11 +24,6 @@ [entityType]="getTypeName()" [types]="resultLandingInfo.types" [year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate"> -
    - -
  • - -
  • - -
  • - -
  • - -
    -
    - Abstract: - {{resultLandingInfo.description.substring(0, showNumDescription)}} - ... -
    - - -
    - -
    - -
    - -
    - - -
    @@ -174,34 +127,6 @@
    -
    - - Powered by OpenAIRE Open Research Graph -
    -
    - -
    -
    -
    - Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} +
    +
    +
    + + +
    +
    + +
    +
    +
    Abstract
    + {{resultLandingInfo.description.substring(0, showNumDescription)}} + ... +
    + + +
    + +
    + + +
    + +
    + + +
    +
    +
    +
    + +
    + +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    + + Powered by OpenAIRE Open Research Graph + + Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} + +
    + +
    + Any information missing or wrong? + Report an Issue +
    +
    + +
    +
    @@ -261,12 +274,13 @@
    + [showForm]="showFeedback" (show)="showFeedback = $event;"> @@ -421,7 +435,7 @@
    - + - + diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 27df1b5f..b36b67ad 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -567,4 +567,12 @@ export class ResultLandingComponent { this.citeModal.alertTitle = "Cite this " + this.getTypeName() + " to"; this.citeModal.open(); } + + public onSelectActiveTab(activeTabId) { + if(this.activeTab != activeTabId) { // tab really changed + if (activeTabId == 'summary') { + this.activeTab = 'summary'; + } + } + } } diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index a218c9d7..1f64b8eb 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -29,13 +29,14 @@ import {LandingHeaderModule} from "../landing-utils/landing-header/landing-heade import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module"; import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module"; import {FeedbackModule} from "../feedback/feedback.module"; +import {TabsModule} from "../../utils/tabs/tabs.module"; @NgModule({ imports: [ CommonModule, FormsModule, LandingModule, SharedModule, RouterModule, CiteThisModule, PagingModule, IFrameModule, MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule, - DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, AnnotationModule, LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule + DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, AnnotationModule, LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule, TabsModule ], declarations: [ ResultLandingComponent diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 83418d89..41a471fd 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -57,34 +57,6 @@

    - -
    -
    - - Download from: - - {{from.downloadName}} - - - - {{from.downloadName}} - - - - Provider: - - {{from.collectedName}} - - - - {{from.collectedName}} - - -
    -
    @@ -163,7 +135,7 @@ {{' '}}
    -
    +
    @@ -255,6 +227,34 @@ {{result.description}}

    + +
    +
    + + Download from: + + {{from.downloadName}} + + + + {{from.downloadName}} + + + + Provider: + + {{from.collectedName}} + + + + {{from.collectedName}} + + +
    +
    diff --git a/utils/tabs/tabs.component.ts b/utils/tabs/tabs.component.ts index d0e2a162..301b6cc1 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: ` -