0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 17:30:29 +01:00

Update field validation

Dieser Commit ist enthalten in:
Angus McLeod 2019-07-31 16:57:25 +10:00
Ursprung f60ae12610
Commit 5b3245c576

Datei anzeigen

@ -204,7 +204,18 @@ export default {
}.property('field.type', 'field.id')
});
const StandardFieldValidation = ['text', 'textarea', 'dropdown', 'tag', 'category', 'image', 'checkbox', 'user-selector', 'text-only', 'composer'];
const StandardFieldValidation = [
'text',
'textarea',
'dropdown',
'tag',
'category',
'image',
'checkbox',
'user-selector',
'text-only',
'composer'
];
FieldModel.reopen({
hasCustomCheck: false,
@ -230,7 +241,7 @@ export default {
if (type === 'checkbox') {
valid = val;
} else if (StandardFieldValidation.indexOf(type) > -1) {
valid = val && val.length > 0;
valid = val && String(val).length > 0;
}
}