diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 64beb872..fe88d78b 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -11,8 +11,7 @@ import {properties} from "../../../../environments/environment"; {{title}} - Download from - + Download from View less
- - + +
- - {{instance.downloadNames.join("; ")}} - - + + + {{instance.downloadNames.join("; ")}} + +
{{instance.types.join(" . ")}} . @@ -75,7 +75,7 @@ export class AvailableOnComponent { @Input() viewAll: boolean = false; @Output() viewAllClicked = new EventEmitter(); public lessBtn: boolean = false; - public threshold: number = 2; + public threshold: number = 1; public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0]; public title: string = "Download from"; diff --git a/landingPages/landing-utils/citeThis/citation.class.ts b/landingPages/landing-utils/citeThis/citation.class.ts index 0100e89c..986b9244 100644 --- a/landingPages/landing-utils/citeThis/citation.class.ts +++ b/landingPages/landing-utils/citeThis/citation.class.ts @@ -1,7 +1,10 @@ +import {Option} from "../../../sharedComponents/input/input.component"; + export class Citation{ public templates:string[]=["bibtex","chicago","ieee","science","apa","cell","harvard","mla","nature","acm","frontiers", "ama"]; public fileFormats:string[]=["bibtex", "ris"]; public fileSuffix:string[]=[".bib", ".ris"]; + public fileFormatOptions: Option[]=[{label: "bibtex (.bib)", value: "bibtex"}, {label: "ris (.ris)", value: "ris"}]; //https://github.com/citation-style-language/styles bibtex:string =``; ieee:string =` `; diff --git a/landingPages/landing-utils/citeThis/citeThis.component.ts b/landingPages/landing-utils/citeThis/citeThis.component.ts index 1c7c086f..3b2c362d 100644 --- a/landingPages/landing-utils/citeThis/citeThis.component.ts +++ b/landingPages/landing-utils/citeThis/citeThis.component.ts @@ -20,38 +20,23 @@ declare var Cite: any; @Component({ selector: 'citeThis', template: ` -
- - Select a citation style - - {{style}} - - -
-
-
- +
+
+ -
- - Or select file format to download - - {{format + " (" +citation.fileSuffix[i] + ")"}} - - + +
+
- - + + {{item['funderShortname'] ? item['funderShortname'] : item['funderName']}} [no funder available] | {{ item['acronym'] ? item['acronym'] : item['title']}} - - + +
diff --git a/landingPages/landing-utils/landing-header/landing-header.component.ts b/landingPages/landing-utils/landing-header/landing-header.component.ts index cab6d945..d4619117 100644 --- a/landingPages/landing-utils/landing-header/landing-header.component.ts +++ b/landingPages/landing-utils/landing-header/landing-header.component.ts @@ -46,7 +46,7 @@ import {AlertModal} from "../../../utils/modal/alert"; . Under curation + class="uk-text-primary">Under curation
@@ -70,7 +70,7 @@ export class LandingHeaderComponent { @Input() title: string; @Input() subTitle: string; @Input() authors: Author[]; - @Input() authorLimit: number = 3; + @Input() authorLimit: number = 7; @Input() showAllAuthors: boolean = true; @Input() underCuration: boolean = false; @Input() modal: AlertModal; diff --git a/landingPages/landing-utils/metrics/metrics.component.ts b/landingPages/landing-utils/metrics/metrics.component.ts index 5c9139f9..23393266 100644 --- a/landingPages/landing-utils/metrics/metrics.component.ts +++ b/landingPages/landing-utils/metrics/metrics.component.ts @@ -6,14 +6,14 @@ import {ErrorCodes} from '../../../utils/properties/errorCodes'; import {Subscription, zip} from 'rxjs'; import {EnvProperties} from '../../../utils/properties/env-properties'; import {animate, state, style, transition, trigger} from "@angular/animations"; +import {ClickEvent} from "../../../utils/click/click-outside-or-esc.directive"; @Component({ selector: 'metrics', styleUrls: ['metrics.component.css'], template: `
+ click-outside-or-esc (clickOutside)="close($event)">
usage counts
{{total | number}}
@@ -309,8 +309,8 @@ export class MetricsComponent { ); } - public close(event) { - if(event.value && this.state !== -1) { + public close(event: ClickEvent) { + if(event.clicked && this.state !== -1) { this.timeouts.forEach(timeout => { clearTimeout(timeout); }); diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index a0764fc2..929911a8 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -13,9 +13,13 @@ export class ParsingFunctions { private notebook_label: string = "EOSC"; private notebook_value: string = "EOSC Jupyter Notebook"; - public open = 'assets/common-assets/unlock.svg'; - public closed = 'assets/common-assets/lock.svg'; - public unknown = 'assets/common-assets/question.svg'; + // public open = 'assets/common-assets/unlock.svg'; + // public closed = 'assets/common-assets/lock.svg'; + // public unknown = 'assets/common-assets/question.svg'; + + public open = 'lock_open'; + public closed = 'lock'; + public unknown = 'question_mark'; private instanceWithDoiExists: boolean = false; diff --git a/landingPages/landing-utils/relatedTo.component.ts b/landingPages/landing-utils/relatedTo.component.ts index 2b9d736d..659807c7 100644 --- a/landingPages/landing-utils/relatedTo.component.ts +++ b/landingPages/landing-utils/relatedTo.component.ts @@ -18,16 +18,15 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; {{title}} - {{title}} + {{title}} View less View more
- + {{community.labelContext}} - diff --git a/landingPages/landing-utils/resultLandingUtils.module.ts b/landingPages/landing-utils/resultLandingUtils.module.ts index 5acb0561..988991e6 100644 --- a/landingPages/landing-utils/resultLandingUtils.module.ts +++ b/landingPages/landing-utils/resultLandingUtils.module.ts @@ -15,11 +15,12 @@ import {RelatedToComponent} from "./relatedTo.component"; import {FosComponent} from "./fos.component"; import {SdgComponent} from "./sdg.component"; import {IconsModule} from "../../utils/icons/icons.module"; +import {AlertModalModule} from "../../utils/modal/alertModal.module"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, PagingModule, ShowPublisherModule, IconsModule + CommonModule, FormsModule, RouterModule, PagingModule, ShowPublisherModule, IconsModule, AlertModalModule ], declarations: [ ShowIdentifiersComponent,ShowSubjectsComponent, diff --git a/landingPages/landing-utils/sdg.component.ts b/landingPages/landing-utils/sdg.component.ts index 123620d8..f575382e 100644 --- a/landingPages/landing-utils/sdg.component.ts +++ b/landingPages/landing-utils/sdg.component.ts @@ -10,7 +10,7 @@ import {properties} from "../../../../environments/environment"; {{title}} - {{title}} + {{title}} View less View more diff --git a/landingPages/landing-utils/showIdentifiers.component.ts b/landingPages/landing-utils/showIdentifiers.component.ts index dd2b4c28..71b71fb1 100644 --- a/landingPages/landing-utils/showIdentifiers.component.ts +++ b/landingPages/landing-utils/showIdentifiers.component.ts @@ -5,7 +5,7 @@ import { ElementRef, HostListener, Input, - QueryList, + QueryList, ViewChild, ViewChildren } from '@angular/core'; import {EnvProperties} from "../../utils/properties/env-properties"; @@ -15,47 +15,54 @@ import {properties} from "../../../../environments/environment"; selector: 'showIdentifiers', template: ` -
+ - - + +
+

+ + {{key}}: + + + + {{item}} + + , + + + +

+
+
+
+ +
+
+ + +
+ +
+
` }) export class ShowIdentifiersComponent implements AfterViewInit { @Input() identifiers: Map; @Input() showViewAll: boolean = false; large: Map = new Map(); - showAll: boolean = false; properties: EnvProperties = properties; @ViewChildren("content", { read: ElementRef }) types: QueryList; - + @ViewChild('identifiersModal') identifiersModal; + constructor(private cdr: ChangeDetectorRef) { } @@ -99,4 +106,23 @@ export class ShowIdentifiersComponent implements AfterViewInit { } }); } + + public getUrl(key: string): string { + if(key == "doi") { + return properties.doiURL; + } else if(key == "pmc") { + return properties.pmcURL; + } else if(key == "pmid") { + return properties.pmidURL; + } else if(key == "handle") { + return properties.handleURL; + } + } + + public openIdentifiersModal() { + this.identifiersModal.cancelButton = false; + this.identifiersModal.okButton = false; + this.identifiersModal.alertTitle = "Persistent Identifiers"; + this.identifiersModal.open(); + } } diff --git a/landingPages/landing-utils/showPublisher.component.ts b/landingPages/landing-utils/showPublisher.component.ts index a7df3c30..55d96ffe 100644 --- a/landingPages/landing-utils/showPublisher.component.ts +++ b/landingPages/landing-utils/showPublisher.component.ts @@ -58,11 +58,11 @@ import {EnvProperties} from "../../utils/properties/env-properties"; , - - Copyright policy + Copyright policy ) diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 66ca0d21..f59e7e24 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -31,18 +31,11 @@
  • + [attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip landing-action-tooltip-portal uk-text-small uk-padding-small'"> - - +
  • @@ -50,7 +43,7 @@
  • + [attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip landing-action-tooltip-portal uk-text-small uk-padding-small'"> -
  • - - - b2note - - - - - b2note - - -
  • + + + + + + + + + + + + + + + +
    @@ -92,6 +85,7 @@
    +
    @@ -292,10 +286,9 @@
    {{keyIn}}
    - {{keyIn}} -
    @@ -316,9 +309,9 @@ alt="Enermaps tool preview" loading="lazy">
    @@ -361,9 +354,9 @@
    + class="uk-width-1-3 uk-width-1-4@l uk-padding-remove landing-background-grey-color uk-text-small" [class.uk-animation-right]="viewAll">
    -
    +
    @@ -434,12 +427,12 @@
    -
    - -
    - -
    -
    + + + + + +
    @@ -462,7 +455,7 @@ -
    +
    - diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index db26e4de..994d8852 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -206,7 +206,7 @@ export class ResultLandingComponent { this.scroll(); })); - this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-height')); + this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-height')); } private initMetaAndLinks(type: string) { diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index 61d0a6aa..336079c6 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -32,6 +32,8 @@ import {OrcidModule} from "../../orcid/orcid.module"; import {MatFormFieldModule} from "@angular/material/form-field"; import {MatSelectModule} from "@angular/material/select"; import {IconsModule} from "../../utils/icons/icons.module"; +import {IconsService} from "../../utils/icons/icons.service"; +import {link, orcid_add, orcid_bin} from "../../utils/icons/icons"; @NgModule({ imports: [ @@ -52,4 +54,8 @@ import {IconsModule} from "../../utils/icons/icons.module"; ResultLandingComponent ] }) -export class ResultLandingModule { } +export class ResultLandingModule { + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([link]) + } +} diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index 425b53fb..28262b41 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -15,7 +15,7 @@ declare var UIkit: any; @Component({ styles: [ - '.loading-action-button { width: 36px; height: 36px; }' + '.loading-action-button { width: 35px; height: 35px; }' ], selector: 'orcid-work', template: ` @@ -56,31 +56,34 @@ declare var UIkit: any; - - - add orcid - - + [attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip uk-text-small uk-padding-small'" + [title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd"> + + + + - - - - + [attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip uk-text-small uk-padding-small'" + [title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete"> + + + + - - + ORCID record"; } get tooltipNoLoggedInUser() { - return "Only logged in users can add or delete a work from their ORCID record"; + return "Only logged in users can add or delete a work from their ORCID record"; + } + + hoverEvent($event, action: string = "add") { + if(action == "add") { + this.hoverAdd = $event.type == "mouseover"; + this.hoverDelete = false; + } else if(action == "delete") { + this.hoverDelete = $event.type == "mouseover"; + this.hoverAdd = false; + } } } diff --git a/orcid/orcid.module.ts b/orcid/orcid.module.ts index 06f1ad47..9ff2bdfd 100644 --- a/orcid/orcid.module.ts +++ b/orcid/orcid.module.ts @@ -13,6 +13,8 @@ import {ResultLandingService} from '../landingPages/result/resultLanding.service import {LoadingModule} from '../utils/loading/loading.module'; import {ResultLandingUtilsModule} from '../landingPages/landing-utils/resultLandingUtils.module'; import {IconsModule} from '../utils/icons/icons.module'; +import {IconsService} from "../utils/icons/icons.service"; +import {orcid_add, orcid_bin} from "../utils/icons/icons"; @NgModule({ imports: [ @@ -35,5 +37,7 @@ import {IconsModule} from '../utils/icons/icons.module'; export class OrcidModule{ - constructor() {} + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([orcid_add, orcid_bin]) + } } diff --git a/services/servicesUtils/customOptions.class.ts b/services/servicesUtils/customOptions.class.ts index 39194da6..3f864990 100644 --- a/services/servicesUtils/customOptions.class.ts +++ b/services/servicesUtils/customOptions.class.ts @@ -1,16 +1,16 @@ import {COOKIE} from '../../login/utils/helper.class'; import {HttpHeaders} from "@angular/common/http"; +export type MediaType = 'application/json' | 'text/plain' export class CustomOptions { - - public static registryOptions(body = true): {} { - let httpHeaders = new HttpHeaders(); - if(body) { - httpHeaders.set('Content-Type', 'application/json'); - } - return {headers: httpHeaders, withCredentials: true}; - } + + public static registryOptions(mediaType: MediaType = 'application/json'): {} { + let httpHeaders = new HttpHeaders({ + 'Content-Type': mediaType, + }); + return {headers: httpHeaders, withCredentials: true}; + } public static getAuthOptionsWithBody():{} { return { @@ -29,4 +29,4 @@ export class CustomOptions { }; } -} +} \ No newline at end of file diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index 9af47660..5b70860e 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -11,7 +11,7 @@ import {properties} from "../../../../environments/environment"; @Component({ selector: 'showAuthors', template: ` - + {{author.fullName + ";"}}  @@ -26,7 +26,7 @@ import {properties} from "../../../../environments/environment";
    + uk-dropdown="mode:click; offset: 4" style="min-width: 465px !important;">
    {{author.fullName}}
    @@ -39,13 +39,14 @@ import {properties} from "../../../../environments/environment"; Harvested from ORCID Public Data File Derived by OpenAIRE algorithms or harvested from 3d party repositories
    -
    -
    - - + @@ -76,24 +77,24 @@ import {properties} from "../../../../environments/environment"; -
    - View less authors + -
    +
    - +
    @@ -103,32 +104,25 @@ import {properties} from "../../../../environments/environment"; export class ShowAuthorsComponent { @Input() authors: Author[]; - @Input() authorsLimit: number = 3; + @Input() authorsLimit: number = 7; @Input() showAll: boolean = true; @Input() modal: AlertModal; @Input() viewAll: boolean = false; public lessBtn: boolean = false; @ViewChild('authorsModal') authorsModal; - public numberOfAuthors: number; public properties: EnvProperties = properties; public routerHelper: RouterHelper = new RouterHelper(); testBrowser: boolean; - + public clipboard; + constructor(private route: ActivatedRoute, @Inject(PLATFORM_ID) private platformId: string) { this.testBrowser = isPlatformBrowser(platformId); } ngOnInit() { - this.numberOfAuthors = this.authorsLimit; - } - - copyToClipboard(element: HTMLInputElement) { - element.select(); - if (typeof document !== 'undefined') { - document.execCommand('copy'); - } + this.createClipboard(); } public onClick() { @@ -152,4 +146,13 @@ export class ShowAuthorsComponent { this.authorsModal.alertTitle = "Authors"; this.authorsModal.open(); } + + private createClipboard() { + if (typeof window !== 'undefined') { + delete this.clipboard; + let Clipboard; + Clipboard = require('clipboard'); + this.clipboard = new Clipboard('.orcid_clipboard_btn'); + } + } } diff --git a/utils/icons/icons.ts b/utils/icons/icons.ts index 3ed494e8..fe3f2fe4 100644 --- a/utils/icons/icons.ts +++ b/utils/icons/icons.ts @@ -198,4 +198,26 @@ export const filters = { data: '' } +export const orcid_add = { + name: 'orcid_add', + data: '' +} + +export const orcid_bin = { + name: 'orcid_bin', + data: '' +} + +export const link = { + name: 'link', + data: '\n' + + ' ' +} + /** Add new icon under this line to be sure that it will be added on preview */ diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts index 796f6b09..c4a2705b 100644 --- a/utils/modal/alert.ts +++ b/utils/modal/alert.ts @@ -13,7 +13,7 @@ declare var UIkit: any; -
    {{alertTitle}}
    +
    {{alertTitle}}
    diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 60a2b247..fd68745a 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -36,10 +36,10 @@

    - +
    @@ -259,10 +259,10 @@ class="uk-margin-small-bottom">
    - - - + class="uk-flex uk-flex-middle"> + + + Download from: diff --git a/utils/result-preview/result-preview.module.ts b/utils/result-preview/result-preview.module.ts index 62101edc..98f72da5 100644 --- a/utils/result-preview/result-preview.module.ts +++ b/utils/result-preview/result-preview.module.ts @@ -5,9 +5,10 @@ import {RouterModule} from "@angular/router"; import {ShowAuthorsModule} from "../authors/showAuthors.module"; import {ResultLandingUtilsModule} from "../../landingPages/landing-utils/resultLandingUtils.module"; import {OrcidModule} from "../../orcid/orcid.module"; +import {IconsModule} from "../icons/icons.module"; @NgModule({ - imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule, OrcidModule], + imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule, OrcidModule, IconsModule], declarations: [ResultPreviewComponent], exports: [ResultPreviewComponent] })