Work on refactoring measurements out of Lesion Tracker package
- Removed AssociatedStudies Collection - Measurement API is generated from configuration files - Data exchange methods are defined in configuration
This commit is contained in:
1 parent
c511edd419
commit
ab4d4c9008
537 files changed
+5122
-3545
No files matched your search
@@ -0,0 +1,39 @@
|
||||
function humanize(text) {
|
||||
var humanized = text.replace(/([A-Z])/g, ' $1'); // insert a space before all caps
|
||||
humanized = humanized.replace(/^./, function(str) { // uppercase the first character
|
||||
return str.toUpperCase();
|
||||
})
|
||||
return humanized;
|
||||
}
|
||||
|
||||
UI.registerHelper('displayConstraint', function(attribute, constraint) {
|
||||
if (!constraint) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!attribute) {
|
||||
return;
|
||||
}
|
||||
|
||||
var validatorType = Object.keys(constraint)[0];
|
||||
if (!attribute) {
|
||||
return;
|
||||
}
|
||||
|
||||
var validator = Object.keys(constraint[validatorType])[0];
|
||||
if (!attribute) {
|
||||
return;
|
||||
}
|
||||
|
||||
var value = constraint[validatorType][validator];
|
||||
if (value === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
var comparator = validator;
|
||||
if (validator === 'value') {
|
||||
comparator = validatorType;
|
||||
}
|
||||
|
||||
return humanize(attribute) + ' ' + humanize(comparator).toLowerCase() + ' ' + value;
|
||||
});
|
||||
Reference in new issue
Block a user