Skip to content

Commit

Permalink
fix select UI validation
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Nov 6, 2016
1 parent ce5523e commit 819c517
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/core/uis/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// For all details and documentation:
// http://www.getdirectus.com

define(['app', 'core/UIComponent', 'core/UIView', 'core/t'],function(app, UIComponent, UIView, __t) {
define(['app', 'core/UIComponent', 'core/UIView', 'core/t', 'utils'],function(app, UIComponent, UIView, __t, Utils) {

'use strict';

Expand Down Expand Up @@ -69,7 +69,7 @@ define(['app', 'core/UIComponent', 'core/UIView', 'core/t'],function(app, UIComp
],
Input: Input,
validate: function(value, options) {
if (options.schema.isRequired() && _.isEmpty(value)) {
if (options.schema.isRequired() && Utils.isEmpty(value)) {
return __t('this_field_is_required');
}
},
Expand Down
4 changes: 4 additions & 0 deletions app/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,9 @@ define(function() {
return value != false;
};

Utils.isEmpty = function(value) {
return value == null || value === '';
};

return Utils;
});

0 comments on commit 819c517

Please sign in to comment.