Adds button and service for DMP DOI creation.
This commit is contained in:
parent
41319ee320
commit
195cea45c1
|
@ -26,4 +26,5 @@ export interface DmpOverviewModel {
|
||||||
researchers: ResearcherModel[];
|
researchers: ResearcherModel[];
|
||||||
finalizedAt: Date;
|
finalizedAt: Date;
|
||||||
publishedAt: Date;
|
publishedAt: Date;
|
||||||
|
doi: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,10 @@ export class DmpService {
|
||||||
return this.http.post<DmpModel>(this.actionUrl + 'finalize/' + id, datasetsToBeFinalized, { headers: this.headers });
|
return this.http.post<DmpModel>(this.actionUrl + 'finalize/' + id, datasetsToBeFinalized, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDoi(id: string): Observable<string> {
|
||||||
|
return this.http.post<string>(this.actionUrl + 'createZenodoDoi/' + id, {headers: this.headers});
|
||||||
|
}
|
||||||
|
|
||||||
getDynamicField(requestItem: RequestItem<DynamicFieldProjectCriteria>): any {
|
getDynamicField(requestItem: RequestItem<DynamicFieldProjectCriteria>): any {
|
||||||
return this.http.post<any>(this.actionUrl + 'dynamic', requestItem, { headers: this.headers });
|
return this.http.post<any>(this.actionUrl + 'dynamic', requestItem, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
<div class="card-header card-header-plain d-flex">
|
<div class="card-header card-header-plain d-flex">
|
||||||
<div class="card-desc d-flex flex-column justify-content-center">
|
<div class="card-desc d-flex flex-column justify-content-center">
|
||||||
<h4 class="card-title">{{ dmp.label }}</h4>
|
<h4 class="card-title">{{ dmp.label }}</h4>
|
||||||
|
<mat-card-subtitle *ngIf="!hasDoi(dmp)">
|
||||||
|
{{ 'DMP-EDITOR.TITLE.SUBTITLE' | translate }}: {{ dmp.doi }}
|
||||||
|
</mat-card-subtitle>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex ml-auto p-2">
|
<div class="d-flex ml-auto p-2">
|
||||||
<button *ngIf="isDraftDmp(dmp)" mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto more-icon"
|
<button *ngIf="isDraftDmp(dmp)" mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto more-icon"
|
||||||
|
@ -42,6 +45,9 @@
|
||||||
<button *ngIf="isDraftDmp(dmp)" mat-raised-button color="primary" (click)="finalize(dmp)" class="lightblue-btn ml-2">
|
<button *ngIf="isDraftDmp(dmp)" mat-raised-button color="primary" (click)="finalize(dmp)" class="lightblue-btn ml-2">
|
||||||
<mat-icon>done_all</mat-icon> {{ 'DMP-LISTING.ACTIONS.FINALIZE' | translate }}
|
<mat-icon>done_all</mat-icon> {{ 'DMP-LISTING.ACTIONS.FINALIZE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
<button *ngIf="hasDoi(dmp) && isFinalizedDmp(dmp)" mat-raised-button color="primary" (click)="getDoi(dmp)" class="lightblue-btn ml-2">
|
||||||
|
<mat-icon>archive</mat-icon> {{ 'DMP-LISTING.ACTIONS.GETDOI' | translate }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row ml-2">
|
<div class="row ml-2">
|
||||||
|
|
|
@ -126,8 +126,8 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
this.dmpService.delete(this.dmp.id)
|
this.dmpService.delete(this.dmp.id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => { this.onCallbackSuccess() },
|
complete => { this.onCallbackSuccess() },
|
||||||
error => this.onDeleteCallbackError(error)
|
error => this.onDeleteCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -279,6 +279,43 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
return dmp.status == DmpStatus.Finalized;
|
return dmp.status == DmpStatus.Finalized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasDoi(dmp: DmpOverviewModel) {
|
||||||
|
return dmp.doi == null ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
getDoi(dmp: DmpOverviewModel) {
|
||||||
|
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||||
|
maxWidth: '600px',
|
||||||
|
data: {
|
||||||
|
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ZENODO-DOI'),
|
||||||
|
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
|
||||||
|
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
|
console.log(result);
|
||||||
|
if (result) {
|
||||||
|
this.dmpService.getDoi(dmp.id)
|
||||||
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
.subscribe(
|
||||||
|
complete => {
|
||||||
|
this.onDOICallbackSuccess();
|
||||||
|
this.dmp.doi = complete;
|
||||||
|
},
|
||||||
|
error => this.onDeleteCallbackError(error)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onDOICallbackSuccess(): void {
|
||||||
|
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-EDITOR.SNACK-BAR.SUCCESSFUL-DOI'), SnackBarNotificationLevel.Success);
|
||||||
|
}
|
||||||
|
|
||||||
|
onDOICallbackError(error) {
|
||||||
|
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error);
|
||||||
|
}
|
||||||
|
|
||||||
showPublishButton(dmp: DmpOverviewModel) {
|
showPublishButton(dmp: DmpOverviewModel) {
|
||||||
return this.isFinalizedDmp(dmp) && !dmp.isPublic && this.hasPublishButton;
|
return this.isFinalizedDmp(dmp) && !dmp.isPublic && this.hasPublishButton;
|
||||||
}
|
}
|
||||||
|
@ -317,7 +354,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
this.dmpService.finalize(datasetsToBeFinalized, this.dmp.id)
|
this.dmpService.finalize(datasetsToBeFinalized, this.dmp.id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => this.onCallbackSuccess()
|
complete => this.onCallbackSuccess()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
"DELETE-USER": "Remove this collaborator?",
|
"DELETE-USER": "Remove this collaborator?",
|
||||||
"FINALIZE-ITEM": "Finalize this item?",
|
"FINALIZE-ITEM": "Finalize this item?",
|
||||||
"ADD-DATASET": "Proceed on adding new Dataset?",
|
"ADD-DATASET": "Proceed on adding new Dataset?",
|
||||||
|
"ZENODO-DOI": "Would you like to create digital object identifier (DOI) for the DMP?",
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"CONFIRM": "Yes",
|
"CONFIRM": "Yes",
|
||||||
"No": "No",
|
"No": "No",
|
||||||
|
@ -282,7 +283,8 @@
|
||||||
"DOWNLOAD-XML": "Download XML",
|
"DOWNLOAD-XML": "Download XML",
|
||||||
"DOWNLOAD-DOCX": "Download Document",
|
"DOWNLOAD-DOCX": "Download Document",
|
||||||
"DOWNLOAD-PDF": "Download PDF",
|
"DOWNLOAD-PDF": "Download PDF",
|
||||||
"SETTINGS": "Settings"
|
"SETTINGS": "Settings",
|
||||||
|
"GETDOI": "Get DOI"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DMP-PUBLIC-LISTING": {
|
"DMP-PUBLIC-LISTING": {
|
||||||
|
@ -478,7 +480,8 @@
|
||||||
"DMP-EDITOR": {
|
"DMP-EDITOR": {
|
||||||
"TITLE": {
|
"TITLE": {
|
||||||
"NEW": "New Data Management Plan",
|
"NEW": "New Data Management Plan",
|
||||||
"EDIT": "Edit"
|
"EDIT": "Edit",
|
||||||
|
"SUBTITLE": "DOI"
|
||||||
},
|
},
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"NAME": "Title",
|
"NAME": "Title",
|
||||||
|
@ -503,6 +506,10 @@
|
||||||
"CANCEL": "Cancel",
|
"CANCEL": "Cancel",
|
||||||
"DELETE": "Delete",
|
"DELETE": "Delete",
|
||||||
"FINALISE": "Finalize"
|
"FINALISE": "Finalize"
|
||||||
|
},
|
||||||
|
"SNACK-BAR": {
|
||||||
|
"UNSUCCESSFUL-DOI": "Unsuccessful DOI creation",
|
||||||
|
"SUCCESSFUL-DOI": "Successful DOI creation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DMP-PROFILE-LISTING": {
|
"DMP-PROFILE-LISTING": {
|
||||||
|
|
Loading…
Reference in New Issue