mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 14:05:05 +02:00
TSK-833 Доработка Таблицы Vacations TSK-817 Click on Employee is broken, it should open Edit Contact TSK-805 Открывать задачу в новой вкладке при клике колесиком TSK-794 Прикрепление ссылки на вакансию/аппликейшн в чате (#2734)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -38,6 +38,7 @@ import {
|
||||
AnyComponent,
|
||||
ErrorPresenter,
|
||||
getCurrentLocation,
|
||||
getPanelURI,
|
||||
getPlatformColorForText,
|
||||
Location,
|
||||
locationToUrl
|
||||
@@ -674,3 +675,25 @@ export function getAdditionalHeader (client: TxOperations, _class: Ref<Class<Doc
|
||||
}
|
||||
return presenterMixin.presenters
|
||||
}
|
||||
|
||||
export async function getObjectLinkFragment (
|
||||
hierarchy: Hierarchy,
|
||||
object: Doc,
|
||||
props: Record<string, any> = {},
|
||||
component: AnyComponent = view.component.EditDoc
|
||||
): Promise<string> {
|
||||
let clazz = hierarchy.getClass(object._class)
|
||||
let provider = hierarchy.as(clazz, view.mixin.LinkProvider)
|
||||
while (provider.encode === undefined && clazz.extends !== undefined) {
|
||||
clazz = hierarchy.getClass(clazz.extends)
|
||||
provider = hierarchy.as(clazz, view.mixin.LinkProvider)
|
||||
}
|
||||
if (provider?.encode !== undefined) {
|
||||
const f = await getResource(provider.encode)
|
||||
const res = await f(object, props)
|
||||
if (res !== undefined) {
|
||||
return res
|
||||
}
|
||||
}
|
||||
return getPanelURI(component, object._id, Hierarchy.mixinOrClass(object), 'content')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user