41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import {Component, Input} from '@angular/core';
|
|
import {ActivatedRoute} from '@angular/router';
|
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
|
import {ZenodoInformationClass} from '../utils/zenodoInformation.class';
|
|
|
|
@Component({
|
|
selector: 'deposit-datasets-result',
|
|
template: `
|
|
<deposit-result [compatibility]="'openaire____::21f8a223b9925c2f87c404096080b046||Registry of Research Data Repository'"
|
|
[requestFor]="'Research Data'" [piwikSiteId]=piwikSiteId
|
|
[zenodoInformation]="zenodoInformation">
|
|
</deposit-result>
|
|
`
|
|
})
|
|
|
|
export class DepositDatasetsResultComponent {
|
|
@Input() zenodoInformation: ZenodoInformationClass;
|
|
properties:EnvProperties;
|
|
|
|
@Input() piwikSiteId = null;
|
|
|
|
constructor (private route: ActivatedRoute) {}
|
|
|
|
ngOnInit() {
|
|
this.route.data
|
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
|
this.properties = data.envSpecific;
|
|
|
|
if(!this.zenodoInformation) {
|
|
this.zenodoInformation = new ZenodoInformationClass();
|
|
}
|
|
if(!this.zenodoInformation.url) {
|
|
this.zenodoInformation.url = this.properties.zenodo;
|
|
}
|
|
if(!this.zenodoInformation.name) {
|
|
this.zenodoInformation.name = "Zenodo";
|
|
}
|
|
});
|
|
}
|
|
}
|