1
0
Fork 0

Merge pull request #265 from paviliondev/temp_ignore_redirect

FEATURE: implement a way to temporarily ignore redirect
Dieser Commit ist enthalten in:
Angus McLeod 2023-09-08 09:53:12 +02:00 committet von GitHub
Commit 52efc15576
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 11 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -30,6 +30,7 @@ export default {
.concat(["loading"]); .concat(["loading"]);
if ( if (
redirectToWizard && redirectToWizard &&
!data.url.includes("ignore_redirect") &&
data.currentRouteName !== "customWizardStep" && data.currentRouteName !== "customWizardStep" &&
!excludedPaths.find((p) => { !excludedPaths.find((p) => {
return data.currentRouteName.indexOf(p) > -1; return data.currentRouteName.indexOf(p) > -1;

Datei anzeigen

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
# name: discourse-custom-wizard # name: discourse-custom-wizard
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more. # 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 # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
# url: https://github.com/paviliondev/discourse-custom-wizard # url: https://github.com/paviliondev/discourse-custom-wizard
# contact_emails: development@pavilion.tech # contact_emails: development@pavilion.tech

Datei anzeigen

@ -74,6 +74,15 @@ acceptance("Wizard | Redirect", function (needs) {
"pending wizard routing works" "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) { acceptance("Wizard | Wizard", function (needs) {