Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: implement a way to temporarily ignore redirect #265

Merged
merged 5 commits into from Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -30,6 +30,7 @@ export default {
.concat(["loading"]);
if (
redirectToWizard &&
!data.url.includes("ignore_redirect") &&
data.currentRouteName !== "customWizardStep" &&
!excludedPaths.find((p) => {
return data.currentRouteName.indexOf(p) > -1;
Expand Down
2 changes: 1 addition & 1 deletion plugin.rb
@@ -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.18
# version: 2.4.19
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
# url: https://github.com/paviliondev/discourse-custom-wizard
# contact_emails: development@pavilion.tech
Expand Down
9 changes: 9 additions & 0 deletions test/javascripts/acceptance/wizard-test.js
Expand Up @@ -74,6 +74,15 @@ acceptance("Wizard | Redirect", function (needs) {
"pending wizard routing works"
);
});

test("Don't redirect to pending Wizard when ingore redirect param is supplied", async function (assert) {
sinon.stub(DiscourseURL, "routeTo");
await visit("/latest?ignore_redirect=1");
assert.notOk(
DiscourseURL.routeTo.calledWith("/w/wizard"),
"pending wizard routing blocked"
);
});
});

acceptance("Wizard | Wizard", function (needs) {
Expand Down