attr detail handles label/relation definition updates

This commit is contained in:
zadam
2020-07-18 23:45:28 +02:00
parent 9d46c7253b
commit df69b1d8dd
5 changed files with 190 additions and 98 deletions

View File

@@ -234,20 +234,24 @@ export default class AttributeEditorWidget extends TabAwareWidget {
return;
}
let type, name;
let type, name, value;
if (command === 'addNewLabel') {
type = 'label';
name = 'fillName';
name = 'myLabel';
value = '';
} else if (command === 'addNewRelation') {
type = 'relation';
name = 'fillName';
name = 'myRelation';
value = '';
} else if (command === 'addNewLabelDefinition') {
type = 'label';
name = 'label:fillName';
name = 'label:myLabel';
value = 'promoted,single,text';
} else if (command === 'addNewRelationDefinition') {
type = 'label';
name = 'relation:fillName';
name = 'relation:myRelation';
value = 'promoted,single';
} else {
return;
}
@@ -255,7 +259,7 @@ export default class AttributeEditorWidget extends TabAwareWidget {
attrs.push({
type,
name,
value: '',
value,
isInheritable: false
});
@@ -347,7 +351,7 @@ export default class AttributeEditorWidget extends TabAwareWidget {
let matchedAttr = null;
for (const attr of parsedAttrs) {
if (clickIndex >= attr.startIndex && clickIndex <= attr.endIndex) {
if (clickIndex > attr.startIndex && clickIndex <= attr.endIndex) {
matchedAttr = attr;
break;
}