mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: wizard last step "corporate" was not saving changes (#17739)
This commit is contained in:
parent
6ce75d3824
commit
cfd0a04965
@ -17,26 +17,16 @@ export default Component.extend({
|
||||
this.autoFocus();
|
||||
},
|
||||
|
||||
@discourseComputed("step.displayIndex", "wizard.totalSteps")
|
||||
showNextButton(current, total) {
|
||||
return current < total;
|
||||
},
|
||||
|
||||
@discourseComputed("step.id", "step.displayIndex", "wizard.totalSteps")
|
||||
showDoneButton(step, current, total) {
|
||||
return step === "ready" || current === total;
|
||||
},
|
||||
|
||||
@discourseComputed("step.id")
|
||||
showFinishButton(step) {
|
||||
return step === "styling" || step === "branding";
|
||||
},
|
||||
|
||||
@discourseComputed("step.index")
|
||||
showBackButton(index) {
|
||||
return index > 0;
|
||||
},
|
||||
|
||||
@discourseComputed("step.displayIndex", "wizard.totalSteps")
|
||||
showNextButton(current, total) {
|
||||
return current < total;
|
||||
},
|
||||
|
||||
@discourseComputed("step.id")
|
||||
nextButtonLabel(step) {
|
||||
return `wizard.${step === "ready" ? "configure_more" : "next"}`;
|
||||
@ -47,6 +37,26 @@ export default Component.extend({
|
||||
return step === "ready" ? "configure-more" : "next";
|
||||
},
|
||||
|
||||
@discourseComputed("step.id")
|
||||
showJumpInButton(step) {
|
||||
return step === "ready";
|
||||
},
|
||||
|
||||
@discourseComputed("step.id")
|
||||
showFinishButton(step) {
|
||||
return ["styling", "branding", "corporate"].includes(step);
|
||||
},
|
||||
|
||||
@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")
|
||||
stepClass(step) {
|
||||
return step;
|
||||
@ -73,7 +83,7 @@ export default Component.extend({
|
||||
|
||||
keyPress(event) {
|
||||
if (event.key === "Enter") {
|
||||
if (this.showDoneButton) {
|
||||
if (this.showJumpInButton) {
|
||||
this.send("quit");
|
||||
} else {
|
||||
this.send("nextStep");
|
||||
|
@ -42,9 +42,9 @@
|
||||
|
||||
<div class="wizard-container__buttons">
|
||||
|
||||
{{#if this.showDoneButton}}
|
||||
{{#if this.showJumpInButton}}
|
||||
<button {{action "quit"}} disabled={{this.saving}} type="button" class="wizard-container__button jump-in">
|
||||
{{i18n "wizard.done"}}
|
||||
{{i18n "wizard.jump_in"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
@ -55,8 +55,8 @@
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showFinishButton}}
|
||||
<button {{action "exitEarly"}} disabled={{this.saving}} type="button" class="wizard-container__button finish">
|
||||
{{i18n "wizard.finish"}}
|
||||
<button {{action "exitEarly"}} disabled={{this.saving}} type="button" class="wizard-container__button {{this.finishButtonClass}}">
|
||||
{{i18n this.finishButtonLabel}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
|
@ -28,10 +28,10 @@ export default function (helpers) {
|
||||
index: 1,
|
||||
fields: [{ id: "some-title", type: "text" }],
|
||||
previous: "hello-world",
|
||||
next: "last-step",
|
||||
next: "corporate",
|
||||
},
|
||||
{
|
||||
id: "last-step",
|
||||
id: "corporate",
|
||||
index: 2,
|
||||
fields: [
|
||||
{ id: "snack", type: "dropdown", required: true },
|
||||
|
@ -5718,7 +5718,7 @@ en:
|
||||
|
||||
wizard_js:
|
||||
wizard:
|
||||
done: "Jump in!"
|
||||
jump_in: "Jump in!"
|
||||
finish: "Exit setup"
|
||||
back: "Back"
|
||||
next: "Next"
|
||||
|
Loading…
Reference in New Issue
Block a user