diff --git a/src/entities/note.js b/src/entities/note.js index 96c23b0dc..81b9d40d0 100644 --- a/src/entities/note.js +++ b/src/entities/note.js @@ -400,7 +400,7 @@ class Note extends Entity { const definition = definitionAttr.value; - if (definition.multiplicityType === 'multivalue') { + if (definition.multiplicityType === 'multi') { return true; } else { diff --git a/src/public/app/widgets/promoted_attributes.js b/src/public/app/widgets/promoted_attributes.js index 9fc8414bd..b12e5d960 100644 --- a/src/public/app/widgets/promoted_attributes.js +++ b/src/public/app/widgets/promoted_attributes.js @@ -51,7 +51,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget { return; } - const cells = []; + const $cells = []; for (const definitionAttr of promotedDefAttrs) { const valueType = definitionAttr.name.startsWith('label:') ? 'label' : 'relation'; @@ -68,20 +68,20 @@ export default class PromotedAttributesWidget extends TabAwareWidget { }); } - if (definitionAttr.value.multiplicity === 'single') { + if (definitionAttr.getDefinition().multiplicity === 'single') { valueAttrs = valueAttrs.slice(0, 1); } for (const valueAttr of valueAttrs) { const $cell = await this.createPromotedAttributeCell(definitionAttr, valueAttr, valueName); - cells.push($cell); + $cells.push($cell); } } // we replace the whole content in one step so there can't be any race conditions // (previously we saw promoted attributes doubling) - this.$container.empty().append(...cells); + this.$container.empty().append(...$cells); this.toggleInt(true); } @@ -212,7 +212,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget { return; } - if (definition.multiplicity === "multivalue") { + if (definition.multiplicity === "multi") { const addButton = $("") .addClass("bx bx-plus pointer") .prop("title", "Add new attribute") @@ -220,9 +220,9 @@ export default class PromotedAttributesWidget extends TabAwareWidget { const $new = await this.createPromotedAttributeCell(definitionAttr, { attributeId: "", type: valueAttr.type, - name: definitionAttr.name, + name: valueName, value: "" - }); + }, valueName); $wrapper.after($new); @@ -240,7 +240,11 @@ export default class PromotedAttributesWidget extends TabAwareWidget { $wrapper.remove(); }); - $multiplicityCell.append(addButton).append("  ").append(removeButton); + $multiplicityCell + .append("  ") + .append(addButton) + .append("  ") + .append(removeButton); } return $wrapper; diff --git a/src/views/desktop.ejs b/src/views/desktop.ejs index af4aa1972..528c24f20 100644 --- a/src/views/desktop.ejs +++ b/src/views/desktop.ejs @@ -19,7 +19,6 @@ <%- include('dialogs/about.ejs') %> <%- include('dialogs/add_link.ejs') %> -<%- include('dialogs/attributes.ejs') %> <%- include('dialogs/branch_prefix.ejs') %> <%- include('dialogs/export.ejs') %> <%- include('dialogs/import.ejs') %> diff --git a/src/views/dialogs/attributes.ejs b/src/views/dialogs/attributes.ejs deleted file mode 100644 index 458e87b87..000000000 --- a/src/views/dialogs/attributes.ejs +++ /dev/null @@ -1,155 +0,0 @@ -