discourse/lib/wizard/step.rb
Penar Musaraj efee8ea4fc
UX: One step wizard (#36082)
Consolidates all three wizard screens into one. Cleans up some leftover,
unused wizard elements (checkbox, image, canvas inputs).

Internal ticket: t/164852

<img width="2880" height="2376" alt="CleanShot 2025-11-25 at 10 35
43@2x"
src="https://github.com/user-attachments/assets/f824a172-38b0-4fda-922a-3732335b93b2"
/>

---------

Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
2025-11-25 13:35:32 -05:00

29 lines
502 B
Ruby

# frozen_string_literal: true
class Wizard
class Step
attr_reader :id, :updater
attr_accessor :index, :fields, :next, :previous, :disabled, :emoji
def initialize(id)
@id = id
@fields = []
end
def add_field(attrs)
field = Field.new(attrs)
field.step = self
@fields << field
yield field if block_given?
field
end
def has_fields?
@fields.present?
end
def on_update(&block)
@updater = block
end
end
end