From 92b60c7c90f45debd800c78f101d8acbb6eb21c2 Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Thu, 17 Jun 2021 12:52:01 +0300 Subject: [PATCH] DMP editor. Show popup dialog when dmp is locked. --- .../src/app/ui/dmp/editor/dmp-editor.component.ts | 8 ++++++++ dmp-frontend/src/assets/i18n/de.json | 4 ++++ dmp-frontend/src/assets/i18n/en.json | 4 ++++ dmp-frontend/src/assets/i18n/es.json | 4 ++++ dmp-frontend/src/assets/i18n/gr.json | 4 ++++ dmp-frontend/src/assets/i18n/pt.json | 4 ++++ dmp-frontend/src/assets/i18n/sk.json | 4 ++++ dmp-frontend/src/assets/i18n/sr.json | 4 ++++ dmp-frontend/src/assets/i18n/tr.json | 4 ++++ 9 files changed, 40 insertions(+) diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index ee448b199..9d5773803 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -54,6 +54,7 @@ import { DmpToDatasetDialogComponent } from '../dmp-to-dataset/dmp-to-dataset-di import { GrantEditorModel } from '@app/ui/grant/editor/grant-editor.model'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; import { HttpClient } from '@angular/common/http'; +import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; @Component({ selector: 'app-dmp-editor-component', @@ -188,6 +189,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC if(this.isUserMember()){ this.router.navigate(['plans', 'overview', itemId]); + return; } this.isFinalized = true; this.formGroup.disable(); @@ -234,6 +236,12 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC .subscribe(x => { this.formChanged(); }); + if(this.lockStatus){ + this.dialog.open(PopupNotificationDialogComponent,{data:{ + title:this.language.instant('DMP-EDITOR.LOCKED.TITLE'), + message:this.language.instant('DMP-EDITOR.LOCKED.MESSAGE') + }, maxWidth:'30em'}); + } }) }); } else if (publicId != null) { diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 92f4b2782..301b3c1f8 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -1052,6 +1052,10 @@ "CLONE": "Clone", "SAVE": "Save", "CANCEL": "Cancel" + }, + "LOCKED":{ + "TITLE":"DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. You may view the dataset but you cannot make any changes." } }, "DMP-PROFILE-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 89f72102c..3537f2ca6 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1052,6 +1052,10 @@ "CLONE": "Clone", "SAVE": "Save", "CANCEL": "Cancel" + }, + "LOCKED":{ + "TITLE":"DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. You may view the dataset but you cannot make any changes." } }, "DMP-PROFILE-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 2cd67fd39..ca04f9851 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1052,6 +1052,10 @@ "CLONE": "Clone", "SAVE": "Save", "CANCEL": "Cancel" + }, + "LOCKED":{ + "TITLE":"DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. You may view the dataset but you cannot make any changes." } }, "DMP-PROFILE-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index dacfc3373..5990361c2 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1052,6 +1052,10 @@ "CLONE": "Κλώνος", "SAVE": "Αποθήκευση", "CANCEL": "Ακύρωση" + }, + "LOCKED":{ + "TITLE":"DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. You may view the dataset but you cannot make any changes." } }, "DMP-PROFILE-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 0582afd99..2323a493d 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -1052,6 +1052,10 @@ "CLONE": "Duplicar", "SAVE": "Guardar", "CANCEL": "Cancelar" + }, + "LOCKED":{ + "TITLE":"DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. You may view the dataset but you cannot make any changes." } }, "DMP-PROFILE-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 26e3c91ec..1a0eed604 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -1052,6 +1052,10 @@ "CLONE": "Klonovať", "SAVE": "Uložiť", "CANCEL": "Zrušiť" + }, + "LOCKED":{ + "TITLE":"DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. You may view the dataset but you cannot make any changes." } }, "DMP-PROFILE-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index f1eb52e6e..9f12e3745 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -1052,6 +1052,10 @@ "CLONE": "Napravite kopiju", "SAVE": "Sačuvajte", "CANCEL": "Otkažite" + }, + "LOCKED":{ + "TITLE":"DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. You may view the dataset but you cannot make any changes." } }, "DMP-PROFILE-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 9fe836177..71fde2ca2 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -1052,6 +1052,10 @@ "CLONE": "Çoğalt", "SAVE": "Kaydet", "CANCEL": "İptal" + }, + "LOCKED":{ + "TITLE":"DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. You may view the dataset but you cannot make any changes." } }, "DMP-PROFILE-LISTING": {