From 7997d34d17d7af783e477fa0bbe50668234649ce Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Mon, 6 Mar 2023 22:44:51 +0700 Subject: [PATCH] Add Bitrix required mixins (#2713) Signed-off-by: Andrey Sobolev --- models/bitrix/src/index.ts | 8 +++- .../src/components/EntityMapping.svelte | 48 ++++++++++++++++++- plugins/bitrix/package.json | 2 +- plugins/bitrix/src/types.ts | 5 +- plugins/bitrix/src/utils.ts | 5 ++ 5 files changed, 63 insertions(+), 5 deletions(-) diff --git a/models/bitrix/src/index.ts b/models/bitrix/src/index.ts index a3055767df..346cbf4298 100644 --- a/models/bitrix/src/index.ts +++ b/models/bitrix/src/index.ts @@ -14,12 +14,12 @@ // limitations under the License. // -import { Builder, Collection, Mixin, Model, Prop, TypeRef, TypeString } from '@hcengineering/model' +import { ArrOf, Builder, Collection, Mixin, Model, Prop, TypeRef, TypeString } from '@hcengineering/model' import core, { TAttachedDoc, TDoc } from '@hcengineering/model-core' import bitrix from './plugin' import { BitrixEntityMapping, BitrixFieldMapping, BitrixSyncDoc, Fields } from '@hcengineering/bitrix' -import { AnyAttribute, Class, Doc, Domain, Ref } from '@hcengineering/core' +import { AnyAttribute, Class, Doc, Domain, Mixin as CoreMixin, Ref } from '@hcengineering/core' import view, { createAction } from '@hcengineering/model-view' @@ -47,6 +47,10 @@ export class TBitrixEntityMapping extends TDoc implements BitrixEntityMapping { comments!: boolean activity!: boolean attachments!: boolean + + @Prop(ArrOf(TypeRef(core.class.Mixin)), core.string.Class) + // If specified, will include this mixins in any case. + mixins!: Ref>[] } @Model(bitrix.class.FieldMapping, core.class.Doc, DOMAIN_BITRIX) diff --git a/plugins/bitrix-resources/src/components/EntityMapping.svelte b/plugins/bitrix-resources/src/components/EntityMapping.svelte index 9881f21d45..b3693769ec 100644 --- a/plugins/bitrix-resources/src/components/EntityMapping.svelte +++ b/plugins/bitrix-resources/src/components/EntityMapping.svelte @@ -12,13 +12,14 @@ import { getEmbeddedLabel } from '@hcengineering/platform' import { createQuery, getClient } from '@hcengineering/presentation' import { ClassSetting } from '@hcengineering/setting-resources' - import { Button, Expandable, Icon, IconDelete, IconEdit, Label, showPopup } from '@hcengineering/ui' + import { Button, Expandable, Icon, IconAdd, IconDelete, IconEdit, Label, showPopup } from '@hcengineering/ui' import bitrix from '../plugin' import AttributeMapper from './AttributeMapper.svelte' import FieldMappingPresenter from './FieldMappingPresenter.svelte' import CheckBox from '@hcengineering/ui/src/components/CheckBox.svelte' + import DropdownLabelsPopup from '@hcengineering/ui/src/components/DropdownLabelsPopup.svelte' import { deepEqual } from 'fast-equals' import BitrixFieldLookup from './BitrixFieldLookup.svelte' import CreateMappingAttribute from './CreateMappingAttribute.svelte' @@ -112,6 +113,51 @@