From 53a8f5dde70c9e3556d889d2489556f6b670764c Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 8 Oct 2024 14:18:09 +0300 Subject: [PATCH] [develop-16-deposit | WIP ] --- .../deposit-file/deposit-file.component.ts | 79 +++++++++++-------- 1 file changed, 46 insertions(+), 33 deletions(-) diff --git a/deposit/deposit-file/deposit-file.component.ts b/deposit/deposit-file/deposit-file.component.ts index 29a76a45..6d9c693f 100644 --- a/deposit/deposit-file/deposit-file.component.ts +++ b/deposit/deposit-file/deposit-file.component.ts @@ -49,23 +49,30 @@ declare var UIkit: any; -
Your file has been uploaded in Zenodo in draft mode.
You can - view, edit and publish the record here. +
+ + Your file has been uploaded to Zenodo in draft mode.
+ Please visit Zenodo to review the metadata, make any necessary edits, and publish the record.

+ Note that it has been uploaded with license + {{space.metadata.license}}, classified as + {{space.metadata.upload_type}}, and is set with + {{space.metadata.access_right}} access rights. +
The preserved DOI is {{space.metadata.prereserve_doi.doi}}.
- - +
Title{{space.metadata.title}}
+ - - - - - + + + + +
Title{{space.metadata.title}}
Publication date{{space.metadata.publication_date}}
Description{{space.metadata.description.substring(0,250)}}...
Access right{{space.metadata.access_right}}
Creators{{creator.name}}{{', '}}
License{{space.metadata.license}}
Upload type{{space.metadata.upload_type}}
Description{{space.metadata.description.substring(0,250)}}...
Access right{{space.metadata.access_right}}
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}} @@ -77,7 +84,8 @@ declare var UIkit: any; Undo + class="uk-button uk-button-danger uk-margin-top">Cancel Continue to Zenodo
{{errorMessage}}
@@ -85,24 +93,25 @@ declare var UIkit: any; - + + <!–
{{requestGrantMessage}}
–>
- + <!– –>
Your file has been deposited in Zenodo with the main metadata of this record. You can view the new record here, edit and publish it.
The preserved DOI is {{space.metadata.prereserve_doi.doi}}.
-
+ --> - + + ` }) @@ -135,7 +144,7 @@ export class DepositionComponent { user//: User; userTokens; - @ViewChild('grantModal') grantModal; + // @ViewChild('grantModal') grantModal; @ViewChild('depositInfoModal') depositInfoModal; constructor(private route: ActivatedRoute, @@ -148,22 +157,23 @@ export class DepositionComponent { this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { //testing - /* this.space = {}; + /* this.space = {}; this.space.links = [] this.space.metadata = this.resultInfoToZenodoRecord(); this.space.metadata.prereserve_doi = {doi:"123"} this.space.files = [];*/ - this.user = user; - //TODO remove later - // this.user = {}; - // this.user.id = "034130792470362"; - // this.user.firstname = "Argiro"; - // this.user.lastname = "Kokogiannaki"; - // this.user.email = "argirok@di.uoa.gr" if (this.user) { console.log(this.user) this.isAuthorizedBefore(); + }else if(properties.environment == 'development'){ + //TODO remove later + this.user = {}; + this.user.id = "034130792470362"; + this.user.firstname = "Argiro"; + this.user.lastname = "Kokogiannaki"; + this.user.email = "argirok@di.uoa.gr" + this.isAuthorizedBefore(); } else { this.authorized = false; } @@ -196,7 +206,7 @@ export class DepositionComponent { this.window = window.open(this.authorizeUrl, '_blank', 'location=yes,height=700,width=540,left=500,top=100,scrollbars=yes,status=yes'); // this.requestGrant = false; - this.closeGrantModal(); + // this.closeGrantModal(); let self = this; window.onmessage = function (ev) { @@ -228,7 +238,7 @@ export class DepositionComponent { } } - openGrantModal(title: string) { +/* openGrantModal(title: string) { this.grantModal.cancelButton = true; this.grantModal.okButton = true; this.grantModal.okButtonText = "Grant OpenAIRE"; @@ -239,7 +249,7 @@ export class DepositionComponent { closeGrantModal() { this.grantModal.cancel(); - } + }*/ public getInfo(func) { if (this.userTokens.zenodoToken) { @@ -301,10 +311,11 @@ export class DepositionComponent { creators: [], description: this.result.description, imprint_publisher: this.result.publisher, - language:this.result.languages?this.result.languages.join(', '):'', related_identifiers: [] } - + if(this.result.languages){ + 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,8 +337,10 @@ export class DepositionComponent { /* if (this.result.resultType == 'publication' && this.result.types[0]) { record['publication_type'] = this.result.types[0]; }*/ - for (let author of this.result.authors) { - record.creators.push({name: author.fullName, orcid: author.orcid}) + if(this.result.authors) { + for (let author of this.result.authors) { + record.creators.push({name: author.fullName, orcid: author.orcid}) + } } return record; } @@ -425,7 +438,7 @@ export class DepositionComponent { console.log(res) this.space = null; this._http.delete(this.properties.depositAPI + "deposit/record/delete?id=" + this.mongoRecord._id).subscribe(res => { - + this.depositInfoModal.cancel() }) }, error => { console.error(error.message)