This commit is contained in:
crusader 2018-05-28 20:39:58 +09:00
parent 41597d406d
commit ffb65a75f4
8 changed files with 60 additions and 1 deletions

View File

@ -2,12 +2,14 @@ import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import { Member } from '@overflow/commons-typescript/model/member';
@Component({ @Component({
selector: 'of-member-signin', selector: 'of-member-signin',
templateUrl: './member-signin.component.html', templateUrl: './member-signin.component.html',
}) })
export class MemberSigninComponent implements OnInit { export class MemberSigninComponent implements OnInit {
@Input() member: Member;
@Input() signinError: string; @Input() signinError: string;
@Output() resetPassword = new EventEmitter(); @Output() resetPassword = new EventEmitter();
@Output() signup = new EventEmitter(); @Output() signup = new EventEmitter();

View File

@ -1 +1,5 @@
<of-member-signin (signin)="onSignin($event)"></of-member-signin> <of-member-signin
[member]="member$ | async"
(signin)="onSignin($event)"
>
</of-member-signin>

View File

@ -7,6 +7,7 @@ import { Observable } from 'rxjs';
import { MemberSigninContainerSelector } from '../store'; import { MemberSigninContainerSelector } from '../store';
import * as MemberEntityStore from '../store/entity/member'; import * as MemberEntityStore from '../store/entity/member';
import { Member } from '@overflow/commons-typescript/model/member';
@Component({ @Component({
selector: 'of-member-signin-container', selector: 'of-member-signin-container',
@ -14,6 +15,7 @@ import * as MemberEntityStore from '../store/entity/member';
}) })
export class MemberSigninContainerComponent implements OnInit { export class MemberSigninContainerComponent implements OnInit {
@Input() returnURL: string; @Input() returnURL: string;
member$: Observable<Member>;
pending$: Observable<boolean>; pending$: Observable<boolean>;
error$: Observable<any>; error$: Observable<any>;
@ -23,6 +25,7 @@ export class MemberSigninContainerComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.member$ = this.store.pipe(select(MemberSigninContainerSelector.selectMember));
this.pending$ = this.store.pipe(select(MemberSigninContainerSelector.selectPending)); this.pending$ = this.store.pipe(select(MemberSigninContainerSelector.selectPending));
this.error$ = this.store.pipe(select(MemberSigninContainerSelector.selectError)); this.error$ = this.store.pipe(select(MemberSigninContainerSelector.selectError));
} }

View File

@ -18,6 +18,7 @@ export function reducer(state: State = initialState, action: MemberActions | Aut
switch (action.type) { switch (action.type) {
case MemberActionType.Signin: { case MemberActionType.Signin: {
return { return {
member: null,
pending: true, pending: true,
error: null, error: null,
}; };
@ -25,6 +26,7 @@ export function reducer(state: State = initialState, action: MemberActions | Aut
case AuthActionType.SigninSuccess: { case AuthActionType.SigninSuccess: {
return { return {
member: action.payload.domainMember.member,
pending: false, pending: false,
error: null, error: null,
}; };
@ -32,6 +34,7 @@ export function reducer(state: State = initialState, action: MemberActions | Aut
case AuthActionType.SigninFailure: { case AuthActionType.SigninFailure: {
return { return {
member: null,
pending: false, pending: false,
error: action.payload, error: action.payload,
}; };

View File

@ -1,19 +1,23 @@
import { Selector, createSelector } from '@ngrx/store'; import { Selector, createSelector } from '@ngrx/store';
import { RESTClientError } from '@loafer/ng-rest'; import { RESTClientError } from '@loafer/ng-rest';
import { Member } from '@overflow/commons-typescript/model/member';
export interface State { export interface State {
member: Member;
pending: boolean; pending: boolean;
error: RESTClientError; error: RESTClientError;
} }
export const initialState: State = { export const initialState: State = {
member: null,
pending: false, pending: false,
error: null, error: null,
}; };
export function getSelectors(selector: Selector<any, State>) { export function getSelectors(selector: Selector<any, State>) {
return { return {
selectMember: createSelector(selector, (state: State) => state.member),
selectPending: createSelector(selector, (state: State) => state.pending), selectPending: createSelector(selector, (state: State) => state.pending),
selectError: createSelector(selector, (state: State) => state.error), selectError: createSelector(selector, (state: State) => state.error),
}; };

View File

@ -0,0 +1,20 @@
<table class="login-table">
<tr>
<td>
<div class="login-panel ui-fluid">
<div class="ui-g">
<div class="ui-g-12">
<img src="assets/layout/images/login/login_img_01.png">
<p><br>
overFlow는 여러분의 서버에 발생하는<br>
변화를 항상 지켜보고 있습니다.<br><br>
서버에 발생하는 모든 변화를 세분화 하여<br>
실시간으로 알려 드립니다.
</p>
</div>
</div>
</div>
</td>
</tr>
</table>

View File

@ -0,0 +1,21 @@
import { Component, OnInit } from '@angular/core';
import { trigger, state, transition, style, animate } from '@angular/animations';
import { ActivatedRoute, Router } from '@angular/router';
import { select, Store } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
@Component({
selector: 'of-site-banner-container',
templateUrl: './app.banner.component.html',
})
export class AppBannerComponent implements OnInit {
constructor(
private store: Store<any>,
) {
}
ngOnInit() {
}
}

View File

@ -8,6 +8,7 @@ import { AppFooterComponent } from '../commons/component/layout/footer/app.foote
import { AppBreadcrumbComponent } from '../commons/component/layout/breadcrumb/app.breadcrumb.component'; import { AppBreadcrumbComponent } from '../commons/component/layout/breadcrumb/app.breadcrumb.component';
import { AppRightpanelComponent } from '../commons/component/layout/right-panel/app.rightpanel.component'; import { AppRightpanelComponent } from '../commons/component/layout/right-panel/app.rightpanel.component';
import { AppInlineProfileComponent } from '../commons/component/layout/profile/app.profile.component'; import { AppInlineProfileComponent } from '../commons/component/layout/profile/app.profile.component';
import { AppBannerComponent } from '../commons/component/layout/banner/app.banner.component';
import { BreadcrumbService } from '../commons/service/breadcrumb.service'; import { BreadcrumbService } from '../commons/service/breadcrumb.service';
import { import {
LocalizationModule, LocalizationModule,
@ -38,6 +39,7 @@ import { NotificationModule } from '@overflow/notification/notification.module';
AppBreadcrumbComponent, AppBreadcrumbComponent,
AppRightpanelComponent, AppRightpanelComponent,
AppInlineProfileComponent, AppInlineProfileComponent,
AppBannerComponent,
], ],
providers: [ providers: [
{ provide: LocationStrategy, useClass: HashLocationStrategy }, { provide: LocationStrategy, useClass: HashLocationStrategy },