Refactor edit_in_editor
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user