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

Merge pull request #249 from paviliondev/fix_reset_behaviour

FIX: upon revisit, start at step 1 if reset on revisit is set
Dieser Commit ist enthalten in:
Angus McLeod 2023-06-21 11:06:42 +02:00 committet von GitHub
Commit 7561bc8042
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 17 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -145,7 +145,7 @@ class CustomWizard::Wizard
step.last_step = true
end
if step.previous && step.previous.id === last_completed_step_id
if !@restart_on_revisit && step.previous && step.previous.id === last_completed_step_id
@start = step.id
end
end

Datei anzeigen

@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-custom-wizard
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
# version: 2.4.5
# version: 2.4.6
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever
# url: https://github.com/paviliondev/discourse-custom-wizard
# contact_emails: development@pavilion.tech

Datei anzeigen

@ -226,6 +226,21 @@ describe CustomWizard::Wizard do
end
end
context "with subscription and restart upon revisit" do
before do
enable_subscription("standard")
@wizard.restart_on_revisit = true
CustomWizard::Template.save(@wizard.as_json)
end
it "returns to step 1 if option to clear submissions on each visit is set" do
append_steps
expect(@wizard.unfinished?).to eq(true)
progress_step('step_1')
expect(@wizard.start).to eq('step_1')
end
end
context "with subscription and guest wizard" do
before do
enable_subscription("standard")