diff --git a/dmp-frontend/package-lock.json b/dmp-frontend/package-lock.json index 52d12fca7..c050a5ace 100644 --- a/dmp-frontend/package-lock.json +++ b/dmp-frontend/package-lock.json @@ -209,6 +209,19 @@ "source-map": "0.5.7" } }, + "@types/gapi": { + "version": "0.0.35", + "resolved": "https://registry.npmjs.org/@types/gapi/-/gapi-0.0.35.tgz", + "integrity": "sha512-6E+WHil3a2+ZQXxa+2Fg9WMi1SwVx9KXT3P/7VmfTwK9Uqw2F+TQ97Ig2yJ7cOa0fUEk4qgdQNKP4rzKZfNMOQ==" + }, + "@types/gapi.auth2": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/@types/gapi.auth2/-/gapi.auth2-0.0.31.tgz", + "integrity": "sha1-P5F/mcHxjgv05HghTYME/60cXe8=", + "requires": { + "@types/gapi": "0.0.35" + } + }, "@types/jasmine": { "version": "2.5.54", "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.5.54.tgz", @@ -352,6 +365,14 @@ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, + "angular-google-signin": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/angular-google-signin/-/angular-google-signin-0.1.5.tgz", + "integrity": "sha1-VQbMWeTCRWIOsJDoOGnH9MoXUTw=", + "requires": { + "@types/gapi.auth2": "0.0.31" + } + }, "angular-ide": { "version": "0.9.31", "resolved": "https://registry.npmjs.org/angular-ide/-/angular-ide-0.9.31.tgz", @@ -8065,12 +8086,6 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -8098,6 +8113,12 @@ } } }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", diff --git a/dmp-frontend/package.json b/dmp-frontend/package.json index 7d6d74c5a..a2eb501cf 100644 --- a/dmp-frontend/package.json +++ b/dmp-frontend/package.json @@ -21,6 +21,7 @@ "@angular/platform-browser": "^4.3.6", "@angular/platform-browser-dynamic": "^4.3.6", "@angular/router": "^4.3.6", + "angular-google-signin": "^0.1.5", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "jquery": "^3.2.1", diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts new file mode 100644 index 000000000..be8d688d6 --- /dev/null +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -0,0 +1,32 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { PageNotFoundComponent } from './not-found.component'; +import { DynamicFormComponent } from './form/dynamic-form.component'; +import { LoginComponent } from './login/login-page'; +import { AuthGuard } from './guards/auth.guard'; + +const appRoutes: Routes = [ + { path: 'dynamic-form.component', component: DynamicFormComponent, canActivate: [AuthGuard] }, + { path: 'login-page', component: LoginComponent }, + { path: '', redirectTo: '/login-page', pathMatch: 'full' }, + { path: '**', component: PageNotFoundComponent } +]; + +@NgModule({ + imports: [ + RouterModule.forRoot( + appRoutes, + { + enableTracing: true // <-- debugging purposes only + + } + ) + ], + exports: [ + RouterModule + ], + providers: [ + + ] +}) +export class AppRoutingModule { } \ No newline at end of file diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 13bd3a448..b882c0b15 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -7,25 +7,19 @@ import { JsonObjest } from '../app/entities/JsonObject.class'; @Component({ selector: 'app-root', template: ` -
Form value: {{ form.value | json }}
+ +Sign out diff --git a/dmp-frontend/src/app/form/dynamic-form.component.ts b/dmp-frontend/src/app/form/dynamic-form.component.ts index d513baea9..73c3ef2b3 100644 --- a/dmp-frontend/src/app/form/dynamic-form.component.ts +++ b/dmp-frontend/src/app/form/dynamic-form.component.ts @@ -8,6 +8,7 @@ import { ServerService } from '../../app/services/server.service'; import { dataModelBuilder } from '../../app/services/dataModelBuilder.service'; import { DataModel } from '../entities/DataModel'; import { GroupBase } from './dynamic-form-group/group-base'; +import { Router, ActivatedRoute } from '@angular/router'; @Component({ selector: 'dynamic-form', @@ -24,9 +25,8 @@ export class DynamicFormComponent implements OnInit { - constructor(private qcs: FieldControlService, private serverService: ServerService, private dataModelService: dataModelBuilder) { + constructor(private qcs: FieldControlService, private serverService: ServerService, private dataModelService: dataModelBuilder, private router: Router, private route: ActivatedRoute) { this.form = this.qcs.toFormGroup(new Array(), new Array()); - } @@ -49,7 +49,7 @@ export class DynamicFormComponent implements OnInit { ); //this.buildForm(); */ - + console.log("DynamicFormComponent.ngOnInit() -- RUNNIGN"); diff --git a/dmp-frontend/src/app/form/fields/dynamic-form-field.component.html b/dmp-frontend/src/app/form/fields/dynamic-form-field.component.html index 80ede029d..49f7c1c15 100644 --- a/dmp-frontend/src/app/form/fields/dynamic-form-field.component.html +++ b/dmp-frontend/src/app/form/fields/dynamic-form-field.component.html @@ -57,7 +57,6 @@ - + + +