diff --git a/deposit/deposit-file/deposit-file.component.ts b/deposit/deposit-file/deposit-file.component.ts
index 6d9c693f..cd852014 100644
--- a/deposit/deposit-file/deposit-file.component.ts
+++ b/deposit/deposit-file/deposit-file.component.ts
@@ -68,17 +68,23 @@ declare var UIkit: any;
Publication date | {{space.metadata.publication_date}} |
0">Description | {{space.metadata.description.substring(0,250)}} 247">... |
Access right | {{space.metadata.access_right}} |
- 0">Creators | {{creator.name}}{{', '}} |
+ 0">Creators |
+ {{creator.name}}{{', '}} |
License | {{space.metadata.license}} |
Upload type | {{space.metadata.upload_type}} |
Related identifiers |
- {{identifier.identifier}} - {{identifier.relation}} -{{identifier.resource_type}}
- {{', '}} |
+ {{identifier.identifier + ' - ' }}
+ {{identifier.relation}} {{' - ' + identifier.resource_type}}
+ {{', '}}
Journal | {{space.metadata.journal_title}}
{{',volume '+ space.metadata.journal_volume}}
{{',issue '+ space.metadata.journal_issue}} |
Publisher | {{space.metadata.imprint_publisher}} |
Language | {{space.metadata.language}} |
+ Grants |
+ {{grant.id}}
+ {{', '}}
+ |
Files | {{space.files.join(", ")}} |
@@ -88,7 +94,7 @@ declare var UIkit: any;
class="uk-button uk-button-default uk-margin-top uk-float-right">Continue to Zenodo
- {{errorMessage}}
+
@@ -295,10 +301,23 @@ export class DepositionComponent {
this.saveRecord(record, this.filesToUpload, this.space);
this.filesToUpload = [];
}, error => {
- console.error(error.message)
- // this.errorMessage = error.message;
- // this.showLoading = false;
- this.authorize();
+ console.error(error)
+ if(error.status == '400'){
+ this.showLoading = false;
+ this.errorMessage = "Zenodo API:
" +error.error.message + "
";
+ if(error.error.errors) {
+ for (let err of error.error.errors) {
+ if (err.field && err.messages && err.messages.length > 0) {
+ this.errorMessage += err.field + ": " + err.messages.join(", ") + "
";
+ }
+ }
+ }
+ }else if(error.status == 401 || error.status == 403){
+ this.authorize();
+ }else{
+ this.showLoading = false;
+ this.errorMessage = "Zenodo API:
" + error.error.message;
+ }
})
}
}
@@ -313,9 +332,10 @@ export class DepositionComponent {
imprint_publisher: this.result.publisher,
related_identifiers: []
}
- if(this.result.languages){
+ /*if(this.result.languages){
+ // metadata.language: Language must be either ISO-639-1 or 639-2 compatible.
record['language'] = this.result.languages[0];
- }
+ }*/
if(this.result.journal && this.result.journal){
record['journal_title'] = this.result.journal.journal;
record['journal_volume'] = this.result.journal.volume;
@@ -326,15 +346,24 @@ export class DepositionComponent {
for (let pid of this.result.identifiers.get(pidType)) {
record.related_identifiers.push({
identifier: pid,
- relation: 'isSupplementTo',
+ relation: 'hasMetadata',
resource_type: this.result.resultType
})
}
}
}
-
- // record['imprint_publisher']=this.result.publisher;
+ if(this.result.fundedByProjects){
+ record['grants']=[];
+ for(let project of this.result.fundedByProjects){
+ if(project.funderShortname == 'EC') {
+ record['grants'].push({id: '10.13039/501100000780::' + project.code})
+ }
+ }
+ }
+ console.log(record['grants'])
+ record['imprint_publisher']=this.result.publisher;
/* if (this.result.resultType == 'publication' && this.result.types[0]) {
+ //has to be match to their vocabulary
record['publication_type'] = this.result.types[0];
}*/
if(this.result.authors) {