0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 02:50:28 +01:00

first feature commit

Dieser Commit ist enthalten in:
Robert Barrow 2020-03-23 14:49:39 +00:00
Ursprung 0390f742a8
Commit f2d7f57bb6
4 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -4,6 +4,7 @@ import getUrl from 'discourse-common/lib/get-url';
export default StepController.extend({ export default StepController.extend({
actions: { actions: {
goNext(response) { goNext(response) {
debugger;
const next = this.get('step.next'); const next = this.get('step.next');
if (response.redirect_on_next) { if (response.redirect_on_next) {
window.location.href = response.redirect_on_next; window.location.href = response.redirect_on_next;

Datei anzeigen

@ -0,0 +1 @@
{{input type='number' step='0.01' id=field.id value=field.value}}

Datei anzeigen

@ -330,6 +330,7 @@ class CustomWizard::Builder
end end
def validate_field(field, updater, step_template) def validate_field(field, updater, step_template)
byebug
value = updater.fields[field['id']] value = updater.fields[field['id']]
min_length = false min_length = false
label = field['label'] || I18n.t("#{field['key']}.label") label = field['label'] || I18n.t("#{field['key']}.label")
@ -356,6 +357,7 @@ class CustomWizard::Builder
validator[:block].call(field, updater, step_template) validator[:block].call(field, updater, step_template)
end end
end end
byebug
end end
def is_text_type(field) def is_text_type(field)

Datei anzeigen

@ -1,6 +1,6 @@
class CustomWizard::Field class CustomWizard::Field
def self.types 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 end
def self.require_assets def self.require_assets