AW-823 implementcorrect editor navigation

This commit is contained in:
Willem Dantuma 2020-01-08 14:43:24 +01:00
parent ab99f6722c
commit f21648386b

View File

@ -15,18 +15,20 @@ export abstract class AbstractSelectedItemComponent {
}
handleOnView(item: IItem) {
var itemType = this.itemTypeService.itemTypes[item.itemType];
if (itemType) {
if (itemType.viewer) {
let url = `/viewer/${itemType.viewer}/item/${item.code}`;
this.router.navigate([url]);
}
if (this.itemTypeService.hasViewer(item)) {
let viewer = this.itemTypeService.itemTypes[item.itemType];
let url = `/viewer/${viewer}/item/${item.code}`;
this.router.navigate([url]);
}
return false;
}
handleOnEdit(item: IItem) {
let url = `/editor/property/item/${item.code}`;
var editor = "property";
if(this.itemTypeService.hasEditor(item)) {
editor = this.itemTypeService.itemTypes[item.itemType].editor;
}
let url = `/editor/${editor}/item/${item.code}`
this.router.navigate([url]);
return false;
}