1
|
import {Component, Input} from '@angular/core';
|
2
|
import {Router} from '@angular/router';
|
3
|
import {ActivatedRoute} from '@angular/router';
|
4
|
import {Title, Meta} from '@angular/platform-browser';
|
5
|
|
6
|
import {Observable} from 'rxjs';
|
7
|
|
8
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
9
|
|
10
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
11
|
|
12
|
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
13
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
14
|
|
15
|
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
16
|
import {OrganizationService} from '../../services/organization.service';
|
17
|
import {PiwikService} from '../../utils/piwik/piwik.service';
|
18
|
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
|
19
|
|
20
|
import {ZenodoInformationClass} from '../utils/zenodoInformation.class';
|
21
|
|
22
|
@Component({
|
23
|
selector: 'deposit-by-subject-result',
|
24
|
template: `
|
25
|
<deposit-result [requestFor]="'Research Data'" [piwikSiteId]=piwikSiteId
|
26
|
[zenodoInformation]="zenodoInformation"
|
27
|
[subjectResults]="true" [subject]="subject">
|
28
|
</deposit-result>
|
29
|
`
|
30
|
//templateUrl: 'depositBySubjectResult.component.html'
|
31
|
})
|
32
|
|
33
|
export class DepositBySubjectResultComponent {
|
34
|
@Input() piwikSiteId = null;
|
35
|
@Input() zenodoInformation: ZenodoInformationClass;
|
36
|
|
37
|
public subject: string = "";
|
38
|
properties:EnvProperties;
|
39
|
|
40
|
constructor (private route: ActivatedRoute) {}
|
41
|
|
42
|
ngOnInit() {
|
43
|
this.route.data
|
44
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
45
|
this.properties = data.envSpecific;
|
46
|
|
47
|
if(!this.zenodoInformation) {
|
48
|
this.zenodoInformation = new ZenodoInformationClass();
|
49
|
}
|
50
|
if(!this.zenodoInformation.url) {
|
51
|
this.zenodoInformation.url = this.properties.zenodo;
|
52
|
}
|
53
|
if(!this.zenodoInformation.name) {
|
54
|
this.zenodoInformation.name = "Zenodo";
|
55
|
}
|
56
|
});
|
57
|
}
|
58
|
}
|