From bac6d12b42d5da2533476fb11b20f477dcad83fc Mon Sep 17 00:00:00 2001 From: Diamadis Tziotzios Date: Tue, 19 Dec 2017 15:57:07 +0200 Subject: [PATCH] no message --- dmp-frontend/src/app/app-routing.module.ts | 3 + dmp-frontend/src/app/app.module.ts | 4 +- .../app/dmp-wizard/dmp-wizard.component.html | 34 +++++++++++ .../app/dmp-wizard/dmp-wizard.component.scss | 35 +++++++++++ .../app/dmp-wizard/dmp-wizard.component.ts | 61 +++++++++++++++++++ .../app/shared/material/material.module.ts | 6 +- 6 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.html create mode 100644 dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.scss create mode 100644 dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.ts diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index c4e80203e..2f5255acc 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -14,6 +14,7 @@ import { ProjectListingComponent } from './projects/project-listing.component'; import { DataManagementPlanListingComponent } from './dmps/dmp-listing.component'; import { ProjectEditorComponent } from './projects/editor/project-editor.component'; import { DataManagementPlanEditorComponent } from './dmps/editor/dmp-editor.component'; +import { DataManagementPlanWizardComponent } from './dmp-wizard/dmp-wizard.component'; const appRoutes: Routes = [ @@ -24,8 +25,10 @@ const appRoutes: Routes = [ { path: 'project/:id', component: ProjectEditorComponent, canActivate: [AuthGuard]}, { path: 'projects/new', component: ProjectEditorComponent, canActivate: [AuthGuard]}, { path: 'dmps', component: DataManagementPlanListingComponent, canActivate: [AuthGuard]}, + { path: 'dmp/new', component: DataManagementPlanWizardComponent, canActivate: [AuthGuard]}, { path: 'dmp/:id', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard]}, { path: 'dmps/new', component: DataManagementPlanEditorComponent, canActivate: [AuthGuard]}, + { path: 'login', component: MainSignInComponent}, { path: "unauthorized", loadChildren: './unauthorized/unauthorized.module#UnauthorizedModule' }, { path: 'welcome', component: HomepageComponent, canActivate: [AuthGuard]}, diff --git a/dmp-frontend/src/app/app.module.ts b/dmp-frontend/src/app/app.module.ts index 50d6f6571..9735d73c9 100644 --- a/dmp-frontend/src/app/app.module.ts +++ b/dmp-frontend/src/app/app.module.ts @@ -111,6 +111,7 @@ import { ProjectEditorComponent } from './projects/editor/project-editor.compone import { DataManagementPlanEditorComponent } from './dmps/editor/dmp-editor.component'; import { FigurecardComponent } from './shared/components/figurecard/figurecard.component'; +import { DataManagementPlanWizardComponent } from './dmp-wizard/dmp-wizard.component'; @@ -152,7 +153,8 @@ import { FigurecardComponent } from './shared/components/figurecard/figurecard.c BreadcrumbComponent, DmpDetailedComponent, ProjectDetailedComponent, ProjectEditorComponent, DataManagementPlanEditorComponent, - FigurecardComponent + FigurecardComponent, + DataManagementPlanWizardComponent ], imports: [ BrowserModule, diff --git a/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.html b/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.html new file mode 100644 index 000000000..06a44a8f1 --- /dev/null +++ b/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.html @@ -0,0 +1,34 @@ +
+ + +
+ Fill out your name + + + +
+ +
+
+
+ +
+ Fill out your address + + + +
+ + +
+
+
+ + Done + You are now done. +
+ +
+
+
+
\ No newline at end of file diff --git a/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.scss b/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.scss new file mode 100644 index 000000000..4921ca203 --- /dev/null +++ b/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.scss @@ -0,0 +1,35 @@ +.full-width { + width: 100%; +} + +.input-table { + table-layout: fixed; +} + +.table-card .mat-grid-tile { + background: rgba(0, 0, 0, 0.32); +} + +.data-management-plan-editor { + mat-form-field { + width: 100%; + padding: 3px; + } + + .mat-card { + margin: 16px 0; + } + + p { + margin: 16px; + } + + .left-button { + float: left; + } + + .description-area { + height: 100px; + } + +} diff --git a/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.ts b/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.ts new file mode 100644 index 000000000..a8cf8c9c4 --- /dev/null +++ b/dmp-frontend/src/app/dmp-wizard/dmp-wizard.component.ts @@ -0,0 +1,61 @@ +import { Component, ViewChild, OnInit, AfterViewInit, ViewEncapsulation } from "@angular/core"; +import { DataManagementPlanService } from "../services/data-management-plan/data-management-plan.service"; +import { FormGroup, Validators, FormBuilder } from "@angular/forms"; + + + +@Component({ + selector: 'app-dmp-wizard-component', + templateUrl: 'dmp-wizard.component.html', + styleUrls: ['./dmp-wizard.component.scss'], + providers: [DataManagementPlanService], + encapsulation: ViewEncapsulation.None +}) +export class DataManagementPlanWizardComponent implements AfterViewInit { + + constructor( + private dataManagementPlanService: DataManagementPlanService, + private formBuilder: FormBuilder + ) { + + } + + isLinear = false; + firstFormGroup: FormGroup; + secondFormGroup: FormGroup; + + ngOnInit() { + this.firstFormGroup = this.formBuilder.group({ + firstCtrl: ['', Validators.required] + }); + this.secondFormGroup = this.formBuilder.group({ + secondCtrl: ['', Validators.required] + }); + } + + ngAfterViewInit() { + // this.route.params.subscribe((params: Params) => { + // const itemId = params['id']; + + // if (itemId != null) { + // this.isNew = false; + // this.dataManagementPlanService.getSingle(itemId).map(data => data as DataManagementPlanModel) + // .subscribe(data => { + // this.dataManagementPlan = new JsonSerializer().fromJSONObject(data, DataManagementPlanModel); + // this.formGroup = this.dataManagementPlan.buildForm(); + // }); + // } else { + // this.dataManagementPlan = new DataManagementPlanModel(); + // setTimeout(() => { + // this.formGroup = this.dataManagementPlan.buildForm(); + // }); + // } + // }); + } + + + + public cancel(): void { + //this.router.navigate(['/dataManagementPlans']); + } +} \ No newline at end of file diff --git a/dmp-frontend/src/app/shared/material/material.module.ts b/dmp-frontend/src/app/shared/material/material.module.ts index b31568832..843b348ee 100644 --- a/dmp-frontend/src/app/shared/material/material.module.ts +++ b/dmp-frontend/src/app/shared/material/material.module.ts @@ -23,7 +23,8 @@ import { DateAdapter, MatTooltipModule, MatCheckboxModule, - MatTabsModule + MatTabsModule, + MatStepperModule } from '@angular/material'; import { CdkTableModule } from '@angular/cdk/table'; import { SnackBarNotificationComponent } from '../components/notificaiton/snack-bar-notification.component'; @@ -60,7 +61,8 @@ import { CovalentLayoutModule, CovalentChipsModule, CovalentDialogsModule } from MatTabsModule, CovalentLayoutModule, CovalentChipsModule, - CovalentDialogsModule + CovalentDialogsModule, + MatStepperModule ], providers: [