diff --git a/db/demo.tar b/db/demo.tar index 43a3a8609..19f0c0415 100644 Binary files a/db/demo.tar and b/db/demo.tar differ diff --git a/src/public/javascripts/dialogs/attributes.js b/src/public/javascripts/dialogs/attributes.js index dde933b04..b742829df 100644 --- a/src/public/javascripts/dialogs/attributes.js +++ b/src/public/javascripts/dialogs/attributes.js @@ -67,7 +67,8 @@ function AttributesModel() { attr.labelDefinition = (attr.type === 'label-definition' && attr.value) ? attr.value : { labelType: "text", multiplicityType: "singlevalue", - isPromoted: true + isPromoted: true, + numberPrecision: 0 }; attr.relationDefinition = (attr.type === 'relation-definition' && attr.value) ? attr.value : { @@ -187,7 +188,8 @@ function AttributesModel() { labelDefinition: { labelType: "text", multiplicityType: "singlevalue", - isPromoted: true + isPromoted: true, + numberPrecision: 0 }, relationDefinition: { multiplicityType: "singlevalue", diff --git a/src/public/javascripts/services/attributes.js b/src/public/javascripts/services/attributes.js index 893e73a5c..3b184a917 100644 --- a/src/public/javascripts/services/attributes.js +++ b/src/public/javascripts/services/attributes.js @@ -3,9 +3,7 @@ import utils from "./utils.js"; import messagingService from "./messaging.js"; import treeUtils from "./tree_utils.js"; import noteAutocompleteService from "./note_autocomplete.js"; -import treeService from "./tree.js"; import linkService from "./link.js"; -import infoService from "./info.js"; import noteDetailService from "./note_detail.js"; const $attributeList = $("#attribute-list"); @@ -163,6 +161,14 @@ async function createPromotedAttributeRow(definitionAttr, valueAttr) { } else if (definition.labelType === 'number') { $input.prop("type", "number"); + + let step = 1; + + for (let i = 0; i < (definition.numberPrecision || 0) && i < 10; i++) { + step /= 10; + } + + $input.prop("step", step); } else if (definition.labelType === 'boolean') { $input.prop("type", "checkbox"); diff --git a/src/views/dialogs/attributes.ejs b/src/views/dialogs/attributes.ejs index 8d91ea044..204d1d594 100644 --- a/src/views/dialogs/attributes.ejs +++ b/src/views/dialogs/attributes.ejs @@ -64,6 +64,11 @@ data-bind="checked: labelDefinition.isPromoted"/> Promoted + +