Refactor edit_in_editor
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2020-04-16 17:05:07 +02:00
parent 0b32153489
commit e30d95ff09
2 changed files with 23 additions and 18 deletions

View File

@@ -256,23 +256,8 @@ export class MapEffects {
ofType(mapActions.SETQUERYSTATE),
switchMap((action: mapActions.SetQueryState) => {
var newAction:Action;
if (action.queryState.itemCode && action.queryState.itemCode != "") {
let urlparts=[];
if(action.queryState.itemType && action.queryState.itemType!= "") {
let itemType = this.itemTypeService$.itemTypes[action.queryState.itemType];
if (itemType.viewer == "edit_in_editor" && itemType.editor) {
urlparts.push('/editor');
urlparts.push(itemType.editor);
urlparts.push('item');
urlparts.push(action.queryState.itemCode);
}
}
if(urlparts.length==0 ) {
newAction= new mapActions.SelectItem(action.queryState.itemCode);
} else {
this.router$.navigate(urlparts);
return [];
}
if (action.queryState.itemCode && action.queryState.itemCode != "") {
newAction= new mapActions.SelectItem(action.queryState.itemCode);
} else {
newAction= new mapActions.StartSearch(action.queryState);
}