Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2023-09-30 23:52:27 +07:00
committed by GitHub
parent c4e1392960
commit 7f1d23ffa1
18 changed files with 78 additions and 71 deletions
@@ -44,7 +44,9 @@
href = undefined
return
}
const loc = await getObjectLinkFragment(hierarchy, object, props, component)
const panelComponent = hierarchy.classHierarchyMixin(object._class, view.mixin.ObjectPanel)
const comp = panelComponent?.component ?? component
const loc = await getObjectLinkFragment(hierarchy, object, props, comp)
href = `${window.location.origin}${locationToUrl(loc)}`
}
+9 -1
View File
@@ -46,7 +46,8 @@ import {
getCurrentResolvedLocation,
getPanelURI,
getPlatformColorForText,
locationToUrl
locationToUrl,
navigate
} from '@hcengineering/ui'
import type { BuildModelOptions, Viewlet, ViewletDescriptor } from '@hcengineering/view'
import view, { AttributeModel, BuildModelKey } from '@hcengineering/view'
@@ -876,3 +877,10 @@ export function enabledConfig (config: Array<string | BuildModelKey>, key: strin
}
return false
}
export async function openDoc (hierarchy: Hierarchy, object: Doc): Promise<void> {
const panelComponent = hierarchy.classHierarchyMixin(object._class, view.mixin.ObjectPanel)
const comp = panelComponent?.component ?? view.component.EditDoc
const loc = await getObjectLinkFragment(hierarchy, object, {}, comp)
navigate(loc)
}