2018-04-30 12:04:58 +00:00
|
|
|
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
|
import { Store, select } from '@ngrx/store';
|
2018-05-28 11:16:00 +00:00
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
|
2018-05-24 06:44:13 +00:00
|
|
|
import { RPCClientError } from '@loafer/ng-rpc';
|
2018-05-28 11:16:00 +00:00
|
|
|
import { Member } from '@overflow/commons-typescript/model/member';
|
|
|
|
|
|
|
|
import { AuthContainerSelector } from '@overflow/shared/auth/store';
|
|
|
|
import { DomainMember } from '@overflow/commons-typescript/model/domain';
|
2018-04-18 12:57:58 +00:00
|
|
|
|
2018-05-28 11:16:00 +00:00
|
|
|
import * as MemberEntityStore from '../store/entity/member';
|
2018-04-18 11:27:27 +00:00
|
|
|
|
|
|
|
@Component({
|
2018-05-28 10:46:47 +00:00
|
|
|
selector: 'of-member-profile-container',
|
|
|
|
templateUrl: './member-profile-container.component.html',
|
2018-04-18 11:27:27 +00:00
|
|
|
})
|
2018-05-28 10:46:47 +00:00
|
|
|
export class MemberProfileContainerComponent implements OnInit, OnDestroy {
|
2018-05-28 11:16:00 +00:00
|
|
|
domainMember$: Observable<DomainMember>;
|
2018-04-30 12:04:58 +00:00
|
|
|
|
2018-04-18 12:57:58 +00:00
|
|
|
constructor(
|
2018-05-28 11:16:00 +00:00
|
|
|
private store: Store<any>,
|
2018-04-18 12:57:58 +00:00
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
2018-04-18 11:27:27 +00:00
|
|
|
|
|
|
|
ngOnInit() {
|
2018-05-28 11:16:00 +00:00
|
|
|
this.domainMember$ = this.store.pipe(select(AuthContainerSelector.selectDomainMember));
|
2018-04-18 12:57:58 +00:00
|
|
|
}
|
|
|
|
|
2018-04-30 12:04:58 +00:00
|
|
|
ngOnDestroy() {
|
|
|
|
}
|
|
|
|
|
2018-05-28 11:16:00 +00:00
|
|
|
modify(member: Member) {
|
|
|
|
this.store.dispatch(new MemberEntityStore.Modify(member));
|
2018-04-18 11:27:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|