0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 19:10: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') }.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({ FieldModel.reopen({
hasCustomCheck: false, hasCustomCheck: false,
@ -230,7 +241,7 @@ export default {
if (type === 'checkbox') { if (type === 'checkbox') {
valid = val; valid = val;
} else if (StandardFieldValidation.indexOf(type) > -1) { } else if (StandardFieldValidation.indexOf(type) > -1) {
valid = val && val.length > 0; valid = val && String(val).length > 0;
} }
} }