Implement select_as_mapitem
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
@@ -13,6 +13,8 @@ import { UserService } from '../services/user.service';
|
||||
import { IItemTypes } from '../models/item.types';
|
||||
import { IListItem } from '../models/list.item';
|
||||
import { IUser } from '../models/user';
|
||||
import {IQueryState} from '../models/query.state';
|
||||
import {StateSerializerService} from '../services/state-serializer.service';
|
||||
|
||||
@Injectable()
|
||||
export class AppCommonEffects {
|
||||
@@ -101,7 +103,24 @@ export class AppCommonEffects {
|
||||
var a = action as appCommonActions.EditItem;
|
||||
var itemType = itemtypes[a.item.itemType];
|
||||
var viewer = itemType.viewer;
|
||||
this.router$.navigate(['/viewer', viewer, 'item', a.item.code])
|
||||
if(viewer == 'select_as_mapitem') {
|
||||
let queryState = {
|
||||
itemCode: a.item.code,
|
||||
parentCode: null,
|
||||
level: 1,
|
||||
itemType: null,
|
||||
bboxFilter: false,
|
||||
query: null,
|
||||
tags: null,
|
||||
endDate: null,
|
||||
startDate: null,
|
||||
bbox: []
|
||||
};
|
||||
let query = this.stateSerializerService$.serialize(queryState);
|
||||
this.router$.navigate(['/map', query ])
|
||||
} else {
|
||||
this.router$.navigate(['/viewer', viewer, 'item', a.item.code])
|
||||
}
|
||||
return [];
|
||||
}
|
||||
));
|
||||
@@ -116,7 +135,7 @@ export class AppCommonEffects {
|
||||
return null;
|
||||
}));
|
||||
|
||||
constructor(private actions$: Actions, private store$: Store<appCommonReducers.State>, private oauthService$: OAuthService, private itemService$: ItemService, private folderService$:FolderService, private userService$: UserService, private router$: Router) {
|
||||
constructor(private actions$: Actions, private store$: Store<appCommonReducers.State>, private oauthService$: OAuthService, private itemService$: ItemService, private folderService$:FolderService, private userService$: UserService, private router$: Router, private stateSerializerService$:StateSerializerService) {
|
||||
store$.dispatch(new appCommonActions.LoadItemTypes());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user