mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-20 07:10:02 +00:00
Fix open action (#3007)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
4a29f8dc8b
commit
76952a4fe9
@ -921,15 +921,6 @@ export function createModel (builder: Builder): void {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
createAction(builder, {
|
|
||||||
...viewTemplates.open,
|
|
||||||
target: recruit.class.Applicant,
|
|
||||||
context: {
|
|
||||||
mode: ['browser', 'context'],
|
|
||||||
group: 'create'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
createAction(builder, {
|
createAction(builder, {
|
||||||
...viewTemplates.open,
|
...viewTemplates.open,
|
||||||
target: recruit.class.ApplicantMatch,
|
target: recruit.class.ApplicantMatch,
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
AnySvelteComponent,
|
AnySvelteComponent,
|
||||||
closeTooltip,
|
closeTooltip,
|
||||||
isPopupPosAlignment,
|
isPopupPosAlignment,
|
||||||
|
navigate,
|
||||||
PopupAlignment,
|
PopupAlignment,
|
||||||
PopupPosAlignment,
|
PopupPosAlignment,
|
||||||
showPanel,
|
showPanel,
|
||||||
@ -16,7 +17,7 @@ import MoveView from './components/Move.svelte'
|
|||||||
import { contextStore } from './context'
|
import { contextStore } from './context'
|
||||||
import view from './plugin'
|
import view from './plugin'
|
||||||
import { FocusSelection, focusStore, previewDocument, SelectDirection, selectionStore } from './selection'
|
import { FocusSelection, focusStore, previewDocument, SelectDirection, selectionStore } from './selection'
|
||||||
import { deleteObjects } from './utils'
|
import { deleteObjects, getObjectLinkFragment } from './utils'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action to be used for copying text to clipboard.
|
* Action to be used for copying text to clipboard.
|
||||||
@ -144,7 +145,7 @@ function ShowPreview (doc: Doc | undefined, evt: Event): void {
|
|||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
function Open (
|
async function Open (
|
||||||
doc: Doc,
|
doc: Doc,
|
||||||
evt: Event,
|
evt: Event,
|
||||||
props:
|
props:
|
||||||
@ -152,9 +153,14 @@ function Open (
|
|||||||
component?: AnyComponent
|
component?: AnyComponent
|
||||||
}
|
}
|
||||||
| undefined
|
| undefined
|
||||||
): void {
|
): Promise<void> {
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
showPanel(props?.component ?? view.component.EditDoc, doc._id, Hierarchy.mixinOrClass(doc), 'content')
|
const client = getClient()
|
||||||
|
const hierarchy = client.getHierarchy()
|
||||||
|
const panelComponent = hierarchy.classHierarchyMixin(doc._class, view.mixin.ObjectPanel)
|
||||||
|
const component = props?.component ?? panelComponent?.component ?? view.component.EditDoc
|
||||||
|
const loc = await getObjectLinkFragment(hierarchy, doc, {}, component)
|
||||||
|
navigate(loc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user