This commit is contained in:
crusader 2018-05-31 21:11:31 +09:00
parent 4ff5eead18
commit e46aa26170
10 changed files with 43 additions and 43 deletions

View File

@ -1,10 +1,10 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs'; import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import {FormBuilder} from '@angular/forms'; import { FormBuilder } from '@angular/forms';
import {EmailAuthService} from '../service/email-auth.service'; import { EmailAuthService } from '../service/email-auth.service';
import {EmailAuth} from '@overflow/commons-typescript/model/email/EmailAuth'; import { EmailAuth } from '@overflow/commons-typescript/model/email/EmailAuth';
@Component({ @Component({
selector: 'of-member-confirm-reset-password', selector: 'of-member-confirm-reset-password',
@ -33,14 +33,14 @@ export class MemberConfirmResetPasswordComponent implements OnInit {
map((emailAuth: EmailAuth) => { map((emailAuth: EmailAuth) => {
this.emailAuth$ = of(emailAuth); this.emailAuth$ = of(emailAuth);
}), }),
catchError( err => { catchError(err => {
this.error$ = of(err); this.error$ = of(err);
return of(); return of();
}), }),
tap(() => { tap(() => {
this.pending$ = of(false); this.pending$ = of(false);
}), }),
).take(1).subscribe(); ).take(1).subscribe();
} }
onModifyPassword() { onModifyPassword() {

View File

@ -1,10 +1,10 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs'; import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import {FormBuilder} from '@angular/forms'; import { FormBuilder } from '@angular/forms';
import {EmailAuthService} from '../service/email-auth.service'; import { EmailAuthService } from '../service/email-auth.service';
import {EmailAuth} from '@overflow/commons-typescript/model/email/EmailAuth'; import { EmailAuth } from '@overflow/commons-typescript/model/email/EmailAuth';
@Component({ @Component({
selector: 'of-member-confirm-signup', selector: 'of-member-confirm-signup',
@ -32,14 +32,14 @@ export class MemberConfirmSignupComponent implements OnInit {
map((emailAuth: EmailAuth) => { map((emailAuth: EmailAuth) => {
this.emailAuth$ = of(emailAuth); this.emailAuth$ = of(emailAuth);
}), }),
catchError( err => { catchError(err => {
this.error$ = of(err); this.error$ = of(err);
return of(); return of();
}), }),
tap(() => { tap(() => {
this.pending$ = of(false); this.pending$ = of(false);
}), }),
).take(1).subscribe(); ).take(1).subscribe();
} }
onSignin() { onSignin() {

View File

@ -1,5 +1,5 @@
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import {FormGroup, FormBuilder, Validators, FormControl, ValidationErrors, AbstractControl} from '@angular/forms'; import { FormGroup, FormBuilder, Validators, FormControl, ValidationErrors, AbstractControl } from '@angular/forms';
import { Member } from '@overflow/commons-typescript/model/member'; import { Member } from '@overflow/commons-typescript/model/member';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs'; import { Observable, of } from 'rxjs';
@ -52,7 +52,7 @@ export class MemberModifyPasswordComponent implements OnInit {
'', '',
[ [
Validators.compose([ Validators.compose([
Validators.required, this.pwMatchValidator Validators.required, this.pwMatchValidator
]) ])
] ]
] ]
@ -84,14 +84,14 @@ export class MemberModifyPasswordComponent implements OnInit {
map((rmember: Member) => { map((rmember: Member) => {
this.member$ = of(rmember); this.member$ = of(rmember);
}), }),
catchError( err => { catchError(err => {
this.error$ = of(err); this.error$ = of(err);
return of(); return of();
}), }),
tap(() => { tap(() => {
this.pending$ = of(false); this.pending$ = of(false);
}), }),
).take(1).subscribe(); ).take(1).subscribe();
} }
onSignin() { onSignin() {

View File

@ -1,4 +1,4 @@
import {Component, OnInit, OnDestroy, EventEmitter, Input, Output} from '@angular/core'; import { Component, OnInit, OnDestroy, EventEmitter, Input, Output } from '@angular/core';
@Component({ @Component({
selector: 'of-member-policy', selector: 'of-member-policy',
@ -6,7 +6,7 @@ import {Component, OnInit, OnDestroy, EventEmitter, Input, Output} from '@angula
}) })
export class MemberPolicyComponent implements OnInit, OnDestroy { export class MemberPolicyComponent implements OnInit, OnDestroy {
@Input() policyDisplay; @Input() policyDisplay;
@Output() close = new EventEmitter(); @Output() close = new EventEmitter();
constructor( constructor(

View File

@ -29,10 +29,10 @@ export class MemberProfileComponent implements OnInit, OnDestroy {
initForm() { initForm() {
this.form = this.formBuilder.group({ this.form = this.formBuilder.group({
'email': ['', 'email': ['',
[ [
Validators.required, Validators.required,
Validators.email Validators.email
]], ]],
'name': ['', []], 'name': ['', []],
'companyName': ['', []], 'companyName': ['', []],
'phone': ['', []], 'phone': ['', []],

View File

@ -14,8 +14,8 @@ import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs'; import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import {Member} from '@overflow/commons-typescript/model/member'; import { Member } from '@overflow/commons-typescript/model/member';
import {MemberService} from '../service/member.service'; import { MemberService } from '../service/member.service';
@Component({ @Component({
selector: 'of-member-reset-password', selector: 'of-member-reset-password',
@ -64,14 +64,14 @@ export class MemberResetPasswordComponent implements OnInit {
map((rmember: Member) => { map((rmember: Member) => {
this.member$ = of(rmember); this.member$ = of(rmember);
}), }),
catchError( err => { catchError(err => {
this.error$ = of(err); this.error$ = of(err);
return of(); return of();
}), }),
tap(() => { tap(() => {
this.pending$ = of(false); this.pending$ = of(false);
}), }),
).take(1).subscribe(); ).take(1).subscribe();
} }
onSignin() { onSignin() {

View File

@ -1,5 +1,5 @@
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import {FormGroup, FormBuilder, Validators, AbstractControl} from '@angular/forms'; import { FormGroup, FormBuilder, Validators, AbstractControl } from '@angular/forms';
import { Member } from '@overflow/commons-typescript/model/member'; import { Member } from '@overflow/commons-typescript/model/member';
@Component({ @Component({
@ -12,7 +12,7 @@ export class MemberSigninComponent implements OnInit {
@Output() resetPassword = new EventEmitter(); @Output() resetPassword = new EventEmitter();
@Output() signup = new EventEmitter(); @Output() signup = new EventEmitter();
@Output() signin = new EventEmitter<{email: string, password: string}>(); @Output() signin = new EventEmitter<{ email: string, password: string }>();
errorMessage: string | null; errorMessage: string | null;

View File

@ -10,7 +10,7 @@ import { Member } from '@overflow/commons-typescript/model/member';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { Observable, of } from 'rxjs'; import { Observable, of } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators'; import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import {MemberService} from '../service/member.service'; import { MemberService } from '../service/member.service';
@Component({ @Component({
selector: 'of-member-signup', selector: 'of-member-signup',
@ -72,8 +72,8 @@ export class MemberSignupComponent implements OnInit, OnDestroy {
'!@#$Qwer1234', '!@#$Qwer1234',
[ [
Validators.compose([ Validators.compose([
Validators.required, this.pwMatchValidator Validators.required, this.pwMatchValidator
]) ])
] ]
], ],
'name': [ 'name': [
@ -95,10 +95,10 @@ export class MemberSignupComponent implements OnInit, OnDestroy {
] ]
], ],
'selectPolicy': [ 'selectPolicy': [
false, [ Validators.requiredTrue ], false, [Validators.requiredTrue],
], ],
'captcha': [ 'captcha': [
false, [ Validators.requiredTrue ], false, [Validators.requiredTrue],
] ]
}); });
this.email = this.signupForm.controls['email']; this.email = this.signupForm.controls['email'];
@ -139,14 +139,14 @@ export class MemberSignupComponent implements OnInit, OnDestroy {
map((rmember: Member) => { map((rmember: Member) => {
this.member$ = of(rmember); this.member$ = of(rmember);
}), }),
catchError( err => { catchError(err => {
this.error$ = of(err); this.error$ = of(err);
return of(); return of();
}), }),
tap(() => { tap(() => {
this.pending$ = of(false); this.pending$ = of(false);
}), }),
).take(1).subscribe(); ).take(1).subscribe();
} }
termsDisplayOpen() { termsDisplayOpen() {

View File

@ -1,4 +1,4 @@
import {Component, OnInit, OnDestroy, Input, EventEmitter, Output} from '@angular/core'; import { Component, OnInit, OnDestroy, Input, EventEmitter, Output } from '@angular/core';
@Component({ @Component({
selector: 'of-member-terms', selector: 'of-member-terms',
@ -6,7 +6,7 @@ import {Component, OnInit, OnDestroy, Input, EventEmitter, Output} from '@angula
}) })
export class MemberTermsComponent implements OnInit, OnDestroy { export class MemberTermsComponent implements OnInit, OnDestroy {
@Input() termsDisplay; @Input() termsDisplay;
@Output() close = new EventEmitter(); @Output() close = new EventEmitter();
constructor( constructor(

View File

@ -1,4 +1,4 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { Member } from '@overflow/commons-typescript/model/member'; import { Member } from '@overflow/commons-typescript/model/member';
@ -9,7 +9,7 @@ import { Member } from '@overflow/commons-typescript/model/member';
export class MemberTotpComponent implements OnInit { export class MemberTotpComponent implements OnInit {
@Input() domainMember: DomainMember; @Input() domainMember: DomainMember;
@Input() totp; @Input() totp;
@Output() regist = new EventEmitter<{member: Member, code: string, secretCode: string}>(); @Output() regist = new EventEmitter<{ member: Member, code: string, secretCode: string }>();
@Output() create = new EventEmitter<Member>(); @Output() create = new EventEmitter<Member>();
selectedItem: any; selectedItem: any;
@ -24,9 +24,9 @@ export class MemberTotpComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.lists = [ this.lists = [
{id: 1, name: 'Email', value: this.domainMember.member.email, description: 'blabla', }, { id: 1, name: 'Email', value: this.domainMember.member.email, description: 'blabla', },
{id: 2, name: 'Phone', value: this.domainMember.member.phone, description: 'blabla', }, { id: 2, name: 'Phone', value: this.domainMember.member.phone, description: 'blabla', },
{id: 3, name: 'Google 2factor', value: this.domainMember.member.totpType, description: 'blabla', }, { id: 3, name: 'Google 2factor', value: this.domainMember.member.totpType, description: 'blabla', },
]; ];
} }
@ -42,7 +42,7 @@ export class MemberTotpComponent implements OnInit {
} }
totpInput(e) { totpInput(e) {
if ( e.target.value.length === 6 ) { if (e.target.value.length === 6) {
this.regist.emit(e.target.value); this.regist.emit(e.target.value);
} }
return; return;