diff --git a/dmp-backend/depositinterface/src/main/java/eu/eudat/depositinterface/repository/RepositoryDepositConfiguration.java b/dmp-backend/depositinterface/src/main/java/eu/eudat/depositinterface/repository/RepositoryDepositConfiguration.java index 5504ad25b..937e5182a 100644 --- a/dmp-backend/depositinterface/src/main/java/eu/eudat/depositinterface/repository/RepositoryDepositConfiguration.java +++ b/dmp-backend/depositinterface/src/main/java/eu/eudat/depositinterface/repository/RepositoryDepositConfiguration.java @@ -33,10 +33,12 @@ public class RepositoryDepositConfiguration { private String repositoryId; private String accessToken; private String repositoryUrl; + private String repositoryAuthorizationUrl; + private String repositoryRecordUrl; private String repositoryLoginAccessTokenUrl; private String repositoryLoginClientId; private String repositoryLoginClientSecret; - private String repositoryLoginRedirectUri; // + private String repositoryLoginRedirectUri; public int getDepositAccountStatus() { return depositAccountStatus; @@ -66,6 +68,20 @@ public class RepositoryDepositConfiguration { this.repositoryUrl = repositoryUrl; } + public String getRepositoryAuthorizationUrl() { + return repositoryAuthorizationUrl; + } + public void setRepositoryAuthorizationUrl(String repositoryAuthorizationUrl) { + this.repositoryAuthorizationUrl = repositoryAuthorizationUrl; + } + + public String getRepositoryRecordUrl() { + return repositoryRecordUrl; + } + public void setRepositoryRecordUrl(String repositoryRecordUrl) { + this.repositoryRecordUrl = repositoryRecordUrl; + } + public String getRepositoryLoginAccessTokenUrl() { return repositoryLoginAccessTokenUrl; } diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DepositManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DepositManager.java index 49fceab84..d5ec7ff88 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DepositManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DepositManager.java @@ -38,17 +38,9 @@ public class DepositManager { public List getAvailableRepos() { List repos = new ArrayList<>(); - -// logger.info("-------------REPOS------------"); -// for (RepositoryDeposit r: this.repositories) { -// logger.info("...Loaded Class: " -// + r.getClass()); -// } -// logger.info("-------------------------------"); for (RepositoryDeposit r: this.repositories) { repos.add(r.getConfiguration()); } - return repos; } diff --git a/dmp-backend/zenodoRepository/src/main/java/eu/eudat/depositinterface/zenodorepository/interfaces/ZenodoDeposit.java b/dmp-backend/zenodoRepository/src/main/java/eu/eudat/depositinterface/zenodorepository/interfaces/ZenodoDeposit.java index b8696885f..012076af7 100644 --- a/dmp-backend/zenodoRepository/src/main/java/eu/eudat/depositinterface/zenodorepository/interfaces/ZenodoDeposit.java +++ b/dmp-backend/zenodoRepository/src/main/java/eu/eudat/depositinterface/zenodorepository/interfaces/ZenodoDeposit.java @@ -177,6 +177,8 @@ public class ZenodoDeposit implements RepositoryDeposit { conf.setRepositoryId("Zenodo"); conf.setAccessToken("pcqw4LGLrhp17FF5GoXNCXakkEi82ThchZw7Tk4qh74VrDE3EmliG3UlhYtd"); conf.setRepositoryUrl("https://sandbox.zenodo.org/api/"); + conf.setRepositoryAuthorizationUrl("https://sandbox.zenodo.org/oauth/authorize"); + conf.setRepositoryRecordUrl("https://sandbox.zenodo.org/record/"); conf.setRepositoryLoginAccessTokenUrl("https://sandbox.zenodo.org/oauth/token"); conf.setRepositoryLoginClientId("hEmVRNc1OzRmWyi2GDR3XVKbhG3OtfJXLXkkOGXx"); conf.setRepositoryLoginClientSecret("7VSU0NjiAg0P3mv14wemMYy2XhvlmV6F7xoszxPH4ZDx98v8FdMpBbxlncqr"); diff --git a/dmp-frontend/src/app/core/model/deposit/deposit-configuration.ts b/dmp-frontend/src/app/core/model/deposit/deposit-configuration.ts index 1e2ef02e1..97840d578 100644 --- a/dmp-frontend/src/app/core/model/deposit/deposit-configuration.ts +++ b/dmp-frontend/src/app/core/model/deposit/deposit-configuration.ts @@ -5,7 +5,10 @@ export class DepositConfigurationModel { repositoryId: string; accessToken: string; repositoryUrl: string; + repositoryAuthorizationUrl: string; + repositoryRecordUrl: string; repositoryLoginAccessTokenUrl: string; repositoryLoginClientId: string; repositoryLoginClientSecret: string; + repositoryLoginRedirectUri: string; } diff --git a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts index 9b92ad064..64082cb55 100644 --- a/dmp-frontend/src/app/core/services/configuration/configuration.service.ts +++ b/dmp-frontend/src/app/core/services/configuration/configuration.service.ts @@ -66,11 +66,6 @@ export class ConfigurationService extends BaseComponent { return this._allowOrganizationCreator; } - private _doiLink: string; - get doiLink(): string { - return this._doiLink; - } - private _useSplash: string; get useSplash(): string { return this._useSplash; @@ -137,7 +132,6 @@ export class ConfigurationService extends BaseComponent { this._lockInterval = config.lockInterval; this._guideAssets = config.guideAssets; this._allowOrganizationCreator = config.allowOrganizationCreator; - this._doiLink = config.doiLink; this._useSplash = config.useSplash; this._orcidPath = config.orcidPath; if (config.matomo) { diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dialog/dmp-deposit-dialog.component.html b/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dialog/dmp-deposit-dialog.component.html index 407452047..1ab72528e 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dialog/dmp-deposit-dialog.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dialog/dmp-deposit-dialog.component.html @@ -9,7 +9,7 @@ -
No publishing repositories so far
+
{{'DMP-OVERVIEW.DEPOSIT.NO-REPOSITORIES' | translate}}
diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dialog/dmp-deposit-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dialog/dmp-deposit-dialog.component.ts index 0f5133e47..88364d012 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dialog/dmp-deposit-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-deposit-dialog/dmp-deposit-dialog.component.ts @@ -5,11 +5,9 @@ import { DepositConfigurationModel } from '@app/core/model/deposit/deposit-confi import { DmpOverviewModel } from '@app/core/model/dmp/dmp-overview'; import { DoiModel } from '@app/core/model/doi/doi'; import { DepositRepositoriesService } from '@app/core/services/deposit-repositories/deposit-repositories.service'; -import { DmpService } from '@app/core/services/dmp/dmp.service'; import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-dialog.service'; import { BaseComponent } from '@common/base/base.component'; -import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { MultipleChoiceDialogComponent } from '@common/modules/multiple-choice-dialog/multiple-choice-dialog.component'; import { TranslateService } from '@ngx-translate/core'; import { takeUntil } from 'rxjs/operators'; @@ -24,13 +22,14 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit { inputRepos: DepositConfigurationModel[]; outputRepos: DoiModel[]; dmp: DmpOverviewModel; + private oauthLock: boolean; constructor( - private dmpService: DmpService, private depositRepositoriesService: DepositRepositoriesService, public dialogRef: MatDialogRef, private dialog: MatDialog, private language: TranslateService, + private translate: TranslateService, private uiNotificationService: UiNotificationService, private oauth2DialogService: Oauth2DialogService, @Inject(MAT_DIALOG_DATA) public data: any @@ -67,16 +66,16 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit { maxWidth: '600px', restoreFocus: false, data: { - message: 'Which account would you like to use?',//this.language.instant('GENERAL.ERRORS.HTTP-REQUEST-ERROR'), - titles: ['Login with ' + repo.repositoryId/*this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.ZENODO-LOGIN')*/, this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')] + message: this.language.instant('DMP-OVERVIEW.DEPOSIT.ACCOUNT-LOGIN'), + titles: [this.language.instant('DMP-OVERVIEW.DEPOSIT.LOGIN', { 'repository': repo.repositoryId }), this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')] } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { switch (result) { case 0: - this.showOauth2Dialog('https://sandbox.zenodo.org/oauth/authorize'+ '?client_id=' + repo.repositoryLoginClientId + this.showOauth2Dialog(repo.repositoryAuthorizationUrl + '?client_id=' + repo.repositoryLoginClientId + '&response_type=code&scope=deposit:write+deposit:actions+user:email&state=astate&redirect_uri=' - + 'http://localhost:4200/login/external/zenodo', repo, this.dmp); + + repo.repositoryLoginRedirectUri, repo, this.dmp); break; case 1: this.depositRepositoriesService.createDoi(repo.repositoryId, this.dmp.id, null) @@ -88,7 +87,7 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit { if(this.inputRepos.length == 0){ this.close(); } - }, error => this.onDeleteCallbackError(error)); + }, error => this.onDOICallbackError(error)); break; } }); @@ -100,8 +99,8 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit { this.uiNotificationService.snackBarNotification(this.language.instant('DMP-EDITOR.SNACK-BAR.SUCCESSFUL-DOI'), SnackBarNotificationLevel.Success); } - onDeleteCallbackError(error) { - this.uiNotificationService.snackBarNotification(error.error.message ? this.language.instant(error.error.message) : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error); + onDOICallbackError(error) { + this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error); } showOauth2Dialog(url: string, repo: DepositConfigurationModel, dmp: DmpOverviewModel) { @@ -109,7 +108,7 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit { .pipe(takeUntil(this._destroyed)) .subscribe(result => { if (result !== undefined) { - if (result.oauthCode !== undefined && result.oauthCode !== null) { + if (result.oauthCode !== undefined && result.oauthCode !== null && !this.oauthLock) { this.depositRepositoriesService.getAccessToken(repo.repositoryId, result.oauthCode) .pipe(takeUntil(this._destroyed)) .subscribe(token => { @@ -122,16 +121,14 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit { if(this.inputRepos.length == 0){ this.close(); } - }, error => this.onDeleteCallbackError(error)); + }, error => this.onDOICallbackError(error)); }); - // this.userService.registerDOIToken(result.oauthCode, this.configurationService.app + 'oauth2') - // .pipe(takeUntil(this._destroyed)) - // .subscribe(() => { - // this.hasDOIToken = true; - // this.showConfirmationDOIDialog(dmp); - // }); + this.oauthLock = true; } } + else{ + this.oauthLock = false; + } }); } diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html index 60d21ea68..602935ded 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html @@ -115,8 +115,8 @@

{{'DMP-EDITOR.TITLE.SUBTITLE' | translate}}

- - {{x.repositoryId}} + + {{doi.repositoryId}}
@@ -124,7 +124,7 @@ content_copy diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index c01ecf706..eaf84437d 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -18,16 +18,15 @@ import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-it import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; import * as FileSaver from 'file-saver'; -import { Observable, of as observableOf, interval } from 'rxjs'; +import { Observable, of as observableOf } from 'rxjs'; import { takeUntil, map } from 'rxjs/operators'; import { Role } from "@app/core/common/enum/role"; import { DmpInvitationDialogComponent } from '../invitation/dmp-invitation-dialog.component'; -import { MultipleChoiceDialogComponent } from '@common/modules/multiple-choice-dialog/multiple-choice-dialog.component'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-dialog.service'; import { UserService } from '@app/core/services/user/user.service'; import { Location } from '@angular/common'; -import { FormGroup, FormArray, FormControl } from '@angular/forms'; +import { FormGroup } from '@angular/forms'; import { LockService } from '@app/core/services/lock/lock.service'; import { VersionListingModel } from '@app/core/model/version/version-listing.model'; import { CloneDialogComponent } from '../clone/clone-dialog/clone-dialog.component'; @@ -67,7 +66,6 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { textMessage: any; versions: VersionListingModel[]; version: VersionListingModel; - private oauthLock: boolean; @ViewChild('doi') doi: ElementRef; @@ -87,11 +85,8 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { private language: TranslateService, private uiNotificationService: UiNotificationService, private configurationService: ConfigurationService, - private oauth2DialogService: Oauth2DialogService, - private userService: UserService, private location: Location, private lockService: LockService, - private httpClient: HttpClient, private matomoService: MatomoService ) { super(); @@ -460,25 +455,6 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { return (this.dmp.dois == null || this.dmp.dois.length == 0) ? true : false; } - getAccessUrl(): string { - const redirectUri = this.configurationService.app + 'oauth2'; - const url = this.configurationService.loginProviders.zenodoConfiguration.oauthUrl - + '?client_id=' + this.configurationService.loginProviders.zenodoConfiguration.clientId - + '&response_type=code&scope=deposit:write+deposit:actions+user:email&state=astate&redirect_uri=' - + redirectUri; - return url; - } - - getDoi(dmp: DmpOverviewModel) { - this.userService.hasDOIToken().subscribe(response => { - this.hasDOIToken = true; - this.showConfirmationDOIDialog(dmp); - }, error => { - this.hasDOIToken = false; - this.showErrorConfirmationDOIDialog(error.error.message, dmp); - }); - } - getAllVersions(dmp: DmpOverviewModel) { this.dmpService.getAllVersions(dmp.groupId, this.isPublicView) .pipe(takeUntil(this._destroyed)) @@ -487,82 +463,6 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { }); } - showConfirmationDOIDialog(dmp: DmpOverviewModel) { - const dialogRef = this.dialog.open(ConfirmationDialogComponent, { - maxWidth: '600px', - restoreFocus: false, - data: { - message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ZENODO-DOI', { 'username': this.hasDOIToken ? this.authentication.current().zenodoEmail : 'default' }), - 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 => { - if (result) { - this.dmpService.getDoi(dmp.id) - .pipe(takeUntil(this._destroyed)) - .subscribe( - complete => { - this.onDOICallbackSuccess(); - this.dmp.doi = complete; - }, - error => this.onDeleteCallbackError(error) - ); - } - }); - } - - showErrorConfirmationDOIDialog(message: string, dmp: DmpOverviewModel) { - const dialogRef = this.dialog.open(MultipleChoiceDialogComponent, { - maxWidth: '600px', - restoreFocus: false, - data: { - message: message ? this.language.instant(message) : this.language.instant('GENERAL.ERRORS.HTTP-REQUEST-ERROR'), - titles: [this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.ZENODO-LOGIN'), this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')] - } - }); - dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { - switch (result) { - case 0: - // this.authentication.logout(); - // this.router.navigate(['/login/external/zenodo']); - this.showOauth2Dialog(this.getAccessUrl(), dmp); - break; - case 1: - this.showConfirmationDOIDialog(dmp); - break; - } - }); - } - - showOauth2Dialog(url: string, dmp: DmpOverviewModel) { - this.oauth2DialogService.login(url) - .pipe(takeUntil(this._destroyed)) - .subscribe(result => { - if (result !== undefined) { - if (result.oauthCode !== undefined && result.oauthCode !== null && !this.oauthLock) { - this.userService.registerDOIToken(result.oauthCode, this.configurationService.app + 'oauth2') - .pipe(takeUntil(this._destroyed)) - .subscribe(() => { - this.hasDOIToken = true; - this.showConfirmationDOIDialog(dmp); - }); - this.oauthLock = true; - } - } else { - this.oauthLock = false; - } - }); - } - - 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) { return this.isFinalizedDmp(dmp) && !dmp.isPublic && this.hasPublishButton; } @@ -599,9 +499,9 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { autoFocus: false, data: { depositRepos: [this.depositRepos, this.dmp], - message: "Select repositories to deposit",//this.language.instant('GENERAL.CONFIRMATION-DIALOG.FINALIZE-ITEM'), - confirmButton: "Proceed to authentication",//this.language.instant('DMP-FINALISE-DIALOG.SUBMIT'), - cancelButton: "Cancel",//this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'), + message: this.language.instant('DMP-OVERVIEW.DEPOSIT.SELECT-REPOSITORIES'), + confirmButton: this.language.instant('DMP-OVERVIEW.DEPOSIT.AUTHORIZE'), + cancelButton: this.language.instant('DMP-OVERVIEW.DEPOSIT.CANCEL'), } }); dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: DoiModel[]) => { @@ -715,10 +615,10 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { this.router.navigate(['/datasets', 'new', this.dmp.id]); } - createDoiLink(doi: string): string { - const doiarr = doi.split('.'); + createDoiLink(doiModel: DoiModel): string { + const doiarr = doiModel.doi.split('.'); const id = doiarr[doiarr.length - 1]; - return this.configurationService.doiLink + id; + return this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId).repositoryRecordUrl + id; } reverse() { @@ -876,5 +776,99 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { // }); // } + // getAccessUrl(): string { + // const redirectUri = this.configurationService.app + 'oauth2'; + // const url = this.configurationService.loginProviders.zenodoConfiguration.oauthUrl + // + '?client_id=' + this.configurationService.loginProviders.zenodoConfiguration.clientId + // + '&response_type=code&scope=deposit:write+deposit:actions+user:email&state=astate&redirect_uri=' + // + redirectUri; + // return url; + // } + + // getDoi(dmp: DmpOverviewModel) { + // this.userService.hasDOIToken().subscribe(response => { + // this.hasDOIToken = true; + // this.showConfirmationDOIDialog(dmp); + // }, error => { + // this.hasDOIToken = false; + // this.showErrorConfirmationDOIDialog(error.error.message, dmp); + // }); + // } + + // showConfirmationDOIDialog(dmp: DmpOverviewModel) { + // const dialogRef = this.dialog.open(ConfirmationDialogComponent, { + // maxWidth: '600px', + // restoreFocus: false, + // data: { + // message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ZENODO-DOI', { 'username': this.hasDOIToken ? this.authentication.current().zenodoEmail : 'default' }), + // 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 => { + // if (result) { + // this.dmpService.getDoi(dmp.id) + // .pipe(takeUntil(this._destroyed)) + // .subscribe( + // complete => { + // this.onDOICallbackSuccess(); + // this.dmp.doi = complete; + // }, + // error => this.onDeleteCallbackError(error) + // ); + // } + // }); + // } + + // showErrorConfirmationDOIDialog(message: string, dmp: DmpOverviewModel) { + // const dialogRef = this.dialog.open(MultipleChoiceDialogComponent, { + // maxWidth: '600px', + // restoreFocus: false, + // data: { + // message: message ? this.language.instant(message) : this.language.instant('GENERAL.ERRORS.HTTP-REQUEST-ERROR'), + // titles: [this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.ZENODO-LOGIN'), this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')] + // } + // }); + // dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { + // switch (result) { + // case 0: + // // this.authentication.logout(); + // // this.router.navigate(['/login/external/zenodo']); + // this.showOauth2Dialog(this.getAccessUrl(), dmp); + // break; + // case 1: + // this.showConfirmationDOIDialog(dmp); + // break; + // } + // }); + // } + + // showOauth2Dialog(url: string, dmp: DmpOverviewModel) { + // this.oauth2DialogService.login(url) + // .pipe(takeUntil(this._destroyed)) + // .subscribe(result => { + // if (result !== undefined) { + // if (result.oauthCode !== undefined && result.oauthCode !== null && !this.oauthLock) { + // this.userService.registerDOIToken(result.oauthCode, this.configurationService.app + 'oauth2') + // .pipe(takeUntil(this._destroyed)) + // .subscribe(() => { + // this.hasDOIToken = true; + // this.showConfirmationDOIDialog(dmp); + // }); + // this.oauthLock = true; + // } + // } else { + // this.oauthLock = false; + // } + // }); + // } + + // 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); + // } } diff --git a/dmp-frontend/src/assets/config/config.json b/dmp-frontend/src/assets/config/config.json index 7b0bbad3d..72c5d8a10 100644 --- a/dmp-frontend/src/assets/config/config.json +++ b/dmp-frontend/src/assets/config/config.json @@ -57,7 +57,6 @@ "lockInterval": 60000, "guideAssets": "assets/images/guide", "allowOrganizationCreator": true, - "doiLink": "https://sandbox.zenodo.org/record/", "useSplash": false, "orcidPath": "https://orcid.org/", "maxFileSizeInMB": 10 diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 9e0e2ed4e..97770fb97 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Login with Zenodo", "USE-DEFAULT": "Use Default Token" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG":{ "TITLE": "DMP is locked", "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 6f563ad38..ceca83d40 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Login with Zenodo", "USE-DEFAULT": "Use Default Token" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG":{ "TITLE": "DMP is locked", "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 1c1d11e2d..acb90f104 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Identificarse con Zenodo", "USE-DEFAULT": "Usar el token por defecto" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG":{ "TITLE": "PGD bloqeuado", "MESSAGE":"Alguien más está modificando el PGD. Si quiere modificarlo o visualizarlo, por favor, inténtelo más tarde." diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 9cf4eca81..9399e919e 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Σύνδεση με Zenodo", "USE-DEFAULT": "Χρήση Προκαθορισμένου Token" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG":{ "TITLE": "DMP is locked", "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." diff --git a/dmp-frontend/src/assets/i18n/hr.json b/dmp-frontend/src/assets/i18n/hr.json index 69b1ab7d2..9e8186572 100644 --- a/dmp-frontend/src/assets/i18n/hr.json +++ b/dmp-frontend/src/assets/i18n/hr.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Prijavite se pomoću Zenodo korisničkog računa", "USE-DEFAULT": "Koristite zadanu opciju" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG": { "TITLE": "PUP je zaključan", "MESSAGE": "U ovom trenutku netko drugi uređuje informacije o skupu podataka. Ako želite pregledati zapis ili napraviti izmjenu, pričekajte i pokušajte ponovo kasnije." diff --git a/dmp-frontend/src/assets/i18n/pl.json b/dmp-frontend/src/assets/i18n/pl.json index 4dba630af..824765d35 100644 --- a/dmp-frontend/src/assets/i18n/pl.json +++ b/dmp-frontend/src/assets/i18n/pl.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Zaloguj się za pomocą Zenodo", "USE-DEFAULT": "Użyj domyślnego tokena" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG": { "TITLE": "DMP jest zablokowany", "MESSAGE": "W tej chwili ktoś inny modyfikuje ten zbiór danych. Możesz przeglądać ten zbiór danych, ale nie możesz wprowadzać żadnych zmian. Jeśli chcesz go zmodyfikować, wróć później." diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 8123b7bca..5d9d81d68 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -808,6 +808,14 @@ "ZENODO-LOGIN": "Entre com o Zenodo", "USE-DEFAULT": "Use o Token" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG":{ "TITLE": "DMP is locked", "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 06032b3d8..2a2344c54 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Prihlásiť sa do Zenodo", "USE-DEFAULT": "Použite predvolený token" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG":{ "TITLE": "DMP is locked", "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index bd4751501..d06447a20 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Prijavite se pomoću Zenodo naloga", "USE-DEFAULT": "Koristite podrazumevani znak" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG":{ "TITLE": "DMP is locked", "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index a99da8a5b..d4d070c60 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -803,6 +803,14 @@ "ZENODO-LOGIN": "Zenodo ile oturum aç", "USE-DEFAULT": "Mevcut Jetonu Kullan" }, + "DEPOSIT": { + "ACCOUNT-LOGIN": "Which account would you like to use?", + "LOGIN": "Login with {{repository}}", + "NO-REPOSITORIES": "No publishing repositories", + "SELECT-REPOSITORIES": "Select repositories to deposit", + "AUTHORIZE": "Proceed to authorization", + "CANCEL": "Cancel" + }, "LOCKED-DIALOG":{ "TITLE": "DMP is locked", "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later."