LT-67: Migrating the remaining DicomWEB inputs to components

This commit is contained in:
Bruno Alves de Faria committed 2016-08-30 11:03:57 -03:00
1 parent 18516b47f0
commit 9e2ab2d21a
4 files changed
+31 -19

No files matched your search

@@ -26,6 +26,24 @@ OHIF.mixins.form = new OHIF.Mixin({
component.schema = schema && schema.newContext();
});
// Get a registered item in form by its key
component.item = itemKey => {
let found;
// Iterate over each registered form item
component.registeredItems.forEach(child => {
const key = child.templateInstance.data.key;
// Change the found item if current key is the same as given
if (key === itemKey) {
found = child;
}
});
// Return the found item or undefined if it was not found
return found;
};
// Check if the form data is valid in its schema
component.validate = () => {
// Assume validation result as true