2022-04-29 05:27:17 +00:00
|
|
|
<script lang="ts">
|
2022-09-21 08:08:25 +00:00
|
|
|
import { Asset } from '@hcengineering/platform'
|
|
|
|
import { getClient } from '@hcengineering/presentation'
|
|
|
|
import { Menu, Action, showPopup, closePopup } from '@hcengineering/ui'
|
|
|
|
import view from '@hcengineering/view'
|
2022-01-11 09:05:53 +00:00
|
|
|
import contact from '../plugin'
|
|
|
|
|
|
|
|
const client = getClient()
|
|
|
|
|
|
|
|
const actions: Action[] = []
|
|
|
|
const hierarchy = client.getHierarchy()
|
|
|
|
|
2022-04-29 05:27:17 +00:00
|
|
|
client
|
|
|
|
.getHierarchy()
|
|
|
|
.getDescendants(contact.class.Contact)
|
|
|
|
.forEach((v) => {
|
|
|
|
const cl = hierarchy.getClass(v)
|
|
|
|
if (hierarchy.hasMixin(cl, view.mixin.ObjectFactory)) {
|
|
|
|
const f = hierarchy.as(cl, view.mixin.ObjectFactory)
|
|
|
|
actions.push({
|
|
|
|
icon: cl.icon as Asset,
|
|
|
|
label: cl.label,
|
|
|
|
action: async () => {
|
|
|
|
closePopup()
|
|
|
|
showPopup(f.component, {}, 'top')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
2022-01-11 09:05:53 +00:00
|
|
|
</script>
|
|
|
|
|
2022-11-17 04:29:58 +00:00
|
|
|
<Menu {actions} on:changeContent />
|