mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 05:55:09 +02:00
Rework Attachments as a bag (#193)
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
@@ -17,7 +17,7 @@ import { Builder } from '@anticrm/model'
|
||||
import core from './component'
|
||||
import { TAttribute, TClass, TDoc, TMixin, TObj, TType, TTypeString } from './core'
|
||||
import { TSpace, TAccount, TState } from './security'
|
||||
import { TTx, TTxCreateDoc, TTxMixin, TTxUpdateDoc, TTxCUD } from './tx'
|
||||
import { TTx, TTxCreateDoc, TTxMixin, TTxUpdateDoc, TTxCUD, TTxPutBag } from './tx'
|
||||
|
||||
export * from './core'
|
||||
export * from './security'
|
||||
@@ -33,6 +33,7 @@ export function createModel (builder: Builder): void {
|
||||
TTx,
|
||||
TTxCUD,
|
||||
TTxCreateDoc,
|
||||
TTxPutBag,
|
||||
TTxMixin,
|
||||
TTxUpdateDoc,
|
||||
TSpace,
|
||||
|
||||
+10
-1
@@ -27,7 +27,9 @@ import type {
|
||||
TxUpdateDoc,
|
||||
TxMixin,
|
||||
Mixin,
|
||||
ExtendedAttributes
|
||||
ExtendedAttributes,
|
||||
PropertyType,
|
||||
TxPutBag
|
||||
} from '@anticrm/core'
|
||||
import { DOMAIN_TX } from '@anticrm/core'
|
||||
import { Model } from '@anticrm/model'
|
||||
@@ -52,6 +54,13 @@ export class TTxCreateDoc<T extends Doc> extends TTxCUD<T> implements TxCreateDo
|
||||
attributes!: Data<T>
|
||||
}
|
||||
|
||||
@Model(core.class.TxPutBag, core.class.TxCUD)
|
||||
export class TTxPutBag<T extends PropertyType> extends TTxCUD<Doc> implements TxPutBag<T> {
|
||||
bag!: string
|
||||
key!: string
|
||||
value!: T
|
||||
}
|
||||
|
||||
@Model(core.class.TxMixin, core.class.TxCUD)
|
||||
export class TTxMixin<D extends Doc, M extends D> extends TTxCUD<D> implements TxMixin<D, M> {
|
||||
mixin!: Ref<Mixin<M>>
|
||||
|
||||
Reference in New Issue
Block a user