UX: Add Styling step to wizard (#14132)

Refactors three wizard steps (colors, fonts, homepage style) into one new step called Styling.
This commit is contained in:
Penar Musaraj
2021-08-25 17:10:12 -04:00
committed by GitHub
parent cfbf69848a
commit 85b8fea262
28 changed files with 548 additions and 371 deletions

View File

@@ -1,6 +1,5 @@
import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row";
import { computed } from "@ember/object";
import { escapeExpression } from "discourse/lib/utilities";
import layout from "select-kit/templates/components/color-palettes/color-palettes-row";
export default SelectKitRowComponent.extend({
@@ -10,7 +9,7 @@ export default SelectKitRowComponent.extend({
palettes: computed("item.colors.[]", function () {
return (this.item.colors || [])
.filter((color) => color.name !== "secondary")
.map((color) => `#${escapeExpression(color.hex)}`)
.map((color) => `#${escape(color.hex)}`)
.map(
(hex) => `<span class="palette" style="background-color:${hex}"></span>`
)
@@ -22,7 +21,7 @@ export default SelectKitRowComponent.extend({
const secondary = (this.item.colors || []).findBy("name", "secondary");
if (secondary && secondary.hex) {
return `background-color:#${escapeExpression(secondary.hex)}`.htmlSafe();
return `background-color:#${escape(secondary.hex)}`.htmlSafe();
} else {
return "";
}