diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts
index 2f71be7b..a693d576 100644
--- a/landingPages/landing-utils/availableOn.component.ts
+++ b/landingPages/landing-utils/availableOn.component.ts
@@ -26,7 +26,7 @@ declare var UIkit;
+ class="uk-drop download-drop uk-card uk-card-default uk-padding-small uk-padding-remove-horizontal uk-text-small">
diff --git a/landingPages/landing-utils/entity-metadata.component.less b/landingPages/landing-utils/entity-metadata.component.less
new file mode 100644
index 00000000..9f8db1b5
--- /dev/null
+++ b/landingPages/landing-utils/entity-metadata.component.less
@@ -0,0 +1,11 @@
+@import (reference) "~src/assets/openaire-theme/less/_import-variables";
+
+.entity-metadata {
+
+ & > *:not(:last-child):not(.other-separator)::after {
+ content: "\2022";
+ font-weight: normal;
+ margin-left: @global-xsmall-margin;
+ margin-right: @global-xsmall-margin;
+ }
+}
diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts
index be45b2ef..b446f758 100644
--- a/landingPages/landing-utils/entity-metadata.component.ts
+++ b/landingPages/landing-utils/entity-metadata.component.ts
@@ -7,83 +7,78 @@ import {Organization, Project} from "../../utils/result-preview/result-preview";
@Component({
selector: 'entity-metadata',
template: `
-
+
-
-
-
-
+
+
+
+
- Open Access Mandate for {{openaireEntities.PUBLICATIONS}} and {{openaireEntities.DATASETS}}
-
+ Open Access Mandate for {{openaireEntities.PUBLICATIONS}} and {{openaireEntities.DATASETS}}
+
- Open Access Mandate for {{openaireEntities.PUBLICATIONS}}
-
+ Open Access Mandate for {{openaireEntities.PUBLICATIONS}}
+
- Open Access Mandate for {{openaireEntities.DATASETS}}
-
-
-
-
-
-
-
-
-
-
-
-
+ Open Access Mandate for {{openaireEntities.DATASETS}}
+
-
{{entityType}}
-
0">
-
+
+ 0">
+
+
+
+
+
+
+
+
+
+ {{entityType}}
+ 0">
+
+
0" class="uk-text-italic">
{{removeUnknown(types, true).join(' , ')}}
-
{{year}}
-
{{startYear}}
-
{{endYear}}
-
{{startYear}} - {{endYear}}
-
-
+
From
{{startDate | date: 'dd MMM yyyy'}}
-
-
-
+
+
Until
{{endDate | date: 'dd MMM yyyy'}}
-
-
-
+
+
{{startDate | date: 'dd MMM yyyy'}}
(Started)
@@ -93,50 +88,38 @@ import {Organization, Project} from "../../utils/result-preview/result-preview";
{{endDate | date: 'dd MMM yyyy'}}
{{currentDate >= endDate ? '(Ended)' : '(Ending)'}}
-
+
-
{{status}}
-
{{date | date: 'dd MMM yyyy': 'UTC'}}
-
Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}}
-
- Under curation
-
0">
-
-
- {{country}}
-
-
+
0">
+ {{removeUnknown(countries).join(', ')}}
+
-
0">
-
-
- {{language}}
-
-
+
0">
+ {{removeUnknown(languages).join(', ')}}
+
-
0">
-
-
- {{programmingLanguage}}
-
-
+
0"
+ class="uk-flex uk-flex-middle uk-flex-wrap">
+ {{removeUnknown(programmingLanguages).join(', ')}}
+
-
+
-
-
{{compatibilityString}}
0">
-
OpenAIRE Text Mining
-
Thematic
-
0">
-
-
-
- {{project.funderShortname ? project.funderShortname : project.funderName}}
-
-
- | {{ project.acronym ? project.acronym : (project.title.length > 25 ?
- project.title.substring(0, 25) + '...' : project.title)}}
-
- ({{project.code}})
- ,
-
- 3">...
-
+
0" [class.truncated]="projects.length > 3">
+ {{projectNames.slice(0,3).join(', ')}}
+
-
0">
-
-
- {{organization.name}}
- ,
-
- 3">...
-
+
0" [class.truncated]="organizations.length > 3">
+ {{organizationNames.slice(0, 3).join(', ')}}
+
-
0">
-
-
- {{subject}}
- ,
-
- 3">...
-
+
0" [class.truncated]="subjects.length > 3">
+ {{subjects.slice(0, 3).join(', ')}}
+
-
{{provenanceAction}}
-
{{relationName}}
- `
+ `,
+ styleUrls: ['entity-metadata.component.less']
})
export class EntityMetadataComponent {
@Input() entityType: string;
@@ -269,4 +226,28 @@ export class EntityMetadataComponent {
tooltipContent += "
";
return tooltipContent;
}
+
+ get projectNames(): string[] {
+ if (this.projects && this.projects.length > 0) {
+ return this.projects.map(project => {
+ let value = project.funderShortname ? project.funderShortname : project.funderName;
+ if (project.acronym || project.title) {
+ value = value + ' | ' + (project.acronym ? project.acronym :
+ (project.title.length > 25 ? (project.title.slice(0, 25) + '...'): project.title));
+ }
+ if(project.code) {
+ value = value + ' (' + project.code + ')';
+ }
+ return value;
+ });
+ }
+ return [];
+ }
+
+ get organizationNames(): string[] {
+ if (this.organizations && this.organizations.length > 0) {
+ return this.organizations.map(organization => organization.name);
+ }
+ return [];
+ }
}
diff --git a/landingPages/landing-utils/showPublisher.component.ts b/landingPages/landing-utils/showPublisher.component.ts
index b480018f..004c146a 100644
--- a/landingPages/landing-utils/showPublisher.component.ts
+++ b/landingPages/landing-utils/showPublisher.component.ts
@@ -8,7 +8,6 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|| journal['volume'] || journal['eissn'] || journal['issue'])">
- •
{{journal['journal']}}
,
@@ -65,9 +64,9 @@ import {EnvProperties} from "../../utils/properties/env-properties";
)
+
- •
{{publisher}}
`
diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts
index 7894e41e..de1a2fca 100644
--- a/utils/entity-actions/entity-actions.component.ts
+++ b/utils/entity-actions/entity-actions.component.ts
@@ -1,17 +1,21 @@
-import {Component, Input, ViewChild} from "@angular/core";
+import {Component, Input, OnInit, ViewChild} from "@angular/core";
import {StringUtils} from "../string-utils.class";
import {RouterHelper} from "../routerHelper.class";
import {properties} from "../../../../environments/environment";
+import {Router} from "@angular/router";
+import {Option} from "../../sharedComponents/input/input.component";
+import {OpenaireEntities} from "../properties/searchFields";
+import {EnvProperties} from "../properties/env-properties";
@Component({
selector: 'entity-actions',
template: `
+ [type]="getTypeName().toLowerCase()" [piwikSiteId]="properties.piwikSiteId">
+
+
+
`
})
-export class EntityActionsComponent {
+export class EntityActionsComponent implements OnInit {
@Input() result: any;
@Input() type: string;
@Input() id: string;
@Input() linking: boolean = false;
@Input() share: boolean = false;
@Input() cite: boolean = false;
+ @Input() deposit: boolean = false;
+ @Input() embed: boolean = false;
@Input() url: string;
- public piwikSiteId = properties.piwikSiteId;
public citeThisClicked: boolean;
public routerHelper: RouterHelper = new RouterHelper();
@ViewChild('citeModal') citeModal;
+ @ViewChild('embedResultsModal') embedResultsModal;
+ @ViewChild('downloadReportModal') downloadReportModal;
@ViewChild('addThisModal') addThisModal;
-
- constructor() {
+ properties: EnvProperties = properties;
+
+
+ /* Embed */
+ public embed_research_results_type: string = "result";
+ public clipboard;
+ public resultTypesForEmbedding: Option[]=[
+ {label: "All "+OpenaireEntities.RESULTS, value: "result"},
+ {label: OpenaireEntities.PUBLICATIONS, value: "publication"},
+ {label: OpenaireEntities.DATASETS, value: "dataset"},
+ {label: OpenaireEntities.SOFTWARE, value: "software"},
+ {label: OpenaireEntities.OTHER, value: "other"}];
+
+ constructor(private router: Router) {
}
-
+
+ ngOnInit() {
+ this.createClipboard();
+ }
+
get linkTo():string {
return this.type === 'project'?'result':'project';
}
@@ -71,10 +128,48 @@ export class EntityActionsComponent {
}
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();
}
+
+ public openEmbedResultsModal() {
+ this.embedResultsModal.cancelButton = false;
+ this.embedResultsModal.okButton = false;
+ this.embedResultsModal.alertTitle = "Embed results";
+ this.embedResultsModal.open();
+ }
+
+ private createClipboard() {
+ if (typeof window !== 'undefined') {
+ delete this.clipboard;
+ let Clipboard;
+ Clipboard = require('clipboard');
+ this.clipboard = new Clipboard('.clipboard_btn');
+ }
+ }
+
+ getDynamicContent(type: string) {
+ return "');"
+ + "\n-->"
+ + "\n";
+ }
+
+ isRouteAvailable(routeToCheck: string) {
+ for (let i = 0; i < this.router.config.length; i++) {
+ let routePath: string = this.router.config[i].path;
+ if (routePath == routeToCheck) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/utils/entity-actions/entity-actions.module.ts b/utils/entity-actions/entity-actions.module.ts
index 5a49c744..b90cd9b3 100644
--- a/utils/entity-actions/entity-actions.module.ts
+++ b/utils/entity-actions/entity-actions.module.ts
@@ -1,14 +1,15 @@
import {NgModule} from "@angular/core";
import {CommonModule} from "@angular/common";
import {EntityActionsComponent} from "./entity-actions.component";
-import {RouterLinkWithHref} from "@angular/router";
+import {RouterModule} 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";
+import {InputModule} from "../../sharedComponents/input/input.module";
@NgModule({
- imports: [CommonModule, RouterLinkWithHref, IconsModule, AlertModalModule, CiteThisModule, LandingModule],
+ imports: [CommonModule, IconsModule, AlertModalModule, CiteThisModule, LandingModule, RouterModule, InputModule],
declarations: [EntityActionsComponent],
exports: [EntityActionsComponent]
})
diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html
index 9e4e1132..08009fda 100644
--- a/utils/result-preview/result-preview.component.html
+++ b/utils/result-preview/result-preview.component.html
@@ -171,8 +171,10 @@
-
0"
diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts
index e07a7340..aba09805 100644
--- a/utils/result-preview/result-preview.component.ts
+++ b/utils/result-preview/result-preview.component.ts
@@ -33,7 +33,6 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
@Input() externalUrl: string;
@Input() showOrcid: boolean = true;
@Input() showEnermaps: boolean = false;
- @Input() deposit: boolean = false;
@Input() provenanceActionVocabulary = null;
@Input() relationsVocabulary = null;
@@ -47,6 +46,8 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
public share: boolean = false;
public cite: boolean = false;
public orcid: boolean = false;
+ public deposit: boolean = false;
+ public embed: boolean = false;
ngOnInit(): void {
if (this.hasLink) {
@@ -74,9 +75,11 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
this.urlParam = "grantId";
}
this.url = properties.searchLinkToProject.split('?')[0];
+ this.projectActions();
} else if (this.result.resultType == "organization") {
this.urlParam = "organizationId";
this.url = properties.searchLinkToOrganization.split('?')[0];
+ this.organizationActions();
} else if (this.result.resultType == "dataprovider") {
if (this.result.compatibilityUNKNOWN && properties.adminToolsPortalType == "eosc") {
this.urlParam = "serviceId";
@@ -85,6 +88,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
this.urlParam = "datasourceId";
this.url = properties.searchLinkToDataProvider.split('?')[0];
}
+ this.contentProviderActions();
} else if (this.result.resultType == "service") {
this.urlParam = "serviceId";
this.url = properties.searchLinkToService.split('?')[0];
@@ -110,6 +114,21 @@ 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;
}
+
+ projectActions() {
+ this.linking = true;
+ this.share = true;
+ this.deposit = true;
+ this.embed = true;
+ }
+
+ organizationActions() {
+ this.share = true;
+ }
+
+ contentProviderActions() {
+ this.share = true;
+ }
ngOnChanges(changes: SimpleChanges) {
if (changes.result && this.hasLink) {