removed not unique warning from attributes dialog as it's more common to have multi value

This commit is contained in:
azivner 2018-08-21 13:51:35 +02:00
parent 71e687ad8e
commit 09b610701d
2 changed files with 0 additions and 19 deletions

View File

@ -208,24 +208,6 @@ function AttributesModel() {
attribute.valueHasMutated(); attribute.valueHasMutated();
}; };
this.isNotUnique = function(index) {
const cur = self.ownedAttributes()[index]();
if (cur.name.trim() === "") {
return false;
}
for (let attributes = self.ownedAttributes(), i = 0; i < attributes.length; i++) {
const attribute = attributes[i]();
if (index !== i && cur.name === attribute.name && cur.type === attribute.type) {
return true;
}
}
return false;
};
this.isEmptyName = function(index) { this.isEmptyName = function(index) {
const cur = self.ownedAttributes()[index](); const cur = self.ownedAttributes()[index]();

View File

@ -620,7 +620,6 @@
<td> <td>
<!-- Change to valueUpdate: blur is necessary because jQuery UI autocomplete hijacks change event --> <!-- Change to valueUpdate: blur is necessary because jQuery UI autocomplete hijacks change event -->
<input type="text" class="attribute-name form-control" data-bind="value: name, valueUpdate: 'blur', event: { blur: $parent.attributeChanged }"/> <input type="text" class="attribute-name form-control" data-bind="value: name, valueUpdate: 'blur', event: { blur: $parent.attributeChanged }"/>
<div style="color: yellowgreen" data-bind="if: $parent.isNotUnique($index())"><span class="glyphicon glyphicon-info-sign"></span> Duplicate attribute.</div>
<div style="color: red" data-bind="if: $parent.isEmptyName($index())">Attribute name can't be empty.</div> <div style="color: red" data-bind="if: $parent.isEmptyName($index())">Attribute name can't be empty.</div>
</td> </td>
<td> <td>