|
|
|
@ -262,25 +262,26 @@ async function loadAttributes() {
|
|
|
|
if (definition.labelType === 'text') {
|
|
|
|
if (definition.labelType === 'text') {
|
|
|
|
$input.prop("type", "text");
|
|
|
|
$input.prop("type", "text");
|
|
|
|
|
|
|
|
|
|
|
|
const attributeValues = await server.get('attributes/values/' + encodeURIComponent(valueAttr.name));
|
|
|
|
// no need to await for this, can be done asynchronously
|
|
|
|
|
|
|
|
server.get('attributes/values/' + encodeURIComponent(valueAttr.name)).then(attributeValues => {
|
|
|
|
if (attributeValues.length === 0) {
|
|
|
|
if (attributeValues.length === 0) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$input.autocomplete({
|
|
|
|
$input.autocomplete({
|
|
|
|
// shouldn't be required and autocomplete should just accept array of strings, but that fails
|
|
|
|
// shouldn't be required and autocomplete should just accept array of strings, but that fails
|
|
|
|
// because we have overriden filter() function in autocomplete.js
|
|
|
|
// because we have overriden filter() function in autocomplete.js
|
|
|
|
source: attributeValues.map(attribute => {
|
|
|
|
source: attributeValues.map(attribute => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
attribute: attribute,
|
|
|
|
attribute: attribute,
|
|
|
|
value: attribute
|
|
|
|
value: attribute
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
minLength: 0
|
|
|
|
minLength: 0
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$input.focus(() => $input.autocomplete("search", ""));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$input.focus(() => $input.autocomplete("search", ""));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (definition.labelType === 'number') {
|
|
|
|
else if (definition.labelType === 'number') {
|
|
|
|
$input.prop("type", "number");
|
|
|
|
$input.prop("type", "number");
|
|
|
|
@ -352,6 +353,7 @@ async function loadAttributes() {
|
|
|
|
|
|
|
|
|
|
|
|
$multiplicityCell.append(addButton).append(" ").append(removeButton);
|
|
|
|
$multiplicityCell.append(addButton).append(" ").append(removeButton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $tr;
|
|
|
|
return $tr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|