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:
Ursprung
f60ae12610
Commit
5b3245c576
1 geänderte Dateien mit 13 neuen und 2 gelöschten Zeilen
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Laden …
In neuem Issue referenzieren