mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Wizard Step Enhancements (#19487)
* UX: Wizard Step Enhancements - Remove illustrations - Add Emoji graphic to top of steps - Add description below step title - Move point of contact to last step * Move step count to header, plus some button navigation tweaks * add remaining emoji to step headers * fix button logic on steps * Update Point of Contact * remove automated messages field * adjust styling for counter, title, and emoji * Update wording for logos * Fix tests * fix prettier * fix specs * set same with for steps except for styling screen * use sentence case; remove duplicate copy under your organization fields * fix missing buttons on small screens * add spacing to buttons; adjust font weight to labels * adjust styling for community logo step; use sentence case for button * update copy for point of contact text helper * use sentence case for field labels * fix ui tests * use btn-back class to fix ui tests * reduce bottom margin for toggle fields * clean up Co-authored-by: Ella <ella.estigoy@gmail.com>
This commit is contained in:
@@ -26,6 +26,9 @@ export default Component.extend({
|
||||
|
||||
@discourseComputed("step.displayIndex", "wizard.totalSteps")
|
||||
showNextButton(current, total) {
|
||||
if (this.showConfigureMore === true) {
|
||||
return false;
|
||||
}
|
||||
return current < total;
|
||||
},
|
||||
|
||||
@@ -39,6 +42,11 @@ export default Component.extend({
|
||||
return step === "ready" ? "configure-more" : "next";
|
||||
},
|
||||
|
||||
@discourseComputed("step.id")
|
||||
showConfigureMore(step) {
|
||||
return step === "ready";
|
||||
},
|
||||
|
||||
@discourseComputed("step.id")
|
||||
showJumpInButton(step) {
|
||||
return ["ready", "styling", "branding"].includes(step);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
{{#if this.field.value}}
|
||||
{{component this.previewComponent field=this.field fieldClass=this.fieldClass wizard=this.wizard}}
|
||||
{{/if}}
|
||||
|
||||
<label class="wizard-container__button wizard-container__button-upload {{if this.uploading "disabled"}}">
|
||||
{{#if this.uploading}}
|
||||
{{i18n "wizard.uploading"}}
|
||||
{{else}}
|
||||
{{i18n "wizard.upload"}}
|
||||
{{d-icon "far-image"}}
|
||||
{{/if}}
|
||||
|
||||
<input class="wizard-hidden-upload-field" disabled={{this.uploading}} type="file" accept="image/*">
|
||||
</label>
|
||||
|
||||
{{#if this.field.value}}
|
||||
{{component this.previewComponent field=this.field fieldClass=this.fieldClass wizard=this.wizard}}
|
||||
{{/if}}
|
||||
|
||||
@@ -1,80 +1,83 @@
|
||||
<div class="wizard-container__step-contents">
|
||||
{{#if this.step.title}}
|
||||
<h1 class="wizard-container__step-title">{{this.step.title}}</h1>
|
||||
{{/if}}
|
||||
<div class="wizard-container__step-counter">
|
||||
<span class="wizard-container__step-text">{{bound-i18n "wizard.step-text"}}</span>
|
||||
<span class="wizard-container__step-count">{{bound-i18n "wizard.step" current=this.step.displayIndex total=this.wizard.totalSteps}}</span>
|
||||
</div>
|
||||
|
||||
<div class="wizard-container__step-container">
|
||||
{{#if this.step.fields}}
|
||||
<WizardStepForm @step={{this.step}}>
|
||||
{{#if this.includeSidebar}}
|
||||
<div class="wizard-container__sidebar">
|
||||
{{#each this.step.fields as |field|}}
|
||||
{{#if field.show_in_sidebar}}
|
||||
<WizardField @field={{field}} @step={{this.step}} @wizard={{this.wizard}} />
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="wizard-container__fields">
|
||||
{{#each this.step.fields as |field|}}
|
||||
{{#unless field.show_in_sidebar}}
|
||||
<WizardField @field={{field}} @step={{this.step}} @wizard={{this.wizard}} />
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
<div class="wizard-container">
|
||||
<div class="wizard-container__step-contents">
|
||||
<div class="wizard-container__step-header">
|
||||
{{#if this.step.emoji}}
|
||||
<div class="wizard-container__step-header--emoji">
|
||||
{{emoji this.step.emoji}}
|
||||
</div>
|
||||
</WizardStepForm>
|
||||
{{/if}}
|
||||
{{#if (or this.bannerImage this.step.description)}}
|
||||
<div class={{this.bannerAndDescriptionClass}}>
|
||||
{{/if}}
|
||||
{{#if this.step.title}}
|
||||
<h1 class="wizard-container__step-title">{{this.step.title}}</h1>
|
||||
{{#if this.step.description}}
|
||||
<p class="wizard-container__step-description">{{html-safe this.step.description}}</p>
|
||||
{{/if}}
|
||||
{{#if this.bannerImage}}
|
||||
<div class="wizard-container__step-banner-image">
|
||||
{{#if (eq this.bannerImage "welcome-illustration")}}
|
||||
<IllustrationWelcome />
|
||||
{{else if (eq this.bannerImage "members-illustration")}}
|
||||
<IllustrationMembers />
|
||||
{{else if (eq this.bannerImage "finished-illustration")}}
|
||||
<IllustrationFinished />
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="wizard-container__step-container">
|
||||
{{#if this.step.fields}}
|
||||
<WizardStepForm @step={{this.step}}>
|
||||
{{#if this.includeSidebar}}
|
||||
<div class="wizard-container__sidebar">
|
||||
{{#each this.step.fields as |field|}}
|
||||
{{#if field.show_in_sidebar}}
|
||||
<WizardField @field={{field}} @step={{this.step}} @wizard={{this.wizard}} />
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="wizard-container__fields">
|
||||
{{#each this.step.fields as |field|}}
|
||||
{{#unless field.show_in_sidebar}}
|
||||
<WizardField @field={{field}} @step={{this.step}} @wizard={{this.wizard}} />
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</WizardStepForm>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wizard-container__step-footer">
|
||||
<div class="wizard-container__buttons">
|
||||
{{#if this.showBackButton}}
|
||||
<button {{on "click" this.backStep}} disabled={{this.saving}} type="button" class="wizard-container__button btn-back">
|
||||
{{i18n "wizard.back"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="wizard-container__step-progress">
|
||||
{{#if this.showFinishButton}}
|
||||
<button {{on "click" this.exitEarly}} disabled={{this.saving}} type="button" class="wizard-container__button jump-in">
|
||||
{{i18n "wizard.jump_in"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showConfigureMore}}
|
||||
<button {{on "click" this.nextStep}} disabled={{this.saving}} type="button" class="wizard-container__button primary {{this.nextButtonClass}}">
|
||||
{{i18n this.nextButtonLabel}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showJumpInButton}}
|
||||
<button {{on "click" this.quit}} disabled={{this.saving}} type="button" class="wizard-container__button {{this.jumpInButtonClass}}">
|
||||
{{i18n this.jumpInButtonLabel}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showNextButton}}
|
||||
<button {{on "click" this.nextStep}} disabled={{this.saving}} type="button" class="wizard-container__button primary {{this.nextButtonClass}}">
|
||||
{{i18n this.nextButtonLabel}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wizard-container__step-footer">
|
||||
<div class="wizard-container__buttons">
|
||||
|
||||
{{#if this.showNextButton}}
|
||||
<button {{on "click" this.nextStep}} disabled={{this.saving}} type="button" class="wizard-container__button primary {{this.nextButtonClass}}">
|
||||
{{i18n this.nextButtonLabel}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showFinishButton}}
|
||||
<button {{on "click" this.exitEarly}} disabled={{this.saving}} type="button" class="wizard-container__button jump-in">
|
||||
{{i18n "wizard.jump_in"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showJumpInButton}}
|
||||
<button {{on "click" this.quit}} disabled={{this.saving}} type="button" class="wizard-container__button {{this.jumpInButtonClass}}">
|
||||
{{i18n this.jumpInButtonLabel}}
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="wizard-container__step-progress">
|
||||
<a href {{on "click" this.backStep}} class="wizard-container__link back {{unless this.showBackButton "inactive"}}">{{d-icon "chevron-left"}}</a>
|
||||
|
||||
<span class="wizard-container__step-text">{{bound-i18n "wizard.step-text"}}</span>
|
||||
<span class="wizard-container__step-count">{{bound-i18n "wizard.step" current=this.step.displayIndex total=this.wizard.totalSteps}}</span>
|
||||
|
||||
<a href {{on "click" this.nextStep}} class="wizard-container__link {{unless this.showNextButton "inactive"}}">{{d-icon "chevron-right"}}</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,5 @@
|
||||
<DiscourseLogo />
|
||||
</div>
|
||||
|
||||
<div class="wizard-container">
|
||||
{{outlet}}
|
||||
</div>
|
||||
{{outlet}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user