ing
This commit is contained in:
parent
86d4058664
commit
46699940be
|
@ -5,7 +5,8 @@
|
|||
<div class="ui-g">
|
||||
<img class="profile-image " src="assets/layout/images/avatar.png" />
|
||||
</div>
|
||||
<button type="button" class="ui-button-photo-add" pButton icon="ui-icon-account-box" (click)="onAddSensorWithTarget(item.target)"></button>
|
||||
<button type="button" class="ui-button-photo-add" pButton icon="ui-icon-account-box" ></button>
|
||||
<!--(click)="onAddSensorWithTarget(item.target)" -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -13,32 +14,32 @@
|
|||
<div class="ui-g form-group">
|
||||
<div class="ui-g-12">
|
||||
<span class="md-inputfield">
|
||||
<input type="text" pInputText formControlName="email" readonly value="{{member.email}}">
|
||||
<input type="text" pInputText formControlName="email" readonly >
|
||||
<label>Email</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="ui-g-12">
|
||||
<span class="md-inputfield">
|
||||
<input type="text" pInputText formControlName="name" value="{{member.name}}" >
|
||||
<input type="text" pInputText formControlName="name" >
|
||||
<label>Name</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="ui-g-12">
|
||||
<span class="md-inputfield">
|
||||
<input type="text" pInputText formControlName="companyName" value="{{member.companyName}}" >
|
||||
<input type="text" pInputText formControlName="companyName" >
|
||||
<label>Company Name</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="ui-g-12">
|
||||
<span class="md-inputfield">
|
||||
<input type="text" pInputText formControlName="phone" value="{{member.phone}}" >
|
||||
<input type="text" pInputText formControlName="phone" >
|
||||
<label>Phone</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g-12" dir="rtl">
|
||||
<button type="submit" [disabled]="selected" class="ui-button ui-button-text-icon-left ui-button-width-fit">
|
||||
<button type="submit" [disabled]="profileForm.touched &&!profileForm.valid " class="ui-button ui-button-text-icon-left ui-button-width-fit">
|
||||
<span class="ui-button-icon-left ui-c fa fa-fw ui-icon-person"></span>
|
||||
<span class="ui-button-text ui-c">Save</span>
|
||||
</button>
|
||||
|
|
|
@ -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<Member>();
|
||||
domainMember: DomainMember;
|
||||
profileForm: FormGroup;
|
||||
|
||||
form: FormGroup;
|
||||
pending$: Observable<boolean>;
|
||||
error$: Observable<any>;
|
||||
|
||||
email: AbstractControl;
|
||||
name: AbstractControl;
|
||||
phone: AbstractControl;
|
||||
company: AbstractControl;
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
];
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<!--<of-member-confirm-reset-password></of-member-confirm-reset-password>-->
|
|
@ -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<any>,
|
||||
) {
|
||||
|
||||
}
|
||||
ngOnInit(): void {
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
<!--<of-member-confirm-signup></of-member-confirm-signup>-->
|
|
@ -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<any>,
|
||||
) {
|
||||
|
||||
|
||||
}
|
||||
ngOnInit(): void {
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<!--<of-member-modify-password-->
|
||||
<!--[token]="token"-->
|
||||
<!--(modifyPassword)="modifyPassword($event)"-->
|
||||
<!--(signin)="onSignin()"-->
|
||||
<!--[member]="member$ | async"-->
|
||||
<!-->-->
|
||||
<!--</of-member-modify-password>-->
|
|
@ -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<ModifyPasswordComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ModifyPasswordComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ModifyPasswordComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -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<Member>;
|
||||
pending$: Observable<boolean>;
|
||||
error$: Observable<any>;
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
) { }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
<div class="ui-g">
|
||||
|
||||
<div class="ui-g-12">
|
||||
<p-scrollPanel [style]="{width: '800px', height: '100%'}">
|
||||
<div style="padding:1em;line-height:1.5">
|
||||
개인정보 취급방침
|
||||
<pre>
|
||||
“㈜와탭랩스”는(이하 “회사”는) 고객님의 개인정보를 중요시하며, “정보통신망 이용촉진 및 정보보호”에 관한 법률을 준수하고 있습니다.
|
||||
|
||||
회사는 개인정보 취급방침을 통하여 고객님께서 제공하시는 개인정보가 어떠한 용도와 방식으로 이용되고 있으며, 개인정보 보호를 위해 어떠한 조치가 취해지고 있는지 알려드립니다.
|
||||
|
||||
회사는 개인정보취급방침을 개정하는 경우 웹사이트 공지사항(또는 개별공지)을 통하여 공지할 것입니다.
|
||||
|
||||
본 방침은 : 2015년 4월 1일부터 시행됩니다.
|
||||
|
||||
|
||||
|
||||
*수집하는 개인정보 항목
|
||||
회사는 회원가입, 상담, 서비스 신청 등등을 위해 아래와 같은 개인정보를 수집하고 있습니다.
|
||||
|
||||
- 수집항목 : 이름, 이메일 ID, 암호화 된 비밀번호, 휴대전화번호, 회사명, 서비스 이용기록, 결제기록
|
||||
|
||||
- 개인정보 수집방법 : 홈페이지(회원가입, 서비스 신청), 세미나 등 행사 응모
|
||||
|
||||
|
||||
|
||||
*개인정보의 수집 및 이용목적
|
||||
회사는 수집한 개인정보를 다음의 목적을 위해 활용합니다.
|
||||
|
||||
|
||||
|
||||
- 서비스 제공에 관한 계약 이행 및 서비스 제공에 따른 요금정산 콘텐츠 제공, 구매 및 요금 결제
|
||||
|
||||
- 회원 관리
|
||||
회원제 서비스 이용에 따른 본인 확인, 개인 식별, 불량회원의 부정 이용 방지와 비인가 사용 방지, 불만처리 등 민원처리, 고지사항 전달
|
||||
|
||||
- 마케팅 및 광고에 활용
|
||||
이벤트 등 광고성 정보 전달, 접속 빈도 파악 또는 회원의 서비스 이용에 대한 통계
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*개인정보의 보유 및 이용기간
|
||||
원칙적으로, 개인정보 수집 및 이용목적이 달성된 후에는 해당 정보를 지체 없이 파기합니다.
|
||||
단, 관계법령의 규정에 의하여 보존할 필요가 있는 경우 회사는 아래와 같이 관계법령에서 정한 일정한 기간 동안 회원정보를 보관합니다.
|
||||
|
||||
|
||||
|
||||
- 보존 항목 : 서비스 이용기록
|
||||
|
||||
- 보존 근거 : 전자상거래 등에서의 소비자보호에 관한 법률
|
||||
|
||||
- 보존 기간 : 3년
|
||||
|
||||
- 계약 또는 청약철회 등에 관한 기록 : 5년 (전자상거래 등에서의 소비자보호에 관한 법률)
|
||||
|
||||
- 대금결제 및 재화 등의 공급에 관한 기록 : 5년 (전자상거래 등에서의 소비자보호에 관한 법률)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*개인정보 자동수집 장치의 설치, 운영 및 그 거부에 관한 사항
|
||||
회사는 귀하의 정보를 수시로 저장하고 찾아내는 “쿠키(cookie)”를 자동 로그인 등의 목적으로 사용합니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*개인정보의 취급위탁
|
||||
회사는 다음과 같이 개인정보 취급업무를 외부 전문업체에 위탁하여 운영하고 있습니다. 아래 각 수탁업자는 계약기간 동안 필요한 범위 내에서 회원의 개인정보를 보유하는 것을 원칙으로 하며, 수탁업자에 대하여 관계법령에서 법정 보유기간을 명시하고 있는 경우는 해당 업체업체는 해당 기간 동안 보유합니다.
|
||||
|
||||
|
||||
|
||||
- 수탁업체명 : 주식회사 케이지이니시스
|
||||
|
||||
- 위탁업무 : 신용카드, 계좌이체 결제 대행
|
||||
|
||||
- 위탁기간 : 위탁계약 종료시까지
|
||||
|
||||
|
||||
|
||||
위탁업무계약서 내지 별도의 정보보호서약(특약) 등을 통하여 개인정보보호 관련 법규의 준수, 개인정보에 관한 비밀유지, 제3자 제공에 대한 금지, 사고시의 책임부담, 위탁기간, 처리 종료 후의 개인정보의 반환 또는 파기 의무 등을 규정하고, 이를 준수하도록 관리하고 있습니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*개인정보의 파기절차 및 방법
|
||||
회사는 원칙적으로 개인정보 수집 및 이용목적이 달성된 후에는 해당 정보를 지체 없이 파기합니다. 파기절차 및 방법은 다음과 같습니다.
|
||||
|
||||
|
||||
|
||||
- 파기절차
|
||||
회원님이 회원가입 등을 위해 입력하신 정보는 목적이 달성된 후 별도의 DB로 옮겨져(종이의 경우 별도의 서류함) 내부 방침 및 기타 관련 법령에 의한 정보보호 사유에 따라(보유 및 이용기간 참조) 일정 기간 저장된 후 파기됩니다. 별도 DB로 옮겨진 개인정보는 법률에 의한 경우가 아니고서는 보유 이외의 다른 목적으로 이용되지 않습니다.
|
||||
|
||||
|
||||
|
||||
- 파기방법
|
||||
전자적 파일형태로 저장된 개인정보는 기록을 재생할 수 없는 기술적 방법을 사용하여 삭제합니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*개인정보에 관한 민원서비스
|
||||
회사는 고객의 개인정보를 보호하고 원활한 운영을 위하여 아래와 책임자를 지정하고 있습니다.
|
||||
|
||||
개인정보관리 책임자 : loafle
|
||||
전화번호 : 031-460-5677
|
||||
이메일 : overflow@loafle.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
귀하께서는 회사의 서비스를 이용하시며 발생하는 모든 개인정보보호 관련 민원을 개인정보관리 책임자에게 신고하실 수 있습니다.
|
||||
회사는 이용자들의 신고사항에 대해 신속하게 충분한 답변을 드릴 것입니다.
|
||||
|
||||
|
||||
|
||||
기타 개인정보침해에 대한 신고나 상담이 필요하신 경우에는 아래 기관에 문의하시기 바랍니다.
|
||||
<pre>1. KISA 개인정보보호 http://www.1336.or.kr</pre>
|
||||
|
||||
<pre>2. 정보보호마크인증제도 http://www.eprivacy.or.kr</pre>
|
||||
|
||||
<pre>3. 경찰청 사이버테러대응센터 http://www.ctrc.go.kr</pre>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
</p-scrollPanel>
|
||||
</div>
|
||||
</div>
|
|
@ -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<PolicyComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PolicyComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PolicyComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
<of-member-profile
|
||||
(modify)="modify($event)"
|
||||
>
|
||||
|
||||
</of-member-profile>
|
|
@ -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<MemberProfileContainerComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MemberProfileContainerComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MemberProfileContainerComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -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<DomainMember>;
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.domainMember$ = this.store.pipe(select(AuthContainerSelector.selectDomainMember));
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
}
|
||||
|
||||
modify(member: Member) {
|
||||
this.store.dispatch(new MemberEntityStore.Modify(member));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<!--<of-member-reset-password-->
|
||||
<!--(resetPassword)="resetPassword($event)"-->
|
||||
<!--(signin)="onSignin()"-->
|
||||
<!--(signup)="onSignup()"-->
|
||||
<!--[member]="member$ | async"-->
|
||||
<!-->-->
|
||||
<!--</of-member-reset-password>-->
|
|
@ -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<MemberResetPasswordComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MemberResetPasswordComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MemberResetPasswordComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -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<Member>;
|
||||
pending$: Observable<boolean>;
|
||||
error$: Observable<any>;
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
) { }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
<!--<of-member-signup [member]="member$ | async" (signup)="onSignup($event)" ></of-member-signup>-->
|
|
@ -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<MemberSignupContainerComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MemberSignupContainerComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MemberSignupContainerComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -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<Member>;
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.member$ = this.store.pipe(select(MemberSignupContainerSelector.selectMember));
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
}
|
||||
|
||||
onSignup(info: {member: Member, password: string}) {
|
||||
this.store.dispatch(new MemberEntityStore.Signup(info));
|
||||
}
|
||||
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
<of-member-terms></of-member-terms>
|
|
@ -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<TermsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ TermsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TermsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<any, State>) {
|
||||
return {
|
||||
selectEmailAuth: createSelector(selector, (state: State) => state.emailAuth),
|
||||
selectPending: createSelector(selector, (state: State) => state.pending),
|
||||
selectError: createSelector(selector, (state: State) => state.error),
|
||||
};
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
export * from './email-auth.reducer';
|
||||
export * from './email-auth.state';
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
export * from './member-modify-password.state';
|
||||
export * from './member-modify-password.reducer';
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<any, State>) {
|
||||
return {
|
||||
selectMember: createSelector(selector, (state: State) => state.member),
|
||||
selectPending: createSelector(selector, (state: State) => state.pending),
|
||||
selectError: createSelector(selector, (state: State) => state.error),
|
||||
};
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
export * from './member-reset-password.reducer';
|
||||
export * from './member-reset-password.state';
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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<any, State>) {
|
||||
return {
|
||||
selectMember: createSelector(selector, (state: State) => state.member),
|
||||
selectPending: createSelector(selector, (state: State) => state.pending),
|
||||
selectError: createSelector(selector, (state: State) => state.error),
|
||||
};
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
export * from './member-signup.reducer';
|
||||
export * from './member-signup.state';
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<any, State>) {
|
||||
return {
|
||||
selectMember: createSelector(selector, (state: State) => state.member),
|
||||
selectPending: createSelector(selector, (state: State) => state.pending),
|
||||
selectError: createSelector(selector, (state: State) => state.error),
|
||||
};
|
||||
}
|
|
@ -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
|
||||
;
|
||||
|
|
|
@ -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)))
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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<State>(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
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="ui-g-12">
|
||||
<div class="card no-margin">
|
||||
<h1>Profile</h1>
|
||||
<of-member-profile-container></of-member-profile-container>
|
||||
<of-member-profile></of-member-profile>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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' },
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user