mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-23 05:53:09 +03:00
kanban fix
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
096fe284da
commit
3eab42c15b
@ -148,7 +148,7 @@
|
||||
<div class="flex-grow caption-color"><AttributeEditor maxWidth="20rem" _class={core.class.State} object={state} key="title"/></div>
|
||||
<div class="tool hover-trans"
|
||||
on:click={(ev) => {
|
||||
showPopup(StatusesPopup, { state, spaceClass }, ev.target, (result) => { if (result) console.log('StatusesPopup:', result) })
|
||||
showPopup(StatusesPopup, { kanban, state, spaceClass }, ev.target, (result) => { if (result) console.log('StatusesPopup:', result) })
|
||||
}}
|
||||
>
|
||||
<IconMoreH size={'medium'} />
|
||||
|
@ -19,10 +19,13 @@
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { Label, showPopup } from '@anticrm/ui'
|
||||
import { getClient, MessageBox } from '@anticrm/presentation'
|
||||
import type { Kanban } from '@anticrm/view'
|
||||
import Delete from './icons/Delete.svelte'
|
||||
|
||||
import workbench from '@anticrm/workbench'
|
||||
import view from '@anticrm/view'
|
||||
|
||||
export let kanban: Kanban
|
||||
export let state: State
|
||||
export let spaceClass: Ref<Class<Obj>>
|
||||
|
||||
@ -32,8 +35,8 @@
|
||||
|
||||
async function deleteState() {
|
||||
const spaceClassInstance = client.getHierarchy().getClass(spaceClass)
|
||||
const view = client.getHierarchy().as(spaceClassInstance, workbench.mixin.SpaceView)
|
||||
const containingClass = view.view.class
|
||||
const spaceView = client.getHierarchy().as(spaceClassInstance, workbench.mixin.SpaceView)
|
||||
const containingClass = spaceView.view.class
|
||||
|
||||
const objectsInThisState = await client.findAll(containingClass, { state: state._id })
|
||||
|
||||
@ -46,8 +49,9 @@
|
||||
showPopup(MessageBox, {
|
||||
label: 'Delete status',
|
||||
message: 'Do you want to delete this status?'
|
||||
}, undefined, (result) => {
|
||||
}, undefined, async (result) => {
|
||||
if (result) {
|
||||
await client.updateDoc(view.class.Kanban, kanban.space, kanban._id, { $pull: { states: state._id } })
|
||||
client.removeDoc(state._class, state.space, state._id)
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user