diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 9bf4b41f0..98d47dd52 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -11,6 +11,7 @@ import { BreadcrumbComponent } from './widgets/breadcrumb/breadcrumb.component'; import { AutocompleteRemoteComponent } from './form/fields/autocomplete-remote/autocomplete-remote.component'; +declare const gapi: any; declare var $ :any; @Component({ @@ -36,10 +37,45 @@ export class AppComponent implements OnInit { } ngOnInit() { + //this.initiateExternalProviders(); + } + + initiateExternalProviders(){ + + + //initiate google + var clientId = '1010962018903-glegmqudqtl1lub0150vacopbu06lgsg.apps.googleusercontent.com'; + var scope = [ + 'profile', + 'email' + ].join(' '); + + if(gapi.auth2 == undefined){ + + gapi.load('auth2', () => { + + gapi.auth2.init({ + client_id: clientId, + cookiepolicy: 'single_host_origin', + scope: scope + }); + + + + //RE-Render the button (due to known issues of google-button with angular's lifecycle) + gapi.signin2.render('googleBtn'); + + //var buttonElement = this.element.nativeElement.querySelector('#googleBtn'); + //this.attachSignin(buttonElement); + + }); + + } } + slideNav(){ $("#appSidebar").toggleClass("expanded"); diff --git a/dmp-frontend/src/app/dmps/dmps.html b/dmp-frontend/src/app/dmps/dmps.html index 23911d5db..d2d9dffef 100644 --- a/dmp-frontend/src/app/dmps/dmps.html +++ b/dmp-frontend/src/app/dmps/dmps.html @@ -68,7 +68,7 @@