From 166f0f7c371aa5ab1b0be2c3a65bcb6de007899e Mon Sep 17 00:00:00 2001 From: apapachristou Date: Wed, 7 Oct 2020 11:27:49 +0300 Subject: [PATCH 001/260] Fixes grammar of notification "Email was send!" (cherry picked from commit 2c57e77183d847322927950b0e931a2ad6aa94ea) --- dmp-frontend/src/assets/i18n/en.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 812944939..1e2f10afa 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -185,7 +185,7 @@ "REQUEST-EMAIL-HEADER": "We are almost done! Please fill your e-mail.", "REQUEST-EMAIL-TEXT": "You will need to confirm it to use the application.", "SUBMIT": "Submit", - "SENT-EMAIL-HEADER": "Email was send!", + "SENT-EMAIL-HEADER": "An email has been sent! Please check your inbox.", "EMAIL-FOUND": "Email is already confirmed" }, "HOME": { @@ -1535,4 +1535,4 @@ "DRAFT": "Draft", "FINALIZED": "Finalized" } -} \ No newline at end of file +} From d8562554055efb551c4206c046a5b7ac2fd686a2 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Wed, 7 Oct 2020 12:42:10 +0300 Subject: [PATCH 002/260] Fixes bug: after discard grant was not set to previous value --- .../src/app/ui/dmp/editor/dmp-editor.component.ts | 13 +++++++++++++ 1 file changed, 13 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 b9bbba867..7901b7ad4 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 @@ -51,6 +51,7 @@ import { CloneDialogComponent } from '../clone/clone-dialog/clone-dialog.compone import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard'; import { DatasetService } from '@app/core/services/dataset/dataset.service'; import { DmpToDatasetDialogComponent } from '../dmp-to-dataset/dmp-to-dataset-dialog.component'; +import { GrantEditorModel } from '@app/ui/grant/editor/grant-editor.model'; @Component({ selector: 'app-dmp-editor-component', @@ -826,7 +827,19 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.isDiscarded = true; this.hasChanges = false; if (!this.isNew) { + let grantControl; + if(this.formGroup.get('grant').get('existGrant')) { + grantControl = new GrantTabModel(); + grantControl.fromModel(this.formGroup.get('grant').get('existGrant').value); + } else { + grantControl = new GrantEditorModel(); + grantControl.fromModel(this.formGroup.get('grant').value); + } + grantControl.buildForm() + this.formGroup.patchValue(JSON.parse(JSON.stringify(this.formGroupRawValue))); + + this.formGroup.get('grant').get('existGrant').setValue(grantControl.existGrant); } else { this.formGroup.reset(); this.formGroup.get('extraProperties').get('visible').setValue(false); From 7cc584ac33ae51c3454fba14aea2a0b7bd0cb3f9 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Wed, 7 Oct 2020 13:14:19 +0300 Subject: [PATCH 003/260] Fixes spelling of variable name --- .../src/app/ui/dmp/editor/dmp-editor.component.ts | 6 +++++- .../upload-dialogue/dmp-upload-dialogue.component.ts | 1 - .../form-composite-field.component.html | 4 ++-- .../form-composite-field.component.scss | 11 ++++++++++- .../tableOfContentsMaterial/table-of-contents.ts | 4 ++-- 5 files changed, 19 insertions(+), 7 deletions(-) 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 7901b7ad4..e91c3cd46 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 @@ -839,7 +839,11 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.formGroup.patchValue(JSON.parse(JSON.stringify(this.formGroupRawValue))); - this.formGroup.get('grant').get('existGrant').setValue(grantControl.existGrant); + if(this.formGroup.get('grant').get('existGrant')) { + this.formGroup.get('grant').get('existGrant').setValue(grantControl.existGrant); + } else { + this.formGroup.get('grant').setValue(grantControl); + } } else { this.formGroup.reset(); this.formGroup.get('extraProperties').get('visible').setValue(false); diff --git a/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts index 5e2fc0157..7446e4e0d 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts @@ -62,7 +62,6 @@ export class DmpUploadDialogue { } selectFile(event) { - console.log(event) const fileList: FileList = event.addedFiles this.data.fileList = fileList; if (this.data.fileList.length > 0) { diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html index ca7f20f7d..ad40f0181 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html @@ -30,14 +30,14 @@
-
+
- - + +
From 71a270137a4d6bce1977a22e50856fa7f7551ad5 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Thu, 8 Oct 2020 23:27:47 +0300 Subject: [PATCH 012/260] Fixes flag image scale on contributors page (to be tested) --- .../ui/dmp/listing/dmp-listing.component.html | 1 - .../src/assets/splash/about/contributors.html | 30 +++++++++++++++---- dmp-frontend/src/assets/splash/css/styles.css | 20 +++++++++++-- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html index ebc2b9c65..bc63cd1bb 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html @@ -14,7 +14,6 @@

{{(isPublic ? 'GENERAL.TITLES.EXPLORE-PLANS' : 'GENERAL.TITLES.PLANS') | translate}}

-
- Flag of Greece +
+
+ Flag of Greece +
+

Athena Research & Innovation Center

Dimitra Aglamisi, Elli Papadopoulou

- Flag of Spain +
+
+ Flag of Spain +
+

Consorcio Madroño

Lanko López, Juan Corrales Correyero, Fernando González Ballesteros

- Flag of Turkey +
+
+ Flag of Turkey +
+

Turkish Higher Education Council Research Data and Open Data working group

- Flag of Austria +
+
+ Flag of Austria +
+

UNIVERSITY OF VIENNA

Gerda McNeill, Raman Ganguly, Mihaela Hubert

- Flag of Slovakia +
+
+ Flag of Slovakia +
+

SLOVAK CENTRE FOR SCIENTIFIC AND TECHNICAL INFORMATION

Silvia Horáková, Richard Rac, Iryna Kuchma

diff --git a/dmp-frontend/src/assets/splash/css/styles.css b/dmp-frontend/src/assets/splash/css/styles.css index 1d9df2a13..345f8aaf1 100644 --- a/dmp-frontend/src/assets/splash/css/styles.css +++ b/dmp-frontend/src/assets/splash/css/styles.css @@ -331,7 +331,12 @@ hr { } .card-img { - transform: scale(0.5); + width: 100%; + height: auto; + /* -webkit-transform: scale(0.45); + -moz-transform: scale(0.45); + -o-transform: scale(0.45); + transform: scale(0.45); */ } .card-body { @@ -354,12 +359,21 @@ hr { opacity: 0.6; } +.flag-img-container { + width: 6.8rem; +} + .flag { - border: 10px solid #EEEEEE; + border: 5px solid #EEEEEE; border-radius: 50% !important; padding-right: 0px !important; padding-left: 0px !important; - transform: scale(0.45); + width: 100%; + height: auto; + /* -webkit-transform: scale(0.45); + -moz-transform: scale(0.45); + -o-transform: scale(0.45); + transform: scale(0.45); */ } .ext-link-icon { From 02c36c1f610085babb5db60f39480967ed7d953d Mon Sep 17 00:00:00 2001 From: apapachristou Date: Fri, 9 Oct 2020 11:21:14 +0300 Subject: [PATCH 013/260] Fixes bug of actions menu on dataset cards on public listings --- .../recent-edited-dataset-activity.component.html | 2 +- .../listing/listing-item/dataset-listing-item.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html index a8558e75d..311a09f2a 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html @@ -49,7 +49,7 @@ diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html index 72ec41e3c..afc0ae8db 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html @@ -26,7 +26,7 @@ From 4c3775232a840219428aaece3a31bd7ed44b829b Mon Sep 17 00:00:00 2001 From: apapachristou Date: Fri, 9 Oct 2020 13:04:38 +0300 Subject: [PATCH 014/260] Adds everywhere snackbar on download rda json failure --- .../recent-edited-activity.component.ts | 10 +++++++++- .../recent-edited-dmp-activity.component.ts | 10 +++++++++- .../src/app/ui/dmp/editor/dmp-editor.component.ts | 10 +++++++++- .../listing/listing-item/dmp-listing-item.component.ts | 10 +++++++++- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 66347e8a3..80ae76eef 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -448,7 +448,15 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn const blob = new Blob([response.body], { type: 'application/json' }); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); - }) + }, async error => { + this.onExportCallbackError(error); + }); + } + + async onExportCallbackError(error: any) { + const errorJsonText = await error.error.text(); + const errorObj = JSON.parse(errorJsonText); + this.uiNotificationService.snackBarNotification(errorObj.message, SnackBarNotificationLevel.Error); } downloadPDF(dataset: DatasetListingModel): void { diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts index dba7a0808..e3725dfd8 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts @@ -394,7 +394,15 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O const blob = new Blob([response.body], { type: 'application/json' }); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); - }) + }, async error => { + this.onExportCallbackError(error); + }); + } + + async onExportCallbackError(error: any) { + const errorJsonText = await error.error.text(); + const errorObj = JSON.parse(errorJsonText); + this.uiNotificationService.snackBarNotification(errorObj.message, SnackBarNotificationLevel.Error); } getFilenameFromContentDispositionHeader(header: string): string { 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 e91c3cd46..1a9925591 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 @@ -662,7 +662,15 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC const blob = new Blob([response.body], { type: 'application/json' }); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); - }) + }, async error => { + this.onExportCallbackError(error); + }); + } + + async onExportCallbackError(error: any) { + const errorJsonText = await error.error.text(); + const errorObj = JSON.parse(errorJsonText); + this.uiNotificationService.snackBarNotification(errorObj.message, SnackBarNotificationLevel.Error); } getFilenameFromContentDispositionHeader(header: string): string { diff --git a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts index a7e5d9522..46c2d3a0c 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts @@ -252,7 +252,15 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit { const blob = new Blob([response.body], { type: 'application/json' }); const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); FileSaver.saveAs(blob, filename); - }) + }, async error => { + this.onExportCallbackError(error); + }); + } + + async onExportCallbackError(error: any) { + const errorJsonText = await error.error.text(); + const errorObj = JSON.parse(errorJsonText); + this.uiNotificationService.snackBarNotification(errorObj.message, SnackBarNotificationLevel.Error); } getFilenameFromContentDispositionHeader(header: string): string { From f71f9b07e0aa9b2d33f8ca56c626affea63f7e73 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Fri, 9 Oct 2020 15:20:34 +0300 Subject: [PATCH 015/260] gr language update --- dmp-frontend/src/assets/i18n/gr.json | 360 +++++++++++++-------------- 1 file changed, 180 insertions(+), 180 deletions(-) diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 460cfb65a..01db4219d 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -24,7 +24,7 @@ "SUCCESSFUL-DELETE": "Επιτυχής διαγραφή", "UNSUCCESSFUL-DELETE": "Αποτυχημένη διαγραφή", "UNSUCCESSFUL-EMAIL-SEND": "Αποτυχία αποστολής email", - "UNSUCCESSFUL-REMOVE-TEMPLATE": "Failed to remove template, one or more datasets of this DMP use this template" + "UNSUCCESSFUL-REMOVE-TEMPLATE": "Αποτυχία αφαίρεσης του template, ένα ή παραπάνω σύνολα δεδομένων του συγκρεκριμένου Σχεδίου Διαχείρισης Δεδομένωνω χρησιμοποιούν αυτό το template" }, "ERRORS": { "HTTP-REQUEST-ERROR": "Παρουσιάστηκε μη αναμενόμενο σφάλμα" @@ -78,44 +78,44 @@ } }, "START-NEW-DMP-DIALOG": { - "IMPORT": "Import", - "FUNCTION-SUPPORTS": "function supports", + "IMPORT": "Εισαγωγή", + "FUNCTION-SUPPORTS": "η λειτουργία υποστηρίζει", "JSON-FILES": ".json files", - "PRODUCED": "produced", - "RDA-SPECIFICATIONS": "according to RDA specifications", - "MACHINE-ACTIONABLE": "for machine-actionable DMPs", - "UPLOAD-FILE": "Upload File" + "PRODUCED": "που έχουν παραχθεί", + "RDA-SPECIFICATIONS": "σύμφωνα με τις προδιαγραφές του RDA", + "MACHINE-ACTIONABLE": "για μηχαναγνώσιμα Σχέδια Διαχείρισης Δεδομένων", + "UPLOAD-FILE": "Μεταφόρτωση Αρχείου" }, "INVITATION-DIALOG": { - "HINT": "Press comma or enter between authors", - "SUCCESS": "Invitation successfully sent", - "ERROR": "Invitation sent failed" + "HINT": "Προσθέστε κόμμα ή πατήστε το κουμπί “enter” ανάμεσα στους συγγραφείς", + "SUCCESS": "Η πρόσκληση στάλθηκε επιτυχώς", + "ERROR": "Η πρόσκληση δε στάλθηκε" }, "DMP-TO-DATASET-DIALOG": { - "FROM-DMP": "You have successfully created your", - "DMP": "DMP", - "TO-DATASET": "You will be transferred to the", - "DATASET": "Dataset", - "EDITOR": "editor", - "START": "let's start" + "FROM-DMP": "Δημιουργήσατε με επιτυχία το Σχέδιο Διαχείρισης Δεδομένων σας", + "DMP": "Σχέδιο Διαχείρισης Δεδομένων", + "TO-DATASET": "Θα μεταφερθείτε στο", + "DATASET": "Σύνολο Δεδομένων", + "EDITOR": "Συντάκτης", + "START": "Ας ξεκινήσουμε" }, "ACTIONS": { "VIEW-ALL": "Προβολή όλων", "SHOW-MORE": "Δείτε περισσότερα", - "LOAD-MORE": "Load more", + "LOAD-MORE": "Φορτώστε περισσότερα", "SHOW-LESS": "Δείτε λιγότερα", "LOG-IN": "Σύνδεση", - "TAKE-A-TOUR": "Do you need help? Take a tour.." + "TAKE-A-TOUR": "Χρειάζεστε βοήθεια; Περιηγηθείτε.." }, "PREPOSITIONS": { - "OF": "of" + "OF": "του" }, "TITLES": { "PREFIX": "Ανοίξτε το Σχέδιο Διαχείρισης Δεδομένων - ", "GENERAL": "Δημιουργός Σχεδίου Διαχείρισης Δεδομένων", "ABOUT": "Σχετικά", "PRIVACY": "Πολιτική Απορρήτου και Προστασίας Προσωπικών Δεδομένων", - "OPENSOURCE-LICENCES": "Opensource Licences", + "OPENSOURCE-LICENCES": "Άδειες Ανοικτού Λογισμικού ", "TERMS": "Όροι χρήσης", "COOKIES-POLICY": "Cookies Policy", "PLANS": "Τα Σχέδια Διαχείρισης Δεδομένων Μου", @@ -155,7 +155,7 @@ "LANGUAGE-EDITOR": "Επεξεργασία γλώσσας", "GUIDE-EDITOR": "Επεξεργασία Οδηγού Χρήσης", "LANGUAGE": "Γλώσσα", - "SIGN-IN": "Sign in to account" + "SIGN-IN": "Σύνδεση στο λογαριασμό" }, "FILE-TYPES": { "PDF": "PDF", @@ -222,9 +222,9 @@ "DMP-TEMPLATES": "TEMPLATES ΣΧΕΔΙΩΝ ΔΙΑΧΕΙΡΙΣΗΣ ΔΕΔΟΜΕΝΩΝ", "USERS-BREADCRUMB": "ΧΡΗΣΤΕΣ", "START-NEW-DMP": "Ξεκινήστε νέο DMP", - "START-NEW-DMP-TXT": "A special Wizard is made to help you create your DMP easily. It has a step by step guide with all the needed information to create a DMP easily.", + "START-NEW-DMP-TXT": "Ένας ειδικός wizard δημιουργήθηκε για να σας βοηθήσει να συντάξετε το δικό σας Σχέδιο Διαχείρισης Δεδομένων εύκολα. Παρέχει έναν βήμα προς βήμα οδηγό περιλαμβάνοντας όλες τις απαραίτητες πληροφορίες για να δημιουργήσετε ένα Σχέδιο Διαχείρισης Δεδομένων εύκολα.", "START-WIZARD": "Ξεκινήστε τον wizard", - "IMPORT-FROM-FILE": "Import from file", + "IMPORT-FROM-FILE": "Εισαγωγή από το φάκελο", "SEARCH": { "DATASET": "Περιγραφή Συνόλου Δεδομένων", "DMP": "Σχέδιο Διαχείρισης Δεδομένων", @@ -364,11 +364,11 @@ "FIELD-RADIO-BOX-VALUE": "Τιμή", "FIELD-AUTOCOMPLETE-TITLE": "Αυτόματη Συμπλήρωση Δεδομένων", "FIELD-AUTOCOMPLETE-PLACEHOLDER": "Τοποθέτηση placeholder", - "FIELD-AUTOCOMPLETE-SOURCE-TITLE": "Sources", - "FIELD-AUTOCOMPLETE-ADD_SOURCE": "Add Source", - "FIELD-AUTOCOMPLETE-TYPE": "Source Type", - "FIELD-AUTOCOMPLETE-TYPE-UNCACHED": "Uncached", - "FIELD-AUTOCOMPLETE-TYPE-CACHED": "Cached", + "FIELD-AUTOCOMPLETE-SOURCE-TITLE": "Πηγές", + "FIELD-AUTOCOMPLETE-ADD_SOURCE": "Προσθήκη Πηγής", + "FIELD-AUTOCOMPLETE-TYPE": "Τύπος Πηγής", + "FIELD-AUTOCOMPLETE-TYPE-UNCACHED": "Προσωρινά Αποθηκευμένα", + "FIELD-AUTOCOMPLETE-TYPE-CACHED": "Μη αποθηκευμένα", "FIELD-AUTOCOMPLETE-LABEL": "Ετικέτα", "FIELD-AUTOCOMPLETE-VALUE": "Τιμή", "FIELD-AUTOCOMPLETE-SOURCE": "Πηγή", @@ -379,7 +379,7 @@ "FIELD-DATE-PICKER-LABEL": "Ετικέτα", "FIELD-DATE-PICKER-VALUE": "Τιμή", "FIELD-MULTIPLE-AUTOCOMPLETE": "Πολλαπλή Αυτόματη Συμπλήρωση", - "FIELD-MULTIPLE-WORDLIST": "Multiple Selection" + "FIELD-MULTIPLE-WORDLIST": "Πολλαπλή Επιλογή" }, "DEFAULT-VALUES": { "NONE": "Κανένα", @@ -415,7 +415,7 @@ "DELETE": "Διαγραφή", "ADD-PAGE": "Προσθήκη Σελίδας +", "ADD-SECTION": "Προσθήκη Ενότητας +", - "VALIDATE": "Validate" + "VALIDATE": "Επιβεβαίωση" } }, "GRANT-LISTING": { @@ -426,22 +426,22 @@ } }, "DMP-LISTING": { - "DMP": "DMP", - "GRANT": "Grant", + "DMP": "Σχέδιο Διαχείρισης Δεδομένων", + "GRANT": "Επιχορήγηση", "TITLE": "Σχέδια Διαχείρισης Δεδομένων", "OWNER": "Κάτοχος", "MEMBER": "Μέλος", "CREATOR": "Συντάκτης", "EDITED": "Επεξεργάστηκε", - "FINALIZED": "Finalized", - "PUBLISHED": "Published", + "FINALIZED": "Οριστικοποιημένο", + "PUBLISHED": "Δημοσιευμένο", "VERSION": "Έκδοση", "CONTAINED-DATASETS": "Δεδομένα που συμπεριλαμβάνει", - "TEXT-INFO": "Information in a DMP show how datasets have been collected and/or generated, how they have been processed and analysed, i.e. using which tools, standards, methodologies etc, but also where and how datasets are backed up, published and preserved, including any costs associated with personnel dedicated for data curation/ stewardship activities or costs for acquiring or building data management services. Not sure how a DMP looks in practice? Browse Public DMPs and LIBER community in Zenodo to get an idea!", - "TEXT-INFO-QUESTION": "Not sure how a DMP looks in practice? Browse Public DMPs and", - "LINK-ZENODO": "LIBER community in Zenodo", - "GET-IDEA": "to get an idea!", - "SORT-BY": "Sort by", + "TEXT-INFO": "Οι πληροφορίες σε ένα Σχέδιο Διαχείρισης Δεδομένων δείχνουν πως έχουν συλλεχθεί ή και/παραχθεί, επεξεργαστεί και αναλυθεί τα σύνολα δεδομένων, π.χ. ποια εργαλεία, πρότυπα, μεθοδολογίες κλπ χρησιμοποιήθηκαν, που και πως δημιουργήθηκαν αντίγραφα ασφαλείας, δημοσιεύτηκαν και διατηρήθηκαν τα σύνολα δεδομένων. Περιλαμβάνουν οποιαδήποτε κόστη σχετίζονται με το προσωπικό που ασχολείται με την επιμέλεια δεδομένων ή τα κόστη για την απόκτηση ή ανάπτυξη υπηρεσιών διαχείρισης δεδομένων. Δεν είστε σίγουροι πως φαίνεται ένα Σχέδιο Διαχείρισης Δεδομένων στην πράξη; Εξερευνήστε τα Δημόσια Σχέδια Διαχείρισης Δεδομένων και την κοινότητα του LIBER στο Zenodo για να πάρετε μια ιδέα!", + "TEXT-INFO-QUESTION": " Εξερευνήστε τα Δημόσια Σχέδια Διαχείρισης Δεδομένων και", + "LINK-ZENODO": "την κοινότητα του LIBER στο Zenodo", + "GET-IDEA": "για να πάρετε μια ιδέα!", + "SORT-BY": "Ταξίνομηση κατά", "COLUMNS": { "NAME": "Τίτλος", "GRANT": "Επιχορήγηση", @@ -452,7 +452,7 @@ "ACTIONS": "Δράσεις", "DATASETS": "Περιγραφές Δεδομένων", "STATUS": "Κατάσταση", - "PEOPLE": "ʼνθρωποι", + "PEOPLE": "Άνθρωποι", "VERSION": "Έκδοση" }, "ACTIONS": { @@ -496,7 +496,7 @@ "TEMPLATES-INVOLVED": "Εμπλεκόμενα Templates Περιγραφών Συνόλων Δεδομένων" }, "VIEW-ALL-VERSIONS": "Όλες οι εκδόσεις", - "EMPTY-LIST": "Nothing here yet." + "EMPTY-LIST": "Δεν υπάρχει τίποτα ακόμα εδώ." }, "DMP-PUBLIC-LISTING": { "TITLE": "Δημοσιευμένα Σχέδια Διαχείρισης Δεδομένων", @@ -509,7 +509,7 @@ "INVOLVED-DATASETS": "Εμπλεκόμενες Περιγραφές Συνόλων Δεδομένων", "TEMPLATES-INVOLVED": "Εμπλεκόμενα Templates Περιγραφών Συνόλων Δεδομένων" }, - "EMPTY-LIST": "Nothing here yet." + "EMPTY-LIST": "Δεν υπάρχει τίποτα ακόμα εδώ." }, "DMP-UPLOAD": { "TITLE": "Εισαγωγή Σχεδίου Διαχείρισης Δεδομένων", @@ -517,7 +517,7 @@ "UPLOAD-SUCCESS": "Επιτυχής Εισαγωγή", "ACTIONS": { "IMPORT": "Εισαγωγή", - "CANCEL": "Ακυρωση" + "CANCEL": "Ακύρωση" }, "PLACEHOLDER": "Τίτλος Σχεδίου Διαχείρισης Δεδομένων" }, @@ -553,8 +553,8 @@ "GO-TO-GRANT": "Μετάβαση σε Περιγραφή Συνόλου Δεδομένων της Επιχορήγησης", "GO-TO-DMP": "Μετάβαση σε Περιγραφή Συνόλου Δεδομένων του Σχεδίου Διαχείρισης Δεδομένων", "SAVE": "Save", - "SAVE-AND-ADD": "Save & Add New", - "SAVE-AND-CLOSE": "Save & Close", + "SAVE-AND-ADD": "Αποθήκευση & Προσθήκη Νέου", + "SAVE-AND-CLOSE": " Αποθήκευση & Κλείσμο", "SAVE-AND-FINALISE": "Αποθήκευση και Οριστικοποίηση", "FINALIZE": "Οριστικοποίηση", "REVERSE": "Αναίρεση Οριστικοποίησης", @@ -585,7 +585,7 @@ }, "COPY": "Αντιγραφή", "CANCEL": "Ακύρωση", - "NEXT": "Next", + "NEXT": "Επόμενο", "ERROR-MESSAGE": "Αυτο το Template Περιγραφής Συνόλου Δεδομένων δεν περιέχεται" } }, @@ -611,12 +611,12 @@ "FORBIDEN-DMP": "Δεν επιτρέπεται η πρόσβαση σε αυτό το Σχέδιο Διαχείρισης Δεδομένων" }, "MULTIPLE-DIALOG": { - "ZENODO-LOGIN": "Login with Zenodo", - "USE-DEFAULT": "Use Default Token" + "ZENODO-LOGIN": "Σύνδεση με Zenodo", + "USE-DEFAULT": "Χρήση Προκαθορισμένου Token" } }, "DATASET-OVERVIEW": { - "DATASET-AUTHORS": "Συγγραφείς περιγραφής δεδομένων", + "DATASET-AUTHORS": "Συγγραφείς περιγραφής συνόλου δεδομένων", "ERROR": { "DELETED-DATASET": "H επιλεγμένη Περιγραφή Δεδομένων θα διαγραφεί", "FORBIDEN-DATASET": "Δεν επιτρέπεται η πρόσβαση σε αυτή την Περιγραφή Δεδομένων" @@ -627,10 +627,10 @@ "DATASET-DESCRIPTION": "Περιγραφή Δεδομένων", "SELECT-DATASETS-TO-CLONE": "Επιλογή των συνόλων δεδομένων που θα συμπεριληφθούν στο νέο Σχέδιο Διαχείρισης Δεδομένων. Τα επιλεγμένα σύνολα δεδομένα θα είναι επεξεργάσιμα.", "SELECT-DATASETS-NONE": "Μη διαθέσιμες Περιγραφές Συνόλου Δεδομένων για αυτό το Σχέδιο Διαχείρισης Δεδομένων", - "TEXT-INFO": "Datasets are documented following pre-defined templates which set the content of dataset descriptions. In Argos, a DMP can contain as many dataset descriptions as the datasets it documents. Browse ", - "TEXT-INFO-REST": " for a look at datasets described in Argos DMPs", - "LINK-PUBLIC-DATASETS": "Public Dataset Descriptions", - "TEXT-INFO-PAR": "New datasets can be added to existing DMPs at any time and be described with more than one template. Dataset descriptions can also be cloned and re-used in other DMPs as well as be deleted without negatively affecting the DMP as a whole.", + "TEXT-INFO": "Τα σύνολα δεδομένων τεκμηριώνονται ακολουθώντας προκαθορισμένα templates τα οποία θέτουν το περιεχόμενο των περιγραφών συνόλων δεδομένων. Στο Argos, ένα Σχέδιο Διαχείρισης Δεδομένων μπορεί να περιλαμβάνει τόσες περιγραφές συνόλου δεδομένων όσα και τα σύνολα δεδομένων που τεκμηριώνει. Περιηγηθείτε ", + "TEXT-INFO-REST": " για μια ματιά στα σύνολα δεδομένων που περιγράφονται στα Σχέδια Διαχείρισης Δεδομένων του Argos", + "LINK-PUBLIC-DATASETS": "Δημόσιες Περιγραφές Συνόλων Δεδομένων", + "TEXT-INFO-PAR": "Νέα σύνολα δεδομένων μπορούν να προστεθούν σε ήδη υπάρχοντα Σχέδια Διαχείρισης Δεδομένων οποιαδήποτε στιγμή και να περιγραφούν με περισσότερα από ένα template. Οι περιγραφές συνόλων δεδομένων μπορούν επίσης να κλωνοποιηθούν και να επαναχρησιμοποιηθούν σε άλλα Σχέδια Διαχείρισης Δεδομένων αλλά και να διαγραφούν χωρίς να επηρεάσουν το σύνολο του Σχεδίου Διαχείρισης Δεδομένων.", "COLUMNS": { "NAME": "Τίτλος", "REFERNCE": "Αναφορά", @@ -659,10 +659,10 @@ "INVITE-COLLABORATORS": "Προσκάλεσε συνεργάτες" }, "STATES": { - "EDITED": "Edited", - "PUBLIC": "Public", - "FINALIZED": "Finalized", - "PUBLISHED": "Published" + "EDITED": "Σε επεξεργασία", + "PUBLIC": "Δημόσια", + "FINALIZED": "Οριστικοποιημένα", + "PUBLISHED": "Δημόσια" }, "TOOLTIP": { "DATASET-STATUS": { @@ -673,11 +673,11 @@ "GRANT": "Επιχορήγηση", "TEMPLATES-INVOLVED": "Template Περιγραφής Συνόλου Δεδομένων", "VERSION": "Έκδοση Σχεδίου Διαχείρισης Δεδομένων", - "PART-OF": "Part of", - "TO-DMP": "To DMP", - "DMP-FOR": "DMP for" + "PART-OF": "Μέρος του", + "TO-DMP": "Σε Σχέδιο Διαχείρισης Δεδομένων", + "DMP-FOR": " Σχέδιο Διαχείρισης Δεδομένων για" }, - "EMPTY-LIST": "Nothing here yet." + "EMPTY-LIST": "Τίποτα ακόμα εδώ." }, "DATASET-PUBLIC-LISTING": { "TITLE": "Δημοσιευμένες Περιγραφές Συνόλων Δεδομένων", @@ -791,49 +791,49 @@ "TITLE": { "NEW": "Νέα Σχέδιο Διαχείρισης Δεδομένων", "EDIT": "Επεξεργασία", - "EDIT-DMP": "Editing DMP", - "ADD-DATASET": "Adding dataset", - "EDIT-DATASET": "Editing Dataset", - "CLONE-DMP": "Clone", - "NEW-VERSION": "New Version", - "CREATE-DATASET": "Creating Dataset", + "EDIT-DMP": "Σχέδιο Διαχείρισης Δεδομένων σε επεξεργασία", + "ADD-DATASET": "Προσθήκη Συνόλου Δεδομένων", + "EDIT-DATASET": "Σύνολο Δεδομένων σε επεξεργασία", + "CLONE-DMP": "Κλώνος", + "NEW-VERSION": "Νέα Έκδοση", + "CREATE-DATASET": "Δημιουργία Συνόλου Δεδομένων", "SUBTITLE": "Μονοσήμαντο Αναγνωριστικό Ψηφιακού Αντικειμένου (DOI)" }, "FIELDS": { "NAME": "Τίτλος", "RELATED-GRANT": "Σχετική Επιχορήγηση", "DESCRIPTION": "Περιγραφή", - "DESCRIPTION-HINT": "Briefly describe the context and purpose of the DMP", + "DESCRIPTION-HINT": "Περιγράψτε εν συντομία το περιεχόμενο και το σκοπό του Σχεδίου Διαχείρισης Δεδομένων", "ORGANISATIONS": "Οργανισμοί", "ORGANISATIONS-HINT": "Προσθήκη ονομάτων των οργανισμών που συνεισφέρουν στη δημιουργία και αναθεώρηση των Σχεδίων Διαχείρισης Δεδομένων", "RESEARCHERS": "Ερευνητές", - "RESEARCHERS-HINT": "Add here the names of people that have produced, processed, analysed the data described in the DMP. ", - "AUTHORS": "Authors", + "RESEARCHERS-HINT": "Προσθέστε εδώ τα ονόματα των ατόμων που έχουν παράξει, επεξεργαστεί και αναλύσει δεδομένα που περιγράφονται μέσα στο Σχέδιο Διαχείρισης Δεδομένων. ", + "AUTHORS": "Συγγραφείς", "TEMPLATES": "Templates", "TEMPLATE": "Template Σχεδίου Διαχείρισης Δεδομένων", "DATASET-TEMPLATES": "Σχετικά Templates Περιγραφής Συνόλου Δεδομένων", - "SELECT-TEMPLATE": "Select a template to describe your dataset", + "SELECT-TEMPLATE": "Επιλέξτε ένα template για να περιγράψετε το σύνολο δεδομένων σας", "PROFILE": "Template Σχεδίου Διαχείρισης Δεδομένων", "PROJECT": "Έργο", "GRANT": "Επιχορήγηση", - "GRANTS": "Grants", - "GRANTS-HINT": "Find the grant of your research or add new", + "GRANTS": "Επιχορηγήσεις", + "GRANTS-HINT": "Βρείτε την επιχορήγηση της έρευνας σας ή προσθέστε νέα", "FUNDER": "Χορηγός", - "FUNDER-HINT": "Select a funder of your research or add new", - "FUNDING-ORGANIZATIONS": "Funding organizations", - "PROJECT-HINT": "This field is to be completed only for projects where multiple grants apply.", + "FUNDER-HINT": "Επιλέξτε έναν χρηματοδότη της έρευνας σας ή προσθέστε νέο", + "FUNDING-ORGANIZATIONS": "Χρημαδοτικοί οργανισμοί", + "PROJECT-HINT": "Αυτό το πεδίο συμπληρώνεται μόνο για έργα όπου ισχύουν πολλαπλές επιχοροηγήσεις.", "STATUS": "Κατάσταση Σχεδίου Διαχείρισης Δεδομένων", "EXTERNAL-SOURCE-HINT": "Κατάλογος των τιμών που παρέχονται από εξωτερικές πηγές", "COLLABORATORS": "Συνεργάτες", - "LANGUAGE": "Language", - "LANGUAGE-HINT": "Select the language of your DMP", - "LICENSE": "License", - "VISIBILITY": "Visibility", - "VISIBILITY-HINT": "Choose how the DMP is displayed in Argos. By choosing Public, the DMP is automatically made available to all users from the “Public DMPs” collection.", - "PUBLICATION": "Publication Date", - "CONTACT": "Contact", - "COST": "Costs", - "DATASETS": "Datasets" + "LANGUAGE": "Γλώσσα", + "LANGUAGE-HINT": "Επιλέξτε τη γλώσσα του Σχεδίου Διαχείρισης Δεδομένων σας", + "LICENSE": "Άδεια", + "VISIBILITY": "Ορατότητα", + "VISIBILITY-HINT": "Επιλέξτε πως θα εμφανίζρται το Σχέδιο Διαχείρισης Δεδομένων στο Argos. Με την επιλογή «Δημόσιο», το Σχέδιο Διαχείρισης Δεδομένων γίνεται αυτόματα διαθέσιμο σε όλους τους χρήστες της συλλογής «Δημόσια Σχέδια Διαχείρισης Δεδομένων».", + "PUBLICATION": "Ημερομηνία Δημοσιοποίησης", + "CONTACT": "Επικοινωνία", + "COST": "Δαπάνες", + "DATASETS": "Σύνολα Δεδομένων" }, "ACTIONS": { "GO-TO-GRANT": "Μεταβείτε στην Επιχορήγηση Σχεδίου Διαχείρισης Δεδομένων", @@ -842,19 +842,19 @@ "SAVE": "Αποθήκευση", "CANCEL": "Ακύρωση", "DELETE": "Διαγραφή", - "DELETE-DATASET": "Delete Dataset", - "DISCARD": "Discard", + "DELETE-DATASET": "Διαγραφή Συνόλου Δεδομένων", + "DISCARD": "Απόρριψη", "FINALISE": "Οριστικοποίηση", "LOCK": "Κλειδωμένο Σχέδιο Διαχείρισης Δεδομένων", "PERMISSION": "Δεν έχετε άδεια να επεξεργαστείτε αυτό το Σχέδιο Διαχείρισης Δεδομένων", - "INSERT-MANUALLY": "Insert it manually", - "CREATE-DATASET": "Create new one" + "INSERT-MANUALLY": "Εισάγετε το χειροκίνητα", + "CREATE-DATASET": "Δημιούργια νέου" }, "PLACEHOLDER": { - "DESCRIPTION": "Fill with description", - "ORGANIZATION": "Select organization", - "AUTHORS": "Select authors", - "RESEARCHERS": "Select researchers" + "DESCRIPTION": "Συμπληρώστε με περιγραφή", + "ORGANIZATION": "Επιλέξτε Οργανισμό", + "AUTHORS": "Επιλέξτε συγγραφείς", + "RESEARCHERS": "Επιλέξτε ερευνητές" }, "SNACK-BAR": { "UNSUCCESSFUL-DOI": "Αποτυχία δημιουργίας Μονοσήμαντων Αναγνωριστικών Ψηφιακών Αντικειμένων (DOI)", @@ -867,48 +867,48 @@ "OK": "OK" }, "VISIBILITY": { - "PUBLIC": "Public", - "RESTRICTED": "Restricted" + "PUBLIC": "Δημόσια", + "RESTRICTED": "Περιορισμένο" }, "STEPPER": { - "USER-GUIDE": "Guide steps", - "MAIN-INFO": "Main info", - "FUNDING-INFO": "Funding info", - "DATASET-SELECTION": "Dataset selection", - "DATASET-INFO": "Dataset info", - "LICENSE-INFO": "License info", - "DATASET": "Dataset", - "PREVIOUS": "Previous", - "NEXT": "Next" + "USER-GUIDE": "΄Βήματα Οδηγού", + "MAIN-INFO": "Κύριες Πληροφορίες", + "FUNDING-INFO": "Πληροφορίες Χρηματοδότησης", + "DATASET-SELECTION": "Επιλογή Συνόλου Δεδομένων", + "DATASET-INFO": "Πληροφορίες Συνόλου Δεδομένων", + "LICENSE-INFO": "Πληροφορίες Άδειας", + "DATASET": "Σύνολο Δεδομένων", + "PREVIOUS": "Προηγούμενο", + "NEXT": "Επόμενο" }, "MAIN-INFO": { - "INTRO": "A DMP in Argos consists of key information about research, such as purpose, objectives and researchers involved, but also about documentation of research datasets, namely dataset descriptions, that highlight the steps followed and the means used across data management activities.", - "HINT": "A brief description of what the DMP is about, it’s scope and objectives.", - "TYPING": "Type more letters of the name so its more possible to find the correct one." + "INTRO": "Ένα Σχέδιο Διαχείρισης στο Argos αποτελείται από τις βασικές πληροφορίες σχετικά με την έρευνα, όπως ο σκοπός, οι στόχοι και οι εμπλεκόμενοι ερευνητές, αλλά και σχετικά με την τεκμηρίωση των ερευνητικών συνόλων δεδομένων, δηλαδή τις περιγραφές δεδομένων που υπογραμμίζουν τα βήματα που ακολουθήθηκαν και τα μέσα που χρησιμοποιήθηκαν σε όλες τις δραστηριότητες διαχείρισης δεδομένων.", + "HINT": "Μία σύντομη περιγραφή του τι αφορά το Σχέδιο Διαχείρισης Δεδομένων, του πεδίου εφαρμογής και των στόχων του.", + "TYPING": "Προσθέστε περισσότερα γράμματα στο όνομα ώστε να είναι πιο πιθανό να βρείτε το σωστό." }, "FUNDING-INFO": { - "INTRO": "A Data Management Plan (DMP) consist of your Data Management Plans closer to where they are generated, analysed and stored. argos is an open, extensible, collaborative tool supporting Open and FAIR Data Management Plans.", - "FIND": "Couldn't find the correct one?" + "INTRO": "Ένα Σχέδιο Διαχείρισης Δεδομένων αποτελείται από τα Σχέδια Διαχείρισης Δεδομένων σας πιο κοντά στο που έχουν παραχθεί, αναλυθεί και αποθηκευτεί. Το Argos είναι ένα ανοικτό, επεκτάσιμο και συνεργατικό εργαλείο που υποστηρίζει τα Ανοικτά και FAIR Σχέδια Διαχείρισης Δεδομένων.", + "FIND": "Δεν μπορέσατε να βρείτε το σωστό;" }, "DATASET-INFO": { - "INTRO": "A DMP in Argos consists of key information about research, such as purpose, objectives and researchers involved, but also about documentation of research datasets, namely dataset descriptions, that highlight the steps followed and the means used across data management activities.", - "SECOND-INTRO": "Datasets are documented following pre-defined templates which set the content of dataset descriptions. In Argos, a DMP can contain as many dataset descriptions as the datasets it documents.", - "FIND": "Couldn't find a suitable one?", - "HINT": "Select a template to describe your datasets. You may select more than one template." + "INTRO": "Ένα Σχέδιο Διαχείρισης στο Argos αποτελείται από τις βασικές πληροφορίες σχετικά με την έρευνα, όπως ο σκοπός, οι στόχοι και οι εμπλεκόμενοι ερευνητές, αλλά και σχετικά με την τεκμηρίωση των ερευνητικών συνόλων δεδομένων, δηλαδή τις περιγραφές δεδομένων που υπογραμμίζουν τα βήματα που ακολουθήθηκαν και τα μέσα που χρησιμοποιήθηκαν σε όλες τις δραστηριότητες διαχείρισης δεδομένων.", + "SECOND-INTRO": "Τα σύνολα δεδομένων τεκμηριώνονται ακολουθώντας προκαθορισμένα templates τα οποία θέτουν το περιεχόμενο των περιγραφών συνόλου δεδομένων. Στο Argos, ένα Σχέδιο Διαχείρισης Δεδομένων μπορεί να περιλαμβάνει τόσες περιγραφές συνόλου δεδομένων όσα και τα σύνολα δεδομένων που τεκμηριώνει.", + "FIND": "Δεν μπορέσατε να βρείτε το σωστό;", + "HINT": "Επιλέξτε ένα template για να περιγράψετε τα σύνολα δεδομένων σας. Μπορείτε να επιλέξετε περισσότερα από ένα template." }, "LICENSE-INFO": { - "INTRO": "Each DMP can contain specific license informatation over how much open and available it is, that way you can determine who can see your dataset and for how long that data will be private", - "HINT": "A brief description of what license the DMP is using, it’s type and when it will open.", - "TYPING": "Type more letters of the name so its more possible to find the correct one." + "INTRO": "Κάθε Σχέδιο Διαχείρισης Δεδομένων μπορεί να περιλαμβάνει συγκεκριμένες πληροφορίες άδειας σχετικά με το πόσο ανοικτό και διαθέσιμο είναι, ώστε να μπορείτε να καθορίσετε ποιος μπορεί να δει το σύνολο δεδομένων σας και για πόσο τα δεδομένα θα είναι ιδιωτικά.", + "HINT": "Μία σύντομη περιγραφή για την άδεια που χρηρισοποιεί το Σχέδιο Διαχείρισης Δεδομένων, το είδος της και πότε θα είναι ανοικτό.", + "TYPING": "Προσθέστε περισσότερα γράμματα για να είναι πιο πιθανό να βρείτε το σωστό." }, "DATASET-DESCRIPTION": { - "INTRO": "Ιn general terms, your research data should be 'fair', that is findable, accessible, interoperable and re-usable. these principles precede implementation choices and do not necessarily suggest any specific technology, standard, or implementation-solution. this template is not intended as a strict technical implementation of the fair principles, it is rather inspired by fair as a general concept." + "INTRO": "Σε γενικές γραμμές, τα ερευνητικά σας δεδομένα πρέπει να ακολουθούν τις αρχές FAIR, δηλαδή να είναι ανιχνεύσιμα, προσβάσιμα, διαλειτουργικά και επαναχρησιμοποιήσιμα. Αυτές οι αρχές προηγούνται των επιλογών εφαρμογής και δεν υποδηλώνουν απαραίτητα κάποια συγκεκριμένη τεχνολογία, πρότυπα ή εφαρμογή λύσης. Αυτό το template δεν προορίζεται ως αυστηρή τεχνική εφαρμογή των αρχών FAIR, αλλά περισσότερο εμπνέεται από την ιδέα των αρχών αυτών." }, - "CHANGES": "unsaved changes", + "CHANGES": "μη αποθηκευμένες αλλαγές", "CLONE-DIALOG": { - "CLONE": "Clone", - "SAVE": "Save", - "CANCEL": "Cancel" + "CLONE": "Κλώνος", + "SAVE": "Αποθήκευση", + "CANCEL": "Ακύρωση" } }, "DMP-PROFILE-LISTING": { @@ -953,7 +953,7 @@ }, "DATASET-PROFILE": { "LIKE": "Αναζήτηση", - "STATUS": "Status" + "STATUS": "Κατάσταση" }, "DATA-SETS": { "PERIOD-FROM": "Έναρξη", @@ -992,17 +992,17 @@ "ROLE": "Ρόλος" }, "SELECT": "Επιλογή", - "LIKE": "Search" + "LIKE": "Αναζήτηση" }, "DATASET-EDITOR": { "TITLE": { "NEW": "Νέο Σχέδιο Διαχείρισης Δεδομένων", "EDIT": "Επεξεργασία", - "INTRO": "A Data Management Plan (DMP) consist of your Data Management Plans closer to where they are generated, analysed and stored. argos is an open, extensible, collaborative tool supporting Open and FAIR Data Management Plans." + "INTRO": "Ένα Σχέδιο Διαχείρισης Δεδομένων αποτελείται από τα Σχέδια Διαχείρισης Δεδομένων σας πιο κοντά στο που έχουν παραχθεί, αναλυθεί και αποθηκευτεί. Το Argos είναι ένα ανοικτό, επεκτάσιμο και συνεργατικό εργαλείο που υποστηρίζει Ανοικτά και FAIR Σχέδια Διαχείρισης Δεδομένων." }, "FIELDS": { "NAME": "Τίτλος Περιγραφής Συνόλου Δεδομένων", - "TITLE": "Title", + "TITLE": "Τίτλος", "DESCRIPTION": "Περιγραφή", "PROFILE": "Template", "URI": "Uri", @@ -1016,7 +1016,7 @@ "EXTERNAL-DATASET-TYPE": "Τύπος Εξωτερικού Συνόλου Δεδομένων", "EXTERNAL-DATASET-INFO": "Πληροφορίες για το Εξωτερικό Σύνολο Δεδομένων", "DATAREPOSITORIES-INFO": "Πληροφορίες για τα Αποθετήρια Δεδομένων", - "EXTERNAL-LINK": "External link", + "EXTERNAL-LINK": "Εξωτερικός Σύνδεσμος", "TAGS": "Ετικέτες", "CREATE": "Δημιουργία νέου" }, @@ -1024,15 +1024,15 @@ "SAVE": "Αποθήκευση", "CANCEL": "Ακύρωση", "DELETE": "Διαγραφή", - "UPDATE": "Update" + "UPDATE": "Ενημέρωση" }, "PLACEHOLDER": { - "DESCRIPTION": "Fill with description", - "EXTERNAL-LINK": "Provide an external URL link" + "DESCRIPTION": "Συμπληρώστε με περιγραφή", + "EXTERNAL-LINK": "Προσθέστε έναν εξωτερικό σύνδεσμο URL" }, "HINT": { - "TITLE": "A brief description of what the", - "TITLE-REST": "is about it’s scope and objectives." + "TITLE": "Μία σύντομη περιγραφή του τι", + "TITLE-REST": "αφορά, το πεδίο εφαρμογής του και τους στόχους του." }, "VERSION-DIALOG": { "ABOUT": "Η δημιουργία νέας έκδοσης συμβαίνει αυτόματα", @@ -1068,8 +1068,8 @@ "LABEL": "Ετικέτα", "ROLES": "Ρόλος", "NAME": "Όνομα", - "PERMISSIONS": "ʼδειες", - "EXPORT": "Export users" + "PERMISSIONS": "Άδειες", + "EXPORT": "Εξαγωγή χρηστών" } }, "TYPES": { @@ -1106,7 +1106,7 @@ "SOURCE:": "Πηγή: ", "NO-SOURCE": "Δε συνδέεται με την πηγή", "OUTPUT": "Αποτελέσμα", - "SELECT": "Select" + "SELECT": "Επιλέξτε" }, "DMP": { "FINALISED": "Οριστικοποιημένο", @@ -1132,15 +1132,15 @@ "RADIO-BOX": "Πλαίσιο Επιλογής", "TEXT-AREA": "Περιοχή Κειμένου", "DATE-PICKER": "Επιλογή Ημερομηνίας", - "EXTERNAL-DATASETS": "External Datasets", - "DATA-REPOSITORIES": "Data Repositories", - "REGISTRIES": "Registries", - "SERVICES": "Services", - "TAGS": "Tags", - "RESEARCHERS": "Researchers", - "ORGANIZATIONS": "Organizations", - "DATASET-IDENTIFIER": "Dataset Identifier", - "CURRENCY": "Currency" + "EXTERNAL-DATASETS": "Εξωτερικά Σύνολα Δεδομένων", + "DATA-REPOSITORIES": "Αποθετήρια Δεδομένων", + "REGISTRIES": "Κατάλογοι", + "SERVICES": "Υπηρεσίες", + "TAGS": "Ετικέτες", + "RESEARCHERS": "Ερευνητές", + "ORGANIZATIONS": "Οργανισμοί", + "DATASET-IDENTIFIER": "Αναγνωριστικό Συνόλου Δεδομένων", + "CURRENCY": "Επικαιρότητα" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Λίστα Λέξεων", @@ -1158,12 +1158,12 @@ "EXTERNAL-SOURCE-HINT": "Κατάλογος τιμών που παρέχονται από εξωτερικές πηγές" }, "RECENT-ACTIVITY-ORDER": { - "CREATED": "Created", - "LABEL": "Label", - "MODIFIED": "Modified", - "FINALIZED": "Finalized", - "PUBLISHED": "Published", - "STATUS": "Status" + "CREATED": "Δημιουργημένο", + "LABEL": "Ετικέτα", + "MODIFIED": "Τροποποιημένο", + "FINALIZED": "Οριστικοποιημένο", + "PUBLISHED": "Δημοσιευμένο", + "STATUS": "Κατάσταση" } }, "ADDRESEARCHERS-EDITOR": { @@ -1171,28 +1171,28 @@ "FIRST_NAME": "Όνομα", "LAST_NAME": "Επώνυμο", "ACTIONS": { - "SAVE": "Save", - "CANCEL": "Cancel" + "SAVE": "Αποθήκευση", + "CANCEL": "Ακύρωση" } }, "ADDORGANIZATION-EDITOR": { - "TITLE": "Add an Organization", - "NAME": "Name", + "TITLE": "Προσθήκη ενός Οργανισμού", + "NAME": "Όνομα", "ACTIONS": { "SAVE": "Αποθήκευση", "CANCEL": "Ακύρωση" } }, "ADDEDITCOST-EDITOR": { - "ADD-TITLE": "Add a Cost", - "EDIT-TITLE": "Edit the Cost", - "CODE": "Code", - "DESCRIPTION": "Description", - "TITLE": "Title", - "VALUE": "Value", + "ADD-TITLE": "Προσθήκη μιας δαπάνης", + "EDIT-TITLE": "Επεξεργασία δαπάνης", + "CODE": "Κώδικας", + "DESCRIPTION": "Περιγραφή", + "TITLE": "Τίτλος", + "VALUE": "Τιμή", "ACTIONS": { - "SAVE": "Save", - "CANCEL": "Cancel" + "SAVE": "Αποθήκευση", + "CANCEL": "Ακύρωση" } }, "DMP-WIZARD": { @@ -1284,7 +1284,7 @@ "MAIN-CONTENT": "" }, "OPENSOURCE-LICENCES": { - "TITLE": "Opensource licences", + "TITLE": "Άδειες Ανοικτού Λογισμικού", "MAIN-CONTENT": "" }, "TERMS-OF-SERVICE": { @@ -1320,7 +1320,7 @@ "TITLE": "Τι είναι το ARGOS?", "DMP-QUESTION": "Τι είναι το DMP στο ARGOS?", "INFO-TEXT": "Το ARGOS είναι μια ανοικτή επεκτάσιμη υπηρεσία που απλοποιεί τη διαχείριση, την επικύρωση, την παρακολούθηση και τη συντήρηση των Σχεδίων Διαχείρισης Δεδομένων. Επιτρέπει στους φορείς (ερευνητές, υπεύθυνους έρευνας, διευθυντές κλπ.) να δημιουργούν ζωντανά Σχέδια Διαχείρισης Δεδομένων που μπορούν να ανταλλάσσονται ελεύθερα μεταξύ των υποδομών για τη διεξαγωγή συγκεκριμένων πτυχών της διαδικασίας διαχείρισης Δεδομένων, σύμφωνα με τις προθέσεις και τη δέσμευση των κατόχων Δεδομένων.", - "INFO-DMP-TEXT": "A Data Management Plan (DMP) is a living document describing the datasets that are generated and/ or re-used during and after a research lifetime. DMPs aim to provide researchers with essential information to re-produce,re-distribute and re-purpose research results thus assuring for their validity and exploitation.", + "INFO-DMP-TEXT": "Ένα Σχέδιο Διαχείρισης Δεδομένων είναι ένα ζωντανό αρχείο που περιγραφεί τα σύνολα δεδομένων που έχουν παραχθεί ή και επαναχρησιμοποιηθεί κατά τη διάρκεια και μετά του κύκλου ζωής της έρευνας. Τα Σχέδια Διαχείρισης Δεδομένων έχουν ως στόχο να παρέχουν στους ερευνητές τις αναγκαίες πληροφορίες για την αναπαραγωγή, επαναδιανομή και ανακατεύθυνση του σκοπού των ερευνητικών αποτελεσμάτων ώστε να εξασφαλίζεται η εγκυρότητα και η εκμετάλλευσή τους.", "NEW-QUESTION": "Νέος με τα DMP; Επίσκεψου", "START-YOUR-FIRST-DMP": "Ξεκινήστε το πρώτο σας DMP", "OPEN-AIR-GUIDE": "Οδηγός για ερευνητές του OpenAIRE", @@ -1332,27 +1332,27 @@ "SEARCH": "ΑΝΑΖΗΤΗΣΗ...", "DATA-MANAGEMENT-PLANS": "ΣΧΕΔΙΑ ΔΙΑΧΕΙΡΙΣΗΣ ΔΕΔΟΜΕΝΩΝ", "PERSONAL-USAGE": "Προσωπική Χρήση", - "PUBLIC-USAGE": "Public Usage", - "DATASET-DESCRIPTIONS": "Περιγραφές Dataset", - "PUBLIC-DMPS": "Public DMPs", - "PUBLIC-DATASETS": "Public Dataset Descriptions", + "PUBLIC-USAGE": "Δημόσια Χρήση", + "DATASET-DESCRIPTIONS": "Περιγραφές Συνόλου Δεδομένων", + "PUBLIC-DMPS": "Δημόσια Σχέδια Διαχείρισης Δεδομένων", + "PUBLIC-DATASETS": "Δημόσιες Περιγραφές Συνόλου Δεδομένων", "RELATED-ORGANISATIONS": "Σχετικοί Οργανισμοί", "DRAFTS": "Προσχέδια", "ALL": "Όλα", - "EMPTY-LIST": "Nothing here yet.", - "LATEST-ACTIVITY": "Latest Activity", - "DMP-ABOUT-BEG": "A DMP in Argos consists of key information about research, such as purpose, objectives and researchers involved, but also about documentation of research datasets, namely", - "DMP-ABOUT-END": ", that highlight the steps followed and the means used across data management activities.", - "SELECT-DMP": "Select a DMP for your Dataset", + "EMPTY-LIST": "Τίποτα ακόμα εδώ.", + "LATEST-ACTIVITY": "Τελευταία Δραστηριότητα", + "DMP-ABOUT-BEG": "Ένα Σχέδιο Διαχείρισης Δεδομένων αποτελέιται από τις βασικές πληροφορίες σχετικά με την έρευνα, όπως ο σκοπός, οι στόχοι και οι εμπλεκόμενοι ερευνητές, αλλά και σχετικά με την τεκμηρίωση των ερευνητικών συνόλων δεδομένων, δηλαδή", + "DMP-ABOUT-END": ", που υπογραμμίζουν τα βήματα που ακολουθήθηκαν και τα μέσα που χρησιμοποιήθηκαν κατά τις δραστηριότητες διαχείρισης δεδομένων.", + "SELECT-DMP": "Επιλέξτε ένα Σχέδιο Διαχείρισης Δεδομένων για το Σύνολο Δεδομένων σας", "ACTIONS": { - "ADD-DATASET-DESCRIPTION": "Προσθήκη Περιγραφή Dataset", - "ADD-DATASET": "Add Dataset", - "ADD-DMP-DESCRIPTION": "Προσθήκη Περιγραφή DMP" + "ADD-DATASET-DESCRIPTION": "Προσθήκη Περιγραφής Συνόλου Δεδομένων", + "ADD-DATASET": "Προσθήκη Συνόλου Δεδομένων", + "ADD-DMP-DESCRIPTION": "Προσθήκη Περιγραφής Σχεδίου Διαχείρισης Δεδομένων " } }, "USER-DIALOG": { "USER-PROFILE": "Το Προφίλ μου", - "USER-PROFILE-SETTINGS": "My Profile Settings...", + "USER-PROFILE-SETTINGS": "Οι ρυθμίσεις του προφίλ μου...", "EXIT": "Έξοδος ", "LOG-OUT": "Αποσύνδεση" }, @@ -1370,10 +1370,10 @@ "MEMBER": "Μέλος" }, "ZENODO": { - "LOGIN": "Login to Zenodo", - "LOGOUT": "Remove Zenodo", - "TITLE": "Zenodo Account", - "DESCRIPTION": "Linked Zenodo Account:" + "LOGIN": "Συνδέση με Zenodo", + "LOGOUT": "Αφαίρεση Zenodo", + "TITLE": "Λογαριασμός Zenodo", + "DESCRIPTION": "Συνδεδεμένος Λογαριασμός Zenodo:" } }, "DATASET-REFERENCED-MODELS": { From a78044920a031882f8272d10071017bf9f1b6e5a Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 12 Oct 2020 12:45:32 +0300 Subject: [PATCH 016/260] Fixed issues with elastic and last public version --- .../java/eu/eudat/data/dao/entities/DMPDaoImpl.java | 4 +++- .../web/src/main/java/eu/eudat/controllers/DMPs.java | 4 ++-- .../logic/managers/DataManagementPlanManager.java | 10 +++++----- dmp-frontend/src/app/core/services/dmp/dmp.service.ts | 4 ++-- .../src/app/ui/dmp/overview/dmp-overview.component.ts | 10 +++++++--- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java index 0074428eb..32c687d9c 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DMPDaoImpl.java @@ -57,7 +57,9 @@ public class DMPDaoImpl extends DatabaseAccess implements DMPDao { query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.ACTIVE.getValue())); } } - query.where(((builder, root) -> builder.equal(root.get("isPublic"), criteria.getIsPublic()))); + if (criteria.getIsPublic()) { + query.where(((builder, root) -> builder.equal(root.get("isPublic"), criteria.getIsPublic()))); + } /*if (criteria.getRole() != null) { if (criteria.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())) { query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).get("role"), UserDMP.UserDMPRoles.OWNER.getValue())); diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java index f8844b7d7..f7f7b907c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java @@ -161,9 +161,9 @@ public class DMPs extends BaseController { @RequestMapping(method = RequestMethod.GET, value = {"/versions/{id}"}, consumes = "application/json", produces = "application/json") public @ResponseBody - ResponseEntity>> getVersions(@PathVariable(value= "id") String groupId, + ResponseEntity>> getVersions(@PathVariable(value= "id") String groupId, @RequestParam(value= "public") Boolean isPublic, @ClaimedAuthorities(claims = {Authorities.ADMIN, Authorities.MANAGER, Authorities.USER, Authorities.ANONYMOUS}) Principal principal) throws Exception { - List versions = this.dataManagementPlanManager.getAllVersions(groupId, principal); + List versions = this.dataManagementPlanManager.getAllVersions(groupId, principal, isPublic); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem>().status(ApiMessageCode.NO_MESSAGE).payload(versions)); } diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index ad66be3b5..a68ffdfbb 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -321,8 +321,8 @@ public class DataManagementPlanManager { return data; } - public List getAllVersions(String groupId, Principal principal) { - UUID principalId = principal.getId(); + public List getAllVersions(String groupId, Principal principal, Boolean isPublic) { + UUID principalId = principal != null ? principal.getId() : null; List versions = new ArrayList<>(); QueryableList items = null; QueryableList authItems = null; @@ -330,10 +330,10 @@ public class DataManagementPlanManager { DataManagementPlanCriteria criteria = new DataManagementPlanCriteria(); criteria.setGroupIds(Collections.singletonList(UUID.fromString(groupId))); criteria.setAllVersions(true); - criteria.setIsPublic(principalId == null); - criteria.setOnlyPublic(principalId == null); + criteria.setIsPublic(isPublic); + criteria.setOnlyPublic(isPublic); items = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().getWithCriteria(criteria); - if (principalId != null) { + if (!isPublic) { authItems = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().getAuthenticated(items, principalId, roles); } else { authItems = items; diff --git a/dmp-frontend/src/app/core/services/dmp/dmp.service.ts b/dmp-frontend/src/app/core/services/dmp/dmp.service.ts index 853ad6b84..52888b3c1 100644 --- a/dmp-frontend/src/app/core/services/dmp/dmp.service.ts +++ b/dmp-frontend/src/app/core/services/dmp/dmp.service.ts @@ -58,8 +58,8 @@ export class DmpService { return this.http.get(this.actionUrl + 'publicOverview/' + id, { headers: this.headers }) } - getAllVersions(id: string): Observable { - return this.http.get(this.actionUrl + 'versions/' + id, { headers: this.headers }) + getAllVersions(id: string, isPublic: boolean): Observable { + return this.http.get(this.actionUrl + 'versions/' + id + '?public=' + isPublic, { headers: this.headers }) } unlock(id: String): Observable { 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 2d457d237..f54f3ae64 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 @@ -468,7 +468,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { } getAllVersions(dmp: DmpOverviewModel) { - this.dmpService.getAllVersions(dmp.groupId) + this.dmpService.getAllVersions(dmp.groupId, this.isPublicView) .pipe(takeUntil(this._destroyed)) .subscribe(items => { this.versions = items; @@ -618,7 +618,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { // } viewVersions(rowId: String, rowLabel: String) { - if (this.dmp.isPublic && !this.isUserOwner) { + if (this.isPublicView) { this.router.navigate(['/explore-plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } }); } else { this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } }); @@ -630,7 +630,11 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { } versionChanged(versionId: string): void { - this.router.navigate(['/plans/overview/' + versionId]); + if (this.isPublicView) { + this.router.navigate(['/explore-plans/publicOverview/' + versionId]); + } else { + this.router.navigate(['/plans/overview/' + versionId]); + } } openShareDialog(rowId: any, rowName: any) { From b878bf9d8fd855d4b03f399abe3ad6bfa6ef85a7 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 13 Oct 2020 11:05:01 +0300 Subject: [PATCH 017/260] Fix issue when importing from RDA and the predefined template(s) inside the json does not exist on the database --- .../main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java index d870377ab..739c90b31 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/rda/mapper/DmpRDAMapper.java @@ -102,7 +102,7 @@ public class DmpRDAMapper { entity.setDoi(rda.getDmpId().getIdentifier()); } if (((List) rda.getAdditionalProperties().get("templates")) != null && !((List) rda.getAdditionalProperties().get("templates")).isEmpty()) { - entity.setAssociatedDmps(((List) rda.getAdditionalProperties().get("templates")).stream().map(this::getProfile).collect(Collectors.toSet())); + entity.setAssociatedDmps(((List) rda.getAdditionalProperties().get("templates")).stream().map(this::getProfile).filter(Objects::nonNull).collect(Collectors.toSet())); } if (entity.getAssociatedDmps() == null) { entity.setAssociatedDmps(new HashSet<>()); @@ -134,6 +134,6 @@ public class DmpRDAMapper { } private DatasetProfile getProfile(String id) { - return apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(id)); + return apiContext.getOperationsContext().getDatabaseRepository().getDatasetProfileDao().asQueryable().where(((builder, root) -> builder.equal(root.get("id"), UUID.fromString(id)))).getSingleOrDefault(); } } From f08d8e2e017d8b30e85fa81e55876b02dd7e2fc6 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Tue, 13 Oct 2020 12:55:11 +0300 Subject: [PATCH 018/260] When checking for Form Validation errors if the control has no nativeElement then pass as name it's formGroup key, also added some additional checkup for the placeholder parser in the FormValidationComponent --- .../app/ui/dmp/editor/dmp-editor.component.ts | 1 + ...form-validation-errors-dialog.component.ts | 32 ++++++++++++------- 2 files changed, 21 insertions(+), 12 deletions(-) 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 1a9925591..e37083cbc 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 @@ -413,6 +413,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC } public isFormValid() { + this.formGroup.markAllAsTouched(); return this.formGroup.valid; // return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid && // (this.formGroup.get('funder').get('label').valid || this.formGroup.get('funder').get('existFunder').valid) && diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts index 400ecba9b..b01d262f7 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts @@ -29,15 +29,23 @@ export class FormValidationErrorsDialogComponent { this.dialogRef.close(); } - public getErrors(formControl: AbstractControl): string[] { + public getErrors(formControl: AbstractControl, key?: string): string[] { const errors: string[] = []; if (formControl instanceof FormControl) { - if (formControl.invalid && formControl['nativeElement']) { errors.push(...this.getErrorMessage(formControl)); } + if (formControl.errors !== null) { + let name: string; + if ((formControl).nativeElement !== undefined && (formControl).nativeElement !== null) { + name = this.getPlaceHolder(formControl); + } else { + name = key; + } + errors.push(...this.getErrorMessage(formControl, name)); + } } else if (formControl instanceof FormGroup) { if (formControl.errors) { (errors.push(...Object.values(formControl.errors).map(x => x.message) as string[])); } - Object.keys(formControl.controls).forEach(item => { - const control = formControl.get(item); - errors.push(...this.getErrors(control)); + Object.keys(formControl.controls).forEach(key => { + const control = formControl.get(key); + errors.push(...this.getErrors(control, key)); }); } else if (formControl instanceof FormArray) { if (formControl.errors) { (errors.push(...Object.values(formControl.errors).map(x => x.message) as string[])); } @@ -48,21 +56,21 @@ export class FormValidationErrorsDialogComponent { return errors; } - getErrorMessage(formControl: FormControl): string[] { + getErrorMessage(formControl: FormControl, name: string): string[] { const errors: string[] = []; Object.keys(formControl.errors).forEach(key => { - if (key === 'required') { errors.push(this.language.instant(this.getPlaceHolder(formControl) + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); } + if (key === 'required') { errors.push(this.language.instant(name + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); } // if (key === 'required') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED')); } - else if (key === 'email') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.EMAIL')); } - else if (key === 'min') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', { 'min': formControl.getError('min').min })); } - else if (key === 'max') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', { 'max': formControl.getError('max').max })); } - else { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + formControl.errors[key].message); } + else if (key === 'email') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.EMAIL')); } + else if (key === 'min') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', { 'min': formControl.getError('min').min })); } + else if (key === 'max') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', { 'max': formControl.getError('max').max })); } + else { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + formControl.errors[key].message); } }); return errors; } getPlaceHolder(formControl: any): string { - if (formControl.nativeElement.localName === 'input') { + if (formControl.nativeElement.localName === 'input' || formControl.nativeElement.localName === 'textarea') { return formControl.nativeElement.getAttribute('placeholder'); } else if (formControl.nativeElement.localName === 'mat-select') { return formControl.nativeElement.getAttribute('aria-label'); From e179d90f127ccf9b6b0e8f86cf120be06edd445e Mon Sep 17 00:00:00 2001 From: apapachristou Date: Thu, 15 Oct 2020 13:46:59 +0300 Subject: [PATCH 019/260] Adds progress bar on DMP editor --- dmp-frontend/src/app/ui/dmp/dmp.module.ts | 5 +- .../ui/dmp/editor/dmp-editor.component.html | 17 +++- .../ui/dmp/editor/dmp-editor.component.scss | 8 ++ .../app/ui/dmp/editor/dmp-editor.component.ts | 25 +++++- .../src/app/ui/dmp/editor/dmp-editor.model.ts | 6 +- .../funding-info/funding-info.component.html | 4 +- .../extra-properties-form.model.ts | 14 ++-- .../editor/grant-tab/project-form-model.ts | 4 +- .../editor/main-info/main-info.component.html | 18 ++--- .../form-progress-indication.component.html | 4 +- .../form-progress-indication.component.scss | 16 ++++ .../form-progress-indication.component.ts | 81 ++++++++++++++++--- .../form-progress-indication.module.ts | 18 +++++ .../dataset-description-form.module.ts | 5 +- 14 files changed, 186 insertions(+), 39 deletions(-) create mode 100644 dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.scss create mode 100644 dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.module.ts diff --git a/dmp-frontend/src/app/ui/dmp/dmp.module.ts b/dmp-frontend/src/app/ui/dmp/dmp.module.ts index 243f3e605..3f37ce449 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp.module.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp.module.ts @@ -46,6 +46,8 @@ import { LicenseInfoComponent } from './editor/license-info/license-info.compone import { StartNewDatasetDialogComponent } from './start-new-dataset-dialogue/start-new-dataset-dialog.component'; import { NgxDropzoneModule } from 'ngx-dropzone'; import { DmpToDatasetDialogComponent } from './dmp-to-dataset/dmp-to-dataset-dialog.component'; +import { FormProgressIndicationComponent } from '../misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component'; +import { FormProgressIndicationModule } from '../misc/dataset-description-form/components/form-progress-indication/form-progress-indication.module'; @NgModule({ imports: [ @@ -62,7 +64,8 @@ import { DmpToDatasetDialogComponent } from './dmp-to-dataset/dmp-to-dataset-dia MultipleChoiceDialogModule, DatasetEditorDetailsModule, DatasetDescriptionFormModule, - NgxDropzoneModule + NgxDropzoneModule, + FormProgressIndicationModule ], declarations: [ DmpListingComponent, diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html index 9e4f13bf1..39392ceac 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html @@ -33,10 +33,18 @@
{{'DMP-EDITOR.STEPPER.USER-GUIDE' | translate}}
    -
  1. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (7)
  2. -
  3. {{'DMP-EDITOR.STEPPER.FUNDING-INFO' | translate}} (3)
  4. +
  5. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (1)
  6. +
  7. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (done)
  8. +
  9. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (2)
  10. +
  11. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (done)
  12. + +
  13. {{'DMP-EDITOR.STEPPER.FUNDING-INFO' | translate}} (2)
  14. +
  15. {{'DMP-EDITOR.STEPPER.FUNDING-INFO' | translate}} (done)
  16. +
  17. {{'DMP-EDITOR.STEPPER.LICENSE-INFO' | translate}}
  18. -
  19. {{'DMP-EDITOR.STEPPER.DATASET-INFO' | translate}}
  20. + +
  21. {{'DMP-EDITOR.STEPPER.DATASET-INFO' | translate}} (1)
  22. +
  23. {{'DMP-EDITOR.STEPPER.DATASET-INFO' | translate}} (done)
  24. @@ -70,6 +78,9 @@
    {{'DMP-EDITOR.ACTIONS.SAVE' | translate}} & {{'DMP-LISTING.ACTIONS.ADD-DATASET-SHORT' | translate}}
+
+ +
diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.scss b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.scss index 7126fa67e..e36d917d7 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.scss +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.scss @@ -442,6 +442,14 @@ mat-icon.size-16 { list-style-type: none; } +.done-icon { + display: inline-flex; + vertical-align: middle; + font-size: 16px !important; + height: auto; + width: auto; +} + // ::ng-deep .mat-tab-labels { // justify-content: space-between; // } 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 e37083cbc..6e5a702a3 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 @@ -413,7 +413,6 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC } public isFormValid() { - this.formGroup.markAllAsTouched(); return this.formGroup.valid; // return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid && // (this.formGroup.get('funder').get('label').valid || this.formGroup.get('funder').get('existFunder').valid) && @@ -896,6 +895,30 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.dmp.id != null ? this.router.navigate(['/plans', 'edit', this.dmp.id]) : this.router.navigate(['/plans']); } + mainInfoValid(): boolean { + if (this.formGroup.get('label').valid) { + if (this.formGroup.get('publicDate')) { + if (this.formGroup.get('publicDate').valid) { + return true; + } else if (this.formGroup.get('publicDate').invalid) { + return false + } + } else { + return true; + } + } else { + return false; + } + } + + fundingInfoValid(): boolean { + return this.formGroup.get('funder') && this.formGroup.get('funder').valid && this.formGroup.get('grant') && this.formGroup.get('grant').valid; + } + + datasetInfoValid(): boolean { + return this.formGroup.get('profiles') && this.formGroup.get('profiles').valid && this.formGroup.get('profiles').value.length > 0; + } + // advancedClicked() { // const dialogRef = this.dialog.open(ExportMethodDialogComponent, { // maxWidth: '500px', diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts index 38edd04aa..b95e0e8e0 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts @@ -92,7 +92,7 @@ export class DmpEditorModel { groupId: [{ value: this.groupId, disabled: disabled }, context.getValidation('groupId').validators], version: [{ value: this.version, disabled: disabled }, context.getValidation('version').validators], status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators], - description: [{ value: this.description, disabled: disabled }], + description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators], grant: this.grant.buildForm(), project: this.project.buildForm(), funder: this.funder.buildForm(), @@ -135,10 +135,10 @@ export class DmpEditorModel { baseContext.validation.push({ key: 'groupId', validators: [BackendErrorValidator(this.validationErrorModel, 'groupId')] }); baseContext.validation.push({ key: 'version', validators: [BackendErrorValidator(this.validationErrorModel, 'version')] }); baseContext.validation.push({ key: 'status', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'status')] }); - baseContext.validation.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] }); + baseContext.validation.push({ key: 'description', validators: [BackendErrorValidator(this.validationErrorModel, 'description')] }); baseContext.validation.push({ key: 'grant', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'grant')] }); baseContext.validation.push({ key: 'project', validators: [BackendErrorValidator(this.validationErrorModel, 'project')] }); - baseContext.validation.push({ key: 'funder', validators: [BackendErrorValidator(this.validationErrorModel, 'funder')] }); + baseContext.validation.push({ key: 'funder', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'funder')] }); baseContext.validation.push({ key: 'organisations', validators: [BackendErrorValidator(this.validationErrorModel, 'organisations')] }); baseContext.validation.push({ key: 'researchers', validators: [BackendErrorValidator(this.validationErrorModel, 'researchers')] }); baseContext.validation.push({ key: 'profiles', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'profiles')] }); diff --git a/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.html b/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.html index 5a1bfa8d1..61104beb1 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/funding-info/funding-info.component.html @@ -112,14 +112,14 @@
- + {{projectFormGroup.get('label').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + {{projectFormGroup.get('description').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts index c2dc45d91..6ff2f48cb 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/extra-properties-form.model.ts @@ -4,6 +4,7 @@ import { BackendErrorValidator } from '@common/forms/validation/custom-validator import { CostModel } from '@app/core/model/dmp/cost'; import { isNullOrUndefined } from 'util'; import { CostEditorModel } from '../cost-editor/add-cost/add-cost.model'; +import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; export class ExtraPropertiesFormModel { public language: string; @@ -12,6 +13,7 @@ export class ExtraPropertiesFormModel { public publicDate: Date; public contact: string; public costs: CostEditorModel[] = []; + public validationErrorModel: ValidationErrorModel = new ValidationErrorModel(); fromModel(item: any): ExtraPropertiesFormModel { this.language = item.language; @@ -53,12 +55,12 @@ export class ExtraPropertiesFormModel { createValidationContext(): ValidationContext { const baseContext: ValidationContext = new ValidationContext(); - baseContext.validation.push({ key: 'language', validators: [] }); - baseContext.validation.push({ key: 'license', validators: [] }); - baseContext.validation.push({ key: 'visible', validators: [] }); - baseContext.validation.push({ key: 'publicDate', validators: [] }); - baseContext.validation.push({ key: 'contact', validators: [] }); - baseContext.validation.push({ key: 'costs', validators: [] }); + baseContext.validation.push({ key: 'language', validators: [BackendErrorValidator(this.validationErrorModel, 'language')] }); + baseContext.validation.push({ key: 'license', validators: [BackendErrorValidator(this.validationErrorModel, 'license')] }); + baseContext.validation.push({ key: 'visible', validators: [BackendErrorValidator(this.validationErrorModel, 'visible')] }); + baseContext.validation.push({ key: 'publicDate', validators: [BackendErrorValidator(this.validationErrorModel, 'publicDate')] }); + baseContext.validation.push({ key: 'contact', validators: [BackendErrorValidator(this.validationErrorModel, 'contact')] }); + baseContext.validation.push({ key: 'costs', validators: [BackendErrorValidator(this.validationErrorModel, 'costs')] }); return baseContext; } diff --git a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/project-form-model.ts b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/project-form-model.ts index 826221b30..83178a711 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/project-form-model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/project-form-model.ts @@ -36,9 +36,9 @@ export class ProjectFormModel { createValidationContext(): ValidationContext { const baseContext: ValidationContext = new ValidationContext(); baseContext.validation.push({ key: 'id', validators: [] }); - baseContext.validation.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] }); + baseContext.validation.push({ key: 'label', validators: [BackendErrorValidator(this.validationErrorModel, 'label')] }); baseContext.validation.push({ key: 'status', validators: [] }); - baseContext.validation.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] }); + baseContext.validation.push({ key: 'description', validators: [BackendErrorValidator(this.validationErrorModel, 'description')] }); baseContext.validation.push({ key: 'existProject', validators: [BackendErrorValidator(this.validationErrorModel, 'existProject')] }); return baseContext; } diff --git a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.html b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.html index aa20383a8..f83b80bf7 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.html @@ -127,7 +127,7 @@
-
1.7 {{'DMP-EDITOR.FIELDS.CONTACT' | translate}}
+
1.7 {{'DMP-EDITOR.FIELDS.CONTACT' | translate}}*
@@ -147,17 +147,17 @@
-
1.8 {{'DMP-EDITOR.FIELDS.PUBLICATION' | translate}}
+
1.8 {{'DMP-EDITOR.FIELDS.PUBLICATION' | translate}}*
- - - - - {{formGroup.get('extraProperties').get('publicDate').getError('backendError').message}} - - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + + + + {{formGroup.get('extraProperties').get('publicDate').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}}
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.html index d25935d91..8244bf0e9 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.html @@ -1,3 +1,5 @@ 
- +
{{progressSoFar}} {{'GENERAL.PREPOSITIONS.OF' | translate}} {{total}}
+ +
{{value}}%
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.scss b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.scss new file mode 100644 index 000000000..a15510639 --- /dev/null +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.scss @@ -0,0 +1,16 @@ +.percentage { + color: #212121; + opacity: 0.7; + font-weight: 400; + font-size: 0.875rem; +} + +.progress-bar { + border-radius: 20px; + height: 11px; + +} + +::ng-deep .mat-progress-bar .mat-progress-bar-fill::after { + border-radius: 20px !important; +} diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts index 9a9b222d4..fc9fa6b3d 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts @@ -1,36 +1,46 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { AbstractControl, FormArray, FormGroup } from '@angular/forms'; +import { Component, ElementRef, Input, OnInit } from '@angular/core'; +import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; import { BaseComponent } from '@common/base/base.component'; import { takeUntil } from 'rxjs/operators'; @Component({ selector: 'app-form-progress-indication', - templateUrl: './form-progress-indication.component.html' + templateUrl: './form-progress-indication.component.html', + styleUrls: ['./form-progress-indication.component.scss'] }) export class FormProgressIndicationComponent extends BaseComponent implements OnInit { @Input() formGroup: FormGroup; + @Input() isEditor: boolean; @Input() public progressValueAccuracy = 2; determinateProgressValue: number; + progressSoFar: number; + total: number; + percent: number; constructor(private visibilityRulesService: VisibilityRulesService) { super(); } public value = 0; ngOnInit() { - this.calculateValueForProgressbar(); + setTimeout(() => {this.calculateValueForProgressbar();}); this.formGroup .valueChanges .pipe(takeUntil(this._destroyed)) .subscribe(control => { - this.calculateValueForProgressbar(); + setTimeout(() => {this.calculateValueForProgressbar();}); }); } calculateValueForProgressbar() { - const progressSoFar = this.countFormControlsWithValueForProgress(this.formGroup); - const total = this.CountFormControlDepthLengthFotTotal(this.formGroup); - const perc = (progressSoFar / total) * 100; - this.value = Number.parseFloat(perc.toPrecision(this.progressValueAccuracy)); + if (this.isEditor) { + this.progressSoFar = this.countFormControlsValidForProgress(this.formGroup); + this.total = this.countFormControlsRequiredFieldsForTotal(this.formGroup); + } else { + this.progressSoFar = this.countFormControlsWithValueForProgress(this.formGroup); + this.total = this.CountFormControlDepthLengthFotTotal(this.formGroup); + } + this.percent = (this.progressSoFar / this.total) * 100; + this.value = Number.parseFloat(this.percent.toPrecision(this.progressValueAccuracy)); } countFormControlsWithValueForProgress(formControl: AbstractControl): number { @@ -125,4 +135,57 @@ export class FormProgressIndicationComponent extends BaseComponent implements On } return valueCurent; } + + countFormControlsValidForProgress(formControl: AbstractControl): number { + let valueCurrent = 0; + if (formControl instanceof FormControl) { + if (this.controlRequired(formControl) && this.controlEnabled(formControl) && formControl['nativeElement'] && formControl.valid) { + valueCurrent++; + } + } else if (formControl instanceof FormGroup) { + Object.keys(formControl.controls).forEach(item => { + const control = formControl.get(item); + valueCurrent = valueCurrent + this.countFormControlsValidForProgress(control); + }); + } else if (formControl instanceof FormArray) { + formControl.controls.forEach(item => { + valueCurrent = valueCurrent + this.countFormControlsValidForProgress(item); + }); + } + return valueCurrent; + } + + countFormControlsRequiredFieldsForTotal(formControl: AbstractControl): number { + let valueCurrent = 0; + if (formControl instanceof FormControl) { + if (this.controlRequired(formControl) && this.controlEnabled(formControl) && formControl['nativeElement']) { + valueCurrent++; + } + } else if (formControl instanceof FormGroup) { + Object.keys(formControl.controls).forEach(item => { + const control = formControl.get(item); + valueCurrent = valueCurrent + this.countFormControlsRequiredFieldsForTotal(control); + }); + } else if (formControl instanceof FormArray) { + formControl.controls.forEach(item => { + valueCurrent = valueCurrent + this.countFormControlsRequiredFieldsForTotal(item); + }); + } + return valueCurrent; + } + + controlRequired(formControl: AbstractControl) { + if (formControl.validator) { + const validator = formControl.validator({} as AbstractControl); + if (validator && validator.required) { + return true; + } + } else { return false } + } + + controlEnabled(formControl: AbstractControl) { + if (formControl.enabled) { + return true; + } else { return false } + } } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.module.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.module.ts new file mode 100644 index 000000000..f287d329d --- /dev/null +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { CommonFormsModule } from '@common/forms/common-forms.module'; +import { CommonUiModule } from '@common/ui/common-ui.module'; +import { FormProgressIndicationComponent } from './form-progress-indication.component'; + +@NgModule({ + imports: [ + CommonUiModule, + CommonFormsModule + ], + declarations: [ + FormProgressIndicationComponent + ], + exports: [ + FormProgressIndicationComponent + ] +}) +export class FormProgressIndicationModule { } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.module.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.module.ts index 0fd99cddc..6dbc01fa1 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.module.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.module.ts @@ -12,18 +12,19 @@ import { CommonUiModule } from '@common/ui/common-ui.module'; import { FormCompositeTitleComponent } from './components/form-composite-title/form-composite-title.component'; import { ExternalSourcesModule } from '../external-sources/external-sources.module'; import { DatasetDescriptionComponent } from './dataset-description.component'; +import { FormProgressIndicationModule } from './components/form-progress-indication/form-progress-indication.module'; @NgModule({ imports: [ CommonUiModule, CommonFormsModule, AutoCompleteModule, - ExternalSourcesModule + ExternalSourcesModule, + FormProgressIndicationModule ], declarations: [ DatasetDescriptionFormComponent, DatasetDescriptionComponent, - FormProgressIndicationComponent, FormSectionComponent, FormCompositeFieldComponent, FormFieldComponent, From a631594f5f3914ebe8936f8b9038d24009c61697 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Fri, 16 Oct 2020 10:22:37 +0300 Subject: [PATCH 020/260] Changes favicon --- dmp-frontend/src/favicon.ico | Bin 615 -> 159214 bytes dmp-frontend/src/favicon_v2.ico | Bin 0 -> 615 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 dmp-frontend/src/favicon_v2.ico diff --git a/dmp-frontend/src/favicon.ico b/dmp-frontend/src/favicon.ico index 376cbdd26d5fb3f4ada129c13f28e2e140ff1a94..0500f785870e9e7f4cdd53cf44c978f1cf5ff1bf 100644 GIT binary patch literal 159214 zcmeI52Vh;rv4)Q^V2Z(DI>s>&2oTDn2NJ-*gAiKiJ(MJr07>Wx-KK_;gwR6*JX%6Y zsBW@l%aXfgTg8&BV#$)#tY)j)>el=I-Fu{~t9#YUm3^EH=j!Y!yL;x}nVp%Pb(|6W zZ@~hG{~qY1{cam)Z^v;ChdAZDFv6bar*r1D+c?KQr zZ>;n%ELGf@R{QfjF9n$z;26_Cy74(6JhgLis4bM-8 zgn?C1E#zTfE9(On5B^8^U~8FMkD;xgH zfr=py1705(9`MINu;1{?mV}FoXwN5*^r6j=hXbz<+VMaz38gUGYFD-Vb)3XN4;s##6VyKp9=N*DLoh z(HRc}Uf0`LD6@?xt!dC)KNAP`TX_&(J6 zA;g1xY6*e$_x|=|M1S%?D83JMo_7znd{E5Yi;(A2^JKz+$OL~ph2r~A=LZ=Nio5#? zYV@zO_uG>R1H}WO_&(Tq>M)qH;d$P(0JI9cWAEQ*^j)r!hp{eg5fF{--kLkztVqg3&M>DLh*m# z`F_NM@;^p~TR(X9@vtc#2;}=ve{*er=u3z29ObzP8~Nzf#rqciJP?Zi1J83$U-2-O zXDAPzXH)gYgRmVB1NlDG-+jcxNbY|fYJkGFFTA>W-zF6Q2cCyl`XV1DbN?of-#mT` zcOD4j`%r)P0S|X@uNRNx$;Dxz7lh(}|MPvo!iC)H$S(Mrzd%RFzk51<@wHzJ;1|(T)V)-f;ScnS03mL2X0vp@bC`T zdOkN#E(|-l;NsWi`B29mVBr^BTj@U6J9;u=IPyR!9JuFcQ+MXl(vy}C$M(0?dHt?eFm-M(=7 zKGc!xx`T(;xNg|x0hl>^U&H@Xrf+9>dcoo|@|MS4J3lGq_n)VxJ@)t2nSXjQYt3Jt zUY+&wv#YcI{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ECYxJI=31UL2_@-q;7^PcbX8B{+m$@RpzybB&3J@r?y z%l)ypM225f7Kod2&($G18u$Avf2h%eXjMjKfhD_0OZ`qiDvc^+i>|{;;aa+!t=$^0 zHYhD=N_&>0w5jnd?Vf_#+O&s^X%U-9_^E&M@^gw$Q(tLq+KXa4j?gaN1^E~5YHVOf zsFpdY{`&HHjwj+A+`N@e5$5K|D4VKutmPGwsUM!uLVq`EK( Date: Fri, 16 Oct 2020 16:48:28 +0300 Subject: [PATCH 021/260] Adds progress bar on dataset editor --- .../dataset-wizard.component.html | 6 ++++- .../dataset-wizard.component.scss | 8 ++++++ .../dataset-wizard.component.ts | 4 +++ .../src/app/ui/dataset/dataset.module.ts | 4 ++- .../ui/dmp/editor/dmp-editor.component.html | 2 +- .../form-progress-indication.component.ts | 25 ++++++++++++++----- 6 files changed, 40 insertions(+), 9 deletions(-) diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html index b880f7ae2..71db4b830 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html @@ -50,7 +50,8 @@
{{'DMP-EDITOR.STEPPER.USER-GUIDE' | translate}}
-
0. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (5)
+
0. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (2)
+
0. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (done)
@@ -74,6 +75,9 @@
{{ 'DATASET-WIZARD.ACTIONS.SAVE-AND-ADD' | translate }}
+
+ +
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss index 876c2da36..ab8703182 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss @@ -481,6 +481,14 @@ mat-icon.size-18 { margin-top: 70px !important; } +.done-icon { + display: inline-flex; + vertical-align: middle; + font-size: 16px !important; + height: auto; + width: auto; +} + // ::ng-deep .mat-tab-labels { // justify-content: space-between; // } diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index 772e07e39..5855875f3 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -884,4 +884,8 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr backToDmp(id: string) { this.router.navigate(['/plans', 'edit', id]); } + + datasetInfoValid(): boolean { + return this.formGroup.get('label') && this.formGroup.get('label').valid && this.formGroup.get('profile') && this.formGroup.get('profile').valid; + } } diff --git a/dmp-frontend/src/app/ui/dataset/dataset.module.ts b/dmp-frontend/src/app/ui/dataset/dataset.module.ts index 31b150f11..1f99600d4 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset.module.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset.module.ts @@ -28,6 +28,7 @@ import { DatasetCriteriaDialogComponent } from './listing/criteria/dataset-crite import { DmpEditorComponent } from '../dmp/editor/dmp-editor.component'; import { DatasetEditorDetailsComponent } from '../dmp/editor/dataset-editor-details/dataset-editor-details.component'; import { DatasetEditorDetailsModule } from '../dmp/editor/dataset-editor-details/dataset-editor-details.module'; +import { FormProgressIndicationModule } from '../misc/dataset-description-form/components/form-progress-indication/form-progress-indication.module'; @NgModule({ imports: [ @@ -44,7 +45,8 @@ import { DatasetEditorDetailsModule } from '../dmp/editor/dataset-editor-details DatasetRoutingModule, FormValidationErrorsDialogModule, DatasetCopyDialogModule, - DatasetOverviewModule + DatasetOverviewModule, + FormProgressIndicationModule ], declarations: [ DatasetListingComponent, diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html index 39392ceac..8e5cc03fd 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html @@ -79,7 +79,7 @@
- +
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts index fc9fa6b3d..6a48092e5 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.ts @@ -11,7 +11,8 @@ import { takeUntil } from 'rxjs/operators'; }) export class FormProgressIndicationComponent extends BaseComponent implements OnInit { @Input() formGroup: FormGroup; - @Input() isEditor: boolean; + @Input() isDmpEditor: boolean; + @Input() isDatasetEditor: boolean; @Input() public progressValueAccuracy = 2; determinateProgressValue: number; progressSoFar: number; @@ -32,9 +33,12 @@ export class FormProgressIndicationComponent extends BaseComponent implements On } calculateValueForProgressbar() { - if (this.isEditor) { + if (this.isDmpEditor) { this.progressSoFar = this.countFormControlsValidForProgress(this.formGroup); this.total = this.countFormControlsRequiredFieldsForTotal(this.formGroup); + } else if (this.isDatasetEditor) { + this.progressSoFar = this.countFormControlsValidForProgress(this.formGroup) + this.countFormControlsWithValueForProgress(this.formGroup); + this.total = this.countFormControlsRequiredFieldsForTotal(this.formGroup) + this.CountFormControlDepthLengthFotTotal(this.formGroup); } else { this.progressSoFar = this.countFormControlsWithValueForProgress(this.formGroup); this.total = this.CountFormControlDepthLengthFotTotal(this.formGroup); @@ -46,11 +50,11 @@ export class FormProgressIndicationComponent extends BaseComponent implements On countFormControlsWithValueForProgress(formControl: AbstractControl): number { let valueCurent = 0; if (formControl instanceof FormGroup) { - if (this.checkFormsIfIsFieldsAndVisible(formControl)) { + if (this.checkFormsIfIsFieldsAndVisible(formControl) && this.checkIfIsRequired((formControl as FormGroup))) { if (this.haseValue(formControl)) valueCurent++; } - if (this.chechFieldIfIsFieldSetAndVisible((formControl as FormGroup))) { + if (this.chechFieldIfIsFieldSetAndVisible((formControl as FormGroup)) && this.checkIfIsRequired((formControl as FormGroup))) { valueCurent = valueCurent + this.compositeFieldsGetChildsForProgress(formControl); } else { Object.keys(formControl.controls).forEach(item => { @@ -86,7 +90,12 @@ export class FormProgressIndicationComponent extends BaseComponent implements On return valueCurent; } - + private checkIfIsRequired(formControl: FormGroup): boolean { + if (formControl.get('validationRequired') && formControl.get('validationRequired').value) { + return true; + } + return false; + } private checkFormsIfIsFieldsAndVisible(formControl: FormGroup): boolean { if (formControl.contains('id') && formControl.contains('value')) { @@ -108,7 +117,7 @@ export class FormProgressIndicationComponent extends BaseComponent implements On valueCurent = valueCurent + this.CountFormControlDepthLengthFotTotal(item); }); } else if (formControl instanceof FormGroup) { - if ((formControl as FormGroup).contains('id') && (formControl as FormGroup).contains('value') && (this.visibilityRulesService.checkElementVisibility((formControl as FormGroup).get('id').value))) { + if ((formControl as FormGroup).contains('id') && (formControl as FormGroup).contains('value') && (this.visibilityRulesService.checkElementVisibility((formControl as FormGroup).get('id').value)) && this.checkIfIsRequired((formControl as FormGroup))) { valueCurent++; } else if ((formControl as FormGroup).contains('id') && (formControl as FormGroup).contains('fields')) { valueCurent = valueCurent + this.compositeFieldsGetChildsForTotal(formControl); @@ -188,4 +197,8 @@ export class FormProgressIndicationComponent extends BaseComponent implements On return true; } else { return false } } + + isEditor(): boolean { + return this.isDmpEditor || this.isDatasetEditor; + } } From b8f3c5af7067fe157a9ff29cdd3b63cd093bbccf Mon Sep 17 00:00:00 2001 From: apapachristou Date: Mon, 19 Oct 2020 12:58:55 +0300 Subject: [PATCH 022/260] with previous commit --- .../form-progress-indication.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.html index 8244bf0e9..56966d9ab 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component.html @@ -1,5 +1,5 @@ 
-
{{progressSoFar}} {{'GENERAL.PREPOSITIONS.OF' | translate}} {{total}}
- -
{{value}}%
+
{{progressSoFar}} {{'GENERAL.PREPOSITIONS.OF' | translate}} {{total}}
+ +
{{value}}%
From 32caed9f6f053c4a3428552e64d7b49fae741b8d Mon Sep 17 00:00:00 2001 From: apapachristou Date: Tue, 20 Oct 2020 13:00:02 +0300 Subject: [PATCH 023/260] Adds preview of dataset template, adds delete with spacebar on multiple autocomplete --- .../multiple-auto-complete-configuration.ts | 4 +- .../multiple-auto-complete.component.html | 26 +++++---- .../multiple-auto-complete.component.scss | 17 ++++++ .../multiple-auto-complete.component.ts | 20 ++++++- .../dataset-preview-dialog.component.html | 17 ++++++ .../dataset-preview-dialog.component.scss | 42 +++++++++++++++ .../dataset-preview-dialog.component.ts | 54 +++++++++++++++++++ dmp-frontend/src/app/ui/dmp/dmp.module.ts | 7 ++- .../dataset-info/dataset-info.component.html | 2 +- .../dataset-info/dataset-info.component.ts | 34 +++++++++++- .../form-section/form-section.component.scss | 2 +- dmp-frontend/src/assets/css/demo.css | 4 ++ 12 files changed, 211 insertions(+), 18 deletions(-) create mode 100644 dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.html create mode 100644 dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.scss create mode 100644 dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts diff --git a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete-configuration.ts b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete-configuration.ts index ebb0be39f..32b99b46c 100644 --- a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete-configuration.ts +++ b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete-configuration.ts @@ -31,7 +31,9 @@ export interface MultipleAutoCompleteConfiguration { optionTemplate?: TemplateRef; // Selected value formating template selectedValueTemplate?: TemplateRef; - + // Display icon that opens popup + popupItemActionIcon?: string; autoSelectFirstOptionOnBlur?: boolean; + } diff --git a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.html b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.html index ae3805b29..83b01d997 100644 --- a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.html +++ b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.html @@ -10,9 +10,9 @@ - + + --> arrow_drop_down @@ -22,10 +22,13 @@ -
- {{_titleFn(item)}} -
- {{_subtitleFn(item)}} +
+
+ {{_titleFn(item)}} +
+ {{_subtitleFn(item)}} +
+ {{popupItemActionIcon}}
@@ -38,10 +41,13 @@ -
- {{_titleFn(item)}} -
- {{_subtitleFn(item)}} +
+
+ {{_titleFn(item)}} +
+ {{_subtitleFn(item)}} +
+ {{popupItemActionIcon}}
diff --git a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.scss b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.scss index 0888bcfa6..6be1e76f5 100644 --- a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.scss +++ b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.scss @@ -19,6 +19,23 @@ } +.title-fn { + flex-grow: 1; + white-space: nowrap; + width: calc(100% - 16px); + overflow: hidden; + text-overflow: ellipsis; +} + +.option-icon { + mat-icon { + margin: 0px 5px 0px 10px; + } + mat-icon:hover { + color: #129d99; + } +} + .two-line-mat-option { line-height: 1.2em; } diff --git a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts index 5f05404a0..5ccb029f1 100644 --- a/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts +++ b/dmp-frontend/src/app/library/auto-complete/multiple/multiple-auto-complete.component.ts @@ -1,5 +1,5 @@ import { FocusMonitor } from '@angular/cdk/a11y'; -import { COMMA, ENTER } from '@angular/cdk/keycodes'; +import { BACKSPACE, COMMA, ENTER } from '@angular/cdk/keycodes'; import { Component, DoCheck, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, Self, SimpleChanges, TemplateRef, ViewChild } from '@angular/core'; import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms'; import { ErrorStateMatcher, MatChipInputEvent, mixinErrorState } from '@angular/material'; @@ -45,6 +45,9 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp @Output() optionSelected: EventEmitter = new EventEmitter(); @Output() optionRemoved: EventEmitter = new EventEmitter(); + @Output() optionActionClicked: EventEmitter = new EventEmitter(); + + id = `multiple-autocomplete-${MultipleAutoCompleteComponent.nextId++}`; stateChanges = new Subject(); focused = false; @@ -200,6 +203,12 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp } } + public onKeyDown(event) { + if (event.keyCode === BACKSPACE && event.target.value.length === 0 && this._selectedItems.size > 0) { + this._removeSelectedItem(Array.from(this._selectedItems.values()).pop(), event); + } + } + private _setValue(value: any) { this.value = value; this.pushChanges(this.value); @@ -301,6 +310,10 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp return this.configuration.autoSelectFirstOptionOnBlur != null ? this.configuration.autoSelectFirstOptionOnBlur : false; } + get popupItemActionIcon(): string { + return this.configuration.popupItemActionIcon != null ? this.configuration.popupItemActionIcon : ''; + } + //Chip Functions _addItem(event: MatChipInputEvent): void { @@ -329,4 +342,9 @@ export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase imp this.autocompleteInput.nativeElement.focus(); this.pushChanges(this.value); } + + _optionActionClick(item: any, event: MouseEvent): void { + if (event != null) { event.stopPropagation(); } + this.optionActionClicked.emit(item); + } } diff --git a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.html b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.html new file mode 100644 index 000000000..8fa254b96 --- /dev/null +++ b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.html @@ -0,0 +1,17 @@ +
+
+ {{'DMP-LISTING.COLUMNS.PROFILE' | translate}} - {{data.template.label}} + close +
+
+ +
+
+ +
+
+
+ +
+
+
diff --git a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.scss b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.scss new file mode 100644 index 000000000..d0cc40e03 --- /dev/null +++ b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.scss @@ -0,0 +1,42 @@ +.template-container { + .header { + display: flex; + width: 100%; + height: 89px; + background-color: #129D99; + color: #FFFFFF; + font-size: 1.25rem; + } + + .template-title { + margin-left: 37px; + } + + .close-icon { + cursor: pointer; + margin-right: 20px; + } + + .close-icon:hover { + background-color: #fefefe6e !important; + border-radius: 50%; + } + + .definition-content { + display: block; + margin: 0px; + padding: 0 24px; + } + + .start-btn { + background: #129d99 0% 0% no-repeat padding-box; + border: 1px solid #129d99; + border-radius: 30px; + opacity: 1; + width: 101px; + height: 43px; + color: #ffffff; + font-weight: 500; + } +} + diff --git a/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts new file mode 100644 index 000000000..a00cc07fc --- /dev/null +++ b/dmp-frontend/src/app/ui/dmp/dataset-preview/dataset-preview-dialog.component.ts @@ -0,0 +1,54 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; +import { ProgressIndicationService } from '@app/core/services/progress-indication/progress-indication-service'; +import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; +import { BaseComponent } from '@common/base/base.component'; +import { takeUntil } from 'rxjs/operators'; + +@Component({ + selector: 'app-dataset-preview-dialog-component', + templateUrl: 'dataset-preview-dialog.component.html', + styleUrls: ['./dataset-preview-dialog.component.scss'], +}) +export class DatasetPreviewDialogComponent extends BaseComponent implements OnInit { + + datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel; + datasetProfileDefinitionFormGroup: FormGroup; + progressIndication = false; + + constructor( + public dialogRef: MatDialogRef, + private datasetWizardService: DatasetWizardService, + private progressIndicationService: ProgressIndicationService, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + super(); + } + + ngOnInit(): void { + this.progressIndicationService.getProgressIndicationObservable().pipe(takeUntil(this._destroyed)).subscribe(x => { + setTimeout(() => { this.progressIndication = x; }); + }); + + if (this.data && this.data.template) { + this.datasetWizardService.getDefinition(this.data.template.id) + .pipe(takeUntil(this._destroyed)) + .subscribe(item => { + this.datasetProfileDefinitionModel = new DatasetDescriptionFormEditorModel().fromModel(item); + this.datasetProfileDefinitionFormGroup = this.datasetProfileDefinitionModel.buildForm(); + this.datasetProfileDefinitionFormGroup.disable(); + }); + } + } + + select(): void { + this.dialogRef.close(true); + } + + closeDialog(): void { + this.dialogRef.close(); + } + +} diff --git a/dmp-frontend/src/app/ui/dmp/dmp.module.ts b/dmp-frontend/src/app/ui/dmp/dmp.module.ts index 3f37ce449..c62ff93dc 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp.module.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp.module.ts @@ -48,6 +48,7 @@ import { NgxDropzoneModule } from 'ngx-dropzone'; import { DmpToDatasetDialogComponent } from './dmp-to-dataset/dmp-to-dataset-dialog.component'; import { FormProgressIndicationComponent } from '../misc/dataset-description-form/components/form-progress-indication/form-progress-indication.component'; import { FormProgressIndicationModule } from '../misc/dataset-description-form/components/form-progress-indication/form-progress-indication.module'; +import { DatasetPreviewDialogComponent } from './dataset-preview/dataset-preview-dialog.component'; @NgModule({ imports: [ @@ -99,7 +100,8 @@ import { FormProgressIndicationModule } from '../misc/dataset-description-form/c MainInfoComponent, FundingInfoComponent, DatasetInfoComponent, - LicenseInfoComponent + LicenseInfoComponent, + DatasetPreviewDialogComponent ], entryComponents: [ DmpInvitationDialogComponent, @@ -114,7 +116,8 @@ import { FormProgressIndicationModule } from '../misc/dataset-description-form/c AddCostComponent, StartNewDmpDialogComponent, StartNewDatasetDialogComponent, - DatasetEditorDetailsComponent + DatasetEditorDetailsComponent, + DatasetPreviewDialogComponent ] }) export class DmpModule { } diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.html b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.html index d2a37ecf0..06b9d9be5 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.html @@ -13,7 +13,7 @@
- + {{formGroup.get('profiles').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts index fba7b8927..b63540869 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts @@ -24,6 +24,7 @@ import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-descript import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; import { DmpListingModel } from '@app/core/model/dmp/dmp-listing'; import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service'; +import { DatasetPreviewDialogComponent } from '../../dataset-preview/dataset-preview-dialog.component'; @Component({ selector: 'dataset-info', @@ -49,6 +50,7 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel; + datasetProfileDefinitionFormGroup: FormGroup; constructor( private language: TranslateService, @@ -71,7 +73,8 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], titleFn: (item) => item['label'], - subtitleFn: (item) => item['description'] + subtitleFn: (item) => item['description'], + popupItemActionIcon: 'visibility' }; if (this.formGroup.get('definition')) { this.selectedDmpProfileDefinition = this.formGroup.get('definition').value; } @@ -84,7 +87,8 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], titleFn: (item) => item['label'], - subtitleFn: (item) => item['description'] + subtitleFn: (item) => item['description'], + popupItemActionIcon: 'visibility' }; } } @@ -205,4 +209,30 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { } } + + onPreviewTemplate(event) { + const dialogRef = this.dialog.open(DatasetPreviewDialogComponent, { + width: '590px', + minHeight: '200px', + restoreFocus: false, + data: { + template: event + }, + panelClass: 'custom-modalbox' + }); + dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { + if (result) { + let profiles = this.formGroup.get('profiles').value; + profiles.push(event); + this.formGroup.get('profiles').setValue(profiles); + this.profilesAutoCompleteConfiguration = { + filterFn: this.filterProfiles.bind(this), + initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), + displayFn: (item) => item['label'], + titleFn: (item) => item['label'], + subtitleFn: (item) => item['description'] + }; + } + }); + } } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss index 01d5c7493..dc8e75447 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss @@ -2,7 +2,7 @@ .expansion-panel { // background-color: #eeeeee54; background-color: white; - margin-bottom: 1em; + // margin-bottom: 1em; } .addOneFieldButton { margin-top: -15px; diff --git a/dmp-frontend/src/assets/css/demo.css b/dmp-frontend/src/assets/css/demo.css index f330ec492..f904db6c4 100644 --- a/dmp-frontend/src/assets/css/demo.css +++ b/dmp-frontend/src/assets/css/demo.css @@ -667,6 +667,10 @@ hr { cursor: pointer; } +.custom-modalbox > mat-dialog-container { + padding: 0px; +} + @media (min-width: 576px) { .container { max-width: 540px; From 1d0a375453ea524e5d5f76b3fdf33bb0e3bca0e1 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Tue, 20 Oct 2020 13:23:22 +0300 Subject: [PATCH 024/260] Adds preview icon on all profile multiple autocomplete fields --- .../app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts | 3 ++- .../dataset-editor-details.component.ts | 3 ++- .../ui/dmp/editor/dataset-info/dataset-info.component.ts | 6 ++++-- .../app/ui/dmp/editor/general-tab/general-tab.component.ts | 3 ++- .../upload-dialogue/dmp-upload-dialogue.component.ts | 3 ++- .../app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts | 3 ++- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts index a82be1604..41325f3de 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts @@ -35,7 +35,8 @@ export class CloneDialogComponent { initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], titleFn: (item) => item['label'], - subtitleFn: (item) => item['description'] + subtitleFn: (item) => item['description'], + popupItemActionIcon: 'visibility' }; if (this.data.isNewVersion) { diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts index c2defedee..b9e187773 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts @@ -107,7 +107,8 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], titleFn: (item) => item['label'], - subtitleFn: (item) => item['description'] + subtitleFn: (item) => item['description'], + popupItemActionIcon: 'visibility' }; } diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts index b63540869..b86c77098 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-info/dataset-info.component.ts @@ -204,7 +204,8 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], titleFn: (item) => item['label'], - subtitleFn: (item) => item['description'] + subtitleFn: (item) => item['description'], + popupItemActionIcon: 'visibility' }; } @@ -230,7 +231,8 @@ export class DatasetInfoComponent extends BaseComponent implements OnInit { initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], titleFn: (item) => item['label'], - subtitleFn: (item) => item['description'] + subtitleFn: (item) => item['description'], + popupItemActionIcon: 'visibility' }; } }); diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts index a4580bf5a..720e4b883 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.ts @@ -51,7 +51,8 @@ export class GeneralTabComponent extends BaseComponent implements OnInit { initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], titleFn: (item) => item['label'], - subtitleFn: (item) => item['description'] + subtitleFn: (item) => item['description'], + popupItemActionIcon: 'visibility' }; organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { diff --git a/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts index 7446e4e0d..95ae0f6c7 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/upload-dialogue/dmp-upload-dialogue.component.ts @@ -23,7 +23,8 @@ export class DmpUploadDialogue { initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], titleFn: (item) => item['label'], - subtitleFn: (item) => item['description'] + subtitleFn: (item) => item['description'], + popupItemActionIcon: 'visibility' }; diff --git a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts index e7eabc512..d050ea2bc 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts @@ -77,7 +77,8 @@ export class DmpWizardEditorComponent extends BaseComponent implements OnInit { filterFn: this.filterProfiles.bind(this), initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => item['label'], - titleFn: (item) => item['label'] + titleFn: (item) => item['label'], + popupItemActionIcon: 'visibility' }; this.organisationsAutoCompleteConfiguration = { From 2c5feb5fa9fee5c81280b2cb589ebfecadf4b8ee Mon Sep 17 00:00:00 2001 From: apapachristou Date: Fri, 23 Oct 2020 10:49:09 +0300 Subject: [PATCH 025/260] Restyles profile page --- dmp-frontend/src/app/app.component.html | 2 +- .../common/enum/role-organization-type.ts | 16 ++ .../src/app/core/model/user/user-listing.ts | 4 + .../services/utilities/enum-utils.service.ts | 20 ++ .../app/ui/auth/login/login.component.scss | 3 +- .../user-profile/user-profile-editor.model.ts | 42 ++++ .../user-profile/user-profile.component.html | 180 +++++++++++++++++- .../user-profile/user-profile.component.scss | 158 ++++++++++++++- .../ui/user-profile/user-profile.component.ts | 70 +++++-- .../ui/user-profile/user-profile.module.ts | 6 +- dmp-frontend/src/assets/i18n/de.json | 26 ++- dmp-frontend/src/assets/i18n/en.json | 26 ++- dmp-frontend/src/assets/i18n/es.json | 26 ++- dmp-frontend/src/assets/i18n/gr.json | 28 ++- dmp-frontend/src/assets/i18n/sk.json | 28 ++- dmp-frontend/src/assets/i18n/tr.json | 28 ++- .../sign-in-dialog.component.scss | 3 +- dmp-frontend/src/index.html | 2 +- dmp-frontend/src/styles.scss | 2 +- 19 files changed, 631 insertions(+), 39 deletions(-) create mode 100644 dmp-frontend/src/app/core/common/enum/role-organization-type.ts create mode 100644 dmp-frontend/src/app/ui/user-profile/user-profile-editor.model.ts diff --git a/dmp-frontend/src/app/app.component.html b/dmp-frontend/src/app/app.component.html index 3e7595fa7..fbe96e3b4 100644 --- a/dmp-frontend/src/app/app.component.html +++ b/dmp-frontend/src/app/app.component.html @@ -25,4 +25,4 @@ - \ No newline at end of file + diff --git a/dmp-frontend/src/app/core/common/enum/role-organization-type.ts b/dmp-frontend/src/app/core/common/enum/role-organization-type.ts new file mode 100644 index 000000000..e8b87c7b4 --- /dev/null +++ b/dmp-frontend/src/app/core/common/enum/role-organization-type.ts @@ -0,0 +1,16 @@ +export enum RoleOrganizationType { + Faculty = "Faculty", + Librarian = "Librarian", + Researcher = "Researcher", + Student = "Student (BA/BSc, MSc)", + EarlyCareerResearcher = "Early Career Researcher (PhD candidate, post-graduate)", + ResearchAdministrator = "Research Administrator", + RepositoryManager = "Repository Manager", + ResearchInfrastructure = "Research Infrastructure", + ServiceProvider = "Service Provider", + Publisher = "Publisher", + ResearchFunder = "Research Funder", + Policymaker = "Policymaker", + SMEIndustry = "SME/ Industry", + Other = "Other" +} diff --git a/dmp-frontend/src/app/core/model/user/user-listing.ts b/dmp-frontend/src/app/core/model/user/user-listing.ts index fde223cb0..89e792cff 100644 --- a/dmp-frontend/src/app/core/model/user/user-listing.ts +++ b/dmp-frontend/src/app/core/model/user/user-listing.ts @@ -1,4 +1,6 @@ +import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type'; import { AppRole } from "../../common/enum/app-role"; +import { OrganizationModel } from '../organisation/organization'; export interface UserListingModel { id: String; @@ -11,4 +13,6 @@ export interface UserListingModel { timezone: String; zenodoEmail: String; avatarUrl: String; + organization: OrganizationModel; + roleOrganization: RoleOrganizationType; } diff --git a/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts b/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts index 54d821ead..d30f81689 100644 --- a/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts +++ b/dmp-frontend/src/app/core/services/utilities/enum-utils.service.ts @@ -11,6 +11,7 @@ import { ValidationType } from '../../common/enum/validation-type'; import { DatasetProfileInternalDmpEntitiesType } from '../../common/enum/dataset-profile-internal-dmp-entities-type'; import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order'; import { Role } from '@app/core/common/enum/role'; +import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type'; @Injectable() export class EnumUtils { @@ -122,4 +123,23 @@ export class EnumUtils { case Role.Member: return this.language.instant('FACET-SEARCH.ROLE.MEMBER'); } } + + toRoleOrganizationString(status: RoleOrganizationType): string { + switch (status) { + case RoleOrganizationType.Faculty: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.FACULTY'); + case RoleOrganizationType.Librarian: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.LIBRARIAN'); + case RoleOrganizationType.Researcher: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.RESEARCHER'); + case RoleOrganizationType.Student: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.STUDENT'); + case RoleOrganizationType.EarlyCareerResearcher: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.EARLY-CAREER-RESEARCHER'); + case RoleOrganizationType.ResearchAdministrator: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.RESEARCH-ADMINISTRATOR'); + case RoleOrganizationType.RepositoryManager: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.REPOSITORY-MANAGER'); + case RoleOrganizationType.ResearchInfrastructure: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.RESEARCH-INFRASTRUCTURE'); + case RoleOrganizationType.ServiceProvider: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.SERVICE-PROVIDER'); + case RoleOrganizationType.Publisher: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.PUBLISHER'); + case RoleOrganizationType.ResearchFunder: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.RESEARCH-FUNDER'); + case RoleOrganizationType.Policymaker: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.POLICY-MAKER'); + case RoleOrganizationType.SMEIndustry: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.SME-INDUSTRY'); + case RoleOrganizationType.Other: return this.language.instant('USER-PROFILE.ROLE-ORGANIZATION.OTHER'); + } + } } diff --git a/dmp-frontend/src/app/ui/auth/login/login.component.scss b/dmp-frontend/src/app/ui/auth/login/login.component.scss index 0b52e1d95..30e0811b5 100644 --- a/dmp-frontend/src/app/ui/auth/login/login.component.scss +++ b/dmp-frontend/src/app/ui/auth/login/login.component.scss @@ -1,5 +1,6 @@ .login-screen { - margin-top: 70px; + // margin-top: 70px; + padding-top: 80px; min-height: calc(100vh - 10px); } diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile-editor.model.ts b/dmp-frontend/src/app/ui/user-profile/user-profile-editor.model.ts new file mode 100644 index 000000000..39044b5f4 --- /dev/null +++ b/dmp-frontend/src/app/ui/user-profile/user-profile-editor.model.ts @@ -0,0 +1,42 @@ +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type'; +import { OrganizationModel } from '@app/core/model/organisation/organization'; +import { UserListingModel } from '@app/core/model/user/user-listing'; +const availableLanguages: any[] = require('../../../assets/resources/language.json'); + +export class UserProfileEditorModel { + public id: String; + public name: String; + public language: any; + public culture: any; + public timezone: String; + public organization: OrganizationModel; + public roleOrganization: RoleOrganizationType; + + fromModel(item: UserListingModel): UserProfileEditorModel { + this.id = item.id; + this.name = item.name; + this.language = item.language; + this.timezone = item.timezone; + this.culture = item.culture; + this.organization = item.organization; + this.roleOrganization = item.roleOrganization; + + return this; + } + + buildForm(): FormGroup { + const formGroup = new FormBuilder().group({ + id: new FormControl(this.id), + name: new FormControl(this.name), + language: new FormControl(this.language ? availableLanguages.filter(x => x.value === this.language.value).pop() : '', [Validators.required]), + timezone: new FormControl(this.timezone, [Validators.required]), + culture: new FormControl(this.culture, [Validators.required]), + organization: new FormControl(this.organization), + roleOrganization: new FormControl(this.roleOrganization), + }); + + return formGroup; + } + +} diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html index d0c3eb6ea..e13026849 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html @@ -1,4 +1,180 @@ -
+
+
+ + + +
+
+ + + diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.scss b/dmp-frontend/src/app/ui/user-profile/user-profile.component.scss index b96e9d794..0738bacc5 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.scss +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.scss @@ -1,5 +1,12 @@ -.clickable{ - cursor: pointer; +.profile { + height: fit-content; + margin-top: 80px; + min-height: 100vh; + background-color: #ffffff; +} + +.clickable { + cursor: pointer; } .clickable:hover { //text-decoration: underline; //Alternative @@ -13,24 +20,157 @@ // width: 100% // } .user-profile { - .profile-card-center-row { - justify-content: center; - } + .profile-card-center-row { + justify-content: center; + } - .profile-card { - margin-bottom: 1em; - } + .profile-card { + margin-bottom: 1em; + } + + .user-profile-title { + font-size: 1.25rem; + color: #212121; + padding-top: 4.1875rem; + padding-left: 3.75rem; + padding-bottom: 4.0625rem; + } + + .profile-content { + margin-left: 9rem; + margin-right: 11rem; + + .avatar { + border-radius: 50%; + width: 122px; + height: 122px; + box-shadow: 0px 3px 6px #00000029; + } + } + + .camera { + position: relative; + bottom: 17px; + + .material-icons-two-tone { + background-color: #00ffdc; + font-size: 34px; + width: 34px; + height: 34px; + -webkit-background-clip: text; + } + } + + .main-info { + margin-bottom: 34px; + } + + .name { + color: #129d99; + font-weight: 500; + font-size: 1.25rem; + line-height: 3rem; + } + + .connected { + color: #a8a8a8; + } + + .mail { + color: #129d99; + font-weight: 500; + } + + .field-title { + color: #212121; + opacity: 0.81; + font-size: 1.125rem; + font-weight: 500; + } } .settings { - line-height: 2.4em !important; + line-height: 2.4em !important; } .zenodo-email { color: black; } +.remove-btn { + padding-bottom: 1.34375em; +} + .unlinkBtn { background-color: FireBrick; color: white; } + +.save-btn { + background: #129d99 0% 0% no-repeat padding-box; + border-radius: 30px; + opacity: 1; + width: auto; + min-width: 110px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; + font-weight: 700; + color: #ffffff; + cursor: pointer; +} + +::ng-deep .name-form .mat-form-field-appearance-outline .mat-form-field-outline { + background: #fafafa !important; +} + +::ng-deep .name-form .mat-form-field-appearance-outline .mat-form-field-infix { + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; +} + +::ng-deep .organization-form .mat-form-field-appearance-outline .mat-form-field-outline { + background: #fafafa !important; +} + +::ng-deep .organization-form .mat-form-field-appearance-outline .mat-form-field-infix { + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; +} + +::ng-deep .timezone-form .mat-form-field-appearance-outline .mat-form-field-outline { + background: #fafafa !important; +} + +::ng-deep .timezone-form .mat-form-field-appearance-outline .mat-form-field-infix { + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; +} + +::ng-deep .culture-form .mat-form-field-appearance-outline .mat-form-field-outline { + background: #fafafa !important; +} + +::ng-deep .culture-form .mat-form-field-appearance-outline .mat-form-field-infix { + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; +} + +::ng-deep .language-form .mat-form-field-appearance-outline .mat-form-field-outline { + background: #fafafa !important; +} + +::ng-deep .language-form .mat-form-field-appearance-outline .mat-form-field-infix { + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; +} + +::ng-deep .role-form .mat-form-field-appearance-outline .mat-form-field-outline { + background: #fafafa !important; +} + +::ng-deep .role-form .mat-form-field-appearance-outline .mat-form-field-infix { + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; +} diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts index 3d3bd1af4..534e5c0c3 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts @@ -16,6 +16,12 @@ import { LanguageService } from '@app/core/services/language/language.service'; import { isNullOrUndefined } from 'util'; import { Oauth2DialogService } from '../misc/oauth2-dialog/service/oauth2-dialog.service'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; +import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration'; +import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item'; +import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service'; +import { UserProfileEditorModel } from './user-profile-editor.model'; +import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type'; +import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; const availableLanguages: any[] = require('../../../assets/resources/language.json'); @@ -26,6 +32,7 @@ const availableLanguages: any[] = require('../../../assets/resources/language.js }) export class UserProfileComponent extends BaseComponent implements OnInit, OnDestroy { + userProfileEditorModel: UserProfileEditorModel; user: Observable; currentUserId: string; cultures: Observable; @@ -34,6 +41,15 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes languages = availableLanguages; zenodoToken: string; zenodoEmail: String; + roleOrganizationEnum = RoleOrganizationType; + + organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { + filterFn: this.filterOrganisations.bind(this), + initialItems: (excludedItems: any[]) => this.filterOrganisations('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), + displayFn: (item) => item['name'], + titleFn: (item) => item['name'], + subtitleFn: (item) => item['tag'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['tag'] : (item['key'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['key'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')) + }; formGroup: FormGroup; constructor( @@ -43,10 +59,12 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes private authService: AuthService, private language: TranslateService, private cultureService: CultureService, + private externalSourcesService: ExternalSourcesService, private authentication: AuthService, private languageService: LanguageService, private configurationService: ConfigurationService, - private oauth2DialogService: Oauth2DialogService + private oauth2DialogService: Oauth2DialogService, + public enumUtils: EnumUtils ) { super(); } ngOnInit() { @@ -59,19 +77,24 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes //result['additionalinfo'] = JSON.parse(result['additionalinfo']); //this.zenodoToken = result['additionalinfo']['zenodoToken']; this.zenodoEmail = result['zenodoEmail']; - this.formGroup = new FormBuilder().group({ - language: new FormControl(result['language'] ? availableLanguages.filter(x => x.value === result['language']['value']).pop() : '', [Validators.required]), - timezone: new FormControl(result['timezone'], [Validators.required]), - culture: new FormControl(result['culture'], [Validators.required]) - }); + + this.userProfileEditorModel = new UserProfileEditorModel().fromModel(result); + this.formGroup = this.userProfileEditorModel.buildForm(); + // this.formGroup = new FormBuilder().group({ + // language: new FormControl(result['language'] ? availableLanguages.filter(x => x.value === result['language']['value']).pop() : '', [Validators.required]), + // timezone: new FormControl(result['timezone'], [Validators.required]), + // culture: new FormControl(result['culture'], [Validators.required]) + // }); + //this.formGroup.get('language').valueChanges.pipe(takeUntil(this._destroyed)).subscribe(x => { if (x) this.translate.use(x.value) }) this.formGroup.get('timezone').valueChanges - .pipe(takeUntil(this._destroyed)) - .subscribe(x => { if (x) { this.timezones = this._filterTimezone(x); } }); + .pipe(takeUntil(this._destroyed)) + .subscribe(x => { if (x) { this.timezones = this._filterTimezone(x); } }); this.formGroup.get('culture').valueChanges - .pipe(takeUntil(this._destroyed)) - .subscribe(x => { if (x) { this.cultures = this._filterCulture(x); } }); - this.formGroup.disable(); + .pipe(takeUntil(this._destroyed)) + .subscribe(x => { if (x) { this.cultures = this._filterCulture(x); } }); + // this.initializeDisabledFormGroup(); + this.unlock(); return result; })); }); @@ -101,6 +124,10 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes this.router.navigate(['/plans/edit/' + dmp.id]); } + private filterOrganisations(value: string): Observable { + return this.externalSourcesService.searchDMPOrganizations(value); + } + private _filterTimezone(value: string): Observable { if (value && typeof value === 'string') { const filterValue = value.toLowerCase(); @@ -124,7 +151,22 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes } save() { - + if (!this.formGroup.valid) { return; } + this.userService.updateUserSettings(this.formGroup.value) + .pipe(takeUntil(this._destroyed)) + .subscribe( + x => { + this.editMode = false; + this.languageService.changeLanguage(this.formGroup.value.language.value); + this.authService.current().culture = this.formGroup.value.culture.name; + this.authService.me() + .pipe(takeUntil(this._destroyed)) + .subscribe(result => this.router.navigate(['/profile'])); + // .subscribe(result => window.location.reload()); + }, + error => { + console.log(error); + }); } public unlock() { @@ -132,6 +174,10 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes this.formGroup.enable(); } + public initializeDisabledFormGroup() { + this.formGroup.disable(); + } + public lock() { if (!this.formGroup.valid) { return; } this.userService.updateUserSettings(this.formGroup.value) diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts index 29f166199..0c28ce678 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { FormattingModule } from '@app/core/formatting.module'; +import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module'; import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; import { UserProfileComponent } from './user-profile.component'; @@ -10,10 +11,11 @@ import { UserProfileRoutingModule } from './user-profile.routing'; CommonUiModule, CommonFormsModule, FormattingModule, - UserProfileRoutingModule + UserProfileRoutingModule, + AutoCompleteModule ], declarations: [ UserProfileComponent ] }) -export class UserProfileModule { } \ No newline at end of file +export class UserProfileModule { } diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 480e86136..4e2d86d79 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -1361,7 +1361,12 @@ "TITLE": "Einstellungen", "TIMEZONE": "Zeitzone", "CULTURE": "Kultur", - "LANGUAGE": "Sprache" + "LANGUAGE": "Sprache", + "CONNECTED-WITH": "Connected with", + "NAME": "Name", + "ORGANIZATION": "Organization", + "ROLE": "Rolle", + "SELECT-ROLE": "Select Role" }, "ASSOCIATED-DMPS": "Zugehörige DMPs", "DMPS": { @@ -1374,6 +1379,25 @@ "LOGOUT": "Remove Zenodo", "TITLE": "Zenodo Account", "DESCRIPTION": "Linked Zenodo Account:" + }, + "ROLE-ORGANIZATION": { + "FACULTY": "Faculty", + "LIBRARIAN": "Librarian", + "RESEARCHER": "Researcher", + "STUDENT": "Student (BA/BSc, MSc)", + "EARLY-CAREER-RESEARCHER": "Early Career Researcher (PhD candidate, post-graduate)", + "RESEARCH-ADMINISTRATOR": "Research Administrator", + "REPOSITORY-MANAGER": "Repository Manager", + "RESEARCH-INFRASTRUCTURE": "Research Infrastructure", + "SERVICE-PROVIDER": "Service Provider", + "PUBLISHER": "Publisher", + "RESEARCH-FUNDER": "Research Funder", + "POLICY-MAKER": "Policymaker", + "SME-INDUSTRY": "SME/ Industry", + "OTHER": "Other" + }, + "ACTIONS": { + "SAVE": "Save" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 8cad2a9ca..aac636def 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1361,7 +1361,12 @@ "TITLE": "Settings", "TIMEZONE": "Time Zone", "CULTURE": "Culture", - "LANGUAGE": "Language" + "LANGUAGE": "Language", + "CONNECTED-WITH": "Connected with", + "NAME": "Name", + "ORGANIZATION": "Organization", + "ROLE": "Role", + "SELECT-ROLE": "Select Role" }, "ASSOCIATED-DMPS": "Associated DMPs", "DMPS": { @@ -1374,6 +1379,25 @@ "LOGOUT": "Remove Zenodo", "TITLE": "Zenodo Account", "DESCRIPTION": "Linked Zenodo Account:" + }, + "ROLE-ORGANIZATION": { + "FACULTY": "Faculty", + "LIBRARIAN": "Librarian", + "RESEARCHER": "Researcher", + "STUDENT": "Student (BA/BSc, MSc)", + "EARLY-CAREER-RESEARCHER": "Early Career Researcher (PhD candidate, post-graduate)", + "RESEARCH-ADMINISTRATOR": "Research Administrator", + "REPOSITORY-MANAGER": "Repository Manager", + "RESEARCH-INFRASTRUCTURE": "Research Infrastructure", + "SERVICE-PROVIDER": "Service Provider", + "PUBLISHER": "Publisher", + "RESEARCH-FUNDER": "Research Funder", + "POLICY-MAKER": "Policymaker", + "SME-INDUSTRY": "SME/ Industry", + "OTHER": "Other" + }, + "ACTIONS": { + "SAVE": "Save" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index e3f893807..aa7e368ff 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1361,7 +1361,12 @@ "TITLE": "Configuración", "TIMEZONE": "Zona horaria", "CULTURE": "Cultura", - "LANGUAGE": "Idioma" + "LANGUAGE": "Idioma", + "CONNECTED-WITH": "Connected with", + "NAME": "Name", + "ORGANIZATION": "Organization", + "ROLE": "Role", + "SELECT-ROLE": "Select Role" }, "ASSOCIATED-DMPS": "PGDs asociados", "DMPS": { @@ -1374,6 +1379,25 @@ "LOGOUT": "Eliminar Zenodo", "TITLE": "Cuenta en Zenodo", "DESCRIPTION": "Enlazar una cuenta en Zenodo:" + }, + "ROLE-ORGANIZATION": { + "FACULTY": "Faculty", + "LIBRARIAN": "Librarian", + "RESEARCHER": "Researcher", + "STUDENT": "Student (BA/BSc, MSc)", + "EARLY-CAREER-RESEARCHER": "Early Career Researcher (PhD candidate, post-graduate)", + "RESEARCH-ADMINISTRATOR": "Research Administrator", + "REPOSITORY-MANAGER": "Repository Manager", + "RESEARCH-INFRASTRUCTURE": "Research Infrastructure", + "SERVICE-PROVIDER": "Service Provider", + "PUBLISHER": "Publisher", + "RESEARCH-FUNDER": "Research Funder", + "POLICY-MAKER": "Policymaker", + "SME-INDUSTRY": "SME/ Industry", + "OTHER": "Other" + }, + "ACTIONS": { + "SAVE": "Save" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 01db4219d..406c02879 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1032,7 +1032,7 @@ }, "HINT": { "TITLE": "Μία σύντομη περιγραφή του τι", - "TITLE-REST": "αφορά, το πεδίο εφαρμογής του και τους στόχους του." + "TITLE-REST": "αφορά, το πεδίο εφαρμογής του και τους στόχους του." }, "VERSION-DIALOG": { "ABOUT": "Η δημιουργία νέας έκδοσης συμβαίνει αυτόματα", @@ -1361,7 +1361,12 @@ "TITLE": "Ρυθμίσεις", "TIMEZONE": "Ζώνη Ώρας", "CULTURE": "Κουλτούρα", - "LANGUAGE": "Γλώσσα" + "LANGUAGE": "Γλώσσα", + "CONNECTED-WITH": "Connected with", + "NAME": "Name", + "ORGANIZATION": "Organization", + "ROLE": "Ρόλος", + "SELECT-ROLE": "Select Role" }, "ASSOCIATED-DMPS": "Συσχετιζόμενα Σχέδια Διαχείρισης Δεδομένων", "DMPS": { @@ -1374,6 +1379,25 @@ "LOGOUT": "Αφαίρεση Zenodo", "TITLE": "Λογαριασμός Zenodo", "DESCRIPTION": "Συνδεδεμένος Λογαριασμός Zenodo:" + }, + "ROLE-ORGANIZATION": { + "FACULTY": "Faculty", + "LIBRARIAN": "Librarian", + "RESEARCHER": "Researcher", + "STUDENT": "Student (BA/BSc, MSc)", + "EARLY-CAREER-RESEARCHER": "Early Career Researcher (PhD candidate, post-graduate)", + "RESEARCH-ADMINISTRATOR": "Research Administrator", + "REPOSITORY-MANAGER": "Repository Manager", + "RESEARCH-INFRASTRUCTURE": "Research Infrastructure", + "SERVICE-PROVIDER": "Service Provider", + "PUBLISHER": "Publisher", + "RESEARCH-FUNDER": "Research Funder", + "POLICY-MAKER": "Policymaker", + "SME-INDUSTRY": "SME/ Industry", + "OTHER": "Other" + }, + "ACTIONS": { + "SAVE": "Save" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 1493a0bd6..f79590458 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -1361,7 +1361,12 @@ "TITLE": "Nastavenia", "TIMEZONE": "Časové pásmo", "CULTURE": "Kultúra", - "LANGUAGE": "Jazyk" + "LANGUAGE": "Jazyk", + "CONNECTED-WITH": "Connected with", + "NAME": "Name", + "ORGANIZATION": "Organization", + "ROLE": "Rola", + "SELECT-ROLE": "Select Role" }, "ASSOCIATED-DMPS": "Pridružené DMP", "DMPS": { @@ -1374,6 +1379,25 @@ "LOGOUT": "odstrániť Zenodo", "TITLE": "Zenodo účet", "DESCRIPTION": "Prepojený Zenodo účet :" + }, + "ROLE-ORGANIZATION": { + "FACULTY": "Faculty", + "LIBRARIAN": "Librarian", + "RESEARCHER": "Researcher", + "STUDENT": "Student (BA/BSc, MSc)", + "EARLY-CAREER-RESEARCHER": "Early Career Researcher (PhD candidate, post-graduate)", + "RESEARCH-ADMINISTRATOR": "Research Administrator", + "REPOSITORY-MANAGER": "Repository Manager", + "RESEARCH-INFRASTRUCTURE": "Research Infrastructure", + "SERVICE-PROVIDER": "Service Provider", + "PUBLISHER": "Publisher", + "RESEARCH-FUNDER": "Research Funder", + "POLICY-MAKER": "Policymaker", + "SME-INDUSTRY": "SME/ Industry", + "OTHER": "Other" + }, + "ACTIONS": { + "SAVE": "Save" } }, "DATASET-REFERENCED-MODELS": { @@ -1536,4 +1560,4 @@ "DRAFT": "Návrh", "FINALIZED": "Dokončené" } -} \ No newline at end of file +} diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index d59057e66..9d4065d5f 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -1361,7 +1361,12 @@ "TITLE": "Ayarlar", "TIMEZONE": "Zaman Dilimi", "CULTURE": "Kültür", - "LANGUAGE": "Dil" + "LANGUAGE": "Dil", + "CONNECTED-WITH": "Connected with", + "NAME": "Name", + "ORGANIZATION": "Organization", + "ROLE": "Görev", + "SELECT-ROLE": "Select Role" }, "ASSOCIATED-DMPS": "İlişkili VYP'ları", "DMPS": { @@ -1374,6 +1379,25 @@ "LOGOUT": "Zenodo'yu Kaldır", "TITLE": "Zenodo Hesabı", "DESCRIPTION": "Bağlantılı Zenodo Hesabı:" + }, + "ROLE-ORGANIZATION": { + "FACULTY": "Faculty", + "LIBRARIAN": "Librarian", + "RESEARCHER": "Researcher", + "STUDENT": "Student (BA/BSc, MSc)", + "EARLY-CAREER-RESEARCHER": "Early Career Researcher (PhD candidate, post-graduate)", + "RESEARCH-ADMINISTRATOR": "Research Administrator", + "REPOSITORY-MANAGER": "Repository Manager", + "RESEARCH-INFRASTRUCTURE": "Research Infrastructure", + "SERVICE-PROVIDER": "Service Provider", + "PUBLISHER": "Publisher", + "RESEARCH-FUNDER": "Research Funder", + "POLICY-MAKER": "Policymaker", + "SME-INDUSTRY": "SME/ Industry", + "OTHER": "Other" + }, + "ACTIONS": { + "SAVE": "Save" } }, "DATASET-REFERENCED-MODELS": { @@ -1536,4 +1560,4 @@ "DRAFT": "Taslak", "FINALIZED": "Tamamlandı" } -} \ No newline at end of file +} diff --git a/dmp-frontend/src/common/modules/sign-in-dialog/sign-in-dialog.component.scss b/dmp-frontend/src/common/modules/sign-in-dialog/sign-in-dialog.component.scss index b05e7b839..21e8dd73b 100644 --- a/dmp-frontend/src/common/modules/sign-in-dialog/sign-in-dialog.component.scss +++ b/dmp-frontend/src/common/modules/sign-in-dialog/sign-in-dialog.component.scss @@ -1,5 +1,6 @@ .login-screen { - margin-top: 70px; + padding-top: 80px; + // margin-top: 70px; min-height: calc(100vh - 10px); } diff --git a/dmp-frontend/src/index.html b/dmp-frontend/src/index.html index 7475f1450..601058d3a 100644 --- a/dmp-frontend/src/index.html +++ b/dmp-frontend/src/index.html @@ -16,7 +16,7 @@ - + diff --git a/dmp-frontend/src/styles.scss b/dmp-frontend/src/styles.scss index 660fa6e4a..78ca91958 100644 --- a/dmp-frontend/src/styles.scss +++ b/dmp-frontend/src/styles.scss @@ -165,7 +165,7 @@ .main-content { background-color: #f5f5f5; - padding-top: 4.68rem; + padding-top: 5rem; padding-bottom: 3rem; // padding-left: 3.31rem; padding-left: 1rem; From 8dd728a85d00c901b73ee8a8cd6d44c056ed7936 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Fri, 23 Oct 2020 11:27:44 +0300 Subject: [PATCH 026/260] Fixes on profile page --- .../src/app/ui/user-profile/user-profile.component.html | 7 +++---- dmp-frontend/src/assets/i18n/de.json | 2 +- dmp-frontend/src/assets/i18n/en.json | 2 +- dmp-frontend/src/assets/i18n/es.json | 2 +- dmp-frontend/src/assets/i18n/gr.json | 2 +- dmp-frontend/src/assets/i18n/sk.json | 2 +- dmp-frontend/src/assets/i18n/tr.json | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html index e13026849..366e68a10 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html @@ -12,8 +12,8 @@
-
{{userProfile.name}}
-
{{'USER-PROFILE.SETTINGS.CONNECTED-WITH' | translate}}: {{userProfile.email}}
+
{{formGroup.get('name').value}}
+
{{'USER-PROFILE.SETTINGS.CONNECTED-WITH' | translate}}:{{userProfile.email}}
@@ -42,8 +42,7 @@
- - + diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 4e2d86d79..cd5a241bb 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -1378,7 +1378,7 @@ "LOGIN": "Login to Zenodo", "LOGOUT": "Remove Zenodo", "TITLE": "Zenodo Account", - "DESCRIPTION": "Linked Zenodo Account:" + "DESCRIPTION": "Linked Zenodo Account" }, "ROLE-ORGANIZATION": { "FACULTY": "Faculty", diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index aac636def..a2a640099 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1378,7 +1378,7 @@ "LOGIN": "Login to Zenodo", "LOGOUT": "Remove Zenodo", "TITLE": "Zenodo Account", - "DESCRIPTION": "Linked Zenodo Account:" + "DESCRIPTION": "Linked Zenodo Account" }, "ROLE-ORGANIZATION": { "FACULTY": "Faculty", diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index aa7e368ff..5faa05dfd 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1378,7 +1378,7 @@ "LOGIN": "Identificarse en Zenodo", "LOGOUT": "Eliminar Zenodo", "TITLE": "Cuenta en Zenodo", - "DESCRIPTION": "Enlazar una cuenta en Zenodo:" + "DESCRIPTION": "Enlazar una cuenta en Zenodo" }, "ROLE-ORGANIZATION": { "FACULTY": "Faculty", diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 406c02879..901895a5c 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1378,7 +1378,7 @@ "LOGIN": "Συνδέση με Zenodo", "LOGOUT": "Αφαίρεση Zenodo", "TITLE": "Λογαριασμός Zenodo", - "DESCRIPTION": "Συνδεδεμένος Λογαριασμός Zenodo:" + "DESCRIPTION": "Συνδεδεμένος Λογαριασμός Zenodo" }, "ROLE-ORGANIZATION": { "FACULTY": "Faculty", diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index f79590458..fbce175fd 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -1378,7 +1378,7 @@ "LOGIN": "Prihlásiť sa do Zenodo", "LOGOUT": "odstrániť Zenodo", "TITLE": "Zenodo účet", - "DESCRIPTION": "Prepojený Zenodo účet :" + "DESCRIPTION": "Prepojený Zenodo účet" }, "ROLE-ORGANIZATION": { "FACULTY": "Faculty", diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 9d4065d5f..a0848126d 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -1378,7 +1378,7 @@ "LOGIN": "Zenodo ile oturum aç", "LOGOUT": "Zenodo'yu Kaldır", "TITLE": "Zenodo Hesabı", - "DESCRIPTION": "Bağlantılı Zenodo Hesabı:" + "DESCRIPTION": "Bağlantılı Zenodo Hesabı" }, "ROLE-ORGANIZATION": { "FACULTY": "Faculty", From 56d6b12555b98f6d5724dd57e0b22cab6788eca5 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Fri, 23 Oct 2020 11:48:27 +0300 Subject: [PATCH 027/260] Add Organization and roleOrganization to the User Info. Also allow to edit the user's name from the updateSettings --- .../eu/eudat/logic/managers/UserManager.java | 2 ++ .../eudat/models/data/dmp/Organisation.java | 13 ++++++++++ .../models/data/userinfo/UserProfile.java | 25 ++++++++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java index 044230061..a0d346020 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java @@ -115,6 +115,8 @@ public class UserManager { apiContext.getOperationsContext().getDatabaseRepository().detachEntity(userInfo); HashMap result = new ObjectMapper().readValue(userInfo.getAdditionalinfo(), HashMap.class); + userInfo.setName(settings.entrySet().stream().filter(entry -> entry.getKey().equals("name")).filter(Objects::nonNull).map(entry -> entry.getValue().toString()).findFirst().orElse(userInfo.getName())); + settings.remove("name"); result.putAll(settings); userInfo.setAdditionalinfo(new JSONObject(result).toString()); apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao() diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/Organisation.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/Organisation.java index c3092bb1f..7fbc5b25a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/Organisation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/Organisation.java @@ -4,6 +4,7 @@ import eu.eudat.models.DataModel; import eu.eudat.logic.utilities.helpers.LabelGenerator; import java.util.Date; +import java.util.HashMap; import java.util.UUID; public class Organisation implements DataModel, LabelGenerator { @@ -95,6 +96,18 @@ public class Organisation implements DataModel map) { + Organisation model = new Organisation(); + model.id = (String) map.get("id"); + model.key = (String) map.get("key"); + model.label = (String) map.get("label"); + model.name = (String) map.get("name"); + model.reference = (String) map.get("reference"); + model.status = (int) map.get("status"); + model.tag = (String) map.get("tag"); + return model; + } @Override public String generateLabel() { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserProfile.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserProfile.java index 05411a72f..28bea2de8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserProfile.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserProfile.java @@ -6,6 +6,7 @@ import eu.eudat.data.entities.*; import eu.eudat.data.entities.UserInfo; import eu.eudat.models.DataModel; import eu.eudat.models.data.dmp.DataManagementPlan; +import eu.eudat.models.data.dmp.Organisation; import net.minidev.json.parser.JSONParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,6 +33,8 @@ public class UserProfile implements DataModel culture; private String avatarUrl; + private Organisation organization; + private String roleOrganization; public UUID getId() { return id; @@ -128,8 +131,26 @@ public class UserProfile implements DataModel) additionalInfo.get("organization")); + this.roleOrganization = (String) additionalInfo.get("roleOrganization"); } catch (IOException e) { logger.error(e.getMessage(), e); } From 8946ea2fb7457a8a938479430c0087d90111c7d5 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Fri, 23 Oct 2020 17:59:59 +0300 Subject: [PATCH 028/260] Changes style of title on dmp an dataset card --- .../src/app/ui/dashboard/dashboard.component.scss | 11 ++++++----- .../app/ui/dashboard/drafts/drafts.component.css | 11 ++++++----- .../app/ui/dashboard/drafts/drafts.component.html | 2 +- .../recent-edited-activity.component.css | 11 ++++++----- .../recent-edited-activity.component.html | 3 ++- .../recent-edited-dataset-activity.component.html | 3 ++- .../recent-edited-dataset-activity.component.scss | 11 ++++++----- .../recent-edited-dmp-activity.component.css | 11 ++++++----- .../dataset-listing-item.component.html | 13 +++++++------ .../dataset-listing-item.component.scss | 11 ++++++----- .../dataset-editor-details.component.ts | 2 +- .../src/app/ui/dmp/editor/dmp-editor.component.scss | 2 +- .../listing-item/dmp-listing-item.component.scss | 11 ++++++----- dmp-frontend/src/assets/i18n/de.json | 7 +++++-- dmp-frontend/src/assets/i18n/en.json | 7 +++++-- dmp-frontend/src/assets/i18n/es.json | 7 +++++-- dmp-frontend/src/assets/i18n/gr.json | 7 +++++-- dmp-frontend/src/assets/i18n/sk.json | 7 +++++-- dmp-frontend/src/assets/i18n/tr.json | 7 +++++-- 19 files changed, 86 insertions(+), 58 deletions(-) diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.scss b/dmp-frontend/src/app/ui/dashboard/dashboard.component.scss index e30827c9e..59eacf94f 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.scss +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.scss @@ -215,10 +215,10 @@ input[type="text"] { .dmp-title, .dataset-title { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + // opacity: 0.81; padding-top: 0.75rem; padding-bottom: 0.55rem; color: #212121; @@ -237,12 +237,13 @@ input[type="text"] { color: #848484; } -.dmp-title-draft { +.dmp-title-draft, +.dataset-title-draft { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + // opacity: 0.81; padding-top: 0.75rem; padding-bottom: 0.55rem; color: #f16868; diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css index e443496e2..b7adab213 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css @@ -72,10 +72,10 @@ input[type="text"] { .dmp-title, .dataset-title { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + /* opacity: 0.81; */ padding-top: 0.75rem; padding-bottom: 0.55rem; color: #212121; @@ -94,12 +94,13 @@ input[type="text"] { color: #848484; } -.dmp-title-draft { +.dmp-title-draft, +.dataset-title-draft { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + /* opacity: 0.81; */ padding-top: 0.75rem; padding-bottom: 0.55rem; color: #f16868; diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html index bc740bf1a..810ca1c81 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html @@ -26,7 +26,7 @@
{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}
{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}
-
{{activity.label}}
+
{{activity.label}}
{{ roleDisplay(activity.users) }} . diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.css b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.css index 6c8c81403..718856adb 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.css +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.css @@ -72,10 +72,10 @@ input[type="text"] { .dmp-title, .dataset-title { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + /* opacity: 0.81; */ padding-top: 0.75rem; padding-bottom: 0.55rem; color: #212121; @@ -94,12 +94,13 @@ input[type="text"] { color: #848484; } -.dmp-title-draft { +.dmp-title-draft, +.dataset-title-draft { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + /* opacity: 0.81; */ padding-top: 0.75rem; padding-bottom: 0.55rem; color: #f16868; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html index 6e3d0c951..ebb4b805d 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html @@ -104,7 +104,8 @@
{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}
{{'DATASET-LISTING.STATES.PUBLISHED' | translate}}: {{activity.publishedAt | date:"longDate"}}
-
{{activity.title}}
+
{{activity.title}}
+
{{activity.title}}
{{ roleDisplay(activity.users) }} . diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html index 311a09f2a..46e5bfc25 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html @@ -28,7 +28,8 @@
{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}
{{'DATASET-LISTING.STATES.PUBLISHED' | translate}}: {{activity.dmpPublishedAt | date:"longDate"}}
-
{{activity.label}}
+
{{activity.label}}
+
{{activity.label}}
{{ roleDisplay(activity.users) }} . diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.scss b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.scss index 201221156..694669d45 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.scss +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.scss @@ -72,10 +72,10 @@ input[type="text"] { .dmp-title, .dataset-title { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + // opacity: 0.81; padding-top: 0.75rem; padding-bottom: 0.55rem; color: #212121; @@ -94,12 +94,13 @@ input[type="text"] { color: #848484; } -.dmp-title-draft { +.dmp-title-draft, +.dataset-title-draft { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + // opacity: 0.81; padding-top: 0.75rem; padding-bottom: 0.55rem; color: #f16868; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.css b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.css index c15a7e8df..5b58378c3 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.css +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.css @@ -69,10 +69,10 @@ input[type="text"] { .dmp-title, .dataset-title { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + /* opacity: 0.81; */ padding-top: 0.75rem; padding-bottom: 0.55rem; color: #212121; @@ -90,12 +90,13 @@ input[type="text"] { color: #848484; } -.dmp-title-draft { +.dmp-title-draft, +.dataset-title-draft { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + /* opacity: 0.81; */ padding-top: 0.75rem; padding-bottom: 0.55rem; color: #f16868; diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html index afc0ae8db..fa47c3acc 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html @@ -5,7 +5,8 @@
{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{dataset.modified | date:"longDate"}}
{{'DATASET-LISTING.STATES.PUBLISHED' | translate}}: {{dataset.dmpPublishedAt | date:"longDate"}}
-
{{dataset.label}}
+
{{dataset.label}}
+
{{dataset.label}}
{{ roleDisplay(dataset.users) }} . @@ -66,11 +67,11 @@

{{ dataset.grantAbbreviation }}

--> - - + - - - diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.scss b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.scss index fe734b6d3..a5f986b6d 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.scss +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.scss @@ -140,10 +140,10 @@ input[type="text"] { .dmp-title, .dataset-title { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + // opacity: 0.81; padding-top: 0.75rem; padding-bottom: 0.55rem; color: #212121; @@ -162,12 +162,13 @@ input[type="text"] { color: #848484; } -.dmp-title-draft { +.dmp-title-draft, +.dataset-title-draft { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + // opacity: 0.81; padding-top: 0.75rem; padding-bottom: 0.55rem; color: #f16868; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts index b9e187773..31338f977 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dataset-editor-details/dataset-editor-details.component.ts @@ -62,7 +62,7 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn // isLinear = false; lock: LockModel; lockStatus: Boolean; - dmpText: string; + dmpText: string = null; @Input() formGroup: FormGroup; @Input() dmpId: string; diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.scss b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.scss index e36d917d7..a833c7e0a 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.scss +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.scss @@ -411,7 +411,7 @@ mat-icon.size-16 { .dmp-title { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; opacity: 0.81; diff --git a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.scss b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.scss index a52a473ae..7a0178156 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.scss +++ b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.scss @@ -173,10 +173,10 @@ input[type="text"] { .dmp-title, .dataset-title { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + // opacity: 0.81; padding-top: 0.75rem; padding-bottom: 0.55rem; color: #212121; @@ -195,12 +195,13 @@ input[type="text"] { color: #848484; } -.dmp-title-draft { +.dmp-title-draft, +.dataset-title-draft { text-align: left; - font-weight: 500; + font-weight: 600; font-family: "Roboto", sans-serif; font-size: 1rem; - opacity: 0.81; + // opacity: 0.81; padding-top: 0.75rem; padding-bottom: 0.55rem; color: #f16868; diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index cd5a241bb..3195a88fd 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -1366,7 +1366,9 @@ "NAME": "Name", "ORGANIZATION": "Organization", "ROLE": "Rolle", - "SELECT-ROLE": "Select Role" + "SELECT-ROLE": "Select Role", + "ACCOUNTS": "Accounts", + "EMAILS": "Emails" }, "ASSOCIATED-DMPS": "Zugehörige DMPs", "DMPS": { @@ -1397,7 +1399,8 @@ "OTHER": "Other" }, "ACTIONS": { - "SAVE": "Save" + "SAVE": "Save", + "ADD-NEW": "Add new" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index a2a640099..db9f476b4 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1366,7 +1366,9 @@ "NAME": "Name", "ORGANIZATION": "Organization", "ROLE": "Role", - "SELECT-ROLE": "Select Role" + "SELECT-ROLE": "Select Role", + "ACCOUNTS": "Accounts", + "EMAILS": "Emails" }, "ASSOCIATED-DMPS": "Associated DMPs", "DMPS": { @@ -1397,7 +1399,8 @@ "OTHER": "Other" }, "ACTIONS": { - "SAVE": "Save" + "SAVE": "Save", + "ADD-NEW": "Add new" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 5faa05dfd..c8edb246f 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1366,7 +1366,9 @@ "NAME": "Name", "ORGANIZATION": "Organization", "ROLE": "Role", - "SELECT-ROLE": "Select Role" + "SELECT-ROLE": "Select Role", + "ACCOUNTS": "Accounts", + "EMAILS": "Emails" }, "ASSOCIATED-DMPS": "PGDs asociados", "DMPS": { @@ -1397,7 +1399,8 @@ "OTHER": "Other" }, "ACTIONS": { - "SAVE": "Save" + "SAVE": "Save", + "ADD-NEW": "Add new" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 901895a5c..604ae7388 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1366,7 +1366,9 @@ "NAME": "Name", "ORGANIZATION": "Organization", "ROLE": "Ρόλος", - "SELECT-ROLE": "Select Role" + "SELECT-ROLE": "Select Role", + "ACCOUNTS": "Accounts", + "EMAILS": "Emails" }, "ASSOCIATED-DMPS": "Συσχετιζόμενα Σχέδια Διαχείρισης Δεδομένων", "DMPS": { @@ -1397,7 +1399,8 @@ "OTHER": "Other" }, "ACTIONS": { - "SAVE": "Save" + "SAVE": "Save", + "ADD-NEW": "Add new" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index fbce175fd..ab38bcdd8 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -1366,7 +1366,9 @@ "NAME": "Name", "ORGANIZATION": "Organization", "ROLE": "Rola", - "SELECT-ROLE": "Select Role" + "SELECT-ROLE": "Select Role", + "ACCOUNTS": "Accounts", + "EMAILS": "Emails" }, "ASSOCIATED-DMPS": "Pridružené DMP", "DMPS": { @@ -1397,7 +1399,8 @@ "OTHER": "Other" }, "ACTIONS": { - "SAVE": "Save" + "SAVE": "Save", + "ADD-NEW": "Add new" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index a0848126d..0b6040591 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -1366,7 +1366,9 @@ "NAME": "Name", "ORGANIZATION": "Organization", "ROLE": "Görev", - "SELECT-ROLE": "Select Role" + "SELECT-ROLE": "Select Role", + "ACCOUNTS": "Accounts", + "EMAILS": "Emails" }, "ASSOCIATED-DMPS": "İlişkili VYP'ları", "DMPS": { @@ -1397,7 +1399,8 @@ "OTHER": "Other" }, "ACTIONS": { - "SAVE": "Save" + "SAVE": "Save", + "ADD-NEW": "Add new" } }, "DATASET-REFERENCED-MODELS": { From e1212383ff4526f2d122b0e152599fcc2e7587c2 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Fri, 23 Oct 2020 18:40:17 +0300 Subject: [PATCH 029/260] Add expirimental logic for userMerge (+ some updates for DB) --- .../criteria/EmailConfirmationCriteria.java | 6 ++ .../LoginConfirmationEmailCriteria.java | 6 -- .../dao/entities/EmailConfirmationDao.java | 13 +++ .../entities/EmailConfirmationDaoImpl.java | 56 ++++++++++ .../entities/LoginConfirmationEmailDao.java | 13 --- .../LoginConfirmationEmailDaoImpl.java | 56 ---------- .../eu/eudat/data/entities/Credential.java | 11 ++ ...ationEmail.java => EmailConfirmation.java} | 18 +++- .../controllers/EmailMergeConfirmation.java | 63 +++++++++++ .../main/java/eu/eudat/controllers/Users.java | 10 ++ .../managers/EmailConfirmationManager.java | 4 +- .../MergeEmailConfirmationManager.java | 100 ++++++++++++++++++ .../eu/eudat/logic/managers/UserManager.java | 15 +++ .../operations/DatabaseRepository.java | 2 +- .../operations/DatabaseRepositoryImpl.java | 6 +- .../AbstractAuthenticationService.java | 1 + .../utilities/ConfirmationEmailService.java | 10 +- .../ConfirmationEmailServiceImpl.java | 37 ++++++- .../models/data/userinfo/UserCredential.java | 19 ++++ .../data/userinfo/UserMergeRequestModel.java | 21 ++++ .../00.00.006_add_email_to_credential.sql | 1 + ...EmailConfirmation - Αντιγραφή.sql | 1 + ...8_add_column_data_to_EmailConfirmation.sql | 1 + 23 files changed, 375 insertions(+), 95 deletions(-) create mode 100644 dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/EmailConfirmationCriteria.java delete mode 100644 dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/LoginConfirmationEmailCriteria.java create mode 100644 dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/EmailConfirmationDao.java create mode 100644 dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/EmailConfirmationDaoImpl.java delete mode 100644 dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/LoginConfirmationEmailDao.java delete mode 100644 dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/LoginConfirmationEmailDaoImpl.java rename dmp-backend/data/src/main/java/eu/eudat/data/entities/{LoginConfirmationEmail.java => EmailConfirmation.java} (79%) create mode 100644 dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/logic/managers/MergeEmailConfirmationManager.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserCredential.java create mode 100644 dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserMergeRequestModel.java create mode 100644 dmp-db-scema/updates/00.00.006_add_email_to_credential.sql create mode 100644 dmp-db-scema/updates/00.00.007_rename_LogicConfirmationEmail_to_EmailConfirmation - Αντιγραφή.sql create mode 100644 dmp-db-scema/updates/00.00.008_add_column_data_to_EmailConfirmation.sql diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/EmailConfirmationCriteria.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/EmailConfirmationCriteria.java new file mode 100644 index 000000000..1436752b9 --- /dev/null +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/EmailConfirmationCriteria.java @@ -0,0 +1,6 @@ +package eu.eudat.data.dao.criteria; + +import eu.eudat.data.entities.EmailConfirmation; + +public class EmailConfirmationCriteria extends Criteria{ +} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/LoginConfirmationEmailCriteria.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/LoginConfirmationEmailCriteria.java deleted file mode 100644 index 4ec5be026..000000000 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/criteria/LoginConfirmationEmailCriteria.java +++ /dev/null @@ -1,6 +0,0 @@ -package eu.eudat.data.dao.criteria; - -import eu.eudat.data.entities.LoginConfirmationEmail; - -public class LoginConfirmationEmailCriteria extends Criteria{ -} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/EmailConfirmationDao.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/EmailConfirmationDao.java new file mode 100644 index 000000000..b379d964d --- /dev/null +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/EmailConfirmationDao.java @@ -0,0 +1,13 @@ +package eu.eudat.data.dao.entities; + +import eu.eudat.data.dao.DatabaseAccessLayer; +import eu.eudat.data.dao.criteria.EmailConfirmationCriteria; +import eu.eudat.data.entities.EmailConfirmation; +import eu.eudat.queryable.QueryableList; + +import java.util.UUID; + +public interface EmailConfirmationDao extends DatabaseAccessLayer { + + QueryableList getWithCriteria(EmailConfirmationCriteria criteria); +} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/EmailConfirmationDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/EmailConfirmationDaoImpl.java new file mode 100644 index 000000000..d53fc9774 --- /dev/null +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/EmailConfirmationDaoImpl.java @@ -0,0 +1,56 @@ +package eu.eudat.data.dao.entities; + +import eu.eudat.data.dao.DatabaseAccess; +import eu.eudat.data.dao.criteria.EmailConfirmationCriteria; +import eu.eudat.data.dao.databaselayer.service.DatabaseService; +import eu.eudat.data.entities.EmailConfirmation; +import eu.eudat.queryable.QueryableList; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.UUID; +import java.util.concurrent.CompletableFuture; + +@Service("LoginConfirmationEmailDao") +public class EmailConfirmationDaoImpl extends DatabaseAccess implements EmailConfirmationDao { + + @Autowired + public EmailConfirmationDaoImpl(DatabaseService databaseService) { + super(databaseService); + } + + @Override + public QueryableList getWithCriteria(EmailConfirmationCriteria criteria) { + return null; + } + + @Override + public EmailConfirmation createOrUpdate(EmailConfirmation item) { + return this.getDatabaseService().createOrUpdate(item, EmailConfirmation.class); + } + + @Override + public CompletableFuture createOrUpdateAsync(EmailConfirmation item) { + return null; + } + + @Override + public EmailConfirmation find(UUID id) { + return this.getDatabaseService().getQueryable(EmailConfirmation.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle(); + } + + @Override + public EmailConfirmation find(UUID id, String hint) { + throw new UnsupportedOperationException(); + } + + @Override + public void delete(EmailConfirmation item) { + throw new UnsupportedOperationException(); + } + + @Override + public QueryableList asQueryable() { + return this.getDatabaseService().getQueryable(EmailConfirmation.class); + } +} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/LoginConfirmationEmailDao.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/LoginConfirmationEmailDao.java deleted file mode 100644 index 71edce65e..000000000 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/LoginConfirmationEmailDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package eu.eudat.data.dao.entities; - -import eu.eudat.data.dao.DatabaseAccessLayer; -import eu.eudat.data.dao.criteria.LoginConfirmationEmailCriteria; -import eu.eudat.data.entities.LoginConfirmationEmail; -import eu.eudat.queryable.QueryableList; - -import java.util.UUID; - -public interface LoginConfirmationEmailDao extends DatabaseAccessLayer { - - QueryableList getWithCriteria(LoginConfirmationEmailCriteria criteria); -} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/LoginConfirmationEmailDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/LoginConfirmationEmailDaoImpl.java deleted file mode 100644 index 691c6b663..000000000 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/LoginConfirmationEmailDaoImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package eu.eudat.data.dao.entities; - -import eu.eudat.data.dao.DatabaseAccess; -import eu.eudat.data.dao.criteria.LoginConfirmationEmailCriteria; -import eu.eudat.data.dao.databaselayer.service.DatabaseService; -import eu.eudat.data.entities.LoginConfirmationEmail; -import eu.eudat.queryable.QueryableList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.UUID; -import java.util.concurrent.CompletableFuture; - -@Service("LoginConfirmationEmailDao") -public class LoginConfirmationEmailDaoImpl extends DatabaseAccess implements LoginConfirmationEmailDao { - - @Autowired - public LoginConfirmationEmailDaoImpl(DatabaseService databaseService) { - super(databaseService); - } - - @Override - public QueryableList getWithCriteria(LoginConfirmationEmailCriteria criteria) { - return null; - } - - @Override - public LoginConfirmationEmail createOrUpdate(LoginConfirmationEmail item) { - return this.getDatabaseService().createOrUpdate(item, LoginConfirmationEmail.class); - } - - @Override - public CompletableFuture createOrUpdateAsync(LoginConfirmationEmail item) { - return null; - } - - @Override - public LoginConfirmationEmail find(UUID id) { - return this.getDatabaseService().getQueryable(LoginConfirmationEmail.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle(); - } - - @Override - public LoginConfirmationEmail find(UUID id, String hint) { - throw new UnsupportedOperationException(); - } - - @Override - public void delete(LoginConfirmationEmail item) { - throw new UnsupportedOperationException(); - } - - @Override - public QueryableList asQueryable() { - return this.getDatabaseService().getQueryable(LoginConfirmationEmail.class); - } -} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java index 7181abfb9..88e3dc36d 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/Credential.java @@ -34,6 +34,8 @@ public class Credential implements DataEntity { private Integer provider; @Column(name = "\"Public\"", nullable = false) private String publicValue; + @Column(name = "\"Email\"", nullable = false) + private String email; @Column(name = "\"Secret\"", nullable = false) private String secret; @@ -88,6 +90,14 @@ public class Credential implements DataEntity { this.publicValue = publicValue; } + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + public String getSecret() { return secret; } @@ -139,6 +149,7 @@ public class Credential implements DataEntity { public void update(Credential entity) { this.status = entity.status; this.publicValue = entity.getPublicValue(); + this.email = entity.getEmail(); this.secret = entity.getSecret(); this.lastUpdateTime = new Date(); } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/entities/LoginConfirmationEmail.java b/dmp-backend/data/src/main/java/eu/eudat/data/entities/EmailConfirmation.java similarity index 79% rename from dmp-backend/data/src/main/java/eu/eudat/data/entities/LoginConfirmationEmail.java rename to dmp-backend/data/src/main/java/eu/eudat/data/entities/EmailConfirmation.java index 2bc9f53c8..8d4363e9e 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/entities/LoginConfirmationEmail.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/entities/EmailConfirmation.java @@ -10,8 +10,8 @@ import java.util.List; import java.util.UUID; @Entity -@Table(name = "\"LoginConfirmationEmail\"") -public class LoginConfirmationEmail implements DataEntity { +@Table(name = "\"EmailConfirmation\"") +public class EmailConfirmation implements DataEntity { @Id @GeneratedValue @@ -30,6 +30,9 @@ public class LoginConfirmationEmail implements DataEntity tuple, List fields, String base) { + public EmailConfirmation buildFromTuple(List tuple, List fields, String base) { return null; } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java new file mode 100644 index 000000000..aca3817af --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/EmailMergeConfirmation.java @@ -0,0 +1,63 @@ +package eu.eudat.controllers; + +import eu.eudat.exceptions.emailconfirmation.HasConfirmedEmailException; +import eu.eudat.exceptions.emailconfirmation.TokenExpiredException; +import eu.eudat.logic.managers.EmailConfirmationManager; +import eu.eudat.logic.managers.MergeEmailConfirmationManager; +import eu.eudat.logic.security.CustomAuthenticationProvider; +import eu.eudat.logic.services.operations.authentication.AuthenticationService; +import eu.eudat.models.data.helpers.responses.ResponseItem; +import eu.eudat.models.data.security.Principal; +import eu.eudat.models.data.userinfo.UserMergeRequestModel; +import eu.eudat.types.ApiMessageCode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.transaction.Transactional; + +@RestController +@CrossOrigin +@RequestMapping(value = "api/emailMergeConfirmation") +public class EmailMergeConfirmation { + + private MergeEmailConfirmationManager emailConfirmationManager; + + @Autowired + public EmailMergeConfirmation(MergeEmailConfirmationManager emailConfirmationManager) { + this.emailConfirmationManager = emailConfirmationManager; + } + + @Transactional + @RequestMapping(method = RequestMethod.GET, value = {"/{emailToken}"}) + public @ResponseBody + ResponseEntity emailConfirmation(@PathVariable(value = "emailToken") String token) { + try { + this.emailConfirmationManager.confirmEmail(token); + return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE)); + } catch + (HasConfirmedEmailException | TokenExpiredException ex) { + if (ex instanceof TokenExpiredException) { + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem().status(ApiMessageCode.NO_MESSAGE)); + } else { + return ResponseEntity.status(HttpStatus.FOUND).body(new ResponseItem().status(ApiMessageCode.WARN_MESSAGE)); + } + } + } + + @Transactional + @RequestMapping(method = RequestMethod.POST, consumes = "application/json", produces = "application/json") + public @ResponseBody + ResponseEntity sendConfirmatioEmail(@RequestBody UserMergeRequestModel requestModel, Principal principal) { + try { + this.emailConfirmationManager.sendConfirmationEmail(requestModel.getEmail(), principal, requestModel.getUserId()); + return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE)); + } catch (Exception ex) { + if (ex instanceof HasConfirmedEmailException) { + return ResponseEntity.status(HttpStatus.FOUND).body(new ResponseItem().status(ApiMessageCode.WARN_MESSAGE)); + } + return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem().status(ApiMessageCode.NO_MESSAGE)); + } + } +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java index a33cf582f..d4d108b42 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/Users.java @@ -11,6 +11,7 @@ import eu.eudat.models.data.doi.DOIRequest; import eu.eudat.models.data.helpers.common.DataTableData; import eu.eudat.models.data.helpers.responses.ResponseItem; import eu.eudat.models.data.security.Principal; +import eu.eudat.models.data.userinfo.UserCredential; import eu.eudat.models.data.userinfo.UserListingModel; import eu.eudat.models.data.userinfo.UserProfile; import eu.eudat.types.ApiMessageCode; @@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.io.IOException; +import java.util.List; import java.util.Map; import java.util.UUID; @@ -62,6 +64,14 @@ public class Users extends BaseController { UserProfile user = userManager.getSingle(userId); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().payload(user).status(ApiMessageCode.NO_MESSAGE)); } + + @RequestMapping(method = RequestMethod.GET, value = {"/{id}/emails"}, produces = "application/json") + public @ResponseBody + ResponseEntity>> getEmails(@PathVariable String id, Principal principal) throws Exception { + UUID userId = id.equals("me") ? principal.getId() : UUID.fromString(id); + List user = userManager.getCredentials(userId); + return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem>().payload(user).status(ApiMessageCode.NO_MESSAGE)); + } @Transactional @RequestMapping(method = RequestMethod.POST, value = {"/settings"}, produces = "application/json") diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/EmailConfirmationManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/EmailConfirmationManager.java index bf26fa3e4..f6ad1d6fc 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/EmailConfirmationManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/EmailConfirmationManager.java @@ -1,7 +1,7 @@ package eu.eudat.logic.managers; import eu.eudat.data.entities.Credential; -import eu.eudat.data.entities.LoginConfirmationEmail; +import eu.eudat.data.entities.EmailConfirmation; import eu.eudat.data.entities.UserInfo; import eu.eudat.data.entities.UserToken; import eu.eudat.exceptions.emailconfirmation.HasConfirmedEmailException; @@ -30,7 +30,7 @@ public class EmailConfirmationManager { } public void confirmEmail(String token) throws TokenExpiredException, HasConfirmedEmailException { - LoginConfirmationEmail loginConfirmationEmail = apiContext.getOperationsContext() + EmailConfirmation loginConfirmationEmail = apiContext.getOperationsContext() .getDatabaseRepository().getLoginConfirmationEmailDao().asQueryable() .where((builder, root) -> builder.equal(root.get("token"), UUID.fromString(token))).getSingle(); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MergeEmailConfirmationManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MergeEmailConfirmationManager.java new file mode 100644 index 000000000..7b41ee712 --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/MergeEmailConfirmationManager.java @@ -0,0 +1,100 @@ +package eu.eudat.logic.managers; + +import eu.eudat.data.entities.Credential; +import eu.eudat.data.entities.EmailConfirmation; +import eu.eudat.data.entities.UserDMP; +import eu.eudat.data.entities.UserInfo; +import eu.eudat.data.entities.UserToken; +import eu.eudat.exceptions.emailconfirmation.HasConfirmedEmailException; +import eu.eudat.exceptions.emailconfirmation.TokenExpiredException; +import eu.eudat.logic.services.ApiContext; +import eu.eudat.logic.services.operations.DatabaseRepository; +import eu.eudat.models.data.security.Principal; +import eu.eudat.queryable.QueryableList; +import eu.eudat.queryable.jpa.predicates.OrderByPredicate; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +@Component +public class MergeEmailConfirmationManager { + private static Logger logger = LoggerFactory.getLogger(MergeEmailConfirmationManager.class); + private ApiContext apiContext; + private DatabaseRepository databaseRepository; + + @Autowired + public MergeEmailConfirmationManager(ApiContext apiContext) { + this.apiContext = apiContext; + this.databaseRepository = apiContext.getOperationsContext().getDatabaseRepository(); + } + + public void confirmEmail(String token) throws TokenExpiredException, HasConfirmedEmailException { + EmailConfirmation loginConfirmationEmail = apiContext.getOperationsContext() + .getDatabaseRepository().getLoginConfirmationEmailDao().asQueryable() + .where((builder, root) -> builder.equal(root.get("token"), UUID.fromString(token))).getSingle(); + + if (loginConfirmationEmail.getExpiresAt().compareTo(new Date()) < 0) + throw new TokenExpiredException("Token has expired."); + + UserInfo userToBeMerged = databaseRepository.getUserInfoDao().asQueryable() + .where((builder, root) -> builder.equal(root.get("id"), loginConfirmationEmail.getUserId())).getSingle(); + + try { + UUID otherUserId = new ObjectMapper().readValue(loginConfirmationEmail.getData(), UUID.class); + UserInfo user = databaseRepository.getUserInfoDao().asQueryable() + .where((builder, root) -> builder.equal(root.get("id"), loginConfirmationEmail.getUserId())).getSingle(); + + // Checks if mail is used by another user. If it is, merges the new the old. + mergeNewUserToOld(user, userToBeMerged); + expireUserToken(user); + loginConfirmationEmail.setIsConfirmed(true); + databaseRepository.getLoginConfirmationEmailDao().createOrUpdate(loginConfirmationEmail); + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + } + + public void sendConfirmationEmail(String email, Principal principal, UUID userId) throws HasConfirmedEmailException { + UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId()); + + apiContext.getUtilitiesService().getConfirmationEmailService().createConfirmationEmail( + databaseRepository.getLoginConfirmationEmailDao(), + apiContext.getUtilitiesService().getMailService(), + email, + userId, + principal.getId() + ); + } + + private void mergeNewUserToOld(UserInfo newUser, UserInfo oldUser) { + Credential credential = databaseRepository.getCredentialDao().asQueryable().where((builder, root) -> builder.equal(root.get("userInfo"), oldUser)).getSingle(); + credential.setUserInfo(newUser); + databaseRepository.getCredentialDao().createOrUpdate(credential); + List userDmps = databaseRepository.getUserDmpDao().asQueryable().where((builder, root) -> builder.equal(root.get("user"), oldUser)).toList(); + userDmps.forEach(userDmp -> { + userDmp.setUser(newUser); + databaseRepository.getUserDmpDao().createOrUpdate(userDmp); + }); + } + + private void expireUserToken(UserInfo user) { + UserToken userToken = databaseRepository.getUserTokenDao().asQueryable() + .where((builder, root) -> builder.equal(root.get("user"), user)) + .orderBy((builder, root) -> builder.desc(root.get("issuedAt"))) + .take(1) + .getSingle(); + userToken.setExpiresAt(new Date()); + databaseRepository.getUserTokenDao().createOrUpdate(userToken); + } +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java index a0d346020..d1ba1f31d 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java @@ -3,6 +3,7 @@ package eu.eudat.logic.managers; import com.fasterxml.jackson.databind.ObjectMapper; import eu.eudat.data.dao.criteria.DataManagementPlanCriteria; import eu.eudat.data.dao.entities.UserInfoDao; +import eu.eudat.data.entities.Credential; import eu.eudat.data.entities.DMP; import eu.eudat.data.entities.UserInfo; import eu.eudat.data.entities.UserRole; @@ -26,6 +27,7 @@ import eu.eudat.models.data.helpers.common.DataTableData; import eu.eudat.models.data.login.Credentials; import eu.eudat.models.data.principal.PrincipalModel; import eu.eudat.models.data.security.Principal; +import eu.eudat.models.data.userinfo.UserCredential; import eu.eudat.models.data.userinfo.UserListingModel; import eu.eudat.models.data.userinfo.UserProfile; import eu.eudat.queryable.QueryableList; @@ -88,6 +90,19 @@ public class UserManager { List modelUsers = pagedUsers.select(item -> new UserListingModel().fromDataModel(item)); return apiContext.getOperationsContext().getBuilderFactory().getBuilder(DataTableDataBuilder.class).totalCount(users.count()).data(modelUsers).build(); } + + public List getCredentials(UUID userId) { + List results = new ArrayList<>(); + eu.eudat.data.entities.UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(userId); + List credentials = apiContext.getOperationsContext().getDatabaseRepository().getCredentialDao().asQueryable().where((builder, root) -> builder.equal(root.get("userInfo").get("id"), userId)).toList(); + credentials.forEach(credential -> { + UserCredential userCredential = new UserCredential(); + userCredential.setEmail(credential.getEmail()); + userCredential.setProvider(credential.getProvider()); + results.add(userCredential); + }); + return results; + } public UserProfile getSingle(UUID userId) throws Exception { eu.eudat.data.entities.UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(userId); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepository.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepository.java index 63790784e..d77af5779 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepository.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepository.java @@ -46,7 +46,7 @@ public interface DatabaseRepository { DatasetServiceDao getDatasetServiceDao(); - LoginConfirmationEmailDao getLoginConfirmationEmailDao(); + EmailConfirmationDao getLoginConfirmationEmailDao(); ProjectDao getProjectDao(); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java index 5e456a26b..cad146eaf 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java @@ -32,7 +32,7 @@ public class DatabaseRepositoryImpl implements DatabaseRepository { private DMPProfileDao dmpProfileDao; private DatasetExternalDatasetDao datasetExternalDatasetDao; private DatasetServiceDao datasetServiceDao; - private LoginConfirmationEmailDao loginConfirmationEmailDao; + private EmailConfirmationDao loginConfirmationEmailDao; private ProjectDao projectDao; private FunderDao funderDao; private LockDao lockDao; @@ -247,12 +247,12 @@ public class DatabaseRepositoryImpl implements DatabaseRepository { } @Override - public LoginConfirmationEmailDao getLoginConfirmationEmailDao() { + public EmailConfirmationDao getLoginConfirmationEmailDao() { return loginConfirmationEmailDao; } @Autowired - public void setLoginConfirmationEmailDao(LoginConfirmationEmailDao loginConfirmationEmailDao) { + public void setLoginConfirmationEmailDao(EmailConfirmationDao loginConfirmationEmailDao) { this.loginConfirmationEmailDao = loginConfirmationEmailDao; } diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java index 50d5e12dd..a43ec4ac7 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java @@ -145,6 +145,7 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer userInfo = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().createOrUpdate(userInfo); credential.setPublicValue(userInfo.getName()); + credential.setEmail(userInfo.getEmail()); credential.setUserInfo(userInfo); apiContext.getOperationsContext().getDatabaseRepository().getCredentialDao().createOrUpdate(credential); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/ConfirmationEmailService.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/ConfirmationEmailService.java index 831e48b9d..57d02345b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/ConfirmationEmailService.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/ConfirmationEmailService.java @@ -1,13 +1,15 @@ package eu.eudat.logic.services.utilities; -import eu.eudat.data.dao.entities.LoginConfirmationEmailDao; -import eu.eudat.data.entities.LoginConfirmationEmail; +import eu.eudat.data.dao.entities.EmailConfirmationDao; +import eu.eudat.data.entities.EmailConfirmation; import java.util.UUID; import java.util.concurrent.CompletableFuture; public interface ConfirmationEmailService { - public void createConfirmationEmail(LoginConfirmationEmailDao loginConfirmationEmailDao, MailService mailService, String email, UUID userId); + public void createConfirmationEmail(EmailConfirmationDao loginConfirmationEmailDao, MailService mailService, String email, UUID userId); + + public void createConfirmationEmail(EmailConfirmationDao loginConfirmationEmailDao, MailService mailService, String email, UUID userId, UUID anotheruserId); - public CompletableFuture sentConfirmationEmail(LoginConfirmationEmail confirmationEmail, MailService mailService); + public CompletableFuture sentConfirmationEmail(EmailConfirmation confirmationEmail, MailService mailService); } \ No newline at end of file diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/ConfirmationEmailServiceImpl.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/ConfirmationEmailServiceImpl.java index dec804949..6ff0be763 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/ConfirmationEmailServiceImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/utilities/ConfirmationEmailServiceImpl.java @@ -1,13 +1,16 @@ package eu.eudat.logic.services.utilities; -import eu.eudat.data.dao.entities.LoginConfirmationEmailDao; -import eu.eudat.data.entities.LoginConfirmationEmail; +import eu.eudat.data.dao.entities.EmailConfirmationDao; +import eu.eudat.data.entities.EmailConfirmation; import eu.eudat.models.data.mail.SimpleMail; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + import java.util.Date; import java.util.UUID; import java.util.concurrent.CompletableFuture; @@ -24,8 +27,8 @@ public class ConfirmationEmailServiceImpl implements ConfirmationEmailService { } @Override - public void createConfirmationEmail(LoginConfirmationEmailDao loginConfirmationEmailDao, MailService mailService, String email, UUID userId) { - LoginConfirmationEmail confirmationEmail = new LoginConfirmationEmail(); + public void createConfirmationEmail(EmailConfirmationDao loginConfirmationEmailDao, MailService mailService, String email, UUID userId) { + EmailConfirmation confirmationEmail = new EmailConfirmation(); confirmationEmail.setEmail(email); confirmationEmail.setExpiresAt(Date .from(new Date() @@ -41,7 +44,7 @@ public class ConfirmationEmailServiceImpl implements ConfirmationEmailService { } @Override - public CompletableFuture sentConfirmationEmail(LoginConfirmationEmail confirmationEmail, MailService mailService) { + public CompletableFuture sentConfirmationEmail(EmailConfirmation confirmationEmail, MailService mailService) { return CompletableFuture.runAsync(() -> { SimpleMail mail = new SimpleMail(); mail.setSubject(environment.getProperty("conf_email.subject")); @@ -71,4 +74,28 @@ public class ConfirmationEmailServiceImpl implements ConfirmationEmailService { hour = hour / 60; return (hour + ":" + min + ":" + sec); } + + @Override + public void createConfirmationEmail(EmailConfirmationDao loginConfirmationEmailDao, MailService mailService, + String email, UUID userId, UUID anotheruserId) { + EmailConfirmation confirmationEmail = new EmailConfirmation(); + confirmationEmail.setEmail(email); + confirmationEmail.setExpiresAt(Date + .from(new Date() + .toInstant() + .plusSeconds(Long.parseLong(this.environment.getProperty("conf_email.expiration_time_seconds"))) + ) + ); + confirmationEmail.setUserId(userId); + try { + confirmationEmail.setData(new ObjectMapper().writeValueAsString(anotheruserId)); + } catch (JsonProcessingException e) { + logger.error(e.getMessage(), e); + } + confirmationEmail.setIsConfirmed(false); + confirmationEmail.setToken(UUID.randomUUID()); + confirmationEmail = loginConfirmationEmailDao.createOrUpdate(confirmationEmail); + sentConfirmationEmail(confirmationEmail, mailService); + + } } \ No newline at end of file diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserCredential.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserCredential.java new file mode 100644 index 000000000..e2ce326f8 --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserCredential.java @@ -0,0 +1,19 @@ +package eu.eudat.models.data.userinfo; + +public class UserCredential { + private String email; + private Integer provider; + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + public Integer getProvider() { + return provider; + } + public void setProvider(Integer provider) { + this.provider = provider; + } + +} diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserMergeRequestModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserMergeRequestModel.java new file mode 100644 index 000000000..dab3bab4e --- /dev/null +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/userinfo/UserMergeRequestModel.java @@ -0,0 +1,21 @@ +package eu.eudat.models.data.userinfo; + +import java.util.UUID; + +public class UserMergeRequestModel { + private UUID userId; + private String email; + public UUID getUserId() { + return userId; + } + public void setUserId(UUID userId) { + this.userId = userId; + } + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + +} diff --git a/dmp-db-scema/updates/00.00.006_add_email_to_credential.sql b/dmp-db-scema/updates/00.00.006_add_email_to_credential.sql new file mode 100644 index 000000000..f60e3ceb1 --- /dev/null +++ b/dmp-db-scema/updates/00.00.006_add_email_to_credential.sql @@ -0,0 +1 @@ +ALTER TABLE public."Credential" ADD COLUMN email character varying; diff --git a/dmp-db-scema/updates/00.00.007_rename_LogicConfirmationEmail_to_EmailConfirmation - Αντιγραφή.sql b/dmp-db-scema/updates/00.00.007_rename_LogicConfirmationEmail_to_EmailConfirmation - Αντιγραφή.sql new file mode 100644 index 000000000..a43076fc9 --- /dev/null +++ b/dmp-db-scema/updates/00.00.007_rename_LogicConfirmationEmail_to_EmailConfirmation - Αντιγραφή.sql @@ -0,0 +1 @@ +ALTER TABLE public."LoginConfirmationEmail" RENAME TO "EmailConfirmation"; \ No newline at end of file diff --git a/dmp-db-scema/updates/00.00.008_add_column_data_to_EmailConfirmation.sql b/dmp-db-scema/updates/00.00.008_add_column_data_to_EmailConfirmation.sql new file mode 100644 index 000000000..38b964a5a --- /dev/null +++ b/dmp-db-scema/updates/00.00.008_add_column_data_to_EmailConfirmation.sql @@ -0,0 +1 @@ +ALTER TABLE public."EmailConfirmation" ADD COLUMN data text; \ No newline at end of file From 9674ec2b6bc285ff3b51593a391f40965b4c2a2f Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 26 Oct 2020 10:36:20 +0200 Subject: [PATCH 030/260] Add user merge related services and updates on existing services on the frontend --- .../eu/eudat/logic/managers/UserManager.java | 2 +- .../core/model/merge/user-merge-request.ts | 4 ++++ .../app/core/model/user/user-credential.ts | 6 +++++ .../merge-email-confirmation.service.ts | 23 +++++++++++++++++++ .../app/core/services/user/user.service.ts | 5 ++++ 5 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 dmp-frontend/src/app/core/model/merge/user-merge-request.ts create mode 100644 dmp-frontend/src/app/core/model/user/user-credential.ts create mode 100644 dmp-frontend/src/app/core/services/merge-email-confirmation/merge-email-confirmation.service.ts diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java index d1ba1f31d..7c3b6d942 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/UserManager.java @@ -94,7 +94,7 @@ public class UserManager { public List getCredentials(UUID userId) { List results = new ArrayList<>(); eu.eudat.data.entities.UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(userId); - List credentials = apiContext.getOperationsContext().getDatabaseRepository().getCredentialDao().asQueryable().where((builder, root) -> builder.equal(root.get("userInfo").get("id"), userId)).toList(); + List credentials = apiContext.getOperationsContext().getDatabaseRepository().getCredentialDao().asQueryable().where((builder, root) -> builder.equal(root.get("userInfo"), user)).toList(); credentials.forEach(credential -> { UserCredential userCredential = new UserCredential(); userCredential.setEmail(credential.getEmail()); diff --git a/dmp-frontend/src/app/core/model/merge/user-merge-request.ts b/dmp-frontend/src/app/core/model/merge/user-merge-request.ts new file mode 100644 index 000000000..ef5c53d7f --- /dev/null +++ b/dmp-frontend/src/app/core/model/merge/user-merge-request.ts @@ -0,0 +1,4 @@ +export class UserMergeRequestModel { + userId: String; + email: String; +} diff --git a/dmp-frontend/src/app/core/model/user/user-credential.ts b/dmp-frontend/src/app/core/model/user/user-credential.ts new file mode 100644 index 000000000..fe716aea0 --- /dev/null +++ b/dmp-frontend/src/app/core/model/user/user-credential.ts @@ -0,0 +1,6 @@ +import { AuthProvider } from '@app/core/common/enum/auth-provider'; + +export class UserCredentialModel { + email: string; + provider: AuthProvider; +} diff --git a/dmp-frontend/src/app/core/services/merge-email-confirmation/merge-email-confirmation.service.ts b/dmp-frontend/src/app/core/services/merge-email-confirmation/merge-email-confirmation.service.ts new file mode 100644 index 000000000..0f3676932 --- /dev/null +++ b/dmp-frontend/src/app/core/services/merge-email-confirmation/merge-email-confirmation.service.ts @@ -0,0 +1,23 @@ +import { HttpHeaders } from '@angular/common/http'; +import { Injectable } from "@angular/core"; +import { BaseHttpService } from "../http/base-http.service"; +import { ConfigurationService } from '../configuration/configuration.service'; +import { UserMergeRequestModel } from '@app/core/model/merge/user-merge-request'; + +@Injectable() +export class MergeEmailConfirmationService { + private actioUrl: string; + private headers: HttpHeaders + + constructor(private http: BaseHttpService, private configurationService: ConfigurationService) { + this.actioUrl = configurationService.server + 'emailMergeConfirmation/'; + } + + public emailConfirmation(token: string) { + return this.http.get(this.actioUrl + token, { headers: this.headers }); + } + + public sendConfirmationEmail(mergeRequest: UserMergeRequestModel) { + return this.http.post(this.actioUrl, mergeRequest, { headers: this.headers }); + } +} diff --git a/dmp-frontend/src/app/core/services/user/user.service.ts b/dmp-frontend/src/app/core/services/user/user.service.ts index 211706ca0..21d25d6c8 100644 --- a/dmp-frontend/src/app/core/services/user/user.service.ts +++ b/dmp-frontend/src/app/core/services/user/user.service.ts @@ -8,6 +8,7 @@ import { UserListingModel } from '../../model/user/user-listing'; import { UserCriteria } from '../../query/user/user-criteria'; import { BaseHttpService } from '../http/base-http.service'; import { ConfigurationService } from '../configuration/configuration.service'; +import { UserCredentialModel } from '@app/core/model/user/user-credential'; @Injectable() export class UserService { @@ -28,6 +29,10 @@ export class UserService { return this.http.get(this.actionUrl + id, { headers: this.headers }); } + getEmails(id: String): Observable { + return this.http.get(`${this.actionUrl}${id}/emails`, { headers: this.headers }); + } + updateRoles(itemToUpdate: UserListingModel): Observable { return this.http.post(this.actionUrl + 'updateRoles', JSON.stringify(itemToUpdate), { headers: this.headers }); } From 29c6774558da79327f7b8f286d8f990f49ee59c5 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Mon, 26 Oct 2020 11:57:06 +0200 Subject: [PATCH 031/260] Adds field "Add account" on profile --- .../add-account-dialog.component.html | 19 ++++++ .../add-account-dialog.component.scss | 55 +++++++++++++++++ .../add-account-dialog.component.ts | 40 +++++++++++++ .../user-profile/user-profile.component.html | 35 ++++++++++- .../user-profile/user-profile.component.scss | 59 +++++++++++++++++++ .../ui/user-profile/user-profile.component.ts | 28 +++++++++ .../ui/user-profile/user-profile.module.ts | 7 ++- dmp-frontend/src/assets/i18n/de.json | 8 ++- dmp-frontend/src/assets/i18n/en.json | 8 ++- dmp-frontend/src/assets/i18n/es.json | 8 ++- dmp-frontend/src/assets/i18n/gr.json | 8 ++- dmp-frontend/src/assets/i18n/sk.json | 8 ++- dmp-frontend/src/assets/i18n/tr.json | 8 ++- 13 files changed, 276 insertions(+), 15 deletions(-) create mode 100644 dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.html create mode 100644 dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.scss create mode 100644 dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts diff --git a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.html b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.html new file mode 100644 index 000000000..994387237 --- /dev/null +++ b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.html @@ -0,0 +1,19 @@ +
+
+

{{'USER-PROFILE.ACTIONS.ADD-NEW-ACCOUNT' | translate}}

+ close +
+ +
+ + + +
+
+
+ + +
+
+
diff --git a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.scss b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.scss new file mode 100644 index 000000000..f5f248a49 --- /dev/null +++ b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.scss @@ -0,0 +1,55 @@ +.template-container { + .header { + display: flex; + width: 100%; + height: 89px; + background-color: #129d99; + color: #ffffff; + font-size: 1.25rem; + } + + .title { + font-weight: 700; + font-size: 1.25rem; + color: #212121; + opacity: 1; + } + + .template-title { + margin-left: 37px; + } + + .close-icon { + cursor: pointer; + margin-right: 20px; + } + + .close-icon:hover { + background-color: #fefefe6e !important; + border-radius: 50%; + } + + .cancel-btn { + width: 101px; + height: 43px; + background: #ffffff; + border: 1px solid #b5b5b5; + border-radius: 30px; + opacity: 1; + } + + .add-btn { + width: 84px; + height: 43px; + background: #ffffff; + color: #129d99; + border: 1px solid #129d99; + border-radius: 30px; + opacity: 1; + } + + .add-btn:hover { + background-color: #129d99; + color: #ffffff; + } +} diff --git a/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts new file mode 100644 index 000000000..498e17c9b --- /dev/null +++ b/dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.component.ts @@ -0,0 +1,40 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; + +@Component({ + selector: 'app-add-account-dialog-component', + templateUrl: 'add-account-dialog.component.html', + styleUrls: ['./add-account-dialog.component.scss'], +}) +export class AddAccountDialogComponent implements OnInit { + + datasetProfileDefinitionModel: DatasetDescriptionFormEditorModel; + datasetProfileDefinitionFormGroup: FormGroup; + progressIndication = false; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + + } + + ngOnInit(): void { + + } + + add(): void { + this.dialogRef.close(true); + } + + cancel(): void { + this.dialogRef.close(); + } + + closeDialog(): void { + this.dialogRef.close(); + } + +} diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html index 366e68a10..1cc529b1d 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html @@ -13,7 +13,7 @@
{{formGroup.get('name').value}}
-
{{'USER-PROFILE.SETTINGS.CONNECTED-WITH' | translate}}:{{userProfile.email}}
+
@@ -25,7 +25,7 @@
- + @@ -33,6 +33,37 @@
+ +
+
+
+
{{'USER-PROFILE.SETTINGS.ACCOUNTS' | translate}}
+
+
+
+ +
+
+
+
+
+ +
{{userCredential.email}}
+ +
+
+
+
+
+ add + {{'USER-PROFILE.ACTIONS.ADD-NEW' | translate}} +
+
+
+
+
+
diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.scss b/dmp-frontend/src/app/ui/user-profile/user-profile.component.scss index 0738bacc5..b0b18cab9 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.scss +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.scss @@ -121,6 +121,65 @@ cursor: pointer; } +.vertical-line { + border-left: 2px solid #129d99; +} + +.email-title { + margin-top: 1.6875rem; + letter-spacing: 0.15px; + color: #a8a8a8; + opacity: 1; +} + +.mail-text { + cursor: pointer; + line-height: 2; + letter-spacing: 0.15px; + color: #212121; +} + +// .mail-text:hover { +// background-color: #f4f8f9; +// } + +.check-icon { + color: #129d99; + transform: scale(0.75); +} + +.clear-icon { + color: #f16868; + cursor: pointer; +} + +.add-new-btn { + margin-top: 2rem; +} + +.add-mail { + padding-left: 22px; + line-height: 2rem; + cursor: pointer; + + mat-icon { + color: #129d99; + display: inline-flex; + vertical-align: middle; + } + + span { + font-weight: 500; + letter-spacing: -0.35px; + color: #212121; + opacity: 1; + } +} + +.add-mail:hover { + background-color: #f4f8f9; +} + ::ng-deep .name-form .mat-form-field-appearance-outline .mat-form-field-outline { background: #fafafa !important; } diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts index 534e5c0c3..5d4901523 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts @@ -22,6 +22,9 @@ import { ExternalSourcesService } from '@app/core/services/external-sources/exte import { UserProfileEditorModel } from './user-profile-editor.model'; import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; +import { AddAccountDialogComponent } from './add-account/add-account-dialog.component'; +import { MatDialog } from '@angular/material'; +import { UserCredentialModel } from '@app/core/model/user/user-credential'; const availableLanguages: any[] = require('../../../assets/resources/language.json'); @@ -34,6 +37,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes userProfileEditorModel: UserProfileEditorModel; user: Observable; + userCredentials: UserCredentialModel[]; currentUserId: string; cultures: Observable; timezones: Observable; @@ -64,6 +68,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes private languageService: LanguageService, private configurationService: ConfigurationService, private oauth2DialogService: Oauth2DialogService, + private dialog: MatDialog, public enumUtils: EnumUtils ) { super(); } @@ -97,6 +102,11 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes this.unlock(); return result; })); + + this.userService.getEmails(userId).pipe(takeUntil(this._destroyed)) + .subscribe(result => { + this.userCredentials = result; + }); }); } @@ -237,4 +247,22 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes .subscribe(() => this.router.navigate(['/reload']).then(() => this.router.navigate(['/profile']))); } + public removeAccount() { + + } + + public addAccount() { + const dialogRef = this.dialog.open(AddAccountDialogComponent, { + restoreFocus: false, + autoFocus: false, + width: '603px', + data: { + } + }); + dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { + if (result) { + } + }); + } + } diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts index 0c28ce678..ac528e61c 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.module.ts @@ -3,6 +3,7 @@ import { FormattingModule } from '@app/core/formatting.module'; import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module'; import { CommonFormsModule } from '@common/forms/common-forms.module'; import { CommonUiModule } from '@common/ui/common-ui.module'; +import { AddAccountDialogComponent } from './add-account/add-account-dialog.component'; import { UserProfileComponent } from './user-profile.component'; import { UserProfileRoutingModule } from './user-profile.routing'; @@ -15,7 +16,11 @@ import { UserProfileRoutingModule } from './user-profile.routing'; AutoCompleteModule ], declarations: [ - UserProfileComponent + UserProfileComponent, + AddAccountDialogComponent + ], + entryComponents: [ + AddAccountDialogComponent ] }) export class UserProfileModule { } diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 3195a88fd..84bcb3b00 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -1368,7 +1368,8 @@ "ROLE": "Rolle", "SELECT-ROLE": "Select Role", "ACCOUNTS": "Accounts", - "EMAILS": "Emails" + "EMAILS": "Emails", + "YOUR-EMAIL": "Your Email" }, "ASSOCIATED-DMPS": "Zugehörige DMPs", "DMPS": { @@ -1400,7 +1401,10 @@ }, "ACTIONS": { "SAVE": "Save", - "ADD-NEW": "Add new" + "ADD-NEW": "Add new", + "ADD-NEW-ACCOUNT": "Add new account", + "ADD": "Add", + "CANCEL": "Cancel" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index db9f476b4..c7ef4bab4 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1368,7 +1368,8 @@ "ROLE": "Role", "SELECT-ROLE": "Select Role", "ACCOUNTS": "Accounts", - "EMAILS": "Emails" + "EMAILS": "Emails", + "YOUR-EMAIL": "Your Email" }, "ASSOCIATED-DMPS": "Associated DMPs", "DMPS": { @@ -1400,7 +1401,10 @@ }, "ACTIONS": { "SAVE": "Save", - "ADD-NEW": "Add new" + "ADD-NEW": "Add new", + "ADD-NEW-ACCOUNT": "Add new account", + "ADD": "Add", + "CANCEL": "Cancel" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index c8edb246f..371d6be5f 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1368,7 +1368,8 @@ "ROLE": "Role", "SELECT-ROLE": "Select Role", "ACCOUNTS": "Accounts", - "EMAILS": "Emails" + "EMAILS": "Emails", + "YOUR-EMAIL": "Your Email" }, "ASSOCIATED-DMPS": "PGDs asociados", "DMPS": { @@ -1400,7 +1401,10 @@ }, "ACTIONS": { "SAVE": "Save", - "ADD-NEW": "Add new" + "ADD-NEW": "Add new", + "ADD-NEW-ACCOUNT": "Add new account", + "ADD": "Add", + "CANCEL": "Cancel" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 604ae7388..fff083cd2 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1368,7 +1368,8 @@ "ROLE": "Ρόλος", "SELECT-ROLE": "Select Role", "ACCOUNTS": "Accounts", - "EMAILS": "Emails" + "EMAILS": "Emails", + "YOUR-EMAIL": "Your Email" }, "ASSOCIATED-DMPS": "Συσχετιζόμενα Σχέδια Διαχείρισης Δεδομένων", "DMPS": { @@ -1400,7 +1401,10 @@ }, "ACTIONS": { "SAVE": "Save", - "ADD-NEW": "Add new" + "ADD-NEW": "Add new", + "ADD-NEW-ACCOUNT": "Add new account", + "ADD": "Add", + "CANCEL": "Cancel" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index ab38bcdd8..ba760a1d3 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -1368,7 +1368,8 @@ "ROLE": "Rola", "SELECT-ROLE": "Select Role", "ACCOUNTS": "Accounts", - "EMAILS": "Emails" + "EMAILS": "Emails", + "YOUR-EMAIL": "Your Email" }, "ASSOCIATED-DMPS": "Pridružené DMP", "DMPS": { @@ -1400,7 +1401,10 @@ }, "ACTIONS": { "SAVE": "Save", - "ADD-NEW": "Add new" + "ADD-NEW": "Add new", + "ADD-NEW-ACCOUNT": "Add new account", + "ADD": "Add", + "CANCEL": "Cancel" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 0b6040591..c88b578cf 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -1368,7 +1368,8 @@ "ROLE": "Görev", "SELECT-ROLE": "Select Role", "ACCOUNTS": "Accounts", - "EMAILS": "Emails" + "EMAILS": "Emails", + "YOUR-EMAIL": "Your Email" }, "ASSOCIATED-DMPS": "İlişkili VYP'ları", "DMPS": { @@ -1400,7 +1401,10 @@ }, "ACTIONS": { "SAVE": "Save", - "ADD-NEW": "Add new" + "ADD-NEW": "Add new", + "ADD-NEW-ACCOUNT": "Add new account", + "ADD": "Add", + "CANCEL": "Cancel" } }, "DATASET-REFERENCED-MODELS": { From 96ffbe6670c7de2495144ac952d46498118492c8 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Mon, 26 Oct 2020 13:11:54 +0200 Subject: [PATCH 032/260] Updated DB scripts --- dmp-db-scema/main/dmp-dump.sql | 6 ++++-- ...dential_and_LoginConfirmationEmail_tables.sql | 16 ++++++++++++++++ .../00.00.006_add_email_to_credential.sql | 1 - ...to_EmailConfirmation - Αντιγραφή.sql | 1 - ....008_add_column_data_to_EmailConfirmation.sql | 1 - 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 dmp-db-scema/updates/00.00.006_Update_Credential_and_LoginConfirmationEmail_tables.sql delete mode 100644 dmp-db-scema/updates/00.00.006_add_email_to_credential.sql delete mode 100644 dmp-db-scema/updates/00.00.007_rename_LogicConfirmationEmail_to_EmailConfirmation - Αντιγραφή.sql delete mode 100644 dmp-db-scema/updates/00.00.008_add_column_data_to_EmailConfirmation.sql diff --git a/dmp-db-scema/main/dmp-dump.sql b/dmp-db-scema/main/dmp-dump.sql index 5355516e4..052a0007e 100644 --- a/dmp-db-scema/main/dmp-dump.sql +++ b/dmp-db-scema/main/dmp-dump.sql @@ -59,6 +59,7 @@ CREATE TABLE public."Credential" ( "Status" numeric NOT NULL, "Provider" numeric NOT NULL, "Public" character varying NOT NULL, + "Email" character varying, "Secret" character varying NOT NULL, "CreationTime" timestamp(4) with time zone NOT NULL, "LastUpdateTime" timestamp(4) with time zone NOT NULL, @@ -571,13 +572,14 @@ ALTER TABLE public."Lock" OWNER TO :POSTGRES_USER; -- Name: LoginConfirmationEmail; Type: TABLE; Schema: public; Owner: :POSTGRES_USER -- -CREATE TABLE public."LoginConfirmationEmail" ( +CREATE TABLE public."EmailConfirmation" ( "ID" uuid NOT NULL, email character varying NOT NULL, "isConfirmed" boolean NOT NULL, token uuid NOT NULL, "userId" uuid NOT NULL, - "expiresAt" timestamp(4) with time zone NOT NULL + "expiresAt" timestamp(4) with time zone NOT NULL, + data text ); diff --git a/dmp-db-scema/updates/00.00.006_Update_Credential_and_LoginConfirmationEmail_tables.sql b/dmp-db-scema/updates/00.00.006_Update_Credential_and_LoginConfirmationEmail_tables.sql new file mode 100644 index 000000000..0a444456c --- /dev/null +++ b/dmp-db-scema/updates/00.00.006_Update_Credential_and_LoginConfirmationEmail_tables.sql @@ -0,0 +1,16 @@ +DO $$DECLARE + this_version CONSTANT varchar := '00.00.006'; +BEGIN + PERFORM * FROM "DBVersion" WHERE version = this_version; + IF FOUND THEN RETURN; END IF; + + ALTER TABLE public."Credential" ADD COLUMN email character varying; + + ALTER TABLE public."LoginConfirmationEmail" RENAME TO "EmailConfirmation"; + + ALTER TABLE public."EmailConfirmation" ADD COLUMN data text; + + UPDATE public."Credential" cred SET "Email"= u.email FROM public."UserInfo" u WHERE cred."UserId" = u.id; + + INSERT INTO public."DBVersion" VALUES ('DMPDB', '00.00.006', '2020-10-26 10:10:00.000000+03', now(), 'Update Credential and LoginConfirmationEmail tables'); +END$$; \ No newline at end of file diff --git a/dmp-db-scema/updates/00.00.006_add_email_to_credential.sql b/dmp-db-scema/updates/00.00.006_add_email_to_credential.sql deleted file mode 100644 index f60e3ceb1..000000000 --- a/dmp-db-scema/updates/00.00.006_add_email_to_credential.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE public."Credential" ADD COLUMN email character varying; diff --git a/dmp-db-scema/updates/00.00.007_rename_LogicConfirmationEmail_to_EmailConfirmation - Αντιγραφή.sql b/dmp-db-scema/updates/00.00.007_rename_LogicConfirmationEmail_to_EmailConfirmation - Αντιγραφή.sql deleted file mode 100644 index a43076fc9..000000000 --- a/dmp-db-scema/updates/00.00.007_rename_LogicConfirmationEmail_to_EmailConfirmation - Αντιγραφή.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE public."LoginConfirmationEmail" RENAME TO "EmailConfirmation"; \ No newline at end of file diff --git a/dmp-db-scema/updates/00.00.008_add_column_data_to_EmailConfirmation.sql b/dmp-db-scema/updates/00.00.008_add_column_data_to_EmailConfirmation.sql deleted file mode 100644 index 38b964a5a..000000000 --- a/dmp-db-scema/updates/00.00.008_add_column_data_to_EmailConfirmation.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE public."EmailConfirmation" ADD COLUMN data text; \ No newline at end of file From f0b9b01695f41df77e00719c6c958ed78a028075 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Mon, 26 Oct 2020 13:24:39 +0200 Subject: [PATCH 033/260] Replace input email dialog with login dialog on add new account --- .../app/ui/auth/login/login.component.html | 2 +- .../app/ui/auth/login/login.component.scss | 1 + .../src/app/ui/auth/login/login.component.ts | 4 +++- .../src/app/ui/auth/login/login.module.ts | 3 +++ .../add-account-dialog.component.html | 7 +++---- .../add-account/add-account-dialog.module.ts | 19 +++++++++++++++++++ .../ui/user-profile/user-profile.component.ts | 2 +- .../ui/user-profile/user-profile.module.ts | 9 ++++++--- 8 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 dmp-frontend/src/app/ui/user-profile/add-account/add-account-dialog.module.ts diff --git a/dmp-frontend/src/app/ui/auth/login/login.component.html b/dmp-frontend/src/app/ui/auth/login/login.component.html index ba900fc39..13ef44581 100644 --- a/dmp-frontend/src/app/ui/auth/login/login.component.html +++ b/dmp-frontend/src/app/ui/auth/login/login.component.html @@ -1,4 +1,4 @@ -