mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00:00
Direct open Candidate from Candidates (#1076)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
3acd536335
commit
0d7857fe99
@ -59,6 +59,11 @@ export class Hierarchy {
|
||||
return _mixinClass(doc)
|
||||
}
|
||||
|
||||
static mixinOrClass<D extends Doc, M extends D>(doc: D): Ref<Mixin<M> | Class<Doc>> {
|
||||
const m = _mixinClass(doc)
|
||||
return m ?? doc._class
|
||||
}
|
||||
|
||||
hasMixin<D extends Doc, M extends D>(doc: D, mixin: Ref<Mixin<M>>): boolean {
|
||||
const d = Hierarchy.toDoc(doc)
|
||||
return typeof (d as any)[mixin] === 'object'
|
||||
|
@ -15,6 +15,7 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { formatName, Person } from '@anticrm/contact'
|
||||
import { Hierarchy } from '@anticrm/core'
|
||||
import { Avatar } from '@anticrm/presentation'
|
||||
import { showPanel } from '@anticrm/ui'
|
||||
import view from '@anticrm/view'
|
||||
@ -23,7 +24,7 @@
|
||||
export let inline: boolean = false
|
||||
|
||||
async function onClick () {
|
||||
showPanel(view.component.EditDoc, value._id, value._class, 'full')
|
||||
showPanel(view.component.EditDoc, value._id, Hierarchy.mixinOrClass(value), 'full')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import contact, { formatName } from '@anticrm/contact'
|
||||
import core, { Class, ClassifierKind, Doc, Mixin, Obj, Ref } from '@anticrm/core'
|
||||
import core, { Class, ClassifierKind, Doc, Hierarchy, Mixin, Obj, Ref } from '@anticrm/core'
|
||||
import notification from '@anticrm/notification'
|
||||
import { Panel } from '@anticrm/panel'
|
||||
import { Asset, getResource, translate } from '@anticrm/platform'
|
||||
import {
|
||||
@ -27,9 +28,8 @@
|
||||
} from '@anticrm/presentation'
|
||||
import { AnyComponent, Component, Label } from '@anticrm/ui'
|
||||
import view from '@anticrm/view'
|
||||
import { createEventDispatcher, afterUpdate, onDestroy } from 'svelte'
|
||||
import { createEventDispatcher, onDestroy } from 'svelte'
|
||||
import { getCollectionCounter, getMixinStyle } from '../utils'
|
||||
import notification from '@anticrm/notification'
|
||||
|
||||
export let _id: Ref<Doc>
|
||||
export let _class: Ref<Class<Doc>>
|
||||
@ -81,7 +81,7 @@
|
||||
|
||||
$: if (object && prevSelected !== object._class) {
|
||||
prevSelected = object._class
|
||||
selectedClass = objectClass._id
|
||||
selectedClass = Hierarchy.mixinOrClass(object)
|
||||
|
||||
parentClass = getParentClass(object._class)
|
||||
mixins = getMixins()
|
||||
|
Loading…
Reference in New Issue
Block a user