diff --git a/models/tags/src/index.ts b/models/tags/src/index.ts index 1763b17e30..8017368ac4 100644 --- a/models/tags/src/index.ts +++ b/models/tags/src/index.ts @@ -88,9 +88,6 @@ export function createModel (builder: Builder): void { builder.createModel(TTagElement, TTagReference, TTagCategory) builder.mixin(tags.class.TagReference, core.class.Class, view.mixin.CollectionEditor, { - editor: tags.component.Tags - }) - builder.mixin(tags.class.TagReference, core.class.Class, view.mixin.AttributeEditor, { editor: tags.component.TagsAttributeEditor }) diff --git a/packages/presentation/src/components/AttributeBarEditor.svelte b/packages/presentation/src/components/AttributeBarEditor.svelte index 46d20d205f..1057ac9462 100644 --- a/packages/presentation/src/components/AttributeBarEditor.svelte +++ b/packages/presentation/src/components/AttributeBarEditor.svelte @@ -41,16 +41,24 @@ attribute: AnyAttribute, presenterClass?: { attrClass: Ref>; category: AttributeCategory } ): void { - if (presenterClass?.attrClass !== undefined && presenterClass?.category === 'attribute') { - const typeClass = hierarchy.getClass(presenterClass.attrClass) - const editorMixin = hierarchy.as(typeClass, view.mixin.AttributeEditor) - editor = getResource(editorMixin.editor).catch((cause) => { - console.error(`failed to find editor for ${_class} ${attribute} ${presenterClass.attrClass} cause: ${cause}`) - }) + if (presenterClass?.attrClass === undefined) { + return } - if (presenterClass?.attrClass !== undefined && presenterClass?.category === 'array') { + const category = presenterClass.category + let mixinRef = undefined + if (category === 'attribute') { + mixinRef = view.mixin.AttributeEditor + } + if (category === 'collection') { + mixinRef = view.mixin.CollectionEditor + } + if (category === 'array') { + mixinRef = view.mixin.ArrayEditor + } + + if (mixinRef !== undefined) { const typeClass = hierarchy.getClass(presenterClass.attrClass) - const editorMixin = hierarchy.as(typeClass, view.mixin.ArrayEditor) + const editorMixin = hierarchy.as(typeClass, mixinRef) editor = getResource(editorMixin.editor).catch((cause) => { console.error(`failed to find editor for ${_class} ${attribute} ${presenterClass.attrClass} cause: ${cause}`) })