diff --git a/assets/javascripts/wizard/controllers/custom-step.js.es6 b/assets/javascripts/wizard/controllers/custom-step.js.es6 index 1881764c..892f785b 100644 --- a/assets/javascripts/wizard/controllers/custom-step.js.es6 +++ b/assets/javascripts/wizard/controllers/custom-step.js.es6 @@ -4,6 +4,7 @@ import getUrl from 'discourse-common/lib/get-url'; export default StepController.extend({ actions: { goNext(response) { + debugger; const next = this.get('step.next'); if (response.redirect_on_next) { window.location.href = response.redirect_on_next; diff --git a/assets/javascripts/wizard/templates/components/wizard-field-number.hbs b/assets/javascripts/wizard/templates/components/wizard-field-number.hbs new file mode 100644 index 00000000..33fae047 --- /dev/null +++ b/assets/javascripts/wizard/templates/components/wizard-field-number.hbs @@ -0,0 +1 @@ +{{input type='number' step='0.01' id=field.id value=field.value}} \ No newline at end of file diff --git a/lib/custom_wizard/builder.rb b/lib/custom_wizard/builder.rb index ea8bdc01..7298e9ac 100644 --- a/lib/custom_wizard/builder.rb +++ b/lib/custom_wizard/builder.rb @@ -330,6 +330,7 @@ class CustomWizard::Builder end def validate_field(field, updater, step_template) + byebug value = updater.fields[field['id']] min_length = false label = field['label'] || I18n.t("#{field['key']}.label") @@ -356,6 +357,7 @@ class CustomWizard::Builder validator[:block].call(field, updater, step_template) end end + byebug end def is_text_type(field) diff --git a/lib/custom_wizard/field.rb b/lib/custom_wizard/field.rb index c68379a6..2afc3237 100644 --- a/lib/custom_wizard/field.rb +++ b/lib/custom_wizard/field.rb @@ -1,6 +1,6 @@ class CustomWizard::Field def self.types - @types ||= ['checkbox', 'composer', 'dropdown', 'tag', 'category', 'image', 'text', 'textarea', 'text-only', 'upload', 'user-selector'] + @types ||= ['checkbox', 'composer', 'dropdown', 'tag', 'category', 'image', 'text', 'textarea', 'text-only', 'number', 'upload', 'user-selector'] end def self.require_assets