FIX: "Exit setup" link should exit the wizard and take user to homepage (#18182)

This commit is contained in:
Arpit Jalan
2022-09-05 17:21:41 +05:30
committed by GitHub
parent 7547878cde
commit c1887d95ff
4 changed files with 31 additions and 21 deletions

View File

@@ -62,6 +62,15 @@ acceptance("Wizard", function (needs) {
"shows finish on an intermediate step" "shows finish on an intermediate step"
); );
await click(".wizard-container__button.finish");
assert.strictEqual(
currentURL(),
"/latest",
"it should transition to the homepage"
);
await visit("/wizard/steps/styling");
await click(".wizard-container__button.next"); await click(".wizard-container__button.next");
assert.ok( assert.ok(
exists(".wizard-container__text-input#company_name"), exists(".wizard-container__text-input#company_name"),

View File

@@ -41,22 +41,22 @@ export default Component.extend({
@discourseComputed("step.id") @discourseComputed("step.id")
showJumpInButton(step) { showJumpInButton(step) {
return step === "ready"; return ["ready", "styling", "branding"].includes(step);
},
@discourseComputed("step.id")
jumpInButtonLabel(step) {
return `wizard.${step === "ready" ? "jump_in" : "finish"}`;
},
@discourseComputed("step.id")
jumpInButtonClass(step) {
return step === "ready" ? "jump-in" : "finish";
}, },
@discourseComputed("step.id") @discourseComputed("step.id")
showFinishButton(step) { showFinishButton(step) {
return ["styling", "branding", "corporate"].includes(step); return step === "corporate";
},
@discourseComputed("step.id")
finishButtonLabel(step) {
return `wizard.${step === "corporate" ? "jump_in" : "finish"}`;
},
@discourseComputed("step.id")
finishButtonClass(step) {
return step === "corporate" ? "jump-in" : "finish";
}, },
@discourseComputed("step.id") @discourseComputed("step.id")

View File

@@ -39,15 +39,8 @@
</div> </div>
<div class="wizard-container__step-footer"> <div class="wizard-container__step-footer">
<div class="wizard-container__buttons"> <div class="wizard-container__buttons">
{{#if this.showJumpInButton}}
<button {{action "quit"}} disabled={{this.saving}} type="button" class="wizard-container__button jump-in">
{{i18n "wizard.jump_in"}}
</button>
{{/if}}
{{#if this.showNextButton}} {{#if this.showNextButton}}
<button {{action "nextStep"}} disabled={{this.saving}} type="button" class="wizard-container__button primary {{this.nextButtonClass}}"> <button {{action "nextStep"}} disabled={{this.saving}} type="button" class="wizard-container__button primary {{this.nextButtonClass}}">
{{i18n this.nextButtonLabel}} {{i18n this.nextButtonLabel}}
@@ -55,11 +48,16 @@
{{/if}} {{/if}}
{{#if this.showFinishButton}} {{#if this.showFinishButton}}
<button {{action "exitEarly"}} disabled={{this.saving}} type="button" class="wizard-container__button {{this.finishButtonClass}}"> <button {{action "exitEarly"}} disabled={{this.saving}} type="button" class="wizard-container__button jump-in">
{{i18n this.finishButtonLabel}} {{i18n "wizard.jump_in"}}
</button> </button>
{{/if}} {{/if}}
{{#if this.showJumpInButton}}
<button {{action "quit"}} disabled={{this.saving}} type="button" class="wizard-container__button {{this.jumpInButtonClass}}">
{{i18n this.jumpInButtonLabel}}
</button>
{{/if}}
</div> </div>
<div class="wizard-container__step-progress"> <div class="wizard-container__step-progress">

View File

@@ -335,6 +335,9 @@ body.wizard {
display: none; display: none;
} }
} }
.wizard-container__buttons {
flex-direction: row-reverse;
}
} }
&__step.branding .wizard-container__description { &__step.branding .wizard-container__description {