From 46699940beb84e4e266aafca8e76c5d030eb4d3f Mon Sep 17 00:00:00 2001 From: geek Date: Fri, 1 Jun 2018 17:21:15 +0900 Subject: [PATCH] ing --- .../component/member-profile.component.html | 13 +- .../component/member-profile.component.ts | 90 ++++++++++-- @overflow/member/container/index.ts | 16 --- ...rm-reset-password-container.component.html | 1 - ...firm-reset-password-container.component.ts | 20 --- ...er-confirm-signup-container.component.html | 1 - ...mber-confirm-signup-container.component.ts | 20 --- ...r-modify-password-container.component.html | 7 - ...odify-password-container.component.spec.ts | 25 ---- ...ber-modify-password-container.component.ts | 38 ----- .../member-policy-container.component.html | 134 ------------------ .../member-policy-container.component.spec.ts | 25 ---- .../member-policy-container.component.ts | 36 ----- .../member-profile-container.component.html | 5 - ...member-profile-container.component.spec.ts | 25 ---- .../member-profile-container.component.ts | 38 ----- ...er-reset-password-container.component.html | 7 - ...reset-password-container.component.spec.ts | 25 ---- ...mber-reset-password-container.component.ts | 46 ------ .../member-signup-container.component.html | 1 - .../member-signup-container.component.spec.ts | 25 ---- .../member-signup-container.component.ts | 36 ----- .../member-terms-container.component.html | 1 - .../member-terms-container.component.spec.ts | 25 ---- .../member-terms-container.component.ts | 33 ----- .../email-auth/email-auth.reducer.ts | 65 --------- .../container/email-auth/email-auth.state.ts | 23 --- .../store/container/email-auth/index.ts | 3 - .../store/container/modify-password/index.ts | 3 - .../member-modify-password.reducer.ts | 42 ------ .../member-modify-password.state.ts | 26 ---- .../store/container/reset-password/index.ts | 2 - .../member-reset-password.reducer.ts | 42 ------ .../member-reset-password.state.ts | 26 ---- .../member/store/container/signup/index.ts | 3 - .../container/signup/member-signup.reducer.ts | 41 ------ .../container/signup/member-signup.state.ts | 24 ---- .../store/entity/member/member.action.ts | 125 ---------------- .../store/entity/member/member.effect.ts | 95 ------------- @overflow/member/store/index.ts | 26 ---- .../profile/profile-page.component.html | 2 +- src/app/pages/pages-routing.module.ts | 2 +- 42 files changed, 86 insertions(+), 1157 deletions(-) delete mode 100644 @overflow/member/container/member-confirm-reset-password-container.component.html delete mode 100644 @overflow/member/container/member-confirm-reset-password-container.component.ts delete mode 100644 @overflow/member/container/member-confirm-signup-container.component.html delete mode 100644 @overflow/member/container/member-confirm-signup-container.component.ts delete mode 100644 @overflow/member/container/member-modify-password-container.component.html delete mode 100644 @overflow/member/container/member-modify-password-container.component.spec.ts delete mode 100644 @overflow/member/container/member-modify-password-container.component.ts delete mode 100644 @overflow/member/container/member-policy-container.component.html delete mode 100644 @overflow/member/container/member-policy-container.component.spec.ts delete mode 100644 @overflow/member/container/member-policy-container.component.ts delete mode 100644 @overflow/member/container/member-profile-container.component.html delete mode 100644 @overflow/member/container/member-profile-container.component.spec.ts delete mode 100644 @overflow/member/container/member-profile-container.component.ts delete mode 100644 @overflow/member/container/member-reset-password-container.component.html delete mode 100644 @overflow/member/container/member-reset-password-container.component.spec.ts delete mode 100644 @overflow/member/container/member-reset-password-container.component.ts delete mode 100644 @overflow/member/container/member-signup-container.component.html delete mode 100644 @overflow/member/container/member-signup-container.component.spec.ts delete mode 100644 @overflow/member/container/member-signup-container.component.ts delete mode 100644 @overflow/member/container/member-terms-container.component.html delete mode 100644 @overflow/member/container/member-terms-container.component.spec.ts delete mode 100644 @overflow/member/container/member-terms-container.component.ts delete mode 100644 @overflow/member/store/container/email-auth/email-auth.reducer.ts delete mode 100644 @overflow/member/store/container/email-auth/email-auth.state.ts delete mode 100644 @overflow/member/store/container/email-auth/index.ts delete mode 100644 @overflow/member/store/container/modify-password/index.ts delete mode 100644 @overflow/member/store/container/modify-password/member-modify-password.reducer.ts delete mode 100644 @overflow/member/store/container/modify-password/member-modify-password.state.ts delete mode 100644 @overflow/member/store/container/reset-password/index.ts delete mode 100644 @overflow/member/store/container/reset-password/member-reset-password.reducer.ts delete mode 100644 @overflow/member/store/container/reset-password/member-reset-password.state.ts delete mode 100644 @overflow/member/store/container/signup/index.ts delete mode 100644 @overflow/member/store/container/signup/member-signup.reducer.ts delete mode 100644 @overflow/member/store/container/signup/member-signup.state.ts diff --git a/@overflow/member/component/member-profile.component.html b/@overflow/member/component/member-profile.component.html index 68a6293..8ee26ba 100644 --- a/@overflow/member/component/member-profile.component.html +++ b/@overflow/member/component/member-profile.component.html @@ -5,7 +5,8 @@
- + + @@ -13,32 +14,32 @@
- +
- +
- +
- +
- diff --git a/@overflow/member/component/member-profile.component.ts b/@overflow/member/component/member-profile.component.ts index 59f105a..356666d 100644 --- a/@overflow/member/component/member-profile.component.ts +++ b/@overflow/member/component/member-profile.component.ts @@ -1,25 +1,43 @@ 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'; +import { AbstractControl, FormBuilder, FormGroup, Validators} from '@angular/forms'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; +import { Observable, of } from 'rxjs'; +import { Store } from '@ngrx/store'; +import { AuthContainerSelector } from '@overflow/shared/auth/store'; +import { catchError, map, tap } from 'rxjs/operators'; +import { MemberService } from '../service/member.service'; +import * as MemberEntityStore from '../store/entity/member'; @Component({ selector: 'of-member-profile', templateUrl: './member-profile.component.html', }) export class MemberProfileComponent implements OnInit, OnDestroy { - @Input() domainMember: DomainMember; - @Output() modify = new EventEmitter(); + domainMember: DomainMember; + profileForm: FormGroup; - form: FormGroup; + pending$: Observable; + error$: Observable; + + email: AbstractControl; + name: AbstractControl; + phone: AbstractControl; + company: AbstractControl; constructor( + private store: Store, private formBuilder: FormBuilder, + private memberService: MemberService, ) { } - ngOnInit() { + this.store.select(AuthContainerSelector.selectDomainMember).subscribe( + (domainMember: DomainMember) => { + this.domainMember = domainMember; + } + ); this.initForm(); } @@ -27,27 +45,73 @@ export class MemberProfileComponent implements OnInit, OnDestroy { } initForm() { - this.form = this.formBuilder.group({ - 'email': ['', + this.profileForm = this.formBuilder.group({ + 'email': [ + this.domainMember.member.email, [ Validators.required, Validators.email ]], - 'name': ['', []], - 'companyName': ['', []], - 'phone': ['', []], + 'name': [ + this.domainMember.member.name, [Validators.required] + ], + 'companyName': [ + this.domainMember.member.companyName, [Validators.required] + ], + 'phone': [ + this.domainMember.member.phone, [Validators.required] + ], }); + + this.email = this.profileForm.controls['email']; + this.name = this.profileForm.controls['name']; + this.phone = this.profileForm.controls['phone']; + this.company = this.profileForm.controls['company']; } profileFormSubmit() { - const formValue = Object.assign({}, this.form.value); + const formValue = Object.assign({}, this.profileForm.value); + + if (!this.checkProfile(formValue)) { + return; + } + const member: Member = { - email: this.domainMember.member.email, + email: formValue.email, name: formValue.name, phone: formValue.phone, companyName: formValue.companyName, }; - this.modify.emit(member); + + this.memberService.modify(member) + .pipe( + tap(() => { + this.pending$ = of(true); + }), + map((rmember: Member) => { + this.store.dispatch(new MemberEntityStore.ModifySuccess(rmember)); + }), + catchError(err => { + this.error$ = of(err); + return of(); + }), + tap(() => { + this.pending$ = of(false); + }), + ).take(1).subscribe(); } + private checkProfile(formValue: any): boolean { + let isChange = false; + if ( + formValue.email !== this.domainMember.member.email && + formValue.name !== this.domainMember.member.name && + formValue.phone !== this.domainMember.member.phone && + formValue.companyName !== this.domainMember.member.companyName + ) { + isChange = true; + } + + return isChange; + } } diff --git a/@overflow/member/container/index.ts b/@overflow/member/container/index.ts index eeb4372..c95153a 100644 --- a/@overflow/member/container/index.ts +++ b/@overflow/member/container/index.ts @@ -1,23 +1,7 @@ import { MemberSigninContainerComponent } from './member-signin-container.component'; -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'; -import {MemberConfirmSignupContainerComponent} from './member-confirm-signup-container.component'; -import {MemberConfirmResetPasswordContainerComponent} from './member-confirm-reset-password-container.component'; export const CONTAINERS = [ MemberSigninContainerComponent, - MemberSignupContainerComponent, - MemberTermsContainerComponent, MemberTotpContainerComponent, - MemberResetPasswordContainerComponent, - MemberModifyPasswordContainerComponent, - MemberPolicyContainerComponent, - MemberProfileContainerComponent, - MemberConfirmSignupContainerComponent, - MemberConfirmResetPasswordContainerComponent, ]; diff --git a/@overflow/member/container/member-confirm-reset-password-container.component.html b/@overflow/member/container/member-confirm-reset-password-container.component.html deleted file mode 100644 index 46c31fe..0000000 --- a/@overflow/member/container/member-confirm-reset-password-container.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/@overflow/member/container/member-confirm-reset-password-container.component.ts b/@overflow/member/container/member-confirm-reset-password-container.component.ts deleted file mode 100644 index 709c02f..0000000 --- a/@overflow/member/container/member-confirm-reset-password-container.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {Store} from '@ngrx/store'; - -@Component({ - selector: 'of-member-confirm-reset-password-container', - templateUrl: './member-confirm-reset-password-container.component.html', -}) -export class MemberConfirmResetPasswordContainerComponent implements OnInit { - @Input() token: string; - @Output() signin = new EventEmitter(); - @Output() modifyPassword = new EventEmitter(); - - constructor( - private store: Store, - ) { - - } - ngOnInit(): void { - } -} diff --git a/@overflow/member/container/member-confirm-signup-container.component.html b/@overflow/member/container/member-confirm-signup-container.component.html deleted file mode 100644 index 88b5c58..0000000 --- a/@overflow/member/container/member-confirm-signup-container.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/@overflow/member/container/member-confirm-signup-container.component.ts b/@overflow/member/container/member-confirm-signup-container.component.ts deleted file mode 100644 index 9a82fc4..0000000 --- a/@overflow/member/container/member-confirm-signup-container.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; -import {Store} from '@ngrx/store'; - -@Component({ - selector: 'of-member-confirm-signup-container', - templateUrl: './member-confirm-signup-container.component.html', -}) -export class MemberConfirmSignupContainerComponent implements OnInit { - @Input() token: string; - @Output() signin = new EventEmitter(); - - constructor( - private store: Store, - ) { - - - } - ngOnInit(): void { - } -} diff --git a/@overflow/member/container/member-modify-password-container.component.html b/@overflow/member/container/member-modify-password-container.component.html deleted file mode 100644 index f657a77..0000000 --- a/@overflow/member/container/member-modify-password-container.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/@overflow/member/container/member-modify-password-container.component.spec.ts b/@overflow/member/container/member-modify-password-container.component.spec.ts deleted file mode 100644 index 2a7b14d..0000000 --- a/@overflow/member/container/member-modify-password-container.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/member-modify-password-container.component.ts b/@overflow/member/container/member-modify-password-container.component.ts deleted file mode 100644 index 4fd9367..0000000 --- a/@overflow/member/container/member-modify-password-container.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; -import {select, Store} from '@ngrx/store'; - -import * as MemberEntityStore from '../store/entity/member'; -import { MemberModifyPasswordContainerSelector } from '../store'; -import { Observable } from 'rxjs'; -import { Member } from '@overflow/commons-typescript/model/member'; - -@Component({ - selector: 'of-member-modify-password-container', - templateUrl: './member-modify-password-container.component.html', -}) -export class MemberModifyPasswordContainerComponent implements OnInit { - @Input() token: string; - @Output() signin = new EventEmitter(); - - member$: Observable; - pending$: Observable; - error$: Observable; - - constructor( - private store: Store, - ) { } - - ngOnInit() { - this.member$ = this.store.pipe(select(MemberModifyPasswordContainerSelector.selectMember)); - this.pending$ = this.store.pipe(select(MemberModifyPasswordContainerSelector.selectPending)); - this.error$ = this.store.pipe(select(MemberModifyPasswordContainerSelector.selectError)); - } - - modifyPassword(info: {token: string, password: string, confirmPassword: string}) { - this.store.dispatch(new MemberEntityStore.ModifyPassword(info)); - } - - onSignin() { - this.signin.emit(); - } -} diff --git a/@overflow/member/container/member-policy-container.component.html b/@overflow/member/container/member-policy-container.component.html deleted file mode 100644 index cd88513..0000000 --- a/@overflow/member/container/member-policy-container.component.html +++ /dev/null @@ -1,134 +0,0 @@ -
- -
- -
- 개인정보 취급방침 -
-“㈜와탭랩스”는(이하 “회사”는) 고객님의 개인정보를 중요시하며, “정보통신망 이용촉진 및 정보보호”에 관한 법률을 준수하고 있습니다.
-
-회사는 개인정보 취급방침을 통하여 고객님께서 제공하시는 개인정보가 어떠한 용도와 방식으로 이용되고 있으며, 개인정보 보호를 위해 어떠한 조치가 취해지고 있는지 알려드립니다.
-
-회사는 개인정보취급방침을 개정하는 경우 웹사이트 공지사항(또는 개별공지)을 통하여 공지할 것입니다.
-
-본 방침은 : 2015년 4월 1일부터 시행됩니다.
-
-
-
-*수집하는 개인정보 항목
-회사는 회원가입, 상담, 서비스 신청 등등을 위해 아래와 같은 개인정보를 수집하고 있습니다.
-
--       수집항목 : 이름, 이메일 ID, 암호화 된 비밀번호, 휴대전화번호, 회사명, 서비스 이용기록, 결제기록
-
--       개인정보 수집방법 : 홈페이지(회원가입, 서비스 신청), 세미나 등 행사 응모
-
-
-
-*개인정보의 수집 및 이용목적
-회사는 수집한 개인정보를 다음의 목적을 위해 활용합니다.
-
-
-
--      서비스 제공에 관한 계약 이행 및 서비스 제공에 따른 요금정산 콘텐츠 제공, 구매 및 요금 결제
-
--      회원 관리
-회원제 서비스 이용에 따른 본인 확인, 개인 식별, 불량회원의 부정 이용 방지와 비인가 사용 방지, 불만처리 등 민원처리, 고지사항 전달
-
--      마케팅 및 광고에 활용
-이벤트 등 광고성 정보 전달, 접속 빈도 파악 또는 회원의 서비스 이용에 대한 통계
-
-
-
-
-
-*개인정보의 보유 및 이용기간
-원칙적으로, 개인정보 수집 및 이용목적이 달성된 후에는 해당 정보를 지체 없이 파기합니다.
-단, 관계법령의 규정에 의하여 보존할 필요가 있는 경우 회사는 아래와 같이 관계법령에서 정한 일정한 기간 동안 회원정보를 보관합니다.
-
-
-
--      보존 항목 : 서비스 이용기록
-
--      보존 근거 : 전자상거래 등에서의 소비자보호에 관한 법률
-
--      보존 기간 : 3년
-
--      계약 또는 청약철회 등에 관한 기록 : 5년 (전자상거래 등에서의 소비자보호에 관한 법률)
-
--      대금결제 및 재화 등의 공급에 관한 기록 : 5년 (전자상거래 등에서의 소비자보호에 관한 법률)
-
-
-
-
-
-*개인정보 자동수집 장치의 설치, 운영 및 그 거부에 관한 사항
-회사는 귀하의 정보를 수시로 저장하고 찾아내는 “쿠키(cookie)”를 자동 로그인 등의 목적으로 사용합니다.
-
-
-
-
-
-*개인정보의 취급위탁
-회사는 다음과 같이 개인정보 취급업무를 외부 전문업체에 위탁하여 운영하고 있습니다. 아래 각 수탁업자는 계약기간 동안 필요한 범위 내에서 회원의 개인정보를 보유하는 것을 원칙으로 하며, 수탁업자에 대하여 관계법령에서 법정 보유기간을 명시하고 있는 경우는 해당 업체업체는 해당 기간 동안 보유합니다.
-
-
-
--      수탁업체명 : 주식회사 케이지이니시스
-
--      위탁업무 : 신용카드, 계좌이체 결제 대행
-
--      위탁기간 : 위탁계약 종료시까지
-
-
-
-위탁업무계약서 내지 별도의 정보보호서약(특약) 등을 통하여 개인정보보호 관련 법규의 준수, 개인정보에 관한 비밀유지, 제3자 제공에 대한 금지, 사고시의 책임부담, 위탁기간, 처리 종료 후의 개인정보의 반환 또는 파기 의무 등을 규정하고, 이를 준수하도록 관리하고 있습니다.
-
-
-
-
-
-*개인정보의 파기절차 및 방법
-회사는 원칙적으로 개인정보 수집 및 이용목적이 달성된 후에는 해당 정보를 지체 없이 파기합니다. 파기절차 및 방법은 다음과 같습니다.
-
-
-
--      파기절차
-회원님이 회원가입 등을 위해 입력하신 정보는 목적이 달성된 후 별도의 DB로 옮겨져(종이의 경우 별도의 서류함) 내부 방침 및 기타 관련 법령에 의한 정보보호 사유에 따라(보유 및 이용기간 참조) 일정 기간 저장된 후 파기됩니다. 별도 DB로 옮겨진 개인정보는 법률에 의한 경우가 아니고서는 보유 이외의 다른 목적으로 이용되지 않습니다.
-
-
-
--      파기방법
-전자적 파일형태로 저장된 개인정보는 기록을 재생할 수 없는 기술적 방법을 사용하여 삭제합니다.
-
-
-
-
-
-*개인정보에 관한 민원서비스
-회사는 고객의 개인정보를 보호하고 원활한 운영을 위하여 아래와 책임자를 지정하고 있습니다.
-
-개인정보관리 책임자 : loafle
-전화번호 : 031-460-5677
-이메일 : overflow@loafle.com
-
-
-
-
-
-귀하께서는 회사의 서비스를 이용하시며 발생하는 모든 개인정보보호 관련 민원을 개인정보관리 책임자에게 신고하실 수 있습니다.
-회사는 이용자들의 신고사항에 대해 신속하게 충분한 답변을 드릴 것입니다.
-
-
-
-기타 개인정보침해에 대한 신고나 상담이 필요하신 경우에는 아래 기관에 문의하시기 바랍니다.
-
1. KISA 개인정보보호 http://www.1336.or.kr
- -
2. 정보보호마크인증제도 http://www.eprivacy.or.kr
- -
3. 경찰청 사이버테러대응센터 http://www.ctrc.go.kr
-
- -
-
-
-
diff --git a/@overflow/member/container/member-policy-container.component.spec.ts b/@overflow/member/container/member-policy-container.component.spec.ts deleted file mode 100644 index 8dbbd37..0000000 --- a/@overflow/member/container/member-policy-container.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PolicyComponent } from './profile.component'; - -describe('ProfileComponent', () => { - let component: PolicyComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PolicyComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PolicyComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/member-policy-container.component.ts b/@overflow/member/container/member-policy-container.component.ts deleted file mode 100644 index 8beccea..0000000 --- a/@overflow/member/container/member-policy-container.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Component, OnInit, OnDestroy, EventEmitter, Input, Output} from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -// import { PagesComponent } from 'app/pages/pages.component'; - - -@Component({ - selector: 'of-member-policy-container', - templateUrl: './member-policy-container.component.html', -}) -export class MemberPolicyContainerComponent implements OnInit, OnDestroy { - - @Input() policyDisplay; - @Output() close = new EventEmitter(); - - constructor( - private activatedRoute: ActivatedRoute, - private router: Router, - ) { - } - - - ngOnInit() { - - } - - ngOnDestroy() { - } - - onTermsClose() { - this.policyDisplay = false; - } - - onCancel() { - this.close.emit(); - } -} diff --git a/@overflow/member/container/member-profile-container.component.html b/@overflow/member/container/member-profile-container.component.html deleted file mode 100644 index f53704b..0000000 --- a/@overflow/member/container/member-profile-container.component.html +++ /dev/null @@ -1,5 +0,0 @@ - - - \ No newline at end of file diff --git a/@overflow/member/container/member-profile-container.component.spec.ts b/@overflow/member/container/member-profile-container.component.spec.ts deleted file mode 100644 index 0cab5a9..0000000 --- a/@overflow/member/container/member-profile-container.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MemberProfileContainerComponent } from './profile.component'; - -describe('ProfileComponent', () => { - let component: MemberProfileContainerComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ MemberProfileContainerComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MemberProfileContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/member-profile-container.component.ts b/@overflow/member/container/member-profile-container.component.ts deleted file mode 100644 index 099c5d7..0000000 --- a/@overflow/member/container/member-profile-container.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Store, select } from '@ngrx/store'; -import { Observable } from 'rxjs'; - -import { RPCClientError } from '@loafer/ng-rpc'; -import { Member } from '@overflow/commons-typescript/model/member'; - -import { AuthContainerSelector } from '@overflow/shared/auth/store'; -import { DomainMember } from '@overflow/commons-typescript/model/domain'; - -import * as MemberEntityStore from '../store/entity/member'; - -@Component({ - selector: 'of-member-profile-container', - templateUrl: './member-profile-container.component.html', -}) -export class MemberProfileContainerComponent implements OnInit, OnDestroy { - domainMember$: Observable; - - constructor( - private store: Store, - ) { - } - - - ngOnInit() { - this.domainMember$ = this.store.pipe(select(AuthContainerSelector.selectDomainMember)); - } - - ngOnDestroy() { - } - - modify(member: Member) { - this.store.dispatch(new MemberEntityStore.Modify(member)); - } - -} diff --git a/@overflow/member/container/member-reset-password-container.component.html b/@overflow/member/container/member-reset-password-container.component.html deleted file mode 100644 index 15e3e06..0000000 --- a/@overflow/member/container/member-reset-password-container.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/@overflow/member/container/member-reset-password-container.component.spec.ts b/@overflow/member/container/member-reset-password-container.component.spec.ts deleted file mode 100644 index 861a5c7..0000000 --- a/@overflow/member/container/member-reset-password-container.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MemberResetPasswordComponent } from './reset-password.component'; - -describe('ResetPasswordComponent', () => { - let component: MemberResetPasswordComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ MemberResetPasswordComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MemberResetPasswordComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/member-reset-password-container.component.ts b/@overflow/member/container/member-reset-password-container.component.ts deleted file mode 100644 index 3ffc4e2..0000000 --- a/@overflow/member/container/member-reset-password-container.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { - Component, EventEmitter, - OnInit, - Output -} from '@angular/core'; -import {select, Store} from '@ngrx/store'; - -import * as MemberEntityStore from '../store/entity/member'; -import { Observable } from 'rxjs'; -import { Member } from '@overflow/commons-typescript/model/member'; -import { MemberResetPasswordContainerSelector } from '../store'; - -@Component({ - selector: 'of-member-reset-password-container', - templateUrl: './member-reset-password-container.component.html', -}) -export class MemberResetPasswordContainerComponent implements OnInit { - @Output() signin = new EventEmitter(); - @Output() signup = new EventEmitter(); - - member$: Observable; - pending$: Observable; - error$: Observable; - - constructor( - private store: Store, - ) { } - - ngOnInit() { - this.member$ = this.store.pipe(select(MemberResetPasswordContainerSelector.selectMember)); - this.pending$ = this.store.pipe(select(MemberResetPasswordContainerSelector.selectPending)); - this.error$ = this.store.pipe(select(MemberResetPasswordContainerSelector.selectError)); - } - - resetPassword(email: string) { - this.store.dispatch(new MemberEntityStore.ResetPassword(email)); - } - - onSignin() { - this.signin.emit(); - } - - onSignup() { - this.signup.emit(); - } -} diff --git a/@overflow/member/container/member-signup-container.component.html b/@overflow/member/container/member-signup-container.component.html deleted file mode 100644 index 54b8014..0000000 --- a/@overflow/member/container/member-signup-container.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/@overflow/member/container/member-signup-container.component.spec.ts b/@overflow/member/container/member-signup-container.component.spec.ts deleted file mode 100644 index 4c1b62c..0000000 --- a/@overflow/member/container/member-signup-container.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MemberSignupContainerComponent } from './member-signup-container.component'; - -describe('MemberSignupContainerComponent', () => { - let component: MemberSignupContainerComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ MemberSignupContainerComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MemberSignupContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/member-signup-container.component.ts b/@overflow/member/container/member-signup-container.component.ts deleted file mode 100644 index 312e18a..0000000 --- a/@overflow/member/container/member-signup-container.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { - Component, EventEmitter, - OnDestroy, - OnInit, Output, -} from '@angular/core'; -import { Member } from '@overflow/commons-typescript/model/member'; -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', - templateUrl: './member-signup-container.component.html', -}) -export class MemberSignupContainerComponent implements OnInit, OnDestroy { - - member$: Observable; - - constructor( - private store: Store, - ) { } - - ngOnInit() { - this.member$ = this.store.pipe(select(MemberSignupContainerSelector.selectMember)); - } - - ngOnDestroy() { - } - - onSignup(info: {member: Member, password: string}) { - this.store.dispatch(new MemberEntityStore.Signup(info)); - } - -} diff --git a/@overflow/member/container/member-terms-container.component.html b/@overflow/member/container/member-terms-container.component.html deleted file mode 100644 index 0f66502..0000000 --- a/@overflow/member/container/member-terms-container.component.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/@overflow/member/container/member-terms-container.component.spec.ts b/@overflow/member/container/member-terms-container.component.spec.ts deleted file mode 100644 index 2d884b4..0000000 --- a/@overflow/member/container/member-terms-container.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TermsComponent } from './profile.component'; - -describe('ProfileComponent', () => { - let component: TermsComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ TermsComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(TermsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/@overflow/member/container/member-terms-container.component.ts b/@overflow/member/container/member-terms-container.component.ts deleted file mode 100644 index cce5b57..0000000 --- a/@overflow/member/container/member-terms-container.component.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {Component, OnInit, OnDestroy, Input, EventEmitter, Output} from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; - -@Component({ - selector: 'of-member-terms-container', - templateUrl: './member-terms-container.component.html', -}) -export class MemberTermsContainerComponent implements OnInit, OnDestroy { - - @Input() termsDisplay; - @Output() close = new EventEmitter(); - - constructor( - private activatedRoute: ActivatedRoute, - private router: Router, - ) { - } - - - ngOnInit() { - - } - - ngOnDestroy() { - } - - onTermsClose() { - this.termsDisplay = false; - } - onCancel() { - this.close.emit(); - } -} diff --git a/@overflow/member/store/container/email-auth/email-auth.reducer.ts b/@overflow/member/store/container/email-auth/email-auth.reducer.ts deleted file mode 100644 index e47bd13..0000000 --- a/@overflow/member/store/container/email-auth/email-auth.reducer.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { - Actions, - ActionType, -} from '../../entity/member/member.action'; - -import { - State, - initialState, -} from './email-auth.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.ConfirmEmailForSignup: { - return { - emailAuth: null, - pending: true, - error: null, - }; - } - - case ActionType.ConfirmEmailForSignupSuccess: { - return { - emailAuth: action.payload, - pending: false, - error: null, - }; - } - - case ActionType.ConfirmEmailForSignupFailure: { - return { - emailAuth: null, - pending: false, - error: action.payload, - }; - } - - case ActionType.ConfirmEmailForPassword: { - return { - emailAuth: null, - pending: true, - error: null, - }; - } - - case ActionType.ConfirmEmailForPasswordSuccess: { - return { - emailAuth: action.payload, - pending: true, - error: null, - }; - } - - case ActionType.ConfirmEmailForPasswordFailure: { - return { - emailAuth: null, - pending: true, - error: action.payload, - }; - } - - default: { - return state; - } - } -} diff --git a/@overflow/member/store/container/email-auth/email-auth.state.ts b/@overflow/member/store/container/email-auth/email-auth.state.ts deleted file mode 100644 index 89648da..0000000 --- a/@overflow/member/store/container/email-auth/email-auth.state.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Selector, createSelector } from '@ngrx/store'; -import { RESTClientError } from '@loafer/ng-rest'; -import { EmailAuth } from '@overflow/commons-typescript/model/email/EmailAuth'; - -export interface State { - emailAuth: EmailAuth; - pending: boolean; - error: RESTClientError; -} - -export const initialState: State = { - emailAuth: null, - pending: false, - error: null, -}; - -export function getSelectors(selector: Selector) { - return { - selectEmailAuth: createSelector(selector, (state: State) => state.emailAuth), - selectPending: createSelector(selector, (state: State) => state.pending), - selectError: createSelector(selector, (state: State) => state.error), - }; -} diff --git a/@overflow/member/store/container/email-auth/index.ts b/@overflow/member/store/container/email-auth/index.ts deleted file mode 100644 index 9906e9b..0000000 --- a/@overflow/member/store/container/email-auth/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './email-auth.reducer'; -export * from './email-auth.state'; - diff --git a/@overflow/member/store/container/modify-password/index.ts b/@overflow/member/store/container/modify-password/index.ts deleted file mode 100644 index 53b16ea..0000000 --- a/@overflow/member/store/container/modify-password/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './member-modify-password.state'; -export * from './member-modify-password.reducer'; - diff --git a/@overflow/member/store/container/modify-password/member-modify-password.reducer.ts b/@overflow/member/store/container/modify-password/member-modify-password.reducer.ts deleted file mode 100644 index 5614fe2..0000000 --- a/@overflow/member/store/container/modify-password/member-modify-password.reducer.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { - Actions, - ActionType, -} from '../../entity/member/member.action'; - -import { - State, - initialState, -} from './member-modify-password.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.ModifyPassword: { - return { - member: null, - pending: true, - error: null, - }; - } - - case ActionType.ModifyPasswordSuccess: { - return { - member: action.payload, - pending: false, - error: null, - }; - } - - case ActionType.ModifyPasswordFailure: { - return { - member: null, - pending: false, - error: action.payload, - }; - } - - default: { - return state; - } - } -} - diff --git a/@overflow/member/store/container/modify-password/member-modify-password.state.ts b/@overflow/member/store/container/modify-password/member-modify-password.state.ts deleted file mode 100644 index d9a9bb5..0000000 --- a/@overflow/member/store/container/modify-password/member-modify-password.state.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Selector, createSelector } from '@ngrx/store'; - -import { RESTClientError } from '@loafer/ng-rest'; - -import { Member } from '@overflow/commons-typescript/model/member'; - -export interface State { - member: Member; - pending: boolean; - error: RESTClientError; -} - -export const initialState: State = { - member: null, - pending: false, - error: null, -}; - - -export function getSelectors(selector: Selector) { - return { - selectMember: createSelector(selector, (state: State) => state.member), - selectPending: createSelector(selector, (state: State) => state.pending), - selectError: createSelector(selector, (state: State) => state.error), - }; -} diff --git a/@overflow/member/store/container/reset-password/index.ts b/@overflow/member/store/container/reset-password/index.ts deleted file mode 100644 index 6f66364..0000000 --- a/@overflow/member/store/container/reset-password/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './member-reset-password.reducer'; -export * from './member-reset-password.state'; diff --git a/@overflow/member/store/container/reset-password/member-reset-password.reducer.ts b/@overflow/member/store/container/reset-password/member-reset-password.reducer.ts deleted file mode 100644 index 06db0ff..0000000 --- a/@overflow/member/store/container/reset-password/member-reset-password.reducer.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { - Actions, - ActionType, -} from '../../entity/member/member.action'; - -import { - State, - initialState, -} from './member-reset-password.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.ResetPassword: { - return { - member: null, - pending: true, - error: null, - }; - } - - case ActionType.ResetPasswordSuccess: { - return { - member: action.payload, - pending: false, - error: null, - }; - } - - case ActionType.ResetPasswordFailure: { - return { - member: null, - pending: false, - error: action.payload, - }; - } - - default: { - return state; - } - } -} - diff --git a/@overflow/member/store/container/reset-password/member-reset-password.state.ts b/@overflow/member/store/container/reset-password/member-reset-password.state.ts deleted file mode 100644 index d9a9bb5..0000000 --- a/@overflow/member/store/container/reset-password/member-reset-password.state.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Selector, createSelector } from '@ngrx/store'; - -import { RESTClientError } from '@loafer/ng-rest'; - -import { Member } from '@overflow/commons-typescript/model/member'; - -export interface State { - member: Member; - pending: boolean; - error: RESTClientError; -} - -export const initialState: State = { - member: null, - pending: false, - error: null, -}; - - -export function getSelectors(selector: Selector) { - return { - selectMember: createSelector(selector, (state: State) => state.member), - selectPending: createSelector(selector, (state: State) => state.pending), - selectError: createSelector(selector, (state: State) => state.error), - }; -} diff --git a/@overflow/member/store/container/signup/index.ts b/@overflow/member/store/container/signup/index.ts deleted file mode 100644 index da28980..0000000 --- a/@overflow/member/store/container/signup/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './member-signup.reducer'; -export * from './member-signup.state'; - diff --git a/@overflow/member/store/container/signup/member-signup.reducer.ts b/@overflow/member/store/container/signup/member-signup.reducer.ts deleted file mode 100644 index 8eda857..0000000 --- a/@overflow/member/store/container/signup/member-signup.reducer.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { - Actions, - ActionType, -} from '../../entity/member/member.action'; - -import { - State, - initialState, -} from './member-signup.state'; - -export function reducer(state = initialState, action: Actions): State { - switch (action.type) { - case ActionType.Signup: { - return { - member: null, - pending: true, - error: null, - }; - } - - case ActionType.SignupSuccess: { - return { - member: action.payload, - pending: false, - error: null, - }; - } - - case ActionType.SignupFailure: { - return { - member: null, - pending: false, - error: action.payload, - }; - } - - default: { - return state; - } - } -} diff --git a/@overflow/member/store/container/signup/member-signup.state.ts b/@overflow/member/store/container/signup/member-signup.state.ts deleted file mode 100644 index 4af3d3b..0000000 --- a/@overflow/member/store/container/signup/member-signup.state.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Selector, createSelector } from '@ngrx/store'; - -import { RESTClientError } from '@loafer/ng-rest'; -import { Member } from '@overflow/commons-typescript/model/member'; - -export interface State { - member: Member; - pending: boolean; - error: RESTClientError; -} - -export const initialState: State = { - member: null, - pending: false, - error: null, -}; - -export function getSelectors(selector: Selector) { - return { - selectMember: createSelector(selector, (state: State) => state.member), - selectPending: createSelector(selector, (state: State) => state.pending), - selectError: createSelector(selector, (state: State) => state.error), - }; -} diff --git a/@overflow/member/store/entity/member/member.action.ts b/@overflow/member/store/entity/member/member.action.ts index 667a54e..4a263b6 100644 --- a/@overflow/member/store/entity/member/member.action.ts +++ b/@overflow/member/store/entity/member/member.action.ts @@ -7,29 +7,9 @@ export enum ActionType { Signin = '[member.member] Signin', Signout = '[member.member] Signout', - Signup = '[member.member] Signup', - SignupSuccess = '[member.member] SignupSuccess', - SignupFailure = '[member.member] SignupFailure', - Modify = '[member.member] Modify', ModifySuccess = '[member.member] ModifySuccess', ModifyFailure = '[member.member] ModifyFailure', - - ResetPassword = '[member.member] ResetPassword', - ResetPasswordSuccess = '[member.member] ResetPasswordSuccess', - ResetPasswordFailure = '[member.member] ResetPasswordFailure', - - ModifyPassword = '[member.member] ModifyPassword', - ModifyPasswordSuccess = '[member.member] ModifyPasswordSuccess', - ModifyPasswordFailure = '[member.member] ModifyPasswordFailure', - - ConfirmEmailForSignup = '[member.member] ConfirmEmailForSignup', - ConfirmEmailForSignupSuccess = '[member.member] ConfirmEmailForSignupSuccess', - ConfirmEmailForSignupFailure = '[member.member] ConfirmEmailForSignupFailure', - - ConfirmEmailForPassword = '[member.member] ConfirmEmailForPassword', - ConfirmEmailForPasswordSuccess = '[member.member] ConfirmEmailForPasswordSuccess', - ConfirmEmailForPasswordFailure = '[member.member] ConfirmEmailForPasswordFailure', } export class Signin implements Action { @@ -42,24 +22,6 @@ export class Signout implements Action { readonly type = ActionType.Signout; } -export class Signup implements Action { - readonly type = ActionType.Signup; - - constructor(public payload: { member: Member, password: string }) { } -} - -export class SignupSuccess implements Action { - readonly type = ActionType.SignupSuccess; - - constructor(public payload: Member) { } -} - -export class SignupFailure implements Action { - readonly type = ActionType.SignupFailure; - - constructor(public payload: RESTClientError) { } -} - export class Modify implements Action { readonly type = ActionType.Modify; @@ -78,97 +40,10 @@ export class ModifyFailure implements Action { constructor(public payload: RESTClientError) {} } -export class ResetPassword implements Action { - readonly type = ActionType.ResetPassword; - - constructor(public payload: string ) {} -} - -export class ResetPasswordSuccess implements Action { - readonly type = ActionType.ResetPasswordSuccess; - - constructor(public payload: Member) {} -} - -export class ResetPasswordFailure implements Action { - readonly type = ActionType.ResetPasswordFailure; - - constructor(public payload: RESTClientError) {} -} - -export class ModifyPassword implements Action { - readonly type = ActionType.ModifyPassword; - - constructor(public payload: { token: string, password: string, confirmPassword: string } ) {} -} - -export class ModifyPasswordSuccess implements Action { - readonly type = ActionType.ModifyPasswordSuccess; - - constructor(public payload: Member) {} -} - -export class ModifyPasswordFailure implements Action { - readonly type = ActionType.ModifyPasswordFailure; - - constructor(public payload: RESTClientError) {} -} - -export class ConfirmEmailForSignup implements Action { - readonly type = ActionType.ConfirmEmailForSignup; - - constructor(public payload: string ) {} -} - -export class ConfirmEmailForSignupSuccess implements Action { - readonly type = ActionType.ConfirmEmailForSignupSuccess; - - constructor(public payload: EmailAuth) {} -} - -export class ConfirmEmailForSignupFailure implements Action { - readonly type = ActionType.ConfirmEmailForSignupFailure; - - constructor(public payload: RESTClientError) {} -} - -export class ConfirmEmailForPassword implements Action { - readonly type = ActionType.ConfirmEmailForPassword; - - constructor(public payload: string) {} -} - -export class ConfirmEmailForPasswordSuccess implements Action { - readonly type = ActionType.ConfirmEmailForPasswordSuccess; - - constructor(public payload: EmailAuth) {} -} - -export class ConfirmEmailForPasswordFailure implements Action { - readonly type = ActionType.ConfirmEmailForPasswordFailure; - - constructor(public payload: RESTClientError) {} -} - export type Actions = | Signin | Signout - | Signup - | SignupSuccess - | SignupFailure | Modify | ModifySuccess | ModifyFailure - | ResetPassword - | ResetPasswordSuccess - | ResetPasswordFailure - | ModifyPassword - | ModifyPasswordSuccess - | ModifyPasswordFailure - | ConfirmEmailForSignup - | ConfirmEmailForSignupSuccess - | ConfirmEmailForSignupFailure - | ConfirmEmailForPassword - | ConfirmEmailForPasswordSuccess - | ConfirmEmailForPasswordFailure ; diff --git a/@overflow/member/store/entity/member/member.effect.ts b/@overflow/member/store/entity/member/member.effect.ts index b7cfd1d..2e47f3f 100644 --- a/@overflow/member/store/entity/member/member.effect.ts +++ b/@overflow/member/store/entity/member/member.effect.ts @@ -10,24 +10,9 @@ import { MemberService } from '../../../service/member.service'; import { Signin, - Signup, - SignupSuccess, - SignupFailure, Modify, ModifySuccess, ModifyFailure, - ResetPassword, - ResetPasswordSuccess, - ResetPasswordFailure, - ModifyPassword, - ModifyPasswordSuccess, - ModifyPasswordFailure, - ConfirmEmailForSignup, - ConfirmEmailForSignupSuccess, - ConfirmEmailForSignupFailure, - ConfirmEmailForPassword, - ConfirmEmailForPasswordSuccess, - ConfirmEmailForPasswordFailure, ActionType, } from './member.action'; @@ -68,22 +53,6 @@ export class Effects { ) ); - @Effect() - signup$ = this.actions$.pipe( - ofType(ActionType.Signup), - map((action: Signup) => action.payload), - exhaustMap((signupInfo: { member: Member, password: string }) => - this.memberService - .signup(signupInfo.member, signupInfo.password) - .pipe( - map((member: Member) => { - return new SignupSuccess(member); - }), - catchError(error => of(new SignupFailure(error))) - ) - ) - ); - @Effect() modify$ = this.actions$.pipe( ofType(ActionType.Modify), @@ -99,68 +68,4 @@ export class Effects { ) ) ); - - @Effect() - resetPassword$ = this.actions$.pipe( - ofType(ActionType.ResetPassword), - map((action: ResetPassword) => action.payload), - exhaustMap((email: string) => - this.memberService - .sendEmailResetPassword(email) - .pipe( - map((newMember: Member) => { - return new ResetPasswordSuccess(newMember); - }), - catchError(error => of(new ResetPasswordFailure(error))) - ) - ) - ); - - @Effect() - modifyPassword$ = this.actions$.pipe( - ofType(ActionType.ModifyPassword), - map((action: ModifyPassword) => action.payload), - exhaustMap((info: { token: string, password: string, confirmPassword: string }) => - this.memberService - .resetPassword(info.token, info.password, info.confirmPassword) - .pipe( - map((newMember: Member) => { - return new ModifyPasswordSuccess(newMember); - }), - catchError(error => of(new ModifyPasswordFailure(error))) - ) - ) - ); - - @Effect() - confirmEmailForSignup$ = this.actions$.pipe( - ofType(ActionType.ConfirmEmailForSignup), - map((action: ConfirmEmailForSignup) => action.payload), - exhaustMap(( token: string ) => - this.emailAuthService - .readBySignupAuthKey(token) - .pipe( - map( (emailAuth: EmailAuth) => { - return new ConfirmEmailForSignupSuccess(emailAuth); - }), - catchError(error => of(new ConfirmEmailForSignupFailure(error))) - ) - ) - ); - - @Effect() - confirmEmailForPassword$ = this.actions$.pipe( - ofType(ActionType.ConfirmEmailForPassword), - map((action: ConfirmEmailForPassword) => action.payload), - exhaustMap(( token: string ) => - this.emailAuthService - .readByPwAuthKey(token) - .pipe( - map( (emailAuth: EmailAuth) => { - return new ConfirmEmailForPasswordSuccess(emailAuth); - }), - catchError(error => of(new ConfirmEmailForPasswordFailure(error))) - ) - ) - ); } diff --git a/@overflow/member/store/index.ts b/@overflow/member/store/index.ts index 1c6e029..710b681 100644 --- a/@overflow/member/store/index.ts +++ b/@overflow/member/store/index.ts @@ -8,30 +8,19 @@ import { MODULE } from '../member.constant'; import * as MemberEntityStore from './entity/member'; import * as MemberTOTPEntityStore from './entity/member-totp'; -import * as MemberSignupContainerStore from './container/signup'; import * as MemberSigninContainerStore from './container/signin'; -import * as MemberModifyPasswordContainerStore from './container/modify-password'; -import * as MemberResetPasswordContainerStore from './container/reset-password'; import * as MemberModifyContainerStore from './container/modify'; import * as MemberSignoutContainerStore from './container/signout'; -import * as ConfirmEmailStore from './container/email-auth'; export interface State { - member_signup_container: MemberSignupContainerStore.State; member_signin_container: MemberSigninContainerStore.State; - member_modify_password_container: MemberModifyPasswordContainerStore.State; - member_reset_password_container: MemberResetPasswordContainerStore.State; member_modify_container: MemberModifyContainerStore.State; member_signout_container: MemberSignoutContainerStore.State; - confirm_email_container: ConfirmEmailStore.State; } export const REDUCERS = { - member_signup_container: MemberSignupContainerStore.reducer, member_signin_container: MemberSigninContainerStore.reducer, - member_modify_password_container: MemberModifyPasswordContainerStore.reducer, - member_reset_password_container: MemberResetPasswordContainerStore.reducer, member_modify_container: MemberModifyContainerStore.reducer, member_signout_container: MemberSignoutContainerStore.reducer, }; @@ -43,26 +32,11 @@ export const EFFECTS = [ export const selectState = createFeatureSelector(MODULE.name); -export const MemberSignupContainerSelector = MemberSignupContainerStore.getSelectors(createSelector( - selectState, - (state: State) => state.member_signup_container -)); - export const MemberSigninContainerSelector = MemberSigninContainerStore.getSelectors(createSelector( selectState, (state: State) => state.member_signin_container )); -export const MemberModifyPasswordContainerSelector = MemberModifyPasswordContainerStore.getSelectors(createSelector( - selectState, - (state: State) => state.member_modify_password_container -)); - -export const MemberResetPasswordContainerSelector = MemberResetPasswordContainerStore.getSelectors(createSelector( - selectState, - (state: State) => state.member_reset_password_container -)); - export const MemberModifyContainerSelector = MemberModifyContainerStore.getSelectors(createSelector( selectState, (state: State) => state.member_modify_container diff --git a/src/app/pages/account/profile/profile-page.component.html b/src/app/pages/account/profile/profile-page.component.html index 0b6e2c0..a2a358e 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/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts index 0c83c27..a27c22d 100644 --- a/src/app/pages/pages-routing.module.ts +++ b/src/app/pages/pages-routing.module.ts @@ -20,7 +20,7 @@ const routes: Routes = [ // { path: 'alert', loadChildren: './alert/alert-page.module#AlertPageModule' }, // { path: 'report', loadChildren: './report/report-page.module#ReportPageModule' }, // { path: 'log', loadChildren: './log/log-page.module#LogPageModule' }, - // { path: 'account', loadChildren: './account/account-page.module#AccountPageModule' }, + { path: 'account', loadChildren: './account/account-page.module#AccountPageModule' }, // { path: 'settings/member', loadChildren: './settings/member/member-page.module#MemberPageModule' }, ] }