diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index 713f61220..928379264 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -16,7 +16,8 @@ const appRoutes: Routes = [ path: 'home', loadChildren: () => import('./ui/dashboard/dashboard.module').then(m => m.DashboardModule), data: { - breadcrumb: true + breadcrumb: true, + title: 'GENERAL.TITLES.HOME' } }, { diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts index 363c56c0d..57fd8325f 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.component.ts @@ -49,6 +49,7 @@ import { DmpDescriptionTemplate } from '@app/core/model/dmp/dmp'; import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type'; import { nameof } from 'ts-simple-nameof'; import { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms'; +import { TableOfContentsValidationService } from './table-of-contents/services/table-of-contents-validation-service'; @Component({ selector: 'app-description-editor-component', @@ -99,6 +100,7 @@ export class DescriptionEditorComponent extends BaseEditor this.prepareForm(data)); + this.tocValidationService.validateForm(); } refreshOnNavigateToData(id?: Guid): void { @@ -1015,6 +1018,10 @@ export class DescriptionEditorComponent extends BaseEditor this.tocValidationService.validateForm()); // // const labelSubscription = // this.formGroup.get('label').valueChanges diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.routing.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.routing.ts index e86406d08..2d1ea28a0 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.routing.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.routing.ts @@ -21,7 +21,8 @@ const routes: Routes = [ data: { ...BreadcrumbService.generateRouteDataConfiguration({ title: 'BREADCRUMBS.EDIT-DESCRIPTION' - }) + }), + title: 'DESCRIPTION-EDITOR.TITLE-EDIT-DESCRIPTION' // , // authContext: { // permissions: [AppPermission.EditDescription] @@ -39,7 +40,8 @@ const routes: Routes = [ data: { ...BreadcrumbService.generateRouteDataConfiguration({ title: 'BREADCRUMBS.EDIT-DESCRIPTION' - }) + }), + title: 'DESCRIPTION-EDITOR.TITLE-EDIT-DESCRIPTION' // , // authContext: { // permissions: [AppPermission.EditDescription] @@ -57,7 +59,8 @@ const routes: Routes = [ data: { ...BreadcrumbService.generateRouteDataConfiguration({ title: 'BREADCRUMBS.EDIT-DESCRIPTION' - }) + }), + title: 'DESCRIPTION-EDITOR.TITLE-NEW' // , // authContext: { // permissions: [AppPermission.EditDescription] @@ -75,7 +78,8 @@ const routes: Routes = [ data: { ...BreadcrumbService.generateRouteDataConfiguration({ title: 'BREADCRUMBS.EDIT-DESCRIPTION' - }) + }), + title: 'DESCRIPTION-EDITOR.TITLE-NEW' // , // authContext: { // permissions: [AppPermission.EditDescription] diff --git a/dmp-frontend/src/app/ui/description/editor/table-of-contents/services/table-of-contents-validation-service.ts b/dmp-frontend/src/app/ui/description/editor/table-of-contents/services/table-of-contents-validation-service.ts new file mode 100644 index 000000000..c90ed33ca --- /dev/null +++ b/dmp-frontend/src/app/ui/description/editor/table-of-contents/services/table-of-contents-validation-service.ts @@ -0,0 +1,13 @@ +import { EventEmitter, Injectable } from "@angular/core"; + +@Injectable() +export class TableOfContentsValidationService { + private _validateFormEvent: EventEmitter = new EventEmitter(); + get validateFormEvent(): EventEmitter { + return this._validateFormEvent; + } + + validateForm(): void { + this._validateFormEvent.emit(); + } +} diff --git a/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents-internal/table-of-contents-internal.ts b/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents-internal/table-of-contents-internal.ts index ecf0ca556..e191fed12 100644 --- a/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents-internal/table-of-contents-internal.ts +++ b/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents-internal/table-of-contents-internal.ts @@ -6,6 +6,7 @@ import { ToCEntry } from '../models/toc-entry'; import { ToCEntryType } from '../models/toc-entry-type.enum'; import { DescriptionFieldIndicator } from '../../description-editor.model'; import { Observable, Subscription, map } from 'rxjs'; +import { TableOfContentsValidationService } from '../services/table-of-contents-validation-service'; @Component({ selector: 'table-of-contents-internal', @@ -34,8 +35,7 @@ export class TableOfContentsInternal implements OnInit, OnDestroy { tocEntriesStateSubscriptions: Subscription[] = []; tocEntriesStateMap: Map = new Map(); - constructor() { - } + constructor(private tocValidationService: TableOfContentsValidationService) { } ngOnInit(): void { // console.log('component created' + JSON.stringify(this.tocentries)); @@ -93,7 +93,7 @@ export class TableOfContentsInternal implements OnInit, OnDestroy { this.tocEntriesStateMap.set(entry.id, false); this.tocEntriesStateSubscriptions.push( - this.propertiesFormGroup.statusChanges + this.tocValidationService.validateFormEvent .pipe(map(() => this.hasErrors(entry.id))) .subscribe(next => { this.tocEntriesStateMap.set(entry.id, next); diff --git a/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents.module.ts b/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents.module.ts index 2a7bc3749..413bfde9a 100644 --- a/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents.module.ts +++ b/dmp-frontend/src/app/ui/description/editor/table-of-contents/table-of-contents.module.ts @@ -1,15 +1,16 @@ import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; +import { NgModule} from '@angular/core'; import {RouterModule} from '@angular/router'; import { TableOfContentsInternal } from './table-of-contents-internal/table-of-contents-internal'; import { MatIconModule } from '@angular/material/icon'; import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service'; import { TableOfContentsComponent } from './table-of-contents.component'; +import { TableOfContentsValidationService } from './services/table-of-contents-validation-service'; @NgModule({ imports: [CommonModule, RouterModule, MatIconModule], declarations: [TableOfContentsComponent, TableOfContentsInternal], exports: [TableOfContentsComponent], - providers: [VisibilityRulesService] + providers: [VisibilityRulesService, TableOfContentsValidationService] }) export class TableOfContentsModule { } diff --git a/dmp-frontend/src/app/ui/dmp/dmp.routing.ts b/dmp-frontend/src/app/ui/dmp/dmp.routing.ts index 3b98458db..46a213860 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp.routing.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp.routing.ts @@ -13,14 +13,16 @@ const routes: Routes = [ path: 'new', loadChildren: () => import('./dmp-editor-blueprint/dmp-editor.module').then(m => m.DmpEditorModule), data: { - breadcrumb: true + breadcrumb: true, + title: 'DMP-EDITOR.TITLE-NEW' } }, { path: 'edit', loadChildren: () => import('./dmp-editor-blueprint/dmp-editor.module').then(m => m.DmpEditorModule), data: { - breadcrumb: true + breadcrumb: true, + title: 'DMP-EDITOR.TITLE-EDIT' } }, { diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.routing.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.routing.ts index b210ddec8..3e5832727 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.routing.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.routing.ts @@ -8,7 +8,7 @@ const routes: Routes = [ component: DmpOverviewComponent, data: { breadcrumb: true, - title: 'GENERAL.TITLES.DATASET-OVERVIEW' + title: 'GENERAL.TITLES.PLAN-OVERVIEW' }, }, { @@ -16,7 +16,7 @@ const routes: Routes = [ component: DmpOverviewComponent, data: { breadcrumb: true, - title: 'GENERAL.TITLES.DATASET-OVERVIEW' + title: 'GENERAL.TITLES.PLAN-OVERVIEW' }, } ]; diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 7fc76d511..600264c9a 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -93,8 +93,10 @@ "USERS": "Users", "PROFILE": "My Profile", "LOGIN": "Login", + "PLAN-OVERVIEW": "Plan Overview", "DATASET-OVERVIEW": "Description Overview", - "MAINTENANCE-TASKS": "Maintenance" + "MAINTENANCE-TASKS": "Maintenance", + "HOME": "Home" }, "FILE-TRANSFORMER": { "PDF": "PDF", @@ -754,6 +756,7 @@ "EMPTY-LIST": "Nothing here yet." }, "DESCRIPTION-EDITOR": { + "TITLE-NEW": "New Description", "TITLE-ADD-DESCRIPTION": "Adding Description", "TITLE-EDIT-DESCRIPTION": "Editing Description", "TITLE-PREVIEW-DESCRIPTION": "Previewing Description", @@ -1446,6 +1449,7 @@ } }, "DMP-EDITOR": { + "TITLE-NEW": "New Plan", "TITLE-EDIT": "Editing Plan", "TITLE": "Plan Blueprint", "UNSAVED-CHANGES": "unsaved changes", diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.html b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.html index 8171c6429..84ea7362a 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.html +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.html @@ -1,10 +1,12 @@ -
-
- {{'GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.WARNING' | translate}} - close +
+
+
+ {{'GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.WARNING' | translate}} + close +
-
-
+
+
  • {{error}}
  • @@ -15,8 +17,8 @@
-
-
+
+