Fix contact link resolvers (#3343)

This commit is contained in:
Denis Bykhov 2023-06-05 22:17:16 +06:00 committed by GitHub
parent 149ff49ba3
commit 5a9e9116fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,13 +232,18 @@ async function generateLocation (loc: Location, id: Ref<Contact>): Promise<Resol
}
const appComponent = loc.path[0] ?? ''
const workspace = loc.path[1] ?? ''
const special = client.getHierarchy().isDerived(doc._class, contact.class.Organization)
? 'companies'
: client.getHierarchy().isDerived(doc._class, contact.class.Employee)
? 'employees'
: 'persons'
return {
loc: {
path: [appComponent, workspace],
fragment: getPanelURI(view.component.EditDoc, doc._id, doc._class, 'content')
},
defaultLocation: {
path: [appComponent, workspace, contactId],
path: [appComponent, workspace, contactId, special],
fragment: getPanelURI(view.component.EditDoc, doc._id, doc._class, 'content')
}
}