From 869fcf4e723b554e727ae224d8deef42d2a2ae1b Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 28 May 2018 14:41:56 +0900 Subject: [PATCH] ing --- @overflow/member/component/index.ts | 30 +-- .../member-modify-password.component.html | 72 +++++++ .../member-modify-password.component.spec.ts | 25 +++ .../member-modify-password.component.ts | 51 +++++ ...nent.html => member-policy.component.html} | 0 ...pec.ts => member-policy.component.spec.ts} | 12 +- .../component/member-policy.component.ts | 27 +++ .../component/member-profile.component.html | 47 +++++ .../member-profile.component.spec.ts} | 12 +- .../component/member-profile.component.ts | 52 +++++ ...l => member-reset-password.component.html} | 23 ++- .../member-reset-password.component.spec.ts | 25 +++ .../member-reset-password.component.ts | 36 ++++ .../component/member-signin.component.html | 34 ++++ .../component/member-signin.component.spec.ts | 25 +++ .../component/member-signin.component.ts | 60 ++++++ ...nent.html => member-signup.component.html} | 2 +- .../component/member-signup.component.spec.ts | 25 +++ ...omponent.ts => member-signup.component.ts} | 18 +- ...onent.html => member-terms.component.html} | 0 ...spec.ts => member-terms.component.spec.ts} | 12 +- .../component/member-terms.component.ts | 24 +++ @overflow/member/container/index.ts | 7 + .../member-signin-container.component.html | 1 + .../member-signin-container.component.spec.ts | 25 +++ .../member-signin-container.component.ts} | 10 +- .../member-signup-container.component.html | 1 + .../member-signup-container.component.spec.ts | 25 +++ .../member-signup-container.component.ts | 29 +++ .../container/policy/policy.component.html | 134 ++++++++++++ .../policy/policy.component.spec.ts | 0 .../policy/policy.component.ts | 0 .../profile/profile.component.html | 0 .../profile/profile.component.spec.ts | 0 .../profile/profile.component.ts | 0 .../modify-password.component.html | 0 .../modify-password.component.spec.ts | 0 .../modify-password.component.ts | 0 .../reset-password.component.html | 0 .../reset-password.component.spec.ts | 0 .../reset-password.component.ts | 0 @overflow/member/container/settings/index.ts | 7 + .../totp/config/config-setting.component.html | 96 +++++++++ .../totp/config/config-setting.component.scss | 0 .../totp/config/config-setting.component.ts | 91 +++++++++ .../settings/totp/totp.component.html | 25 +++ .../settings/totp/totp.component.spec.ts} | 12 +- .../container/settings/totp/totp.component.ts | 72 +++++++ .../container/terms/terms.component.html | 104 ++++++++++ .../terms/terms.component.spec.ts | 0 .../terms/terms.component.ts | 0 @overflow/member/member.module.ts | 3 + .../member/store/container/modify/index.ts | 5 + .../store/container/modify/modify.reducer.ts | 35 ++++ .../store/container/modify/modify.state.ts | 11 + .../store/container/reset-password/index.ts | 5 + .../reset-password/reset-password.reducer.ts | 54 +++++ .../reset-password/reset-password.state.ts | 11 + .../member/store/container/signin/index.ts | 2 + .../store/container/signin/signin.reducer.ts | 48 +++++ .../store/container/signin/signin.state.ts | 11 + .../member/store/container/signout/index.ts | 2 + .../container/signout/signout.reducer.ts | 35 ++++ .../store/container/signout/signout.state.ts | 11 + .../member/store/container/signup/index.ts | 5 + .../store/container/signup/signup.reducer.ts | 35 ++++ .../store/container/signup/signup.state.ts | 11 + @overflow/member/store/entity/member/index.ts | 5 + .../store/entity/member/member.action.ts | 190 ++++++++++++++++++ .../store/entity/member/member.effect.spec.ts | 15 ++ .../store/entity/member/member.effect.ts | 51 +++++ .../store/entity/member/member.reducer.ts | 45 +++++ .../store/entity/member/member.state.ts | 15 ++ @overflow/noauth-probe/component/index.ts | 2 +- ....html => noauth-probe-list.component.html} | 0 .../noauth-probe-list.component.spec.ts | 25 +++ ...nent.ts => noauth-probe-list.component.ts} | 4 +- @overflow/noauth-probe/container/index.ts | 2 +- .../list/list-container.component.html | 1 - ...noauth-probe-list-container.component.html | 1 + ...uth-probe-list-container.component.spec.ts | 25 +++ ... noauth-probe-list-container.component.ts} | 8 +- @overflow/shared/auth/auth.constant.ts | 3 + @overflow/shared/auth/auth.module.ts | 9 + .../shared/auth/store/auth/auth.action.ts | 89 ++++++++ .../auth/store/auth/auth.effect.spec.ts | 15 ++ .../shared/auth/store/auth/auth.effect.ts | 107 ++++++++++ .../shared/auth/store/auth/auth.reducer.ts | 102 ++++++++++ .../shared/auth/store/auth/auth.state.ts | 19 ++ @overflow/shared/auth/store/auth/index.ts | 4 + @overflow/shared/shared.constant.ts | 3 + @overflow/shared/shared.module.ts | 9 + src/app/commons/guard/auth.guard.ts | 7 +- .../auth/signin/signin-page.component.html | 9 +- .../noauth-probe-page.component.html | 2 +- 95 files changed, 2224 insertions(+), 78 deletions(-) create mode 100644 @overflow/member/component/member-modify-password.component.html create mode 100644 @overflow/member/component/member-modify-password.component.spec.ts create mode 100644 @overflow/member/component/member-modify-password.component.ts rename @overflow/member/component/{policy/policy.component.html => member-policy.component.html} (100%) rename @overflow/member/component/{signin/signin.component.spec.ts => member-policy.component.spec.ts} (53%) create mode 100644 @overflow/member/component/member-policy.component.ts create mode 100644 @overflow/member/component/member-profile.component.html rename @overflow/{noauth-probe/container/list/list-container.component.spec.ts => member/component/member-profile.component.spec.ts} (53%) create mode 100644 @overflow/member/component/member-profile.component.ts rename @overflow/member/component/{signin/signin.component.html => member-reset-password.component.html} (71%) create mode 100644 @overflow/member/component/member-reset-password.component.spec.ts create mode 100644 @overflow/member/component/member-reset-password.component.ts create mode 100644 @overflow/member/component/member-signin.component.html create mode 100644 @overflow/member/component/member-signin.component.spec.ts create mode 100644 @overflow/member/component/member-signin.component.ts rename @overflow/member/component/{signup/signup.component.html => member-signup.component.html} (99%) create mode 100644 @overflow/member/component/member-signup.component.spec.ts rename @overflow/member/component/{signup/signup.component.ts => member-signup.component.ts} (88%) rename @overflow/member/component/{terms/terms.component.html => member-terms.component.html} (100%) rename @overflow/member/component/{signup/signup.component.spec.ts => member-terms.component.spec.ts} (53%) create mode 100644 @overflow/member/component/member-terms.component.ts create mode 100644 @overflow/member/container/index.ts create mode 100644 @overflow/member/container/member-signin-container.component.html create mode 100644 @overflow/member/container/member-signin-container.component.spec.ts rename @overflow/member/{component/signin/signin.component.ts => container/member-signin-container.component.ts} (88%) create mode 100644 @overflow/member/container/member-signup-container.component.html create mode 100644 @overflow/member/container/member-signup-container.component.spec.ts create mode 100644 @overflow/member/container/member-signup-container.component.ts create mode 100644 @overflow/member/container/policy/policy.component.html rename @overflow/member/{component => container}/policy/policy.component.spec.ts (100%) rename @overflow/member/{component => container}/policy/policy.component.ts (100%) rename @overflow/member/{component => container}/profile/profile.component.html (100%) rename @overflow/member/{component => container}/profile/profile.component.spec.ts (100%) rename @overflow/member/{component => container}/profile/profile.component.ts (100%) rename @overflow/member/{component => container}/reset-password/modify-password.component.html (100%) rename @overflow/member/{component => container}/reset-password/modify-password.component.spec.ts (100%) rename @overflow/member/{component => container}/reset-password/modify-password.component.ts (100%) rename @overflow/member/{component => container}/reset-password/reset-password.component.html (100%) rename @overflow/member/{component => container}/reset-password/reset-password.component.spec.ts (100%) rename @overflow/member/{component => container}/reset-password/reset-password.component.ts (100%) create mode 100644 @overflow/member/container/settings/index.ts create mode 100644 @overflow/member/container/settings/totp/config/config-setting.component.html create mode 100644 @overflow/member/container/settings/totp/config/config-setting.component.scss create mode 100644 @overflow/member/container/settings/totp/config/config-setting.component.ts create mode 100644 @overflow/member/container/settings/totp/totp.component.html rename @overflow/{noauth-probe/component/list/list.component.spec.ts => member/container/settings/totp/totp.component.spec.ts} (58%) create mode 100644 @overflow/member/container/settings/totp/totp.component.ts create mode 100644 @overflow/member/container/terms/terms.component.html rename @overflow/member/{component => container}/terms/terms.component.spec.ts (100%) rename @overflow/member/{component => container}/terms/terms.component.ts (100%) create mode 100644 @overflow/member/store/container/modify/index.ts create mode 100644 @overflow/member/store/container/modify/modify.reducer.ts create mode 100644 @overflow/member/store/container/modify/modify.state.ts create mode 100644 @overflow/member/store/container/reset-password/index.ts create mode 100644 @overflow/member/store/container/reset-password/reset-password.reducer.ts create mode 100644 @overflow/member/store/container/reset-password/reset-password.state.ts create mode 100644 @overflow/member/store/container/signin/index.ts create mode 100644 @overflow/member/store/container/signin/signin.reducer.ts create mode 100644 @overflow/member/store/container/signin/signin.state.ts create mode 100644 @overflow/member/store/container/signout/index.ts create mode 100644 @overflow/member/store/container/signout/signout.reducer.ts create mode 100644 @overflow/member/store/container/signout/signout.state.ts create mode 100644 @overflow/member/store/container/signup/index.ts create mode 100644 @overflow/member/store/container/signup/signup.reducer.ts create mode 100644 @overflow/member/store/container/signup/signup.state.ts create mode 100644 @overflow/member/store/entity/member/index.ts create mode 100644 @overflow/member/store/entity/member/member.action.ts create mode 100644 @overflow/member/store/entity/member/member.effect.spec.ts create mode 100644 @overflow/member/store/entity/member/member.effect.ts create mode 100644 @overflow/member/store/entity/member/member.reducer.ts create mode 100644 @overflow/member/store/entity/member/member.state.ts rename @overflow/noauth-probe/component/{list/list.component.html => noauth-probe-list.component.html} (100%) create mode 100644 @overflow/noauth-probe/component/noauth-probe-list.component.spec.ts rename @overflow/noauth-probe/component/{list/list.component.ts => noauth-probe-list.component.ts} (93%) delete mode 100644 @overflow/noauth-probe/container/list/list-container.component.html create mode 100644 @overflow/noauth-probe/container/noauth-probe-list-container.component.html create mode 100644 @overflow/noauth-probe/container/noauth-probe-list-container.component.spec.ts rename @overflow/noauth-probe/container/{list/list-container.component.ts => noauth-probe-list-container.component.ts} (86%) create mode 100644 @overflow/shared/auth/auth.constant.ts create mode 100644 @overflow/shared/auth/auth.module.ts create mode 100644 @overflow/shared/auth/store/auth/auth.action.ts create mode 100644 @overflow/shared/auth/store/auth/auth.effect.spec.ts create mode 100644 @overflow/shared/auth/store/auth/auth.effect.ts create mode 100644 @overflow/shared/auth/store/auth/auth.reducer.ts create mode 100644 @overflow/shared/auth/store/auth/auth.state.ts create mode 100644 @overflow/shared/auth/store/auth/index.ts create mode 100644 @overflow/shared/shared.constant.ts create mode 100644 @overflow/shared/shared.module.ts diff --git a/@overflow/member/component/index.ts b/@overflow/member/component/index.ts index 3258093..14db1ae 100644 --- a/@overflow/member/component/index.ts +++ b/@overflow/member/component/index.ts @@ -1,19 +1,21 @@ -import { ProfileComponent } from './profile/profile.component'; -import { SigninComponent } from './signin/signin.component'; -import { SignupComponent } from './signup/signup.component'; -import { ResetPasswordComponent } from './reset-password/reset-password.component'; +import { MemberSigninComponent } from './member-signin.component'; +import { MemberSignupComponent } from './member-signup.component'; +import { MemberTermsComponent } from './member-terms.component'; +import { MemberResetPasswordComponent } from './member-reset-password.component'; +import { MemberModifyPasswordComponent } from './member-modify-password.component'; +import { MemberProfileComponent } from './member-profile.component'; +import { MemberPolicyComponent } from './member-policy.component'; + import { SETTINGS_COMPONENTS } from './settings'; -import { PolicyComponent } from './policy/policy.component'; -import { TermsComponent } from './terms/terms.component'; -import { ModifyPasswordComponent } from './reset-password/modify-password.component'; export const COMPONENTS = [ - ProfileComponent, - SigninComponent, - SignupComponent, - ResetPasswordComponent, - ModifyPasswordComponent, - PolicyComponent, - TermsComponent, + MemberSigninComponent, + MemberSignupComponent, + MemberTermsComponent, + MemberResetPasswordComponent, + MemberProfileComponent, + MemberModifyPasswordComponent, + MemberPolicyComponent, + SETTINGS_COMPONENTS, ]; diff --git a/@overflow/member/component/member-modify-password.component.html b/@overflow/member/component/member-modify-password.component.html new file mode 100644 index 0000000..3eee678 --- /dev/null +++ b/@overflow/member/component/member-modify-password.component.html @@ -0,0 +1,72 @@ +
+
+
+ + + + + +
+
+ +
\ No newline at end of file diff --git a/@overflow/member/component/member-modify-password.component.spec.ts b/@overflow/member/component/member-modify-password.component.spec.ts new file mode 100644 index 0000000..8739879 --- /dev/null +++ b/@overflow/member/component/member-modify-password.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MemberModifyPasswordComponent } from './member-modify-password.component'; + +describe('MemberModifyPasswordComponent', () => { + let component: MemberModifyPasswordComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MemberModifyPasswordComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MemberModifyPasswordComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/@overflow/member/component/member-modify-password.component.ts b/@overflow/member/component/member-modify-password.component.ts new file mode 100644 index 0000000..0b65ad6 --- /dev/null +++ b/@overflow/member/component/member-modify-password.component.ts @@ -0,0 +1,51 @@ +import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; + +@Component({ + selector: 'of-member-modify-password', + templateUrl: './member-modify-password.component.html', +}) +export class MemberModifyPasswordComponent implements OnInit { + @Input() token: string; + @Output() resetPassword = new EventEmitter<{token: string, password: string, confirmPassword: string}>(); + @Output() signin = new EventEmitter(); + + modifyPasswordForm: FormGroup; + formErrors = { + 'pw': '', + 'confirmPw': '' + }; + + constructor( + private formBuilder: FormBuilder, + ) { } + + ngOnInit() { + this.initForm(); + } + + initForm() { + this.modifyPasswordForm = this.formBuilder.group({ + 'pw': [ + '', + [ + // Validators.required, + ] + ], + 'confirmPw': [ + '', + [ + // Validators.pattern('^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+)$'), + // Validators.minLength(6), + // Validators.maxLength(25) + ] + ], + }); + + } + + modifyPasswordFormSubmit() { + const formValue = Object.assign({}, this.modifyPasswordForm.value); + this.resetPassword.emit({token: this.token, password: formValue.pw, confirmPassword: formValue.confirmPw}); + } +} diff --git a/@overflow/member/component/policy/policy.component.html b/@overflow/member/component/member-policy.component.html similarity index 100% rename from @overflow/member/component/policy/policy.component.html rename to @overflow/member/component/member-policy.component.html diff --git a/@overflow/member/component/signin/signin.component.spec.ts b/@overflow/member/component/member-policy.component.spec.ts similarity index 53% rename from @overflow/member/component/signin/signin.component.spec.ts rename to @overflow/member/component/member-policy.component.spec.ts index c64b0b2..573b8e6 100644 --- a/@overflow/member/component/signin/signin.component.spec.ts +++ b/@overflow/member/component/member-policy.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { SigninComponent } from './signin.component'; +import { MemberPolicyComponent } from './member-policy.component'; -describe('SigninComponent', () => { - let component: SigninComponent; - let fixture: ComponentFixture; +describe('MemberPolicyComponent', () => { + let component: MemberPolicyComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SigninComponent ] + declarations: [ MemberPolicyComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(SigninComponent); + fixture = TestBed.createComponent(MemberPolicyComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/@overflow/member/component/member-policy.component.ts b/@overflow/member/component/member-policy.component.ts new file mode 100644 index 0000000..b685eac --- /dev/null +++ b/@overflow/member/component/member-policy.component.ts @@ -0,0 +1,27 @@ +import {Component, OnInit, OnDestroy, EventEmitter, Input, Output} from '@angular/core'; + +@Component({ + selector: 'of-member-policy', + templateUrl: './member-policy.component.html', +}) +export class MemberPolicyComponent implements OnInit, OnDestroy { + + @Input() policyDisplay; + @Output() close = new EventEmitter(); + + constructor( + ) { + } + + + ngOnInit() { + + } + + ngOnDestroy() { + } + + onTermsClose() { + this.policyDisplay = false; + } +} diff --git a/@overflow/member/component/member-profile.component.html b/@overflow/member/component/member-profile.component.html new file mode 100644 index 0000000..a530a3b --- /dev/null +++ b/@overflow/member/component/member-profile.component.html @@ -0,0 +1,47 @@ +
+
+
+
+
+ +
+ +
+
+ +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+
+ +
+
+
diff --git a/@overflow/noauth-probe/container/list/list-container.component.spec.ts b/@overflow/member/component/member-profile.component.spec.ts similarity index 53% rename from @overflow/noauth-probe/container/list/list-container.component.spec.ts rename to @overflow/member/component/member-profile.component.spec.ts index 3812a85..b8459e0 100644 --- a/@overflow/noauth-probe/container/list/list-container.component.spec.ts +++ b/@overflow/member/component/member-profile.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { ListContainerComponent } from './list-container.component'; +import { MemberProfileComponent } from './member-profile.component'; -describe('ListContainerComponent', () => { - let component: ListContainerComponent; - let fixture: ComponentFixture; +describe('MemberProfileComponent', () => { + let component: MemberProfileComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ListContainerComponent ] + declarations: [ MemberProfileComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(ListContainerComponent); + fixture = TestBed.createComponent(MemberProfileComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/@overflow/member/component/member-profile.component.ts b/@overflow/member/component/member-profile.component.ts new file mode 100644 index 0000000..7d20b76 --- /dev/null +++ b/@overflow/member/component/member-profile.component.ts @@ -0,0 +1,52 @@ +import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core'; +import { Member } from '@overflow/commons-typescript/model/member'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; + +@Component({ + selector: 'of-member-profile', + templateUrl: './member-profile.component.html', +}) +export class MemberProfileComponent implements OnInit, OnDestroy { + @Input() member: Member; + @Output() modify = new EventEmitter(); + + form: FormGroup; + + constructor( + private formBuilder: FormBuilder, + ) { + } + + + ngOnInit() { + this.initForm(); + } + + ngOnDestroy() { + } + + initForm() { + this.form = this.formBuilder.group({ + 'email': [this.member.email, + [ + Validators.required, + Validators.email + ]], + 'name': [this.member.name, []], + 'companyName': [this.member.companyName, []], + 'phone': [this.member.phone, []], + }); + } + + onSubmit() { + const formValue = Object.assign({}, this.form.value); + const member: Member = { + email: this.member.email, + name: formValue.name, + phone: formValue.phone, + companyName: formValue.companyName, + }; + this.modify.emit(member); + } + +} diff --git a/@overflow/member/component/signin/signin.component.html b/@overflow/member/component/member-reset-password.component.html similarity index 71% rename from @overflow/member/component/signin/signin.component.html rename to @overflow/member/component/member-reset-password.component.html index a0b9ff2..c10ca40 100644 --- a/@overflow/member/component/signin/signin.component.html +++ b/@overflow/member/component/member-reset-password.component.html @@ -1,32 +1,33 @@
-
+