From 72b18b7770c98d6eb8b64a4bcbe74a7859b807c2 Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Thu, 17 Jun 2021 19:12:47 +0300 Subject: [PATCH 1/5] Remove mat select ellipses. Wrap text below. --- dmp-frontend/src/app/ui/navbar/navbar.component.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.scss b/dmp-frontend/src/app/ui/navbar/navbar.component.scss index c4515f9e4..84e7ba19f 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.scss +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.scss @@ -139,3 +139,14 @@ $mat-card-header-size: 40px !default; .new-dmp-dialog { padding: 0em .5em 0em 0em; } +::ng-deep .mat-option-text { + text-overflow: unset !important; + white-space: normal; + line-height: 1.2em; +} + +::ng-deep .mat-option { + padding-top: 1em !important; + padding-bottom: 1em !important; + height: auto !important; +} \ No newline at end of file From c9b376f76c3e44ca1fdb65098f9f33b0183e85b1 Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Tue, 22 Jun 2021 13:00:58 +0300 Subject: [PATCH 2/5] Restyle DMP profile listing (Admin Pages) --- .../dmp-profile-criteria.component.html | 19 ++-- .../dmp-profile-criteria.component.scss | 13 +++ .../dmp-profile-criteria.component.ts | 40 ++++----- .../dmp-profile-listing.component.html | 33 +++++-- .../dmp-profile-listing.component.scss | 88 +++++++++++-------- .../listing/dmp-profile-listing.component.ts | 50 ++++++++++- dmp-frontend/src/assets/i18n/de.json | 5 ++ dmp-frontend/src/assets/i18n/en.json | 5 ++ dmp-frontend/src/assets/i18n/es.json | 5 ++ dmp-frontend/src/assets/i18n/gr.json | 5 ++ dmp-frontend/src/assets/i18n/pt.json | 5 ++ dmp-frontend/src/assets/i18n/sk.json | 5 ++ dmp-frontend/src/assets/i18n/sr.json | 5 ++ dmp-frontend/src/assets/i18n/tr.json | 5 ++ 14 files changed, 200 insertions(+), 83 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.html b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.html index 5ed6cc96b..fa9141ae4 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.html +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.html @@ -1,18 +1,11 @@
- -
- - - - - -
+
- - + + + search +
-
diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.scss b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.scss index e69de29bb..0cea7d62b 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.scss +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.scss @@ -0,0 +1,13 @@ + +:host ::ng-deep .search-form-field .mat-form-field-wrapper { + background-color: white !important; + padding-bottom: 0 !important; +} +:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix { + padding: 0.3rem 0rem 0.6rem 0rem !important; +} + +.dmp-criteria{ + margin-top: 4em; + margin-bottom: 2em; +} \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts index bac44b696..f9b0ed07c 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts @@ -53,24 +53,24 @@ export class DmpProfileCriteriaComponent extends BaseCriteriaComponent implement } - openDialog(): void { - const dialogRef = this.dialog.open(DialodConfirmationUploadDmpProfiles, { - restoreFocus: false, - data: { - message: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-FILE-TITLE'), - confirmButton: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML'), - cancelButton: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-FILE-CANCEL'), - name: '', - file: FileList, - sucsess: false - } - }); - dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => { - if (data && data.sucsess && data.name != null && data.file != null) { - this.dmpProfileService.uploadFile(data.file, data.name) - .pipe(takeUntil(this._destroyed)) - .subscribe(); - } - }); - } + // openDialog(): void { + // const dialogRef = this.dialog.open(DialodConfirmationUploadDmpProfiles, { + // restoreFocus: false, + // data: { + // message: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-FILE-TITLE'), + // confirmButton: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML'), + // cancelButton: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-FILE-CANCEL'), + // name: '', + // file: FileList, + // sucsess: false + // } + // }); + // dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => { + // if (data && data.sucsess && data.name != null && data.file != null) { + // this.dmpProfileService.uploadFile(data.file, data.name) + // .pipe(takeUntil(this._destroyed)) + // .subscribe(); + // } + // }); + // } } diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.html b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.html index 515549df8..733ea2248 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.html @@ -1,9 +1,26 @@
-

{{titlePrefix}} {{'DMP-PROFILE-LISTING.TITLE' | translate}}

+
+
+

{{titlePrefix}} {{'DMP-PROFILE-LISTING.TITLE' | translate}}

+
+
+
+ + +
+
- +
@@ -17,7 +34,11 @@ {{'DMP-PROFILE-LISTING.COLUMNS.STATUS' | translate}} - {{row.status}} + +
+ {{parseStatus(row.status) | translate}} +
+
@@ -36,12 +57,6 @@
- - -
-
diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.scss b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.scss index 7720847f5..ea1d13594 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.scss +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.scss @@ -1,65 +1,77 @@ .mat-table { - margin: 24px; + margin-top: 47px; + border-radius: 4px; } - .dmp-profile-listing { margin-top: 1.3rem; + margin-left: 1rem; + margin-right: 2rem; + .mat-header-row{ + background: #f3f5f8; + } + .mat-card { + margin: 16px 0; + padding: 0px; + } + .mat-row { cursor: pointer; + min-height: 4.5em; } - - .mat-card { - margin: 1em 0; - } - + mat-row:hover { - background-color: lightgray; + background-color: #eef5f6; } - - mat-row:nth-child(odd) { - background-color: #0c748914; - // background-color: #eef0fb; - } - .mat-fab-bottom-right { - // top: auto !important; - // right: 20px !important; - // bottom: 10px !important; - // left: auto !important; - // position: fixed !important; float: right; z-index: 5; } } - +// PAGINATOR :host ::ng-deep .mat-paginator-container { flex-direction: row-reverse !important; justify-content: space-between !important; background-color: #f6f6f6; - height: 30px; - min-height: 30px !important; + align-items: center; +} +.create-btn { + border-radius: 30px; + background-color: #f7dd72; + padding-left: 2em; + padding-right: 2em; + // color: #000; + + .button-text{ + display: inline-block; + } } -:host ::ng-deep .mat-paginator-page-size { - height: 43px; +.import-btn { + background: #ffffff 0% 0% no-repeat padding-box; + border-radius: 30px; + // color: #129d99; + // border: 1px solid #129d99; + padding-left: 2em; + padding-right: 2em; + color: #000; + border: 1px solid #000; } -:host ::ng-deep .mat-paginator-range-label { - margin: 15px 32px 0 24px !important; +.status-chip{ + border-radius: 20px; + padding-left: 1em; + padding-right: 1em; + padding-top: 0.2em; + font-size: .8em; } -:host ::ng-deep .mat-paginator-range-actions { - width: 55% !important; - min-height: 43px !important; - justify-content: space-between; +.status-chip-inactive{ + color: #ff3d33; + background: #ffd5d3 0% 0% no-repeat padding-box; } -:host ::ng-deep .mat-paginator-navigation-previous { - margin-left: auto !important; -} - -:host ::ng-deep .mat-icon-button { - height: 30px !important; - font-size: 12px !important; -} +.status-chip-active{ + color: #00c4ff; + background: #d3f5ff 0% 0% no-repeat padding-box; +} \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts index 2bcd93061..2832fd381 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts @@ -2,10 +2,12 @@ import { DataSource } from '@angular/cdk/table'; import { HttpClient } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; +import { MatDialog } from '@angular/material'; import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; +import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DmpProfileListing } from '@app/core/model/dmp-profile/dmp-profile-listing'; import { DmpProfileCriteria } from '@app/core/query/dmp/dmp-profile-criteria'; @@ -17,6 +19,7 @@ import { BaseComponent } from '@common/base/base.component'; import { TranslateService } from '@ngx-translate/core'; import { merge as observableMerge, Observable, of as observableOf } from 'rxjs'; import { map, startWith, switchMap, takeUntil } from 'rxjs/operators'; +import { DialodConfirmationUploadDmpProfiles } from './criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component'; @Component({ @@ -38,8 +41,8 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit breadCrumbs: Observable; statuses = [ - { value: '0', viewValue: 'Active' }, - { value: '1', viewValue: 'Inactive' } + { value: '0', viewValue: 'DMP-PROFILE-LISTING.STATUS.ACTIVE' },// active + { value: '1', viewValue: 'DMP-PROFILE-LISTING.STATUS.INACTIVE' }// inactive ]; constructor( @@ -49,7 +52,8 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit public route: ActivatedRoute, public dmpProfileService: DmpProfileService, private httpClient: HttpClient, - private matomoService: MatomoService + private matomoService: MatomoService, + private dialog: MatDialog, ) { super(); } @@ -88,6 +92,46 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit // debugger; // this.datasetService.makeDatasetPublic(id).pipe(takeUntil(this._destroyed)).subscribe(); // } + + parseStatus(value: number): string{ + const stringVal = value.toString() + try{ + return this.statuses.find(status => status.value === stringVal).viewValue; + }catch{ + return stringVal; + } + } + + openDialog(): void { + const dialogRef = this.dialog.open(DialodConfirmationUploadDmpProfiles, { + restoreFocus: false, + data: { + message: this.languageService.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-FILE-TITLE'), + confirmButton: this.languageService.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML'), + cancelButton: this.languageService.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-FILE-CANCEL'), + name: '', + file: FileList, + sucsess: false + } + }); + dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => { + if (data && data.sucsess && data.name != null && data.file != null) { + this.dmpProfileService.uploadFile(data.file, data.name) + .pipe(takeUntil(this._destroyed)) + .subscribe(); + } + }); + } + getStatusClass(status: number):string{ + + if(status === 1){//inactive + return 'status-chip-inactive' + } + if(status === 0){ + return 'status-chip-active'; + } + return ''; + } } export class DatasetDataSource extends DataSource { diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 301b3c1f8..8a3311f14 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -1060,6 +1060,7 @@ }, "DMP-PROFILE-LISTING": { "TITLE": "DMP Vorlagen", + "CREATE-DMP-TEMPLATE": "Create DMP Template", "COLUMNS": { "NAME": "Name", "STATUS": "Status", @@ -1073,6 +1074,10 @@ "UPLOAD-XML-NAME": "Name der DMP Vorlage", "UPLOAD-XML-IMPORT": "Datei", "UPLOAD-XML-FILE-CANCEL": "Abbrechen" + }, + "STATUS":{ + "ACTIVE": "Active", + "INACTIVE": "Inactive" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 3537f2ca6..0b7c4f02f 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1060,6 +1060,7 @@ }, "DMP-PROFILE-LISTING": { "TITLE": "DMP Templates", + "CREATE-DMP-TEMPLATE": "Create DMP Template", "COLUMNS": { "NAME": "Name", "STATUS": "Status", @@ -1073,6 +1074,10 @@ "UPLOAD-XML-NAME": "Name Of DMP Template", "UPLOAD-XML-IMPORT": "File", "UPLOAD-XML-FILE-CANCEL": "Cancel" + }, + "STATUS":{ + "ACTIVE": "Active", + "INACTIVE": "Inactive" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index ca04f9851..3902900b3 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1060,6 +1060,7 @@ }, "DMP-PROFILE-LISTING": { "TITLE": "Plantilla del PGD", + "CREATE-DMP-TEMPLATE": "Create DMP Template", "COLUMNS": { "NAME": "Nombre", "STATUS": "Estado", @@ -1073,6 +1074,10 @@ "UPLOAD-XML-NAME": "Nombre de la Plantilla del PGD", "UPLOAD-XML-IMPORT": "Fichero", "UPLOAD-XML-FILE-CANCEL": "Cancelar" + }, + "STATUS":{ + "ACTIVE": "Active", + "INACTIVE": "Inactive" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 5990361c2..2c473acd7 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1060,6 +1060,7 @@ }, "DMP-PROFILE-LISTING": { "TITLE": "Templates Σχεδίων Διαχείρισης Δεδομένων", + "CREATE-DMP-TEMPLATE": "Create DMP Template", "COLUMNS": { "NAME": "Τίτλος", "STATUS": "Κατάσταση", @@ -1073,6 +1074,10 @@ "UPLOAD-XML-NAME": "Τίτλος Template Σχεδίου Διαχείρισης Δεδομένων", "UPLOAD-XML-IMPORT": "Αρχείο", "UPLOAD-XML-FILE-CANCEL": "Ακύρωση" + }, + "STATUS":{ + "ACTIVE": "Active", + "INACTIVE": "Inactive" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 2323a493d..370855730 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -1060,6 +1060,7 @@ }, "DMP-PROFILE-LISTING": { "TITLE": "PGDs", + "CREATE-DMP-TEMPLATE": "Create DMP Template", "COLUMNS": { "NAME": "Nome", "STATUS": "Estado", @@ -1073,6 +1074,10 @@ "UPLOAD-XML-NAME": "Nome do PGD", "UPLOAD-XML-IMPORT": "Ficheiro", "UPLOAD-XML-FILE-CANCEL": "Cancelar" + }, + "STATUS":{ + "ACTIVE": "Active", + "INACTIVE": "Inactive" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 1a0eed604..9aaed8a82 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -1060,6 +1060,7 @@ }, "DMP-PROFILE-LISTING": { "TITLE": "Šablóny DMP", + "CREATE-DMP-TEMPLATE": "Create DMP Template", "COLUMNS": { "NAME": "Názov", "STATUS": "Stav", @@ -1073,6 +1074,10 @@ "UPLOAD-XML-NAME": "Názov šablóny DMP", "UPLOAD-XML-IMPORT": "Súbor", "UPLOAD-XML-FILE-CANCEL": "Zrušiť" + }, + "STATUS":{ + "ACTIVE": "Active", + "INACTIVE": "Inactive" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index 9f12e3745..e5cfa472d 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -1060,6 +1060,7 @@ }, "DMP-PROFILE-LISTING": { "TITLE": "Obrasci za Planove", + "CREATE-DMP-TEMPLATE": "Create DMP Template", "COLUMNS": { "NAME": "Ime", "STATUS": "Status", @@ -1073,6 +1074,10 @@ "UPLOAD-XML-NAME": "Ime obrasca za Plan", "UPLOAD-XML-IMPORT": "Datoteka", "UPLOAD-XML-FILE-CANCEL": "Otkažite" + }, + "STATUS":{ + "ACTIVE": "Active", + "INACTIVE": "Inactive" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 71fde2ca2..462462c98 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -1060,6 +1060,7 @@ }, "DMP-PROFILE-LISTING": { "TITLE": "VYP Şablonları", + "CREATE-DMP-TEMPLATE": "Create DMP Template", "COLUMNS": { "NAME": "İsim", "STATUS": "Durum", @@ -1073,6 +1074,10 @@ "UPLOAD-XML-NAME": "VYP Şablonu İsmi", "UPLOAD-XML-IMPORT": "Dosya", "UPLOAD-XML-FILE-CANCEL": "İptal" + }, + "STATUS":{ + "ACTIVE": "Active", + "INACTIVE": "Inactive" } }, "DYNAMIC-FORM": { From e2f262b3856a4c86b855026275e2bcdedc198bfb Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Tue, 22 Jun 2021 14:12:58 +0300 Subject: [PATCH 3/5] Popup dialog on locked DMP/Datasets overview / editors --- .../dataset-wizard.component.html | 10 ++++----- .../dataset-wizard.component.ts | 12 ++++++++--- .../overview/dataset-overview.component.ts | 11 +++++++++- .../app/ui/dmp/editor/dmp-editor.component.ts | 15 ++++--------- .../dmp/overview/dmp-overview.component.html | 2 +- .../ui/dmp/overview/dmp-overview.component.ts | 21 ++++++++++--------- dmp-frontend/src/assets/i18n/de.json | 12 +++++++++++ dmp-frontend/src/assets/i18n/en.json | 12 +++++++++++ dmp-frontend/src/assets/i18n/es.json | 12 +++++++++++ dmp-frontend/src/assets/i18n/gr.json | 12 +++++++++++ dmp-frontend/src/assets/i18n/pt.json | 12 +++++++++++ dmp-frontend/src/assets/i18n/sk.json | 12 +++++++++++ dmp-frontend/src/assets/i18n/sr.json | 12 +++++++++++ dmp-frontend/src/assets/i18n/tr.json | 12 +++++++++++ 14 files changed, 136 insertions(+), 31 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 ca513b5b7..9a894bd63 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 @@ -26,16 +26,16 @@
-
-
+
+
- - - + + +
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 711414023..c5b7516fe 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 @@ -31,7 +31,7 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { TranslateService } from '@ngx-translate/core'; import * as FileSaver from 'file-saver'; -import { Observable, of as observableOf, interval, Subscription } from 'rxjs'; +import { Observable, of as observableOf, interval} from 'rxjs'; import { catchError, debounceTime, map, takeUntil } from 'rxjs/operators'; import { LockService } from '@app/core/services/lock/lock.service'; import { Location } from '@angular/common'; @@ -39,14 +39,13 @@ import { LockModel } from '@app/core/model/lock/lock.model'; import { Guid } from '@common/types/guid'; import { isNullOrUndefined } from 'util'; import { AuthService } from '@app/core/services/auth/auth.service'; -import { environment } from 'environments/environment'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { SaveType } from '@app/core/common/enum/save-type'; import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; import { HttpClient } from '@angular/common/http'; -import { ToCEntry, ToCEntryType } from '@app/ui/misc/dataset-description-form/dataset-description.component'; import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; +import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; @Component({ selector: 'app-dataset-wizard-component', @@ -193,6 +192,13 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr // if (this.viewOnly) { this.formGroup.disable(); } // For future use, to make Dataset edit like DMP. this.loadDatasetProfiles(); this.registerFormListeners(); + + if(lockStatus){ + this.dialog.open(PopupNotificationDialogComponent,{data:{ + title:this.language.instant('DATASET-WIZARD.LOCKED.TITLE'), + message:this.language.instant('DATASET-WIZARD.LOCKED.MESSAGE') + }, maxWidth:'30em'}); + } // this.availableProfiles = this.datasetWizardModel.dmp.profiles; }) }, diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts index 3ce790c8d..3d5b72096 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts @@ -33,6 +33,7 @@ import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DmpOverviewModel } from '@app/core/model/dmp/dmp-overview'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; import { HttpClient } from '@angular/common/http'; +import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; @Component({ @@ -139,7 +140,15 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { checkLockStatus(id: string) { this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed)) - .subscribe(lockStatus => this.lockStatus = lockStatus); + .subscribe(lockStatus => { + this.lockStatus = lockStatus + if(lockStatus){ + this.dialog.open(PopupNotificationDialogComponent,{data:{ + title:this.language.instant('DATASET-OVERVIEW.LOCKED.TITLE'), + message:this.language.instant('DATASET-OVERVIEW.LOCKED.MESSAGE') + }, maxWidth:'30em'}); + } + }); } onFetchingDeletedCallbackError(redirectRoot: 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 9d5773803..cd8c9d6b0 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 @@ -1,11 +1,11 @@ -import { Component, OnInit, SimpleChanges } from '@angular/core'; -import { FormGroup, AbstractControl, FormControl, FormArray, FormBuilder } from '@angular/forms'; +import { Component, OnInit} from '@angular/core'; +import { FormGroup, AbstractControl, FormControl, FormArray} from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; -import { DmpProfileDefinition, DmpProfile } from '@app/core/model/dmp-profile/dmp-profile'; +import { DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile'; import { DmpProfileListing } from '@app/core/model/dmp-profile/dmp-profile-listing'; import { DmpModel } from '@app/core/model/dmp/dmp'; import { UserModel } from '@app/core/model/user/user'; @@ -33,7 +33,7 @@ import { ValidationErrorModel } from '@common/forms/validation/error-model/valid import { TranslateService } from '@ngx-translate/core'; import * as FileSaver from 'file-saver'; import { Observable, of as observableOf, interval } from 'rxjs'; -import { catchError, delay, map, takeUntil } from 'rxjs/operators'; +import { map, takeUntil } from 'rxjs/operators'; import { Principal } from "@app/core/model/auth/principal"; import { Role } from "@app/core/common/enum/role"; import { LockService } from '@app/core/services/lock/lock.service'; @@ -42,13 +42,7 @@ import { Guid } from '@common/types/guid'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { ExtraPropertiesFormModel } from './general-tab/extra-properties-form.model'; import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; -import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration'; -import { DmpListingModel } from '@app/core/model/dmp/dmp-listing'; -import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; -import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; -import { CloneDialogComponent } from '../clone/clone-dialog/clone-dialog.component'; -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'; @@ -117,7 +111,6 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC private formService: FormService, private lockService: LockService, private configurationService: ConfigurationService, - private httpClient: HttpClient, private matomoService: MatomoService ) { super(); diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html index 1517c084e..5ca21021a 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html @@ -103,7 +103,7 @@ horizontal_rule
-
+
add {{'DMP-LISTING.ACTIONS.ADD-DATASET-SHORT' | translate}} 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 5e203919a..28fc75677 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 @@ -1,5 +1,5 @@ -import { Component, OnInit, Input, ViewChild, ElementRef } from '@angular/core'; +import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { DatasetStatus } from '@app/core/common/enum/dataset-status'; @@ -22,19 +22,13 @@ import { Observable, of as observableOf, interval } from 'rxjs'; import { takeUntil, map } from 'rxjs/operators'; import { Role } from "@app/core/common/enum/role"; import { DmpInvitationDialogComponent } from '../invitation/dmp-invitation-dialog.component'; -import { MultipleChoiceDialogModule } from '@common/modules/multiple-choice-dialog/multiple-choice-dialog.module'; import { MultipleChoiceDialogComponent } from '@common/modules/multiple-choice-dialog/multiple-choice-dialog.component'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; -import { Oauth2DialogComponent } from '@app/ui/misc/oauth2-dialog/oauth2-dialog.component'; import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-dialog.service'; -import { isNullOrUndefined } from 'util'; import { UserService } from '@app/core/services/user/user.service'; import { Location } from '@angular/common'; import { FormGroup, FormArray, FormControl } from '@angular/forms'; import { LockService } from '@app/core/services/lock/lock.service'; -import { ReturnStatement, ConditionalExpr } from '@angular/compiler'; -import { LockModel } from '@app/core/model/lock/lock.model'; -import { Guid } from '@common/types/guid'; import { VersionListingModel } from '@app/core/model/version/version-listing.model'; import { CloneDialogComponent } from '../clone/clone-dialog/clone-dialog.component'; import { DmpModel } from '@app/core/model/dmp/dmp'; @@ -43,11 +37,10 @@ import { FunderFormModel } from '../editor/grant-tab/funder-form-model'; import { ProjectFormModel } from '../editor/grant-tab/project-form-model'; import { GrantTabModel } from '../editor/grant-tab/grant-tab-model'; import { ExtraPropertiesFormModel } from '../editor/general-tab/extra-properties-form.model'; -import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; -import { StartNewDatasetDialogComponent } from '../start-new-dataset-dialogue/start-new-dataset-dialog.component'; import { StartNewDmpDialogComponent } from '../start-new-dmp-dialogue/start-new-dmp-dialog.component'; import { HttpClient } from '@angular/common/http'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; +import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; @Component({ selector: 'app-dmp-overview', @@ -781,7 +774,15 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { checkLockStatus(id: string) { this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed)) - .subscribe(lockStatus => this.lockStatus = lockStatus); + .subscribe(lockStatus => { + this.lockStatus = lockStatus + if(lockStatus){ + this.dialog.open(PopupNotificationDialogComponent,{data:{ + title:this.language.instant('DMP-OVERVIEW.LOCKED-DIALOG.TITLE'), + message:this.language.instant('DMP-OVERVIEW.LOCKED-DIALOG.MESSAGE') + }, maxWidth:'30em'}); + } + }); } getUserFromDMP(): any { diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 8a3311f14..83bcf5f66 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -718,6 +718,10 @@ "CANCEL": "Abbrechen", "NEXT": "Next", "ERROR-MESSAGE": "Diese Vorlage der Datensatzbeschreibung ist nicht enthalten" + }, + "LOCKED":{ + "TITLE":"Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. You may view the dataset but you cannot make any changes. If you would like to modify it please come back later." } }, "DMP-OVERVIEW": { @@ -744,6 +748,10 @@ "MULTIPLE-DIALOG": { "ZENODO-LOGIN": "Login with Zenodo", "USE-DEFAULT": "Use Default Token" + }, + "LOCKED-DIALOG":{ + "TITLE": "DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-OVERVIEW": { @@ -751,6 +759,10 @@ "ERROR": { "DELETED-DATASET": "The requested dataset is deleted", "FORBIDEN-DATASET": "You are not allowed to access this dataset" + }, + "LOCKED":{ + "TITLE": "Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 0b7c4f02f..586f64ce0 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -718,6 +718,10 @@ "CANCEL": "Cancel", "NEXT": "Next", "ERROR-MESSAGE": "Does not contain this Dataset Template" + }, + "LOCKED":{ + "TITLE":"Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. You may view the dataset but you cannot make any changes. If you would like to modify it please come back later." } }, "DMP-OVERVIEW": { @@ -744,6 +748,10 @@ "MULTIPLE-DIALOG": { "ZENODO-LOGIN": "Login with Zenodo", "USE-DEFAULT": "Use Default Token" + }, + "LOCKED-DIALOG":{ + "TITLE": "DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-OVERVIEW": { @@ -751,6 +759,10 @@ "ERROR": { "DELETED-DATASET": "The requested dataset is deleted", "FORBIDEN-DATASET": "You are not allowed to access this dataset" + }, + "LOCKED":{ + "TITLE": "Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 3902900b3..512aa604e 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -718,6 +718,10 @@ "CANCEL": "Cancelar", "NEXT": "Next", "ERROR-MESSAGE": "No contiene esta plantilla de descripción del dataset" + }, + "LOCKED":{ + "TITLE":"Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. You may view the dataset but you cannot make any changes. If you would like to modify it please come back later." } }, "DMP-OVERVIEW": { @@ -744,6 +748,10 @@ "MULTIPLE-DIALOG": { "ZENODO-LOGIN": "Identificarse con Zenodo", "USE-DEFAULT": "Usar el token por defecto" + }, + "LOCKED-DIALOG":{ + "TITLE": "DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-OVERVIEW": { @@ -751,6 +759,10 @@ "ERROR": { "DELETED-DATASET": "El dataset pedido ha sido eliminado", "FORBIDEN-DATASET": "No tiene permisos para acceder a este Dataset" + }, + "LOCKED":{ + "TITLE": "Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 2c473acd7..1dc0d7138 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -718,6 +718,10 @@ "CANCEL": "Ακύρωση", "NEXT": "Επόμενο", "ERROR-MESSAGE": "Αυτο το Template Περιγραφής Συνόλου Δεδομένων δεν περιέχεται" + }, + "LOCKED":{ + "TITLE":"Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. You may view the dataset but you cannot make any changes. If you would like to modify it please come back later." } }, "DMP-OVERVIEW": { @@ -744,6 +748,10 @@ "MULTIPLE-DIALOG": { "ZENODO-LOGIN": "Σύνδεση με Zenodo", "USE-DEFAULT": "Χρήση Προκαθορισμένου Token" + }, + "LOCKED-DIALOG":{ + "TITLE": "DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-OVERVIEW": { @@ -751,6 +759,10 @@ "ERROR": { "DELETED-DATASET": "H επιλεγμένη Περιγραφή Δεδομένων θα διαγραφεί", "FORBIDEN-DATASET": "Δεν επιτρέπεται η πρόσβαση σε αυτή την Περιγραφή Δεδομένων" + }, + "LOCKED":{ + "TITLE": "Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 370855730..164d7e7db 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -718,6 +718,10 @@ "CANCEL": "Cancelar", "NEXT": "Seguinte", "ERROR-MESSAGE": "Não contém este Modelo de Dados" + }, + "LOCKED":{ + "TITLE":"Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. You may view the dataset but you cannot make any changes. If you would like to modify it please come back later." } }, "DMP-OVERVIEW": { @@ -744,6 +748,10 @@ "MULTIPLE-DIALOG": { "ZENODO-LOGIN": "Entre com o Zenodo", "USE-DEFAULT": "Use o Token" + }, + "LOCKED-DIALOG":{ + "TITLE": "DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-OVERVIEW": { @@ -751,6 +759,10 @@ "ERROR": { "DELETED-DATASET": "O Dataset requerido foi eliminado", "FORBIDEN-DATASET": "Não está autorizado o acesso a este Dataset" + }, + "LOCKED":{ + "TITLE": "Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 9aaed8a82..abb01ecde 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -718,6 +718,10 @@ "CANCEL": "Zrušiť", "NEXT": "Ďalej", "ERROR-MESSAGE": "Neobsahuje túto šablónu súboru dát" + }, + "LOCKED":{ + "TITLE":"Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. You may view the dataset but you cannot make any changes. If you would like to modify it please come back later." } }, "DMP-OVERVIEW": { @@ -744,6 +748,10 @@ "MULTIPLE-DIALOG": { "ZENODO-LOGIN": "Prihlásiť sa do Zenodo", "USE-DEFAULT": "Použite predvolený token" + }, + "LOCKED-DIALOG":{ + "TITLE": "DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-OVERVIEW": { @@ -751,6 +759,10 @@ "ERROR": { "DELETED-DATASET": "Požadovaný DMP je vymazaný", "FORBIDEN-DATASET": "K tomuto DMP nemáte povolený prístup" + }, + "LOCKED":{ + "TITLE": "Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index e5cfa472d..37ffc6179 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -718,6 +718,10 @@ "CANCEL": "Otkažite", "NEXT": "Sledeće", "ERROR-MESSAGE": "Ne sadrži obrazac za podatke" + }, + "LOCKED":{ + "TITLE":"Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. You may view the dataset but you cannot make any changes. If you would like to modify it please come back later." } }, "DMP-OVERVIEW": { @@ -744,6 +748,10 @@ "MULTIPLE-DIALOG": { "ZENODO-LOGIN": "Prijavite se pomoću Zenodo naloga", "USE-DEFAULT": "Koristite podrazumevani znak" + }, + "LOCKED-DIALOG":{ + "TITLE": "DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-OVERVIEW": { @@ -751,6 +759,10 @@ "ERROR": { "DELETED-DATASET": "Traženi skup podataka je obrisan", "FORBIDEN-DATASET": "Nije Vam dozvoljeno da pristupite ovom skupu podataka" + }, + "LOCKED":{ + "TITLE": "Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-LISTING": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 462462c98..522d1aa13 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -718,6 +718,10 @@ "CANCEL": "İptal", "NEXT": "İleri", "ERROR-MESSAGE": "Bu Veri Seti Şablonunu İçermiyor" + }, + "LOCKED":{ + "TITLE":"Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. You may view the dataset but you cannot make any changes. If you would like to modify it please come back later." } }, "DMP-OVERVIEW": { @@ -744,6 +748,10 @@ "MULTIPLE-DIALOG": { "ZENODO-LOGIN": "Zenodo ile oturum aç", "USE-DEFAULT": "Mevcut Jetonu Kullan" + }, + "LOCKED-DIALOG":{ + "TITLE": "DMP is locked", + "MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-OVERVIEW": { @@ -751,6 +759,10 @@ "ERROR": { "DELETED-DATASET": "Seçili Veri Seti silindi", "FORBIDEN-DATASET": "Bu veri setine erişim izniniz yok" + }, + "LOCKED":{ + "TITLE": "Dataset is locked", + "MESSAGE": "Somebody else is modifying the dataset at this moment. If you would like to modify or view it, please come back later." } }, "DATASET-LISTING": { From ad0853dc209565e0495d88437612100975d891fa Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Tue, 22 Jun 2021 16:48:46 +0300 Subject: [PATCH 4/5] DMP profile editor. Basic restyle --- .../editor/dmp-profile-editor.component.html | 41 +++++++++++++++---- .../editor/dmp-profile-editor.component.scss | 36 ++++++++++++++++ .../editor/dmp-profile-editor.component.ts | 33 +++++++++++---- .../dmp-profile-criteria.component.scss | 4 +- dmp-frontend/src/assets/i18n/de.json | 5 +++ dmp-frontend/src/assets/i18n/en.json | 5 +++ dmp-frontend/src/assets/i18n/es.json | 5 +++ dmp-frontend/src/assets/i18n/gr.json | 5 +++ dmp-frontend/src/assets/i18n/pt.json | 5 +++ dmp-frontend/src/assets/i18n/sk.json | 5 +++ dmp-frontend/src/assets/i18n/sr.json | 5 +++ dmp-frontend/src/assets/i18n/tr.json | 5 +++ 12 files changed, 136 insertions(+), 18 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html index 1ff4715bd..8a894e323 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html @@ -1,9 +1,28 @@
+
+
+

{{'DMP-PROFILE-EDITOR.TITLE.NEW' | translate}}

+

{{formGroup.get('label').value}}

+
+
+
+ +
+
+ +
+
+ +
+
-

{{'DMP-PROFILE-EDITOR.TITLE.NEW' | translate}}

-

{{formGroup.get('label').value}}

- + -
- +
+ @@ -101,12 +120,12 @@
-
+
- +
-
+ + +
+
diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.scss b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.scss index 972e19d7b..ae188ac09 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.scss +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.scss @@ -1,5 +1,7 @@ .dmp-profile-editor { margin-top: 1.3rem; + margin-left: 1em; + margin-right: 3em; .centered-row-item { align-items: center; @@ -25,3 +27,37 @@ ::ng-deep .mat-checkbox-disabled.mat-checkbox-checked .mat-checkbox-background, .mat-checkbox-disabled.mat-checkbox-indeterminate .mat-checkbox-background { background-color: #b0b0b0; } + +.finalize-btn { + border-radius: 30px; + border: 1px solid #129D99; + background: transparent; + padding-left: 2em; + padding-right: 2em; + box-shadow: 0px 3px 6px #1E202029; + color: #129D99; + &:disabled{ + background-color: #CBCBCB; + color: #FFF; + border: 0px; + } +} + +.action-btn { + border-radius: 30px; + background-color: #f7dd72; + border: 1px solid transparent; + padding-left: 2em; + padding-right: 2em; + box-shadow: 0px 3px 6px #1E202029; + + transition-property: background-color, color; + transition-duration: 200ms; + transition-delay: 50ms; + transition-timing-function: ease-in-out; + &:disabled{ + background-color: #CBCBCB; + color: #FFF; + border: 0px; + } +} \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts index 90cc566e0..0de715ef4 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.ts @@ -23,6 +23,8 @@ import { map, takeUntil } from 'rxjs/operators'; import { ConfigurationService } from '@app/core/services/configuration/configuration.service'; import { HttpClient } from '@angular/common/http'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; +import { MatDialog } from '@angular/material'; +import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; @Component({ @@ -50,7 +52,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie private formService: FormService, private configurationService: ConfigurationService, private httpClient: HttpClient, - private matomoService: MatomoService + private matomoService: MatomoService, + private dialog: MatDialog ) { super(); this.host = configurationService.server; @@ -177,13 +180,27 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie } delete() { - this.formGroup.get('status').setValue(DmpProfileStatus.Deleted); - this.dmpProfileService.createDmp(this.formGroup.value) - .pipe(takeUntil(this._destroyed)) - .subscribe( - complete => this.onCallbackSuccess(), - error => this.onCallbackError(error) - ); + this.dialog.open(ConfirmationDialogComponent,{data:{ + isDeleteConfirmation: true, + confirmButton: this.language.instant('DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.CONFIRM-BUTTON'), + cancelButton: this.language.instant("DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.CANCEL-BUTTON"), + message: this.language.instant("DMP-PROFILE-EDITOR.CONFIRM-DELETE-DIALOG.MESSAGE") + }}) + .afterClosed() + .subscribe( + confirmed =>{ + if(confirmed){ + this.formGroup.get('status').setValue(DmpProfileStatus.Deleted); + this.dmpProfileService.createDmp(this.formGroup.value) + .pipe(takeUntil(this._destroyed)) + .subscribe( + complete => this.onCallbackSuccess(), + error => this.onCallbackError(error) + ); + } + } + ) + } finalize() { diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.scss b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.scss index 0cea7d62b..88846d9a8 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.scss +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.scss @@ -8,6 +8,6 @@ } .dmp-criteria{ - margin-top: 4em; - margin-bottom: 2em; + margin-top: 3em; + margin-bottom: 0em; } \ No newline at end of file diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index 83bcf5f66..ac755028c 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -908,6 +908,11 @@ "DELETE": "Löschen", "FINALIZE": "Finalize", "DOWNLOAD-XML": "Download XML" + }, + "CONFIRM-DELETE-DIALOG":{ + "MESSAGE": "Would you like to delete this DMP template?", + "CONFIRM-BUTTON": "Yes, delete", + "CANCEL-BUTTON": "No" } }, "GRANT-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 586f64ce0..c8913786a 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -908,6 +908,11 @@ "DELETE": "Delete", "FINALIZE": "Finalize", "DOWNLOAD-XML": "Download XML" + }, + "CONFIRM-DELETE-DIALOG":{ + "MESSAGE": "Would you like to delete this DMP template?", + "CONFIRM-BUTTON": "Yes, delete", + "CANCEL-BUTTON": "No" } }, "GRANT-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 512aa604e..4806a5d5c 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -908,6 +908,11 @@ "DELETE": "Borrar", "FINALIZE": "Finalizar", "DOWNLOAD-XML": "Descargar XML" + }, + "CONFIRM-DELETE-DIALOG":{ + "MESSAGE": "Would you like to delete this DMP template?", + "CONFIRM-BUTTON": "Yes, delete", + "CANCEL-BUTTON": "No" } }, "GRANT-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 1dc0d7138..bd736b761 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -908,6 +908,11 @@ "DELETE": "Διαγραφή", "FINALIZE": "Οριστικοποίηση", "DOWNLOAD-XML": "Ληψη XML" + }, + "CONFIRM-DELETE-DIALOG":{ + "MESSAGE": "Would you like to delete this DMP template?", + "CONFIRM-BUTTON": "Yes, delete", + "CANCEL-BUTTON": "No" } }, "GRANT-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 164d7e7db..eaf12329a 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -908,6 +908,11 @@ "DELETE": "Eliminar", "FINALIZE": "Concluir", "DOWNLOAD-XML": "Exportar para XML" + }, + "CONFIRM-DELETE-DIALOG":{ + "MESSAGE": "Would you like to delete this DMP template?", + "CONFIRM-BUTTON": "Yes, delete", + "CANCEL-BUTTON": "No" } }, "GRANT-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index abb01ecde..7d3c8efb7 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -908,6 +908,11 @@ "DELETE": "Vymazať", "FINALIZE": "Dokončiť", "DOWNLOAD-XML": "Stiahnuť XML" + }, + "CONFIRM-DELETE-DIALOG":{ + "MESSAGE": "Would you like to delete this DMP template?", + "CONFIRM-BUTTON": "Yes, delete", + "CANCEL-BUTTON": "No" } }, "GRANT-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index 37ffc6179..e7075e147 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -908,6 +908,11 @@ "DELETE": "Obrišite", "FINALIZE": "Dovršite", "DOWNLOAD-XML": "Preuzmite XML" + }, + "CONFIRM-DELETE-DIALOG":{ + "MESSAGE": "Would you like to delete this DMP template?", + "CONFIRM-BUTTON": "Yes, delete", + "CANCEL-BUTTON": "No" } }, "GRANT-EDITOR": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 522d1aa13..ee6213535 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -908,6 +908,11 @@ "DELETE": "Sil", "FINALIZE": "Tamamla", "DOWNLOAD-XML": "XML İndir" + }, + "CONFIRM-DELETE-DIALOG":{ + "MESSAGE": "Would you like to delete this DMP template?", + "CONFIRM-BUTTON": "Yes, delete", + "CANCEL-BUTTON": "No" } }, "GRANT-EDITOR": { From d90ab00833d707f030d958d203e207c108a2f4ba Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Tue, 22 Jun 2021 17:51:00 +0300 Subject: [PATCH 5/5] DMP Profile listing. Restyle import dialog --- .../admin/dmp-profile/dmp-profile.module.ts | 4 +- .../editor/dmp-profile-editor.component.html | 2 +- ...onfirmation-upload-profiles.component.html | 26 ++++- ...onfirmation-upload-profiles.component.scss | 99 +++++++++++++++++++ ...-confirmation-upload-profiles.component.ts | 21 ++-- .../dmp-profile-listing.component.scss | 8 +- .../listing/dmp-profile-listing.component.ts | 22 +++-- 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/pt.json | 7 +- dmp-frontend/src/assets/i18n/sk.json | 7 +- dmp-frontend/src/assets/i18n/sr.json | 7 +- dmp-frontend/src/assets/i18n/tr.json | 7 +- 15 files changed, 198 insertions(+), 40 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/dmp-profile.module.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/dmp-profile.module.ts index 4e4e79439..5059a98b0 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/dmp-profile.module.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/dmp-profile.module.ts @@ -9,6 +9,7 @@ import { DmpProfileExternalAutocompleteFieldEditorComponent } from './editor/ext import { DialodConfirmationUploadDmpProfiles } from './listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component'; import { DmpProfileCriteriaComponent } from './listing/criteria/dmp-profile-criteria.component'; import { DmpProfileListingComponent } from './listing/dmp-profile-listing.component'; +import { NgxDropzoneModule } from "ngx-dropzone"; @NgModule({ imports: [ @@ -16,7 +17,8 @@ import { DmpProfileListingComponent } from './listing/dmp-profile-listing.compon CommonFormsModule, UrlListingModule, ConfirmationDialogModule, - DmpProfileRoutingModule + DmpProfileRoutingModule, + NgxDropzoneModule ], declarations: [ DmpProfileEditorComponent, diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html index 8a894e323..e0bc6fda9 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/editor/dmp-profile-editor.component.html @@ -13,7 +13,7 @@
-
diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.html b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.html index 83c70604d..c07d4eca4 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.html +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.html @@ -4,10 +4,26 @@

{{ data.message }}

- -
+
+
+
+ + + {{ selectedFileName }} + + +
+
+
+
+ +
@@ -15,11 +31,11 @@
- +
- +
diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.scss b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.scss index 226db6ce8..63c42f81e 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.scss +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.scss @@ -1,3 +1,102 @@ .hidden { display: none; +} + + +.cancel-btn { + background: #ffffff 0% 0% no-repeat padding-box; + border: 1px solid #b5b5b5; + border-radius: 30px; + width: 101px; + height: 43px; + color: #212121; + font-weight: 500; +} + +.next-btn { + background: #ffffff 0% 0% no-repeat padding-box; + border: 1px solid #129d99; + border-radius: 30px; + opacity: 1; + width: 101px; + height: 43px; + color: #129d99; + font-weight: 500; +} + +.next-btn[disabled] { + width: 100px; + height: 43px; + background: #ffffff 0% 0% no-repeat padding-box; + border: 1px solid #b5b5b5; + border-radius: 30px; + opacity: 1; +} + +.next-btn:not([disabled]):hover { + background-color: #129d99; + color: #ffffff; +} + +//ngx dropzone +.drop-file { + background-color: #fafafa; + border: 1px dashed #d1d1d1; + border-radius: 4px; + max-width: 480px; + height: 98px; + margin-top: 0.5rem; +} + +.file-preview { + height: auto !important; + width: auto !important; + max-width: 500px !important; + min-height: 1rem !important; + + background-color: #e0e0e0 !important; + background-image: none !important; + color: rgba(0, 0, 0, 0.87) !important; + font-weight: 500 !important; + border-radius: 24px !important; + line-height: 1.25 !important; +} + +.file-label { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 14px !important; +} + +::ng-deep ngx-dropzone-remove-badge { + opacity: 1 !important; + margin-left: .5rem !important; + position: initial !important; +} + + +//attach file + +.attach-btn { + top: -20px; +} + +.attach-file { + width: 156px; + height: 44px; + color: #ffffff; + background: #129d99 0% 0% no-repeat padding-box; + box-shadow: 0px 3px 6px #1e202029; + border-radius: 30px; +} + +.attach-file:hover { + background-color: #ffffff; + border: 1px solid #129d99; + color: #129d99; +} + +.close-btn:hover{ + cursor: pointer; } \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts index 42a7dfa61..c8081101f 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component.ts @@ -10,9 +10,9 @@ import { Inject, Component } from '@angular/core'; export class DialodConfirmationUploadDmpProfiles { sizeError = false; - btnColore:String="primary"; selectFile =false; maxFileSize: number = 1048576; + selectedFileName: string; constructor( public dialogRef: MatDialogRef, @@ -21,16 +21,20 @@ export class DialodConfirmationUploadDmpProfiles { selectXML(event) { - const file: FileList = event.target.files; + let file: FileList = null; + if(event.target && event.target.files){ + file = event.target.files; + }else if(event.addedFiles && event.addedFiles.length){ + file = event.addedFiles; + } + if(!file) return;//no select closed with cancel . no file selected const size: number = file[0].size; // Get file size. this.sizeError = size > this.maxFileSize; // Checks if file size is valid. const formdata: FormData = new FormData(); if (!this.sizeError) { this.data.file = file; this.selectFile=true; - this.btnColore="primary"; - }else{ - this.btnColore="warn"; + this.selectedFileName = file[0].name; } this.data.name = file[0].name; } @@ -49,5 +53,10 @@ export class DialodConfirmationUploadDmpProfiles { hasProfile():boolean{ return (this.selectFile && !this.sizeError); } - + //remove selected file + onRemove(){ + this.data.name=""; + this.selectFile = false; + this.selectedFileName = ""; + } } diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.scss b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.scss index ea1d13594..e797578ad 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.scss +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.scss @@ -66,12 +66,12 @@ font-size: .8em; } -.status-chip-inactive{ - color: #ff3d33; - background: #ffd5d3 0% 0% no-repeat padding-box; +.status-chip-finalized{ + color: #568b5a; + background: #9dd1a1 0% 0% no-repeat padding-box; } -.status-chip-active{ +.status-chip-draft{ color: #00c4ff; background: #d3f5ff 0% 0% no-repeat padding-box; } \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts index 2832fd381..3ec322ecf 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/dmp-profile-listing.component.ts @@ -7,15 +7,16 @@ import { MatPaginator, PageEvent } from '@angular/material/paginator'; import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute, Params, Router } from '@angular/router'; -import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DataTableRequest } from '@app/core/model/data-table/data-table-request'; import { DmpProfileListing } from '@app/core/model/dmp-profile/dmp-profile-listing'; import { DmpProfileCriteria } from '@app/core/query/dmp/dmp-profile-criteria'; import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service'; import { MatomoService } from '@app/core/services/matomo/matomo-service'; +import { UiNotificationService } from '@app/core/services/notification/ui-notification-service'; import { DmpProfileCriteriaComponent } from '@app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component'; import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item'; import { BaseComponent } from '@common/base/base.component'; +import { SnackBarNotificationLevel } from '@common/modules/notification/ui-notification-service'; import { TranslateService } from '@ngx-translate/core'; import { merge as observableMerge, Observable, of as observableOf } from 'rxjs'; import { map, startWith, switchMap, takeUntil } from 'rxjs/operators'; @@ -41,8 +42,8 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit breadCrumbs: Observable; statuses = [ - { value: '0', viewValue: 'DMP-PROFILE-LISTING.STATUS.ACTIVE' },// active - { value: '1', viewValue: 'DMP-PROFILE-LISTING.STATUS.INACTIVE' }// inactive + { value: '0', viewValue: 'DMP-PROFILE-LISTING.STATUS.DRAFT' },// active + { value: '1', viewValue: 'DMP-PROFILE-LISTING.STATUS.FINALIZED' }// inactive ]; constructor( @@ -54,6 +55,7 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit private httpClient: HttpClient, private matomoService: MatomoService, private dialog: MatDialog, + private uiNotificationService: UiNotificationService, ) { super(); } @@ -118,17 +120,23 @@ export class DmpProfileListingComponent extends BaseComponent implements OnInit if (data && data.sucsess && data.name != null && data.file != null) { this.dmpProfileService.uploadFile(data.file, data.name) .pipe(takeUntil(this._destroyed)) - .subscribe(); + .subscribe(_=>{ + this.uiNotificationService.snackBarNotification(this.languageService.instant('DMP-PROFILE-LISTING.MESSAGES.TEMPLATE-UPLOAD-SUCCESS'), SnackBarNotificationLevel.Success); + this.refresh(); + }, + error=>{ + this.uiNotificationService.snackBarNotification(error.message, SnackBarNotificationLevel.Error); + }); } }); } getStatusClass(status: number):string{ - if(status === 1){//inactive - return 'status-chip-inactive' + if(status === 1){//finalized + return 'status-chip-finalized' } if(status === 0){ - return 'status-chip-active'; + return 'status-chip-draft'; } return ''; } diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index ac755028c..244a7fbb3 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -1093,8 +1093,11 @@ "UPLOAD-XML-FILE-CANCEL": "Abbrechen" }, "STATUS":{ - "ACTIVE": "Active", - "INACTIVE": "Inactive" + "DRAFT": "Draft", + "FINALIZED": "Finalized" + }, + "MESSAGES":{ + "TEMPLATE-UPLOAD-SUCCESS":"Template successfully uploaded" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index c8913786a..77484b7a0 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1093,8 +1093,11 @@ "UPLOAD-XML-FILE-CANCEL": "Cancel" }, "STATUS":{ - "ACTIVE": "Active", - "INACTIVE": "Inactive" + "DRAFT": "Draft", + "FINALIZED": "Finalized" + }, + "MESSAGES":{ + "TEMPLATE-UPLOAD-SUCCESS":"Template successfully uploaded" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 4806a5d5c..5cc7d6820 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -1093,8 +1093,11 @@ "UPLOAD-XML-FILE-CANCEL": "Cancelar" }, "STATUS":{ - "ACTIVE": "Active", - "INACTIVE": "Inactive" + "DRAFT": "Draft", + "FINALIZED": "Finalized" + }, + "MESSAGES":{ + "TEMPLATE-UPLOAD-SUCCESS":"Template successfully uploaded" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index bd736b761..abea652e3 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -1093,8 +1093,11 @@ "UPLOAD-XML-FILE-CANCEL": "Ακύρωση" }, "STATUS":{ - "ACTIVE": "Active", - "INACTIVE": "Inactive" + "DRAFT": "Draft", + "FINALIZED": "Finalized" + }, + "MESSAGES":{ + "TEMPLATE-UPLOAD-SUCCESS":"Template successfully uploaded" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index eaf12329a..b46969729 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -1093,8 +1093,11 @@ "UPLOAD-XML-FILE-CANCEL": "Cancelar" }, "STATUS":{ - "ACTIVE": "Active", - "INACTIVE": "Inactive" + "DRAFT": "Draft", + "FINALIZED": "Finalized" + }, + "MESSAGES":{ + "TEMPLATE-UPLOAD-SUCCESS":"Template successfully uploaded" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index 7d3c8efb7..4a07d4adc 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -1093,8 +1093,11 @@ "UPLOAD-XML-FILE-CANCEL": "Zrušiť" }, "STATUS":{ - "ACTIVE": "Active", - "INACTIVE": "Inactive" + "DRAFT": "Draft", + "FINALIZED": "Finalized" + }, + "MESSAGES":{ + "TEMPLATE-UPLOAD-SUCCESS":"Template successfully uploaded" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index e7075e147..f2595eea5 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -1093,8 +1093,11 @@ "UPLOAD-XML-FILE-CANCEL": "Otkažite" }, "STATUS":{ - "ACTIVE": "Active", - "INACTIVE": "Inactive" + "DRAFT": "Draft", + "FINALIZED": "Finalized" + }, + "MESSAGES":{ + "TEMPLATE-UPLOAD-SUCCESS":"Template successfully uploaded" } }, "DYNAMIC-FORM": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index ee6213535..d8375d9e6 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -1093,8 +1093,11 @@ "UPLOAD-XML-FILE-CANCEL": "İptal" }, "STATUS":{ - "ACTIVE": "Active", - "INACTIVE": "Inactive" + "DRAFT": "Draft", + "FINALIZED": "Finalized" + }, + "MESSAGES":{ + "TEMPLATE-UPLOAD-SUCCESS":"Template successfully uploaded" } }, "DYNAMIC-FORM": {