diff --git a/@overflow/member/component/member-modify-password.component.html b/@overflow/member/component/member-modify-password.component.html index 3eee678..dbc42d8 100644 --- a/@overflow/member/component/member-modify-password.component.html +++ b/@overflow/member/component/member-modify-password.component.html @@ -47,26 +47,4 @@ -
- - - - -
- -
-
- \ No newline at end of file + diff --git a/@overflow/member/component/member-reset-password.component.html b/@overflow/member/component/member-reset-password.component.html index c10ca40..ca831a8 100644 --- a/@overflow/member/component/member-reset-password.component.html +++ b/@overflow/member/component/member-reset-password.component.html @@ -18,13 +18,13 @@ {{ formErrors.email }} - +
- + Sign In | Sign Up @@ -36,26 +36,5 @@
-
- - - - -
- -
-
- \ No newline at end of file + + diff --git a/@overflow/member/component/member-signup.component.html b/@overflow/member/component/member-signup.component.html index ac88f13..451c4ab 100644 --- a/@overflow/member/component/member-signup.component.html +++ b/@overflow/member/component/member-signup.component.html @@ -5,7 +5,7 @@ [(visible)]="termsDisplay" [showHeader]="true" [closeOnEscape]="false"> - + - + + + + +
Membership is welcome.
@@ -39,7 +50,7 @@ placeholder="Email" formControlName="email" required - value="geekhot@hotmail.co.kr" /> + />
Invalid email
@@ -125,8 +136,16 @@

- + +

