Commit Graph

12 Commits

Author SHA1 Message Date
Sanne de Vries
2c648fda34 Added dropdown arrow to custom settings select component 2021-10-20 16:57:37 +02:00
Sanne de Vries
53ac7d2f6d Updated design settings side nav 2021-10-20 11:14:26 +02:00
Sanne de Vries
7534dbc7a6 Updated general and custom theme settings design 2021-10-19 16:26:27 +02:00
Kevin Ansfield
53bdb5720f Added support for image custom theme settings
refs https://github.com/TryGhost/Team/issues/1109

- added `<CustomThemeSettings::Image>`  component that is displayed for any custom theme settings with the type `'image'`
2021-10-14 18:43:04 +01:00
Kevin Ansfield
54ae6902b3 Removed support for empty colors in custom theme settings
refs https://github.com/TryGhost/Team/issues/1107

- allowing empty colors introduced some edge cases around theme usage and default values
- it makes more sense to force a color setting to always have a color, if a theme wants to make usage of that color optional then it should use a separate boolean or select setting to control that
2021-10-14 15:53:14 +01:00
Kevin Ansfield
0b267098ea Added support for text custom theme settings
refs https://github.com/TryGhost/Team/issues/1109

- added basic `<CustomThemeSettings::Text>`  component that is displayed for any custom theme settings with the type `'text'`
2021-10-14 15:40:22 +01:00
Kevin Ansfield
869cc9d47a Added support for color type custom theme settings
refs https://github.com/TryGhost/Team/issues/1107

- uses the same type of color picker used elsewhere in Admin with some minor changes to allow blank values
  - when value is blank it adjusts the background color block to have a border and a diagonal red line to represent no color being present and makes the native color picker that sits on top transparent because native color pickers _always_ have a color
  - has it's own invalid handling/display because we're not dealing with a model that has our typical validation at the moment
2021-10-14 10:36:02 +01:00
Kevin Ansfield
9d38a0a1e1 Added support for boolean custom theme settings
refs https://github.com/TryGhost/Team/issues/1106

- removed `'string'` from the `attr()` definition for `customThemeSetting.value` so that we're not coercing the value from the API into something that doesn't work when applied to the `checked` attribute on checkbox inputs
- added initial `<CustomThemeSettings::Boolean>` component and used it for display in theme setting forms when `type === 'boolean'`
2021-10-13 17:55:17 +01:00
Kevin Ansfield
4fa13bfa9f Fixed capitalization of API and CTA in theme setting labels
no issue

- added `{{humanize-setting-key}}` helper that uses the base `humanize` output but then forces capitalization for known acronyms
- updated `<CustomThemeSettings::Select>` to use the new helper
2021-10-12 10:11:24 +01:00
Kevin Ansfield
aa5b0705e0 Fixed "(default)" not showing next to default custom theme select options
no issue

- default option conditional was missing the `@` on the passed in argument so was always evaluating to `false`
2021-09-30 16:31:44 +01:00
Kevin Ansfield
dab672c7b8 Wired up custom theme settings form to preview updates
refs https://github.com/TryGhost/Team/issues/1097

- added `customThemeSettings.keyValueObject` which returns a plain object with setting values assign to the setting keys on the object
- updated customize modal's preview data generation to use `customThemeSettings.keyValueObject` to assign a JSON-stringified version to the `custom` param on the `x-ghost-preview` header
- updated theme settings `<Select>` component to call the passed through `updatePreview()` action when the value changes
2021-09-30 13:30:06 +01:00
Kevin Ansfield
d10e102de4 Wired up saving of custom theme settings
refs https://github.com/TryGhost/Team/issues/1070

- split select form component into it's own component so it's cleaner when we get to additional setting types
  - added change handler that updates the setting record's value when a new option is selected
- added `.isDirty` to the custom-theme-settings service so we can warn of unsaved changes and revert any changed values when needed
- added save of custom theme settings to the customize design modal's save routine
- added missing `notifications` service import to customize design controller
2021-09-28 16:50:28 +01:00