Compare commits

..

2 Commits

Author SHA1 Message Date
5e1bc6d705 AW-6495 Exception editor croppingscheme: do not use 'item' in route
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-11-15 14:06:33 +01:00
d4a230f96d AW-6495 Exception editor croppingscheme: do not use 'item' in route 2024-11-15 14:06:11 +01:00

View File

@ -134,15 +134,22 @@ export class AppCommonEffects {
withLatestFrom(this.store$.select(appCommonReducers.selectGetItemTypes)), withLatestFrom(this.store$.select(appCommonReducers.selectGetItemTypes)),
switchMap(([action, itemtypes]) => { switchMap(([action, itemtypes]) => {
const a = action as appCommonActions.EditItem; const a = action as appCommonActions.EditItem;
var editor = "property"; var editor = "property";
if(a.item.itemType) { if(a.item.itemType) {
const itemType = itemtypes[a.item.itemType]; const itemType = itemtypes[a.item.itemType];
var editor = itemType && itemType.editor ? itemType.editor : editor; var editor = itemType && itemType.editor ? itemType.editor : editor;
} }
this.router$.navigate(['/editor',editor,'item', a.item.code]) if (editor == 'croppingscheme') {
return []; // Exeception: no 'item' in route
} this.router$.navigate(['/editor', editor, a.item.code])
))); }
else {
this.router$.navigate(['/editor', editor, 'item', a.item.code])
}
return [];
}
)
));
viewItem$ = createEffect(() => this.actions$.pipe( viewItem$ = createEffect(() => this.actions$.pipe(
ofType(appCommonActions.VIEWITEM), ofType(appCommonActions.VIEWITEM),