mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-22 01:25:00 +02:00
UBERF-65 Use ObjectPanel from class hierarchy (#3649)
Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
@@ -229,9 +229,8 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Reso
|
||||
}
|
||||
if (hierarchy.isDerived(doc._class, chunter.class.Comment)) {
|
||||
const comment = doc as Comment
|
||||
const targetClass = hierarchy.getClass(comment.attachedToClass)
|
||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||
const component = panelComponent.component ?? view.component.EditDoc
|
||||
const panelComponent = hierarchy.classHierarchyMixin(comment.attachedToClass, view.mixin.ObjectPanel)
|
||||
const component = panelComponent?.component ?? view.component.EditDoc
|
||||
return {
|
||||
loc: {
|
||||
path: [appComponent, workspace],
|
||||
|
||||
@@ -133,9 +133,8 @@
|
||||
})
|
||||
|
||||
notification.onclick = () => {
|
||||
const targetClass = hierarchy.getClass(notifyInstance.attachedToClass)
|
||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||
const component = panelComponent.component ?? view.component.EditDoc
|
||||
const panelComponent = hierarchy.classHierarchyMixin(notifyInstance.attachedToClass, view.mixin.ObjectPanel)
|
||||
const component = panelComponent?.component ?? view.component.EditDoc
|
||||
showPanel(component, notifyInstance.attachedTo, notifyInstance.attachedToClass, 'content')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,9 +86,8 @@
|
||||
if (hierarchy.isDerived(value.attachedToClass, chunter.class.ChunterSpace)) {
|
||||
openDM(value.attachedTo)
|
||||
} else {
|
||||
const targetClass = hierarchy.getClass(value.attachedToClass)
|
||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||
component = panelComponent.component ?? view.component.EditDoc
|
||||
const panelComponent = hierarchy.classHierarchyMixin(value.attachedToClass, view.mixin.ObjectPanel)
|
||||
component = panelComponent?.component ?? view.component.EditDoc
|
||||
_id = value.attachedTo
|
||||
_class = value.attachedToClass
|
||||
}
|
||||
@@ -96,9 +95,11 @@
|
||||
|
||||
function openDM (value: Ref<Doc>) {
|
||||
if (value) {
|
||||
const targetClass = hierarchy.getClass(chunter.class.DirectMessage)
|
||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||
component = panelComponent.component ?? view.component.EditDoc
|
||||
const panelComponent = hierarchy.classHierarchyMixin(
|
||||
chunter.class.DirectMessage as Ref<Class<Doc>>,
|
||||
view.mixin.ObjectPanel
|
||||
)
|
||||
component = panelComponent?.component ?? view.component.EditDoc
|
||||
_id = value
|
||||
_class = chunter.class.DirectMessage
|
||||
const loc = getLocation()
|
||||
|
||||
@@ -65,9 +65,8 @@ async function generateIdLocation (loc: Location, shortLink: string): Promise<Re
|
||||
}
|
||||
const appComponent = loc.path[0] ?? ''
|
||||
const workspace = loc.path[1] ?? ''
|
||||
const targetClass = hierarchy.getClass(recruit.mixin.Candidate)
|
||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||
const component = panelComponent.component ?? view.component.EditDoc
|
||||
const objectPanel = hierarchy.classHierarchyMixin(recruit.mixin.Candidate as Ref<Class<Doc>>, view.mixin.ObjectPanel)
|
||||
const component = objectPanel?.component ?? view.component.EditDoc
|
||||
const special = _class === recruit.mixin.Candidate ? 'talents' : 'organizations'
|
||||
const defaultPath = [appComponent, workspace, recruitId, special]
|
||||
|
||||
@@ -111,9 +110,8 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Reso
|
||||
}
|
||||
const appComponent = loc.path[0] ?? ''
|
||||
const workspace = loc.path[1] ?? ''
|
||||
const targetClass = hierarchy.getClass(_class)
|
||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||
const component = panelComponent.component ?? view.component.EditDoc
|
||||
const objectPanel = hierarchy.classHierarchyMixin(_class, view.mixin.ObjectPanel)
|
||||
const component = objectPanel?.component ?? view.component.EditDoc
|
||||
const defaultPath = [appComponent, workspace, recruitId]
|
||||
if (_class === recruit.class.Vacancy) {
|
||||
defaultPath.push('vacancies')
|
||||
|
||||
Reference in New Issue
Block a user