Commit Graph

8 Commits

Author SHA1 Message Date
Daniel Lockyer
abdcd9a650
Switched to @tryghost/nql-lang
- we moved this from `@nexes` to the `@tryghost` organization a while
  back, and this was missed from the switchover
2022-07-20 17:54:13 +02:00
Daniel Lockyer
d3930b50ef
Reworked imports for custom-theme-settings-service tests
- now they import from the package exports, we get a slight boost in
  coverage because `index.js` is now used
2022-07-20 17:47:23 +02:00
Kevin Ansfield
5c2f25d016 Fixed "Error parsing filter" when a theme name contains . chars
no issue

- we were passing the theme name directly in the model query filter string without any surrounding `'` chars meaning we were generating invalid filters
2021-10-26 10:14:39 +01:00
Kevin Ansfield
2951da002c Added name argument to .activateTheme()
no issue

Ghost allows multiple themes with the same `name` value in `package.json` so it assigns custom names based on the file name. When syncing we were only looking at the package.json `name` value so there could be a syncing clash when swapping between active themes.

- added `name` as the first argument to `.activateTheme(name, theme)` so that the service's consumer is in control of settings sync applying to it's known theme name
2021-10-20 11:04:44 +01:00
Thibaut Patel
e5e67fe6f0 Added validation for boolean and color
refs https://github.com/TryGhost/Team/issues/1107
refs https://github.com/TryGhost/Team/issues/1106
2021-10-20 11:23:14 +02:00
Kevin Ansfield
7729560201 Fixed tests
- unsaved changes didn't make it into previous commit
2021-10-08 15:42:54 +01:00
Kevin Ansfield
b708c7ea67 Changed "NotFoundError" and "BadRequestError" to "ValidationError"
refs https://github.com/TryGhost/Team/issues/1104

- better matches the context of the request as we're validating known keys and valid options from multiple settings
  - "404 Not Found" didn't make sense because `/custom_theme_settings/` _does_ exist, it's just that one setting key wasn't known
  - "400 Bad Request" didn't make sense because the request was understood, it just failed validation of the setting values
2021-10-08 15:40:44 +01:00
Kevin Ansfield
88fc9c7964 Added tests for Service class, fixed error when throwing invalid option error
refs https://github.com/TryGhost/Team/issues/1104

- there was a mismatch of template options when throwing error on invalid select value meaning we were erroring but with the wrong error type and message
- added missing `lodash` dependency in package.json
2021-10-07 16:57:52 +01:00