+
+ please check +
Terms Of Use | Privacy Policy @@ -136,7 +155,7 @@
@@ -158,26 +177,4 @@
-
- - - - - -
diff --git a/@overflow/member/component/member-signup.component.ts b/@overflow/member/component/member-signup.component.ts index e13dce0..dee4dd2 100644 --- a/@overflow/member/component/member-signup.component.ts +++ b/@overflow/member/component/member-signup.component.ts @@ -3,7 +3,7 @@ import { OnDestroy, OnInit, Output, - EventEmitter, + EventEmitter, Input, } from '@angular/core'; import { FormGroup, FormBuilder, Validators, AbstractControl, FormControl, ValidationErrors } from '@angular/forms'; import { Member } from '@overflow/commons-typescript/model/member'; @@ -14,8 +14,9 @@ import { Member } from '@overflow/commons-typescript/model/member'; }) export class MemberSignupComponent implements OnInit, OnDestroy { @Output() signup = new EventEmitter<{member: Member, password: string}>(); + @Output() doneSignup = new EventEmitter(); - myRecaptcha = new FormControl(false); + @Input() signupComplete; signupForm: FormGroup; email: AbstractControl; @@ -24,6 +25,8 @@ export class MemberSignupComponent implements OnInit, OnDestroy { name: AbstractControl; phone: AbstractControl; company: AbstractControl; + selectPolicy: AbstractControl; + captcha: AbstractControl; termsDisplay = false; policyDisplay = false; @@ -83,6 +86,12 @@ export class MemberSignupComponent implements OnInit, OnDestroy { Validators.required ] ], + 'selectPolicy': [ + false, [ Validators.requiredTrue ], + ], + 'captcha': [ + false, [ Validators.requiredTrue ], + ] }); this.email = this.signupForm.controls['email']; this.password = this.signupForm.controls['password']; @@ -90,6 +99,8 @@ export class MemberSignupComponent implements OnInit, OnDestroy { this.name = this.signupForm.controls['name']; this.phone = this.signupForm.controls['phone']; this.company = this.signupForm.controls['company']; + this.selectPolicy = this.signupForm.controls['selectPolicy']; + this.captcha = this.signupForm.controls['captcha']; } pwMatchValidator(control: FormControl): ValidationErrors { @@ -104,10 +115,6 @@ export class MemberSignupComponent implements OnInit, OnDestroy { } signupFormSubmit() { - if (!this.myRecaptcha.valid) { - console.log('dddddddd'); - return; - } const signupValue = Object.assign({}, this.signupForm.value); const password = signupValue.password; const member: Member = { @@ -122,16 +129,13 @@ export class MemberSignupComponent implements OnInit, OnDestroy { termsDisplayOpen() { this.termsDisplay = true; } - onTermsDisplayClose() { - this.termsDisplay = false; - } policyDisplayOpen() { this.policyDisplay = true; } - onPolicyDisplayClose() { - this.policyDisplay = false; + closeSignup() { + this.doneSignup.emit(); } onScriptLoad() { diff --git a/@overflow/member/container/member-signup-container.component.html b/@overflow/member/container/member-signup-container.component.html index 595efb7..8e2dd6c 100644 --- a/@overflow/member/container/member-signup-container.component.html +++ b/@overflow/member/container/member-signup-container.component.html @@ -1 +1 @@ - + diff --git a/@overflow/member/container/member-signup-container.component.ts b/@overflow/member/container/member-signup-container.component.ts index 2b88916..0d0caf7 100644 --- a/@overflow/member/container/member-signup-container.component.ts +++ b/@overflow/member/container/member-signup-container.component.ts @@ -1,12 +1,14 @@ import { - Component, + Component, EventEmitter, OnDestroy, - OnInit, + OnInit, Output, } from '@angular/core'; import { Member } from '@overflow/commons-typescript/model/member'; -import { Store } from '@ngrx/store'; +import {select, Store} from '@ngrx/store'; import * as MemberEntityStore from '../store/entity/member'; +import { MemberSignupContainerSelector } from '../store'; +import {Observable} from 'rxjs'; @Component({ selector: 'of-member-signup-container', @@ -14,11 +16,16 @@ import * as MemberEntityStore from '../store/entity/member'; }) export class MemberSignupContainerComponent implements OnInit, OnDestroy { + @Output() doneSignup = new EventEmitter(); + + signupComplete$: Observable; + constructor( private store: Store, ) { } ngOnInit() { + this.signupComplete$ = this.store.pipe(select(MemberSignupContainerSelector.selectSignupComplete)); } ngOnDestroy() { @@ -27,4 +34,8 @@ export class MemberSignupContainerComponent implements OnInit, OnDestroy { onSignup(info: {member: Member, password: string}) { this.store.dispatch(new MemberEntityStore.Signup(info)); } + + onDoneSignup() { + this.doneSignup.emit(); + } } diff --git a/@overflow/member/store/container/signup/member-signup.reducer.ts b/@overflow/member/store/container/signup/member-signup.reducer.ts index c7f3f8c..099cae5 100644 --- a/@overflow/member/store/container/signup/member-signup.reducer.ts +++ b/@overflow/member/store/container/signup/member-signup.reducer.ts @@ -12,6 +12,7 @@ export function reducer(state = initialState, action: Actions): State { switch (action.type) { case ActionType.Signup: { return { + signupComplete: false, pending: true, error: null, }; @@ -19,6 +20,7 @@ export function reducer(state = initialState, action: Actions): State { case ActionType.SignupSuccess: { return { + signupComplete: true, pending: false, error: null, }; @@ -26,6 +28,7 @@ export function reducer(state = initialState, action: Actions): State { case ActionType.SignupFailure: { return { + signupComplete: false, pending: false, error: action.payload, }; diff --git a/@overflow/member/store/container/signup/member-signup.state.ts b/@overflow/member/store/container/signup/member-signup.state.ts index 39f65af..2a84abc 100644 --- a/@overflow/member/store/container/signup/member-signup.state.ts +++ b/@overflow/member/store/container/signup/member-signup.state.ts @@ -3,17 +3,20 @@ import { Selector, createSelector } from '@ngrx/store'; import { RESTClientError } from '@loafer/ng-rest'; export interface State { + signupComplete: boolean; pending: boolean; error: RESTClientError; } export const initialState: State = { + signupComplete: false, pending: false, error: null, }; export function getSelectors(selector: Selector) { return { + selectSignupComplete: createSelector(selector, (state: State) => state.signupComplete), selectPending: createSelector(selector, (state: State) => state.pending), selectError: createSelector(selector, (state: State) => state.error), }; diff --git a/@overflow/member/store/container/totp/member-totp.reducer.ts b/@overflow/member/store/container/totp/member-totp.reducer.ts index 8819b6a..7df832b 100644 --- a/@overflow/member/store/container/totp/member-totp.reducer.ts +++ b/@overflow/member/store/container/totp/member-totp.reducer.ts @@ -37,6 +37,59 @@ export function reducer(state = initialState, action: Actions): State { }; } + case ActionType.Regist: { + return { + secretKey: null, + sourceURI: null, + pending: true, + error: null, + }; + } + + case ActionType.RegistSuccess: { + return { + secretKey: null, + sourceURI: null, + pending: true, + error: null, + }; + } + + case ActionType.RegistFailure: { + return { + secretKey: null, + sourceURI: null, + pending: true, + error: action.payload, + }; + } + + case ActionType.CheckCodeForMember: { + return { + secretKey: null, + sourceURI: null, + pending: true, + error: null, + }; + } + + case ActionType.CheckCodeForMemberSuccess: { + return { + secretKey: null, + sourceURI: null, + pending: true, + error: null, + }; + } + + case ActionType.CheckCodeForMemberFailure: { + return { + secretKey: null, + sourceURI: null, + pending: true, + error: action.payload, + }; + } default: { return state; } diff --git a/@overflow/member/store/container/totp/member-totp.state.ts b/@overflow/member/store/container/totp/member-totp.state.ts index 010bf0f..402b18e 100644 --- a/@overflow/member/store/container/totp/member-totp.state.ts +++ b/@overflow/member/store/container/totp/member-totp.state.ts @@ -1,11 +1,11 @@ import { Selector, createSelector } from '@ngrx/store'; -import { RESTClientError } from '@loafer/ng-rest'; +import { RPCClientError } from '@loafer/ng-rpc'; export interface State { secretKey: string; sourceURI: string; pending: boolean; - error: RESTClientError; + error: RPCClientError; } export const initialState: State = { diff --git a/@overflow/member/store/entity/member-totp/member-totp.action.ts b/@overflow/member/store/entity/member-totp/member-totp.action.ts index 8202b86..9d0a888 100644 --- a/@overflow/member/store/entity/member-totp/member-totp.action.ts +++ b/@overflow/member/store/entity/member-totp/member-totp.action.ts @@ -1,6 +1,6 @@ import { Action } from '@ngrx/store'; -import { RESTClientError } from '@loafer/ng-rest'; +import { RPCClientError } from '@loafer/ng-rpc'; import { Member } from '@overflow/commons-typescript/model/member'; @@ -33,7 +33,7 @@ export class CreateTotpSuccess implements Action { export class CreateTotpFailure implements Action { readonly type = ActionType.CreateTotpFailure; - constructor(public payload: RESTClientError) {} + constructor(public payload: RPCClientError) {} } // ---------------------------------------------------------------------------------------- @@ -51,7 +51,7 @@ export class RegistSuccess implements Action { export class RegistFailure implements Action { readonly type = ActionType.RegistFailure; - constructor(public payload: RESTClientError) {} + constructor(public payload: RPCClientError) {} } // ---------------------------------------------------------------------------------------- @@ -71,7 +71,7 @@ export class CheckCodeForMemberSuccess implements Action { export class CheckCodeForMemberFailure implements Action { readonly type = ActionType.CheckCodeForMemberFailure; - constructor(public payload: RESTClientError) {} + constructor(public payload: RPCClientError) {} } export type Actions = diff --git a/src/app/pages/auth/signup/signup-page.component.html b/src/app/pages/auth/signup/signup-page.component.html index c891b15..0c0a77d 100644 --- a/src/app/pages/auth/signup/signup-page.component.html +++ b/src/app/pages/auth/signup/signup-page.component.html @@ -1,6 +1,6 @@
- +
-
\ No newline at end of file + diff --git a/src/app/pages/auth/signup/signup-page.component.ts b/src/app/pages/auth/signup/signup-page.component.ts index 138a3cc..1c935f4 100644 --- a/src/app/pages/auth/signup/signup-page.component.ts +++ b/src/app/pages/auth/signup/signup-page.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import {ActivatedRoute, Router} from '@angular/router'; @Component({ selector: 'of-pages-auth-signup', @@ -10,6 +10,7 @@ export class SignupPageComponent implements OnInit { returnURL: string; constructor( + private router: Router, private activatedRoute: ActivatedRoute, ) { } @@ -19,4 +20,8 @@ export class SignupPageComponent implements OnInit { initForm() { } + + signupComplete() { + this.router.navigate(['/auth/signin']); + } }