diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 817d7f8a..c38c37ac 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -11,21 +11,18 @@ declare var UIkit;
- Source: - - + {{sliceString(availableOn[0].downloadNames.join("; "), 20)}} + + + - - - - -
+
` @@ -74,7 +72,6 @@ declare var UIkit; export class AvailableOnComponent { @Input() availableOn: HostedByCollectedFrom[]; - @Input() source: boolean = true; /** @deprecated */ @Output() viewAllClicked = new EventEmitter(); @ViewChild("dropElement") dropElement: ElementRef; diff --git a/landingPages/landing-utils/citeThis/citeThis.component.ts b/landingPages/landing-utils/citeThis/citeThis.component.ts index 8924f035..457f64fc 100644 --- a/landingPages/landing-utils/citeThis/citeThis.component.ts +++ b/landingPages/landing-utils/citeThis/citeThis.component.ts @@ -257,7 +257,7 @@ export class CiteThisComponent implements OnInit, OnDestroy { /** * Based on this and citeproc library https://citation.js.org/api/tutorial-plugins.html - * if the template doesn;t exist add the CSL xml and the library will produce the citation + * if the template doesn't exist add the CSL xml and the library will produce the citation * @param template */ diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts index 09bb4283..c098253d 100644 --- a/landingPages/landing-utils/entity-metadata.component.ts +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -2,13 +2,15 @@ import {Component, Input} from "@angular/core"; import {EnvProperties} from "../../utils/properties/env-properties"; import {properties} from "../../../../environments/environment"; import {OpenaireEntities} from "../../utils/properties/searchFields"; +import {Project} from "../../utils/result-preview/result-preview"; @Component({ selector: 'entity-metadata', template: `
- + @@ -28,28 +30,28 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; - - - - - - - - + + + + + + + + {{entityType}} - - + + - {{removeUnknown(types, true).join(' , ')}} - + {{removeUnknown(types, true).join(' , ')}} + @@ -65,7 +67,7 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; - + {{startYear}} - {{endYear}} @@ -92,7 +94,7 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; {{currentDate >= endDate ? '(Ended)' : '(Ending)'}} - + {{status}} @@ -105,10 +107,10 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}} - . Under curation - + + Under curation + @@ -130,29 +132,62 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; {{programmingLanguage}} + + + + + + + {{project.funderShortname ? project.funderShortname : project.funderName}} + + + | {{ project.acronym ? project.acronym : (project.title.length > 25 ? + project.title.substring(0, 25) + '...' : project.title)}} + + ({{project.code}}) + , + + ... + + + + + + + + {{subject}} + {{(i < (subjects.slice(0, 10).length - 1)) ? ", " : ""}} + {{(i == subjects.slice(0, 10).length - 1 && subjects.length > 10) ? "..." : ""}} + + + - - - {{compatibility.info}} - {{compatibility.name}} - - - {{compatibility.info}} - - {{compatibility.info}} in OpenAIRE - - - - {{compatibility.name}} - - + + + {{compatibility.info}} + {{compatibility.name}} + + + {{compatibility.info}} + + {{compatibility.info}} in OpenAIRE + + + + {{compatibility.name}} + + + + + + {{compatibilityString}} @@ -172,7 +207,7 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; {{relationName}}
- ` + ` }) export class EntityMetadataComponent { @Input() entityType: string; @@ -194,12 +229,15 @@ export class EntityMetadataComponent { @Input() countries; @Input() languages; @Input() programmingLanguages; + @Input() compatibilityString: string; @Input() compatibility; // data provider landing @Input() aggregationStatus; // data provider landing @Input() thematic: boolean; // data provider landing @Input() type; // data provider landing @Input() provenanceAction: string; // search result @Input() relationName: string; // search result + @Input() projects: Project[]; + @Input() subjects: string[]; properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 64341985..633b5656 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -948,7 +948,7 @@ export class ResultLandingComponent { // this.sdgSelectionModal.open(); // } - private openFosSelectionModal() { + /*private openFosSelectionModal() { this.fosSelectionModal.cancelButton = false; this.fosSelectionModal.alertTitle = "Please select FOS that are the most relevant for this publication."; this.fosSelectionModal.open(); @@ -956,5 +956,5 @@ export class ResultLandingComponent { public sdgModalOutput() { this.sdgFosSuggest.sdgModalOutput(); - } + }*/ } diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index 570cd7db..80cc62f7 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -82,7 +82,7 @@ [id]="'autocomplete-'+i"> - +
- +
+ + +
- - - -
+ + + +
diff --git a/searchPages/searchUtils/searchResult.component.html b/searchPages/searchUtils/searchResult.component.html index b71d21f3..81674b08 100644 --- a/searchPages/searchUtils/searchResult.component.html +++ b/searchPages/searchUtils/searchResult.component.html @@ -1,6 +1,6 @@ -
-
+
+ +
+
@@ -34,6 +37,7 @@ import {EntitiesSelectionComponent} from "../../searchPages/searchUtils/entities export class AdvancedSearchInputComponent implements AfterContentInit, OnDestroy { @ContentChildren(InputComponent) inputs: QueryList; @ContentChildren(EntitiesSelectionComponent) entities: QueryList; + @Input() iconPosition: 'left' | 'right' = 'right'; @Input() disabled: boolean = false; @Input() searchInputClass: string = 'inner'; @Input() dark: boolean; diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index b31ea38e..daf87fb3 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -75,17 +75,17 @@ import {properties} from "../../../../environments/environment"; - - +{{authors.length-authorsLimit | number}} more - + + +{{authors.length-authorsLimit | number}} more + +{{authors.length-authorsLimit | number}} Authors -
- diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts new file mode 100644 index 00000000..7894e41e --- /dev/null +++ b/utils/entity-actions/entity-actions.component.ts @@ -0,0 +1,80 @@ +import {Component, Input, ViewChild} from "@angular/core"; +import {StringUtils} from "../string-utils.class"; +import {RouterHelper} from "../routerHelper.class"; +import {properties} from "../../../../environments/environment"; + +@Component({ + selector: 'entity-actions', + template: ` + + + + + + + + ` +}) +export class EntityActionsComponent { + @Input() result: any; + @Input() type: string; + @Input() id: string; + @Input() linking: boolean = false; + @Input() share: boolean = false; + @Input() cite: boolean = false; + @Input() url: string; + public piwikSiteId = properties.piwikSiteId; + public citeThisClicked: boolean; + public routerHelper: RouterHelper = new RouterHelper(); + @ViewChild('citeModal') citeModal; + @ViewChild('addThisModal') addThisModal; + + constructor() { + } + + get linkTo():string { + return this.type === 'project'?'result':'project'; + } + + public getTypeName(): string { + return StringUtils.getEntityName(this.type, false); + } + + public openCiteModal() { + this.citeThisClicked = true; + this.citeModal.cancelButton = false; + this.citeModal.okButton = false; + this.citeModal.alertTitle = "Cite this " + this.getTypeName(); + this.citeModal.open(); + } + + public openAddThisModal() { + console.log(this.url); + this.addThisModal.cancelButton = false; + this.addThisModal.okButton = false; + this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks"; + this.addThisModal.open(); + } +} diff --git a/utils/entity-actions/entity-actions.module.ts b/utils/entity-actions/entity-actions.module.ts new file mode 100644 index 00000000..5a49c744 --- /dev/null +++ b/utils/entity-actions/entity-actions.module.ts @@ -0,0 +1,17 @@ +import {NgModule} from "@angular/core"; +import {CommonModule} from "@angular/common"; +import {EntityActionsComponent} from "./entity-actions.component"; +import {RouterLinkWithHref} from "@angular/router"; +import {IconsModule} from "../icons/icons.module"; +import {AlertModalModule} from "../modal/alertModal.module"; +import {CiteThisModule} from "../../landingPages/landing-utils/citeThis/citeThis.module"; +import {LandingModule} from "../../landingPages/landing-utils/landing.module"; + +@NgModule({ + imports: [CommonModule, RouterLinkWithHref, IconsModule, AlertModalModule, CiteThisModule, LandingModule], + declarations: [EntityActionsComponent], + exports: [EntityActionsComponent] +}) +export class EntityActionsModule { + +} diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 9c3388df..125b772e 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -1,329 +1,262 @@ -
-
-
-
- Enermaps tool preview - -
-
- - + +
+ +
Funder: - {{result.funderShortname}} + {{result.funderShortname}} - + {{openaireEntities.PROJECT}} Code: - {{result.code}} + {{result.code}} - - - - - -
- -
+ + + + + +
+ +
Overall Budget: - {{result.budget | number}} - {{result.currency}} + {{result.budget | number}} + {{result.currency}} - + Funder Contribution: - {{result.contribution | number}} - {{result.currency}} + {{result.contribution | number}} + {{result.currency}} -
- -
- -
- -
- -
- -
- Project: - - - {{project.funderShortname ? project.funderShortname : project.funderName}} - - - | {{ project.acronym ? project.acronym : (project.title.length > 25 ? - project.title.substring(0, 25) + '...' : project.title)}} - - ({{project.code}}) - , - - ... -
- -
- Partners: - - {{organization.name}} - , - - ... -
- -
- Website URL: - - - {{result.websiteURL}} - - -
- -
- OAI-PMH URL: - - - {{result.OAIPMHURL}} - - -
- -
- Subject: - - {{subject}} - {{(i < (result.subjects.slice(0, 10).length - 1)) ? ", " : ""}} - {{(i == result.subjects.slice(0, 10).length - 1 && result.subjects.length > 10) ? "..." : ""}} - -
-
- -
- -
-

-
-
- - -
-
-
- -
-
-
- -
-
- +
+ +
+ +
+ +
+ +
+ +
+ Partners: + + {{organization.name}} + , + + ... +
+ +
+ Website URL: + + + {{result.websiteURL}} + + +
+ +
+ OAI-PMH URL: + + + {{result.OAIPMHURL}} + + +
+
+ +
+ +
+

+
+
+ + +
+
+
+
+
+ +
+
+ + [resultId]="result.relcanId" [resultTitle]="result.title" + [type]="result.resultType" [pageType]="'search'" + [putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers"> - + Added in ORCID: {{date | date: 'dd MMM yyyy'}} - + & - -
-
- - - - {{result.measure.bip[0].value}} - -
- - - - - - -
{{metric.name}}{{metric.value}}
-
- BIP! - Powered by BIP! -
-
-
- - - - {{result.measure.counts[0].value}} - -
- - - - - - -
{{metric.name}}{{metric.value}}
-
- Powered by - BIP! -
-
-
-
-
-
+ +
+
+ + + + {{result.measure.bip[0].value}} + +
+ + + + + + +
+ + {{metric.name}}{{metric.value}}
+
+ BIP! + Powered by BIP! +
+
+
+ + + + {{result.measure.counts[0].value}} + +
+ + + + + + +
+ + {{metric.name}}{{metric.value}}
+
+ Powered by + BIP! +
+
+
+
+ + + + diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index 225e0335..e07a7340 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -22,20 +22,21 @@ export class ResultPreviewComponent implements OnInit, OnChanges { @Input() modal: AlertModal = null; @Input() promoteWebsiteURL: boolean = false; @Input() hasLink: boolean = true; + /** + * @deprecated + * */ @Input() isCard: boolean = false; @Input() isMobile: boolean = false; public routerHelper: RouterHelper = new RouterHelper(); public urlParam: string; public url: string; @Input() externalUrl: string; - - public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0]; @Input() showOrcid: boolean = true; @Input() showEnermaps: boolean = false; @Input() deposit: boolean = false; @Input() provenanceActionVocabulary = null; @Input() relationsVocabulary = null; - + /* Metadata */ public type: string; public types: string[]; @@ -46,7 +47,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { public share: boolean = false; public cite: boolean = false; public orcid: boolean = false; - + ngOnInit(): void { if (this.hasLink) { if (this.result.resultType === "publication") { @@ -109,7 +110,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { this.orcid = (this.properties.adminToolsPortalType == 'explore' || this.properties.adminToolsPortalType == 'community' || this.properties.adminToolsPortalType == 'aggregator') && this.showOrcid && this.result.identifiers && this.result.identifiers.size > 0; } - + ngOnChanges(changes: SimpleChanges) { if (changes.result && this.hasLink) { this.checkPID(); @@ -151,7 +152,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { get hasActions() { return this.linking || this.share || this.cite || this.orcid; } - + public getTypeName(type: string): string { return StringUtils.getEntityName(type, false); } @@ -188,7 +189,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { return this.routerHelper.createQueryParam(this.urlParam, this.result.id) } - + public get isResultType() { return this.result.resultType == "publication" || this.result.resultType == "dataset" || this.result.resultType == "software" || this.result.resultType == "other" || this.result.resultType == "result"; diff --git a/utils/result-preview/result-preview.module.ts b/utils/result-preview/result-preview.module.ts index 4f0ee949..dfbf7c9f 100644 --- a/utils/result-preview/result-preview.module.ts +++ b/utils/result-preview/result-preview.module.ts @@ -8,9 +8,10 @@ import {OrcidModule} from "../../orcid/orcid.module"; import {IconsModule} from "../icons/icons.module"; import {IconsService} from "../icons/icons.service"; import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../icons/icons"; +import {EntityActionsModule} from "../entity-actions/entity-actions.module"; @NgModule({ - imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule, OrcidModule, IconsModule], + imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule, OrcidModule, IconsModule, EntityActionsModule], declarations: [ResultPreviewComponent], exports: [ResultPreviewComponent] })