modify ing

This commit is contained in:
geek 2018-05-02 17:25:38 +09:00
parent 2eb902c1cd
commit 8e5773b590
16 changed files with 53 additions and 75 deletions

View File

@ -1,6 +1,6 @@
import { Component, OnInit, AfterViewInit, AfterContentInit } from '@angular/core';
import { Router } from '@angular/router';
import { MetaSensorDisplayItem } from 'packages/meta/sensor-display-item/model/MetaSensorDisplayItem';
import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta';
@Component({
selector: 'of-sensor-item-list',

View File

@ -1,12 +1,7 @@
import { NgModule } from '@angular/core';
import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import {
StoreRouterConnectingModule,
RouterStateSerializer,
} from '@ngrx/router-store';
import { EffectsModule } from '@ngrx/effects';
import { combineReducers, ActionReducer, ActionReducerMap, MetaReducer } from '@ngrx/store';
import {
REDUCERS,

View File

@ -2,9 +2,9 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { RPCService } from '@loafer/ng-rpc/service';
import { SensorItemDependency } from '../model/SensorItemDependency';
import { MetaSensorItemKey } from 'packages/meta/sensor-item-key/model/MetaSensorItemKey';
import { MetaSensorDisplayItem } from '../../meta/sensor-display-item/model/MetaSensorDisplayItem';
import { SensorItemDependency } from '@overflow/commons-typescript/model/sensor-item';
import { MetaSensorItemKey } from '@overflow/commons-typescript/model/meta';
import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta';

View File

@ -1,5 +1,4 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { RPCService } from '@loafer/ng-rpc/service';

View File

@ -1,7 +1,6 @@
import {
createSelector,
createFeatureSelector,
ActionReducerMap,
} from '@ngrx/store';
import { StateSelector } from 'packages/core/ngrx/store';

View File

@ -1,8 +1,8 @@
import { Action } from '@ngrx/store';
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { MetaSensorItemKey } from 'packages/meta/sensor-item-key/model/MetaSensorItemKey';
import { MetaSensorDisplayItem } from 'packages/meta/sensor-display-item/model/MetaSensorDisplayItem';
import { MetaSensorItemKey } from '@overflow/commons-typescript/model/meta';
import { MetaSensorDisplayItem } from '@overflow/commons-typescript/model/meta';
export enum ActionType {

View File

@ -16,9 +16,6 @@ import 'rxjs/add/operator/take';
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { DomainMember } from 'packages/domain/model';
import {
ReadAllByDisplayItem,
ReadAllByDisplayItemSuccess,

View File

@ -1,5 +1,5 @@
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { MetaSensorItemKey } from 'packages/meta/sensor-item-key/model/MetaSensorItemKey';
import { MetaSensorItemKey } from '@overflow/commons-typescript/model/meta';
export interface State {

View File

@ -1,7 +1,7 @@
import { Component, ViewChild, OnInit, Input, AfterContentInit, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Sensor } from 'packages/sensor/model';
import { Infra } from 'packages/infra/model';
import { Sensor } from '@overflow/commons-typescript/model/sensor';
import { Infra } from '@overflow/commons-typescript/model/infra';
import { Store, select } from '@ngrx/store';
import { DetailSelector as InfraDetailSelector } from 'packages/infra/store';
import * as InfraDetailStore from 'packages/infra/store/detail';
@ -12,7 +12,7 @@ import * as SensorListStore from 'packages/sensor/store/list';
import { PageParams, Page } from 'app/commons/model';
import { ModifySelector } from 'packages/target/store';
import * as TargetModifyStore from 'packages/target/store/modify';
import { Target } from '../../model';
import { Target } from '@overflow/commons-typescript/model/target';
@Component({

View File

@ -1,16 +1,14 @@
import { Component, OnInit, AfterViewInit, AfterContentInit, Input, OnDestroy } from '@angular/core';
import { Component, OnInit, AfterContentInit, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Infra } from 'packages/infra/model';
import { Infra } from '@overflow/commons-typescript/model/infra';
import { Store, select } from '@ngrx/store';
import { ListSelector } from 'packages/infra/store';
import * as InfraListStore from 'packages/infra/store/list';
import { Page, PageParams } from 'app/commons/model';
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { Probe } from 'packages/probe/model';
import { Probe } from '@overflow/commons-typescript/model/probe';
import * as ProbeDetailStore from 'packages/probe/store/detail';
import { DetailSelector as ProbeDetailSelector } from 'packages/probe/store';
import { Target } from '../../model';
import { Target } from '@overflow/commons-typescript/model/target';
import { Subscription } from 'rxjs/Subscription';

View File

@ -5,7 +5,7 @@ import 'rxjs/add/operator/map';
import { RPCService } from '@loafer/ng-rpc/service';
import { Target } from '../model';
import { Target } from '@overflow/commons-typescript/model/target';
@Injectable()

View File

@ -1,8 +1,7 @@
import { Action } from '@ngrx/store';
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { Target } from '../../model';
import { Target } from '@overflow/commons-typescript/model/target';
export enum ActionType {
Modify = '[Target.modify] Modify',

View File

@ -13,7 +13,6 @@ import 'rxjs/add/operator/exhaustMap';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/take';
import { Target } from '../../model';
import { TargetService } from '../../service/target.service';
import {

View File

@ -1,45 +1,43 @@
import {
Actions,
ActionType,
} from './modify.action';
Actions,
ActionType,
} from './modify.action';
import {
State,
initialState,
} from './modify.state';
import {
State,
initialState,
} from './modify.state';
import { Target } from '../../model';
export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.Modify: {
return {
...state,
error: null,
pending: true,
};
}
export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.Modify: {
return {
...state,
error: null,
pending: true,
};
}
case ActionType.ModifySuccess: {
return {
...state,
error: null,
pending: false,
target: action.payload
};
}
case ActionType.ModifySuccess: {
return {
...state,
error: null,
pending: false,
target: action.payload
};
}
case ActionType.ModifyFailure: {
return {
...state,
error: action.payload,
pending: false,
target: null,
};
}
case ActionType.ModifyFailure: {
return {
...state,
error: action.payload,
pending: false,
target: null,
};
}
default: {
return state;
}
default: {
return state;
}
}
}

View File

@ -1,5 +1,5 @@
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { Target } from '../../model';
import { Target } from '@overflow/commons-typescript/model/target';
export interface State {
error: RPCClientError | null;

View File

@ -1,12 +1,6 @@
import { NgModule } from '@angular/core';
import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import {
StoreRouterConnectingModule,
RouterStateSerializer,
} from '@ngrx/router-store';
import { EffectsModule } from '@ngrx/effects';
import { combineReducers, ActionReducer, ActionReducerMap, MetaReducer } from '@ngrx/store';
import {
REDUCERS,