diff --git a/Packages/ohif-core/client/components/base/index.js b/Packages/ohif-core/client/components/base/index.js index 521942557..b6dcb77d9 100644 --- a/Packages/ohif-core/client/components/base/index.js +++ b/Packages/ohif-core/client/components/base/index.js @@ -31,6 +31,7 @@ import './templates/form.html'; import './templates/input.html'; import './templates/link.html'; import './templates/select.html'; +import './templates/tr.html'; // wrappers import './wrappers/label.html'; diff --git a/Packages/ohif-core/client/components/base/mixins/schemaData.js b/Packages/ohif-core/client/components/base/mixins/schemaData.js index 572425a18..5370ad6a6 100644 --- a/Packages/ohif-core/client/components/base/mixins/schemaData.js +++ b/Packages/ohif-core/client/components/base/mixins/schemaData.js @@ -141,19 +141,23 @@ OHIF.mixins.schemaData = new OHIF.Mixin({ component.parseData = value => { // Get the current schema data using component's key const { currentSchema } = getCurrentSchemaDefs(component.parent, instance.data.pathKey); + const { dataType } = instance.data; - // Stop here if there's no schema data for current key - if (!currentSchema) { + // Stop here if there's no schema data for current key or no dataType defined + if (!currentSchema && !dataType) { return value; } - // Check if the schema is a Number - if (currentSchema.type === Number) { + // Get the schema type + const schemaType = currentSchema && currentSchema.type; + + // Check if the type is Number + if (schemaType === Number || dataType === 'Number') { return parseFloat(value); } - // Check if the schema is a Boolean - if (currentSchema.type === Boolean) { + // Check if the type is Boolean + if (schemaType === Boolean || dataType === 'Boolean') { return !!value; } diff --git a/Packages/ohif-core/client/components/base/templates/tr.html b/Packages/ohif-core/client/components/base/templates/tr.html new file mode 100644 index 000000000..003ae583a --- /dev/null +++ b/Packages/ohif-core/client/components/base/templates/tr.html @@ -0,0 +1,9 @@ + diff --git a/Packages/ohif-core/client/components/bootstrap/form/group.html b/Packages/ohif-core/client/components/bootstrap/form/group.html index 3bf8bc0ed..402f38fc2 100644 --- a/Packages/ohif-core/client/components/bootstrap/form/group.html +++ b/Packages/ohif-core/client/components/bootstrap/form/group.html @@ -1,7 +1,7 @@