From b5ccf8991440ab30d02db19e2b1a8925ebf38a3f Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Mon, 25 Sep 2023 19:34:38 -0700 Subject: [PATCH] DEV: Cleanup unused wizard illustrations (#23659) These were defunct since #19487 --- .../components/illustration-finished.hbs | 44 --------------- .../addon/components/illustration-members.hbs | 56 ------------------- .../addon/components/illustration-welcome.hbs | 33 ----------- .../wizard/addon/components/wizard-step.js | 27 --------- app/assets/stylesheets/wizard.scss | 35 ------------ app/serializers/wizard_step_serializer.rb | 10 +--- lib/wizard/builder.rb | 3 - lib/wizard/step.rb | 2 +- 8 files changed, 2 insertions(+), 208 deletions(-) delete mode 100644 app/assets/javascripts/wizard/addon/components/illustration-finished.hbs delete mode 100644 app/assets/javascripts/wizard/addon/components/illustration-members.hbs delete mode 100644 app/assets/javascripts/wizard/addon/components/illustration-welcome.hbs diff --git a/app/assets/javascripts/wizard/addon/components/illustration-finished.hbs b/app/assets/javascripts/wizard/addon/components/illustration-finished.hbs deleted file mode 100644 index 35016019287..00000000000 --- a/app/assets/javascripts/wizard/addon/components/illustration-finished.hbs +++ /dev/null @@ -1,44 +0,0 @@ -{{! prettier-ignore }} - - - {{! template-lint-disable no-forbidden-elements }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/assets/javascripts/wizard/addon/components/illustration-members.hbs b/app/assets/javascripts/wizard/addon/components/illustration-members.hbs deleted file mode 100644 index 8483528bad8..00000000000 --- a/app/assets/javascripts/wizard/addon/components/illustration-members.hbs +++ /dev/null @@ -1,56 +0,0 @@ -{{! prettier-ignore }} - - - - - - - - {{! template-lint-disable no-forbidden-elements }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/assets/javascripts/wizard/addon/components/illustration-welcome.hbs b/app/assets/javascripts/wizard/addon/components/illustration-welcome.hbs deleted file mode 100644 index 413c959d29f..00000000000 --- a/app/assets/javascripts/wizard/addon/components/illustration-welcome.hbs +++ /dev/null @@ -1,33 +0,0 @@ -{{! prettier-ignore }} - - - {{! template-lint-disable no-forbidden-elements }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/assets/javascripts/wizard/addon/components/wizard-step.js b/app/assets/javascripts/wizard/addon/components/wizard-step.js index b12933c3ee3..4d9b55ed2fd 100644 --- a/app/assets/javascripts/wizard/addon/components/wizard-step.js +++ b/app/assets/javascripts/wizard/addon/components/wizard-step.js @@ -1,7 +1,6 @@ import discourseComputed, { observes } from "discourse-common/utils/decorators"; import Component from "@ember/component"; import I18n from "I18n"; -import { htmlSafe } from "@ember/template"; import { schedule } from "@ember/runloop"; import { action } from "@ember/object"; import { inject as service } from "@ember/service"; @@ -72,19 +71,6 @@ export default Component.extend({ return step; }, - @discourseComputed("step.banner") - bannerImage(bannerName) { - if (!bannerName) { - return; - } - return bannerName; - }, - - @discourseComputed() - bannerAndDescriptionClass() { - return `wizard-container__step-banner`; - }, - @observes("step.id") _stepChanged() { this.set("saving", false); @@ -101,19 +87,6 @@ export default Component.extend({ } }, - @discourseComputed("step.index", "wizard.totalSteps") - barStyle(displayIndex, totalSteps) { - let ratio = parseFloat(displayIndex) / parseFloat(totalSteps - 1); - if (ratio < 0) { - ratio = 0; - } - if (ratio > 1) { - ratio = 1; - } - - return htmlSafe(`width: ${ratio * 200}px`); - }, - @discourseComputed("step.fields") includeSidebar(fields) { return !!fields.findBy("show_in_sidebar"); diff --git a/app/assets/stylesheets/wizard.scss b/app/assets/stylesheets/wizard.scss index 96ffe21c33f..73bcfcbbc6d 100644 --- a/app/assets/stylesheets/wizard.scss +++ b/app/assets/stylesheets/wizard.scss @@ -99,12 +99,6 @@ body.wizard { color: var(--primary-medium); } - &__step-banner { - @include breakpoint("large") { - display: none; - } - } - &__step-description { font-size: var(--font-up-2); flex: 1 0 40%; @@ -283,36 +277,7 @@ body.wizard { } } - @media only screen and (max-device-width: 568px) { - &__step.introduction .wizard-container__step-banner, - &__step.privacy .wizard-container__step-banner { - display: none; - } - } - - &__step-banner { - flex: 0 1 40%; - } - - &__step-banner-image { - width: 100%; - } - &__step.ready { - .wizard-container__step-banner { - display: flex; - flex: 1 0 100%; - gap: 2em; - } - .wizard-container__step-banner-image { - padding-top: 2em; - flex: 0 1 40%; - margin-left: 2em; - max-height: 300px; - @include breakpoint("large") { - display: none; - } - } .wizard-container__buttons { flex-direction: row-reverse; } diff --git a/app/serializers/wizard_step_serializer.rb b/app/serializers/wizard_step_serializer.rb index 76ec852124d..1fe6a15cafa 100644 --- a/app/serializers/wizard_step_serializer.rb +++ b/app/serializers/wizard_step_serializer.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class WizardStepSerializer < ApplicationSerializer - attributes :id, :next, :previous, :description, :title, :index, :banner, :emoji + attributes :id, :next, :previous, :description, :title, :index, :emoji has_many :fields, serializer: WizardFieldSerializer, embed: :objects def id @@ -56,14 +56,6 @@ class WizardStepSerializer < ApplicationSerializer title.present? end - def banner - object.banner - end - - def include_banner? - object.banner.present? - end - def emoji object.emoji end diff --git a/lib/wizard/builder.rb b/lib/wizard/builder.rb index 340c750f388..50fa9129a7f 100644 --- a/lib/wizard/builder.rb +++ b/lib/wizard/builder.rb @@ -10,7 +10,6 @@ class Wizard return @wizard unless SiteSetting.wizard_enabled? && @wizard.user.try(:staff?) @wizard.append_step("introduction") do |step| - step.banner = "welcome-illustration" step.emoji = "wave" step.description_vars = { base_path: Discourse.base_path } @@ -59,7 +58,6 @@ class Wizard end @wizard.append_step("privacy") do |step| - step.banner = "members-illustration" step.emoji = "hugs" step.add_field( id: "login_required", @@ -109,7 +107,6 @@ class Wizard @wizard.append_step("ready") do |step| # no form on this page, just info. - step.banner = "finished-illustration" step.emoji = "rocket" end diff --git a/lib/wizard/step.rb b/lib/wizard/step.rb index 6e8fcdae899..ff675d18dfb 100644 --- a/lib/wizard/step.rb +++ b/lib/wizard/step.rb @@ -3,7 +3,7 @@ class Wizard class Step attr_reader :id, :updater - attr_accessor :index, :fields, :next, :previous, :banner, :disabled, :description_vars, :emoji + attr_accessor :index, :fields, :next, :previous, :disabled, :description_vars, :emoji def initialize(id) @id = id