mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-20 23:32:14 +00:00
UBERF-4870: Fixed attribute creation (#4325)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
5d889380ab
commit
6abf41cd0f
@ -41,6 +41,7 @@
|
|||||||
Label,
|
Label,
|
||||||
Menu,
|
Menu,
|
||||||
getEventPositionElement,
|
getEventPositionElement,
|
||||||
|
getEventPopupPositionElement,
|
||||||
showPopup
|
showPopup
|
||||||
} from '@hcengineering/ui'
|
} from '@hcengineering/ui'
|
||||||
import { getContextActions } from '@hcengineering/view-resources'
|
import { getContextActions } from '@hcengineering/view-resources'
|
||||||
@ -48,6 +49,8 @@
|
|||||||
import CreateAttribute from './CreateAttribute.svelte'
|
import CreateAttribute from './CreateAttribute.svelte'
|
||||||
import EditAttribute from './EditAttribute.svelte'
|
import EditAttribute from './EditAttribute.svelte'
|
||||||
import EditClassLabel from './EditClassLabel.svelte'
|
import EditClassLabel from './EditClassLabel.svelte'
|
||||||
|
import { settingsStore } from '../store'
|
||||||
|
import TypesPopup from './typeEditors/TypesPopup.svelte'
|
||||||
|
|
||||||
export let _class: Ref<Class<Doc>>
|
export let _class: Ref<Class<Doc>>
|
||||||
export let ofClass: Ref<Class<Doc>> | undefined = undefined
|
export let ofClass: Ref<Class<Doc>> | undefined = undefined
|
||||||
@ -95,8 +98,10 @@
|
|||||||
attributes = getCustomAttributes(_class)
|
attributes = getCustomAttributes(_class)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createAttribute (): void {
|
export function createAttribute (ev: MouseEvent): void {
|
||||||
showPopup(CreateAttribute, { _class }, 'top', update)
|
showPopup(TypesPopup, { _class }, getEventPopupPositionElement(ev), (_id) => {
|
||||||
|
if (_id !== undefined) $settingsStore = { component: CreateAttribute, props: { _id, _class } }
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function editAttribute (attribute: AnyAttribute, exist: boolean): Promise<void> {
|
export async function editAttribute (attribute: AnyAttribute, exist: boolean): Promise<void> {
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
<ObjectPresenter _class={clazz._class} objectId={clazz._id} value={clazz} />
|
<ObjectPresenter _class={clazz._class} objectId={clazz._id} value={clazz} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<Button icon={IconAdd} size={'small'} kind={'primary'} on:click={() => mainAttributes?.createAttribute()} />
|
<Button icon={IconAdd} size={'small'} kind={'primary'} on:click={(ev) => mainAttributes?.createAttribute(ev)} />
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-2 mr-2">
|
<div class="ml-2 mr-2">
|
||||||
<table class="antiTable mx-2">
|
<table class="antiTable mx-2">
|
||||||
|
Loading…
Reference in New Issue
Block a user