1
0

Test if reopening PR works

This commit is contained in:
Julius Gruber
2019-09-04 14:14:12 +02:00
parent 093ad47a3d
commit c428b1deef
10 changed files with 120 additions and 38 deletions

View File

@@ -1,9 +1,9 @@
import { Component, Injector, Input, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { AuthMethodModel } from '../../core/auth/models/auth-method.model';
import { Store } from '@ngrx/store';
import { AuthState } from '../../core/auth/auth.reducer';
import { getAuthenticationMethods } from '../../core/auth/selectors';
import { select, Store } from '@ngrx/store';
import { getAuthenticationMethods, isAuthenticated, isAuthenticationLoading } from '../../core/auth/selectors';
import { CoreState } from '../../core/core.reducers';
@Component({
selector: 'ds-auth-methods',
@@ -17,11 +17,29 @@ export class AuthMethodsComponent implements OnInit {
*/
@Input() authMethodData: Observable<AuthMethodModel[]>;
constructor( private store: Store<AuthState>) {
/**
* Whether user is authenticated.
* @type {Observable<string>}
*/
public isAuthenticated: Observable<boolean>;
/**
* True if the authentication is loading.
* @type {boolean}
*/
public loading: Observable<boolean>;
constructor( private store: Store<CoreState>) {
}
ngOnInit(): void {
this.authMethodData = this.authMethodData = this.store.select(getAuthenticationMethods);
// set loading
this.loading = this.store.pipe(select(isAuthenticationLoading));
// set isAuthenticated
this.isAuthenticated = this.store.pipe(select(isAuthenticated));
}
}