This commit is contained in:
crusader 2018-05-25 20:31:58 +09:00
parent 98c166ebcb
commit 19ef851759
13 changed files with 1928 additions and 1951 deletions

View File

@ -6,7 +6,7 @@ import 'rxjs/add/operator/map';
import { AuthSelector } from '@overflow/member/store';
import { Domain } from '@overflow/commons-typescript/model/domain';
import * as ListStore from '../../store/noauth-probe';
import * as ListStore from '../../store/entity/noauth-probe';
import { NoAuthProbeSelector } from '../../store';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
import { ConfirmationService } from 'primeng/primeng';
@ -27,7 +27,7 @@ export class NoAuthProbeListContainerComponent implements OnInit, AfterContentIn
}
ngOnInit() {
this.noauthProbes$ = this.store.pipe(select(NoAuthProbeSelector.select('noAuthProbes'))).map((_noauthProbes: NoAuthProbe[]) => {
this.noauthProbes$ = this.store.pipe(select(NoAuthProbeSelector.selectAll)).map((_noauthProbes: NoAuthProbe[]) => {
if (null === _noauthProbes) {
return null;
}

View File

@ -0,0 +1 @@
export * from './noauth-probe';

View File

@ -7,20 +7,20 @@ import { Domain } from '@overflow/commons-typescript/model/domain';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
export enum ActionType {
ReadAllByDomainID = '[noauth-proboe.noauth-proboe] ReadAllByDomainID',
ReadAllByDomainIDSuccess = '[noauth-proboe.noauth-proboe] ReadAllByDomainIDSuccess',
ReadAllByDomainIDFailure = '[noauth-proboe.noauth-proboe] ReadAllByDomainIDFailure',
ReadAllByDomainID = '[noauth-probe.noauth-probe] ReadAllByDomainID',
ReadAllByDomainIDSuccess = '[noauth-probe.noauth-probe] ReadAllByDomainIDSuccess',
ReadAllByDomainIDFailure = '[noauth-probe.noauth-probe] ReadAllByDomainIDFailure',
Accept = '[noauth-proboe.noauth-proboe] Accept',
AcceptSuccess = '[noauth-proboe.noauth-proboe] AcceptSuccess',
AcceptFailure = '[noauth-proboe.noauth-proboe] AcceptFailure',
Accept = '[noauth-probe.noauth-probe] Accept',
AcceptSuccess = '[noauth-probe.noauth-probe] AcceptSuccess',
AcceptFailure = '[noauth-probe.noauth-probe] AcceptFailure',
Deny = '[noauth-proboe.noauth-proboe] Deny',
DenySuccess = '[noauth-proboe.noauth-proboe] DenySuccess',
DenyFailure = '[noauth-proboe.noauth-proboe] DenyFailure',
Deny = '[noauth-probe.noauth-probe] Deny',
DenySuccess = '[noauth-probe.noauth-probe] DenySuccess',
DenyFailure = '[noauth-probe.noauth-probe] DenyFailure',
OnConnect = '[noauth-proboe.noauth-proboe] OnConnect',
OnDisconnect = '[noauth-proboe.noauth-proboe] OnDisconnect',
OnConnect = '[noauth-probe.noauth-probe] OnConnect',
OnDisconnect = '[noauth-probe.noauth-probe] OnDisconnect',
}
export class ReadAllByDomainID implements Action {

View File

@ -19,7 +19,7 @@ import { RPCClientError } from '@loafer/ng-rpc';
import { Domain } from '@overflow/commons-typescript/model/domain';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
import { NoAuthProbeService } from '../../service/noauth-probe.service';
import { NoAuthProbeService } from '../../../service/noauth-probe.service';
import {
ReadAllByDomainID,

View File

@ -15,6 +15,7 @@ import {
import {
State,
initialState,
noAuthProbeAdapter,
} from './noauth-probe.state';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
@ -25,76 +26,45 @@ export function reducer(state = initialState, action: Actions): State {
return {
...state,
error: null,
pending: true,
};
}
case ActionType.ReadAllByDomainIDSuccess: {
return {
...state,
error: null,
pending: false,
noAuthProbes: action.payload,
};
return noAuthProbeAdapter.setAll(action.payload, state);
}
case ActionType.ReadAllByDomainIDFailure: {
return {
...state,
error: action.payload,
pending: false,
noAuthProbes: null,
};
return noAuthProbeAdapter.setError(action.payload, state);
}
case ActionType.Accept: {
return {
...state,
error: null,
pending: true,
};
}
case ActionType.AcceptSuccess: {
return {
...state,
error: null,
pending: false,
noAuthProbes: action.payload,
};
return noAuthProbeAdapter.setAll(action.payload, state);
}
case ActionType.AcceptFailure: {
return {
...state,
error: action.payload,
pending: false,
};
return noAuthProbeAdapter.setError(action.payload, state);
}
case ActionType.Deny: {
return {
...state,
error: null,
pending: true,
};
}
case ActionType.DenySuccess: {
return {
...state,
error: null,
pending: false,
noAuthProbes: action.payload,
};
return noAuthProbeAdapter.setAll(action.payload, state);
}
case ActionType.DenyFailure: {
return {
...state,
error: action.payload,
pending: false,
};
return noAuthProbeAdapter.setError(action.payload, state);
}
case ActionType.OnConnect: {

View File

@ -0,0 +1,14 @@
import { RPCClientError } from '@loafer/ng-rpc';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
import { Selector, createSelector } from '@ngrx/store';
import { createEntityAdapter, EntityState } from '@loafer/ng-entity';
export const noAuthProbeAdapter = createEntityAdapter<NoAuthProbe, RPCClientError>();
export interface State extends EntityState<NoAuthProbe, RPCClientError> {
}
export const initialState: State = noAuthProbeAdapter.getInitialState();
export function getSelectors<S>(selector: Selector<any, State>) {
return noAuthProbeAdapter.getSelectors(selector);
}

View File

@ -7,7 +7,7 @@ import { StateSelector } from '@overflow/core/ngrx/store';
import { MODULE } from '../noauth-probe.constant';
import * as NoAuthProbeStore from './noauth-probe';
import * as NoAuthProbeStore from './entity/noauth-probe';
export interface State {
noAuthProbe: NoAuthProbeStore.State;
@ -21,9 +21,9 @@ export const EFFECTS = [
NoAuthProbeStore.Effects,
];
export const selectNoAuthProbeState = createFeatureSelector<State>(MODULE.name);
export const selectState = createFeatureSelector<State>(MODULE.name);
export const NoAuthProbeSelector = new StateSelector<NoAuthProbeStore.State>(createSelector(
selectNoAuthProbeState,
export const NoAuthProbeSelector = NoAuthProbeStore.getSelectors(createSelector(
selectState,
(state: State) => state.noAuthProbe
));

View File

@ -1,15 +0,0 @@
import { RPCClientError } from '@loafer/ng-rpc';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
export interface State {
error: RPCClientError | null;
pending: boolean;
noAuthProbes: NoAuthProbe[] | null;
}
export const initialState: State = {
error: null,
pending: false,
noAuthProbes: null,
};

View File

@ -4,7 +4,7 @@ import { Store, select } from '@ngrx/store';
import { RPCSubscriber } from '@loafer/ng-rpc';
import { LoggerService } from '@loafer/ng-logger';
import * as NoAuthProbeStore from '../store/noauth-probe';
import * as NoAuthProbeStore from '../store/entity/noauth-probe';
import {
NoAuthProbe,

3766
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@
"@angular/router": "^6.0.2",
"@loafer/core": "^0.0.1",
"@loafer/decorator": "^0.0.1",
"@loafer/ng-entity": "^0.0.1",
"@loafer/ng-logger": "^0.0.1",
"@loafer/ng-rest": "^0.0.1",
"@loafer/ng-rpc": "^0.0.1",