@@ -20,14 +20,16 @@
@@ -38,3 +40,6 @@
+
+ I sent an authentication mail to the mail address you registered. Please check and change your password.
+
diff --git a/@overflow/member/component/member-reset-password.component.ts b/@overflow/member/component/member-reset-password.component.ts
index e9b73e2..00ab882 100644
--- a/@overflow/member/component/member-reset-password.component.ts
+++ b/@overflow/member/component/member-reset-password.component.ts
@@ -1,5 +1,16 @@
-import { Component, OnInit, Output, EventEmitter } from '@angular/core';
-import {FormGroup, FormBuilder, Validators, AbstractControl} from '@angular/forms';
+import {
+ Component,
+ OnInit,
+ Output,
+ EventEmitter, Input
+} from '@angular/core';
+import {
+ FormGroup,
+ FormBuilder,
+ Validators,
+ AbstractControl
+} from '@angular/forms';
+import {Member} from '@overflow/commons-typescript/model/member';
@Component({
selector: 'of-member-reset-password',
@@ -7,6 +18,10 @@ import {FormGroup, FormBuilder, Validators, AbstractControl} from '@angular/form
})
export class MemberResetPasswordComponent implements OnInit {
@Output() resetPassword = new EventEmitter();
+ @Output() signin = new EventEmitter();
+ @Output() signup = new EventEmitter();
+
+ @Input() member: Member;
resetPasswordForm: FormGroup;
email: AbstractControl;
@@ -28,8 +43,16 @@ export class MemberResetPasswordComponent implements OnInit {
this.email = this.resetPasswordForm.controls['email'];
}
- resetPasswordFormSubmit() {
+ resetPasswordSubmit() {
const formValue = Object.assign({}, this.resetPasswordForm.value);
this.resetPassword.emit(formValue.email);
}
+
+ onSignin() {
+ this.signin.emit();
+ }
+
+ onSignup() {
+ this.signup.emit();
+ }
}
diff --git a/@overflow/member/container/member-modify-password-container.component.html b/@overflow/member/container/member-modify-password-container.component.html
index 95d23bd..6c14e57 100644
--- a/@overflow/member/container/member-modify-password-container.component.html
+++ b/@overflow/member/container/member-modify-password-container.component.html
@@ -1,6 +1,7 @@
diff --git a/@overflow/member/container/member-modify-password-container.component.ts b/@overflow/member/container/member-modify-password-container.component.ts
index baa4a69..4fd9367 100644
--- a/@overflow/member/container/member-modify-password-container.component.ts
+++ b/@overflow/member/container/member-modify-password-container.component.ts
@@ -1,10 +1,10 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
-import { ActivatedRoute, Router } from '@angular/router';
-import { FormGroup, FormBuilder, Validators } from '@angular/forms';
-import { select, Store } from '@ngrx/store';
-import { Observable } from 'rxjs';
+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',
@@ -14,15 +14,25 @@ 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-reset-password-container.component.html b/@overflow/member/container/member-reset-password-container.component.html
index 00ae5d0..6e31e48 100644
--- a/@overflow/member/container/member-reset-password-container.component.html
+++ b/@overflow/member/container/member-reset-password-container.component.html
@@ -1,4 +1,7 @@
diff --git a/@overflow/member/container/member-reset-password-container.component.ts b/@overflow/member/container/member-reset-password-container.component.ts
index 964d1d3..3ffc4e2 100644
--- a/@overflow/member/container/member-reset-password-container.component.ts
+++ b/@overflow/member/container/member-reset-password-container.component.ts
@@ -1,24 +1,46 @@
-import { Component, OnInit } from '@angular/core';
-import { Router } from '@angular/router';
-import { FormGroup, FormBuilder, Validators } from '@angular/forms';
+import {
+ Component, EventEmitter,
+ OnInit,
+ Output
+} from '@angular/core';
import {select, Store} from '@ngrx/store';
-import {RPCClientError} from '@loafer/ng-rpc';
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/store/container/modify-password/member-modify-password.reducer.ts b/@overflow/member/store/container/modify-password/member-modify-password.reducer.ts
index bce2a8a..5614fe2 100644
--- a/@overflow/member/store/container/modify-password/member-modify-password.reducer.ts
+++ b/@overflow/member/store/container/modify-password/member-modify-password.reducer.ts
@@ -12,6 +12,7 @@ export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.ModifyPassword: {
return {
+ member: null,
pending: true,
error: null,
};
@@ -19,6 +20,7 @@ export function reducer(state = initialState, action: Actions): State {
case ActionType.ModifyPasswordSuccess: {
return {
+ member: action.payload,
pending: false,
error: null,
};
@@ -26,6 +28,7 @@ export function reducer(state = initialState, action: Actions): State {
case ActionType.ModifyPasswordFailure: {
return {
+ member: null,
pending: false,
error: action.payload,
};
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
index 7f8f259..d9a9bb5 100644
--- a/@overflow/member/store/container/modify-password/member-modify-password.state.ts
+++ b/@overflow/member/store/container/modify-password/member-modify-password.state.ts
@@ -5,11 +5,13 @@ 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,
};
@@ -17,6 +19,7 @@ export const initialState: State = {
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/member-reset-password.reducer.ts b/@overflow/member/store/container/reset-password/member-reset-password.reducer.ts
index f949fcc..06db0ff 100644
--- a/@overflow/member/store/container/reset-password/member-reset-password.reducer.ts
+++ b/@overflow/member/store/container/reset-password/member-reset-password.reducer.ts
@@ -12,6 +12,7 @@ export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.ResetPassword: {
return {
+ member: null,
pending: true,
error: null,
};
@@ -19,6 +20,7 @@ export function reducer(state = initialState, action: Actions): State {
case ActionType.ResetPasswordSuccess: {
return {
+ member: action.payload,
pending: false,
error: null,
};
@@ -26,6 +28,7 @@ export function reducer(state = initialState, action: Actions): State {
case ActionType.ResetPasswordFailure: {
return {
+ member: null,
pending: false,
error: action.payload,
};
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
index 7f8f259..d9a9bb5 100644
--- a/@overflow/member/store/container/reset-password/member-reset-password.state.ts
+++ b/@overflow/member/store/container/reset-password/member-reset-password.state.ts
@@ -5,11 +5,13 @@ 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,
};
@@ -17,6 +19,7 @@ export const initialState: State = {
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/src/app/pages/auth/reset-password/modify-password-page.component.html b/src/app/pages/auth/reset-password/modify-password-page.component.html
index b1ad7ae..b721923 100644
--- a/src/app/pages/auth/reset-password/modify-password-page.component.html
+++ b/src/app/pages/auth/reset-password/modify-password-page.component.html
@@ -1,6 +1,6 @@
\ No newline at end of file
+
diff --git a/src/app/pages/auth/reset-password/modify-password-page.component.ts b/src/app/pages/auth/reset-password/modify-password-page.component.ts
index 078f350..e783fc8 100644
--- a/src/app/pages/auth/reset-password/modify-password-page.component.ts
+++ b/src/app/pages/auth/reset-password/modify-password-page.component.ts
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
-import { ActivatedRoute } from '@angular/router';
+import {ActivatedRoute, Router} from '@angular/router';
@Component({
selector: 'of-pages-modify-password',
@@ -9,6 +9,7 @@ export class ModifyPasswordPageComponent implements OnInit {
toenURL: string;
constructor(
+ private router: Router,
private activatedRoute: ActivatedRoute,
) { }
@@ -16,4 +17,7 @@ export class ModifyPasswordPageComponent implements OnInit {
this.toenURL = this.activatedRoute.snapshot.queryParams['token'];
}
+ onSignin() {
+ this.router.navigate(['auth/signin']);
+ }
}
diff --git a/src/app/pages/auth/reset-password/reset-password-page.component.html b/src/app/pages/auth/reset-password/reset-password-page.component.html
index c3a5206..35a2266 100644
--- a/src/app/pages/auth/reset-password/reset-password-page.component.html
+++ b/src/app/pages/auth/reset-password/reset-password-page.component.html
@@ -1,6 +1,6 @@
\ No newline at end of file
+
diff --git a/src/app/pages/auth/reset-password/reset-password-page.component.ts b/src/app/pages/auth/reset-password/reset-password-page.component.ts
index bff1c1c..0cd303f 100644
--- a/src/app/pages/auth/reset-password/reset-password-page.component.ts
+++ b/src/app/pages/auth/reset-password/reset-password-page.component.ts
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
+import {Router} from '@angular/router';
@Component({
selector: 'of-pages-auth-reset-password',
@@ -6,9 +7,18 @@ import { Component, OnInit } from '@angular/core';
})
export class ResetPasswordPageComponent implements OnInit {
- constructor() { }
+ constructor(
+ private router: Router
+ ) { }
ngOnInit() {
}
+ onSignin() {
+ this.router.navigate(['auth/signin']);
+ }
+
+ onSignup() {
+ this.router.navigate(['auth/signup']);
+ }
}
|