diff --git a/@overflow/member/container/index.ts b/@overflow/member/container/index.ts index 714df85..c2807c6 100644 --- a/@overflow/member/container/index.ts +++ b/@overflow/member/container/index.ts @@ -2,11 +2,18 @@ import { MemberSigninContainerComponent } from './member-signin-container.compon import { MemberSignupContainerComponent } from './member-signup-container.component'; import { MemberTermsContainerComponent } from './member-terms-container.component'; import { MemberTotpContainerComponent } from './member-totp-container.component'; +import { MemberResetPasswordContainerComponent } from './member-reset-password-container.component'; +import { MemberModifyPasswordContainerComponent } from './member-modify-password-container.component'; +import { MemberPolicyContainerComponent } from './member-policy-container.component'; +import { MemberProfileContainerComponent } from './member-profile-container.component'; export const CONTAINERS = [ MemberSigninContainerComponent, MemberSignupContainerComponent, MemberTermsContainerComponent, MemberTotpContainerComponent, - // MemberSignupContainerComponent, + MemberResetPasswordContainerComponent, + MemberModifyPasswordContainerComponent, + MemberPolicyContainerComponent, + MemberProfileContainerComponent, ]; diff --git a/@overflow/member/container/member-modify-password-container.component.ts b/@overflow/member/container/member-modify-password-container.component.ts index 3e40691..0da3d8f 100644 --- a/@overflow/member/container/member-modify-password-container.component.ts +++ b/@overflow/member/container/member-modify-password-container.component.ts @@ -6,8 +6,8 @@ import {select, Store} from '@ngrx/store'; import { ResetPasswordSelector } from '../../store'; @Component({ - selector: 'of-member-modify-password', - templateUrl: './modify-password.component.html', + selector: 'of-member-modify-password-container', + templateUrl: './modify-password-container.component.html', }) export class MemberModifyPasswordContainerComponent implements OnInit { diff --git a/@overflow/member/container/policy/policy.component.html b/@overflow/member/container/member-policy-container.component.html similarity index 100% rename from @overflow/member/container/policy/policy.component.html rename to @overflow/member/container/member-policy-container.component.html diff --git a/@overflow/member/container/policy/policy.component.spec.ts b/@overflow/member/container/member-policy-container.component.spec.ts similarity index 100% rename from @overflow/member/container/policy/policy.component.spec.ts rename to @overflow/member/container/member-policy-container.component.spec.ts diff --git a/@overflow/member/container/policy/policy.component.ts b/@overflow/member/container/member-policy-container.component.ts similarity index 75% rename from @overflow/member/container/policy/policy.component.ts rename to @overflow/member/container/member-policy-container.component.ts index 21859c3..8beccea 100644 --- a/@overflow/member/container/policy/policy.component.ts +++ b/@overflow/member/container/member-policy-container.component.ts @@ -4,10 +4,10 @@ import { ActivatedRoute, Router } from '@angular/router'; @Component({ - selector: 'of-member-policy', - templateUrl: './policy.component.html', + selector: 'of-member-policy-container', + templateUrl: './member-policy-container.component.html', }) -export class PolicyComponent implements OnInit, OnDestroy { +export class MemberPolicyContainerComponent implements OnInit, OnDestroy { @Input() policyDisplay; @Output() close = new EventEmitter(); diff --git a/@overflow/member/container/profile/profile.component.html b/@overflow/member/container/member-profile-container.component.html similarity index 100% rename from @overflow/member/container/profile/profile.component.html rename to @overflow/member/container/member-profile-container.component.html diff --git a/@overflow/member/container/profile/profile.component.spec.ts b/@overflow/member/container/member-profile-container.component.spec.ts similarity index 55% rename from @overflow/member/container/profile/profile.component.spec.ts rename to @overflow/member/container/member-profile-container.component.spec.ts index 692b234..0cab5a9 100644 --- a/@overflow/member/container/profile/profile.component.spec.ts +++ b/@overflow/member/container/member-profile-container.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { ProfileComponent } from './profile.component'; +import { MemberProfileContainerComponent } from './profile.component'; describe('ProfileComponent', () => { - let component: ProfileComponent; - let fixture: ComponentFixture; + let component: MemberProfileContainerComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ProfileComponent ] + declarations: [ MemberProfileContainerComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(ProfileComponent); + fixture = TestBed.createComponent(MemberProfileContainerComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/@overflow/member/container/profile/profile.component.ts b/@overflow/member/container/member-profile-container.component.ts similarity index 92% rename from @overflow/member/container/profile/profile.component.ts rename to @overflow/member/container/member-profile-container.component.ts index 6115c36..a805ca7 100644 --- a/@overflow/member/container/profile/profile.component.ts +++ b/@overflow/member/container/member-profile-container.component.ts @@ -14,10 +14,10 @@ import { RPCClientError } from '@loafer/ng-rpc'; @Component({ - selector: 'of-member-profile', - templateUrl: './profile.component.html', + selector: 'of-member-profile-container', + templateUrl: './member-profile-container.component.html', }) -export class ProfileComponent implements OnInit, OnDestroy { +export class MemberProfileContainerComponent implements OnInit, OnDestroy { member: Member; modifyForm: FormGroup; diff --git a/@overflow/member/container/member-reset-password-container.component.html b/@overflow/member/container/member-reset-password-container.component.html index c078d1f..0c4fdcd 100644 --- a/@overflow/member/container/member-reset-password-container.component.html +++ b/@overflow/member/container/member-reset-password-container.component.html @@ -1,61 +1 @@ -
-
-
- - - - - -
-
- -
\ No newline at end of file + diff --git a/@overflow/member/container/member-reset-password-container.component.ts b/@overflow/member/container/member-reset-password-container.component.ts index 9655f00..68ded9c 100644 --- a/@overflow/member/container/member-reset-password-container.component.ts +++ b/@overflow/member/container/member-reset-password-container.component.ts @@ -8,8 +8,8 @@ import {RPCClientError} from '@loafer/ng-rpc'; import {Member} from '@overflow/commons-typescript/model/member/index'; @Component({ - selector: 'of-member-reset-password', - templateUrl: './reset-password.component.html', + selector: 'of-member-reset-password-container', + templateUrl: './reset-password-container.component.html', }) export class MemberResetPasswordContainerComponent implements OnInit { diff --git a/@overflow/member/container/reset-password/modify-password.component.html b/@overflow/member/container/reset-password/modify-password.component.html deleted file mode 100644 index 54af963..0000000 --- a/@overflow/member/container/reset-password/modify-password.component.html +++ /dev/null @@ -1,72 +0,0 @@ -
-
-
- - - - - -
-
- -
\ No newline at end of file diff --git a/@overflow/member/container/reset-password/modify-password.component.spec.ts b/@overflow/member/container/reset-password/modify-password.component.spec.ts deleted file mode 100644 index 2a7b14d..0000000 --- a/@overflow/member/container/reset-password/modify-password.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ModifyPasswordComponent } from './modify-password-page.component'; - -describe('ModifyPasswordPageComponent', () => { - let component: ModifyPasswordComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ModifyPasswordComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ModifyPasswordComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/reset-password/modify-password.component.ts b/@overflow/member/container/reset-password/modify-password.component.ts deleted file mode 100644 index bfb40b0..0000000 --- a/@overflow/member/container/reset-password/modify-password.component.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import * as ModifyPasswordStore from '../../store/reset-password'; -import {select, Store} from '@ngrx/store'; -import { ResetPasswordSelector } from '../../store'; - -@Component({ - selector: 'of-member-modify-password', - templateUrl: './modify-password.component.html', -}) -export class ModifyPasswordComponent implements OnInit { - - modifyPwForm: FormGroup; - tokenURL: string; - formErrors = { - 'pw': '', - 'confirmPw': '' - }; - - constructor( - private router: Router, - private activatedRoute: ActivatedRoute, - private formBuilder: FormBuilder, - private modifyPasswordStore: Store, - ) { } - - ngOnInit() { - this.tokenURL = this.activatedRoute.snapshot.queryParams['token']; - console.log(this.tokenURL); - this.initForm(); - } - - initForm() { - this.modifyPwForm = this.formBuilder.group({ - 'pw': [ - '', - [ - // Validators.required, - ] - ], - 'confirmPw': [ - '', - [ - // Validators.pattern('^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]+)$'), - // Validators.minLength(6), - // Validators.maxLength(25) - ] - ], - }); - - } - - modifyPw() { - const modifyPwValue = Object.assign({}, this.modifyPwForm.value); - const m = {token: this.tokenURL, pw: modifyPwValue.pw, confirmPw: modifyPwValue.confirmPw}; - this.modifyPasswordStore.dispatch(new ModifyPasswordStore.ModifyPassword(m)); - } - - signinBtn() { - this.router.navigateByUrl('/auth/signin'); - } -} diff --git a/@overflow/member/container/reset-password/reset-password.component.html b/@overflow/member/container/reset-password/reset-password.component.html deleted file mode 100644 index c078d1f..0000000 --- a/@overflow/member/container/reset-password/reset-password.component.html +++ /dev/null @@ -1,61 +0,0 @@ -
-
-
- - - - - -
-
- -
\ No newline at end of file diff --git a/@overflow/member/container/reset-password/reset-password.component.spec.ts b/@overflow/member/container/reset-password/reset-password.component.spec.ts deleted file mode 100644 index 3f03471..0000000 --- a/@overflow/member/container/reset-password/reset-password.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ResetPasswordComponent } from './reset-password.component'; - -describe('ResetPasswordComponent', () => { - let component: ResetPasswordComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ResetPasswordComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ResetPasswordComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/reset-password/reset-password.component.ts b/@overflow/member/container/reset-password/reset-password.component.ts deleted file mode 100644 index e75edd9..0000000 --- a/@overflow/member/container/reset-password/reset-password.component.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { FormGroup, FormBuilder, Validators } from '@angular/forms'; -import * as ResetPasswordStore from '../../store/reset-password'; -import {select, Store} from '@ngrx/store'; -import { ResetPasswordSelector } from '../../store'; -import {RPCClientError} from '@loafer/ng-rpc'; -import {Member} from '@overflow/commons-typescript/model/member/index'; - -@Component({ - selector: 'of-member-reset-password', - templateUrl: './reset-password.component.html', -}) -export class ResetPasswordComponent implements OnInit { - - resetPassword$ = this.resetPasswordStore.pipe(select(ResetPasswordSelector.select('member'))); - - resetPassword: FormGroup; - formErrors = { - 'email': '' - }; - - constructor( - private resetPasswordStore: Store, - private router: Router, - private formBuilder: FormBuilder) { } - - ngOnInit() { - this.resetPassword = this.formBuilder.group({ - 'email': ['', [ - Validators.required, - Validators.email - ] - ] - }); - } - - sendResetPassword() { - const emailValue = Object.assign({}, this.resetPassword.value); - console.log(emailValue.email); - this.resetPasswordStore.dispatch(new ResetPasswordStore.ResetPassword(emailValue.email)); - - const resetPasswordSubscription$ = this.resetPassword$.subscribe( - (m: Member) => { - if (m) { - console.log(m); - } - - if (resetPasswordSubscription$) { - resetPasswordSubscription$.unsubscribe(); - } - }, - (error: RPCClientError) => { - console.log(error.response.message); - } - ); - } -} diff --git a/src/app/pages/account/profile/profile-page.component.html b/src/app/pages/account/profile/profile-page.component.html index a2a358e..0b6e2c0 100644 --- a/src/app/pages/account/profile/profile-page.component.html +++ b/src/app/pages/account/profile/profile-page.component.html @@ -3,7 +3,7 @@

Profile

- +
diff --git a/src/app/pages/auth/reset-password/modify-password-page.component.html b/src/app/pages/auth/reset-password/modify-password-page.component.html index 8838c53..9b60172 100644 --- a/src/app/pages/auth/reset-password/modify-password-page.component.html +++ b/src/app/pages/auth/reset-password/modify-password-page.component.html @@ -1 +1,9 @@ - +
+
+ +
+ +
+ diff --git a/src/app/pages/auth/reset-password/reset-password-page.component.html b/src/app/pages/auth/reset-password/reset-password-page.component.html index 37d0931..9b3624c 100644 --- a/src/app/pages/auth/reset-password/reset-password-page.component.html +++ b/src/app/pages/auth/reset-password/reset-password-page.component.html @@ -1 +1,8 @@ - \ No newline at end of file +
+
+ +
+ +