Commit Graph

14240 Commits

Author SHA1 Message Date
Hannah Wolfe
9d7049cd3f
Refactored helper registration code into a service
- The helper registration code is "framework" code and very specific
- At the moment the "theme engine" is full of lots of disparate theme related stuff
- I'm trying to make the frontend framework code clearer and also expand it to  make it more useful
- The helper system now also exposes 3 methods allowing you to register a directory, a helper or an alias
- I've updated the codebase to use these both for our core helpers and for "apps"
2021-10-05 10:04:02 +01:00
Gustavo Hernández
554f36de55
Replaced i18n.t w/ tpl helper in serve-public-file.js (#13429)
refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-05 10:00:28 +01:00
Gustavo Hernández
5438644a51
Replaced i18n.t w/ tpl in tags.js (#13428)
refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-05 10:00:00 +01:00
Ozan Uslan
8eeaae5dba Replaced i18n.t w/ tpl in middleware.js in api/v3/admin
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-05 09:58:58 +01:00
Ozan Uslan
12a839b29f Replaced i18n.t w/ tpl in middleware.js in api/v2/admin
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-05 09:58:58 +01:00
Ozan Uslan
cb4915aed1 Replaced i18n.t w/ tpl in middleware.js in api/canary/admin
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-05 09:58:58 +01:00
Guillaume
1cd1ae36bf Replaced i18n.t w/ tpl helper in mail.js
refs #13380
- this is a refactor to do everywhere
2021-10-05 09:43:47 +01:00
Renovate Bot
4f406318a9 Update dependency coffeescript to v2.6.1 2021-10-05 09:29:46 +01:00
Renovate Bot
9e7a789575 Update dependency postcss to v8.3.9 2021-10-05 08:35:08 +01:00
Daniel Lockyer
0ec6b425ee
Merged v4.17.1 into main
v4.17.1
2021-10-05 08:33:42 +01:00
Daniel Lockyer
a145c7b1b8 v4.17.1 2021-10-05 08:31:40 +01:00
Daniel Lockyer
d3c3923d62 Updated Admin to v4.17.1 2021-10-05 08:31:40 +01:00
Renovate Bot
c4ef15a9ed Lock file maintenance 2021-10-04 19:08:39 +01:00
Fabien O'Carroll
cda041d424 Moved StripeAPIService to its own service
refs https://github.com/TryGhost/Team/issues/1083

The Offers service is going to need access to the StripeAPIService too,
so we need to move it out of the @tryghost/members-api module and make
it accessible to both.
2021-10-04 19:28:19 +02:00
Naz
5066e65e03 Added validation to redirects config
refs https://linear.app/tryghost/issue/CORE-86/fix-failing-site-instance-when-redirects-file-is-invalid
refs 260a47da83

- Added validation logic to catch redirects files having invalid RegEx expressions when they are introduced into the system (on upload)
- This way the error happening in the refed commit would have not happened as the validator would not have passed it through
- Moved up the "Router" declaration in custom-redirects as it needs to happen before any other bit of logic has a chance to throw
2021-10-04 18:32:40 +02:00
Hannah Wolfe
025faec7c3
Updated naming in boot post-refactors
- Trying to make the boot make more sense again
- Rough times ahead, but we're making progress towards the frontend being its own thing
2021-10-04 17:12:18 +01:00
Hannah Wolfe
1bbaf65a22
Removed need for index.js in frontend/helpers
- The index.js file was actually loader code
- It was mainly used by the unit tests, which needed to be rewritten to get each helper individually
2021-10-04 16:46:01 +01:00
Renovate Bot
2acbf9fb50 Update dependency @tryghost/zip to v1.1.17 2021-10-04 16:40:06 +01:00
Renovate Bot
ada99d3e9d Update dependency @tryghost/package-json to v1.0.5 2021-10-04 16:12:35 +01:00
Renovate Bot
7941bfcafa Update dependency @tryghost/vhost-middleware to v1.0.18 2021-10-04 16:10:38 +01:00
Renovate Bot
d6347d80b3 Update dependency @tryghost/security to v0.2.12 2021-10-04 16:10:26 +01:00
Renovate Bot
18a6f536a1 Update dependency @tryghost/job-manager to v0.8.10 2021-10-04 16:08:02 +01:00
Renovate Bot
e24adb436b Update dependency @tryghost/session-service to v0.1.27 2021-10-04 16:05:54 +01:00
Renovate Bot
da0d97449f Update dependency @tryghost/promise to v0.1.12 2021-10-04 16:05:40 +01:00
Renovate Bot
e657527fa8 Update dependency @tryghost/mw-session-from-token to v0.1.25 2021-10-04 16:03:58 +01:00
Renovate Bot
682bb1cb1e Update dependency @tryghost/limit-service to v0.6.4 2021-10-04 16:03:40 +01:00
Renovate Bot
79f778c469 Update dependency @tryghost/errors to v0.2.16 2021-10-04 16:03:27 +01:00
Renovate Bot
9412515e98 Update dependency @tryghost/image-transform to v1.0.16 2021-10-04 16:00:43 +01:00
Renovate Bot
55f951f58f Update dependency @tryghost/constants to v0.1.11 2021-10-04 16:00:34 +01:00
Renovate Bot
ed069d51d3 Update dependency @tryghost/bootstrap-socket to v0.2.12 2021-10-04 16:00:27 +01:00
Renovate Bot
e53bafb1aa Update dependency @tryghost/adapter-manager to v0.2.17 2021-10-04 16:00:18 +01:00
Naz
8f5186995d Added unit test coverage for invalid redirects config
refs https://linear.app/tryghost/issue/CORE-86/fix-failing-site-instance-when-redirects-file-is-invalid
refs 260a47da83

- Refed commit was missing a unit test coverage.
- The approach here introduces a new pattern - using `supertest` in unit tests. I've found this to be the most expressive way to test an express app which receives certain middleware dynamically. Because there are very few moving parts the test is still extremely quick to run
2021-10-04 16:44:23 +02:00
Ozan Uslan
d1b7055af5 Replaced i18n.t w/ tpl in version-match middleware
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-04 15:32:53 +01:00
Ozan Uslan
b1395bbe20 Replaced i18n.t w/ tpl in upload middleware
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-04 15:32:53 +01:00
Naz
260a47da83 🐛 Fixed 500 when instance has an invalid redirects config
refs https://linear.app/tryghost/issue/CORE-86/fix-failing-site-instance-when-redirects-file-is-invalid

- The site was returning a 500 for all routes whenever an invalid redirects file was uploaded.
- The cause of this issue surfacing was this change - 0962b3ed45 (diff-10784969d51d9abb9d620625a14b31661ff3f98dbfb0ea17186186a8151bacfaL35) . Previously an instance always had some sort of a working router and when the configuration failed it still functioned as an empty redirects router. After the change no router was mounted resulting in a 500
- Test cases fixing the problem will folllow
2021-10-04 15:25:37 +02:00
Hannah Wolfe
b10802f4c6
Updated fixture hash for integrity check
refs: fe2958eb73

Commit fe2958eb73 updated fixtures without updating the integrity hash - not sure how I missed this!
2021-10-04 13:47:12 +01:00
Jack Dawson
2e2a0e387c
Updated unsubscribe.hbs (#13365)
- minor text improvement
2021-10-04 12:18:42 +01:00
Paul Cushing
fe2958eb73
Fixed typo "in" default About page. (#13271)
- added a missing word
2021-10-04 12:18:15 +01:00
Kevin Ansfield
28fb6f2939 Fixed errors when syncing theme settings
no issue

- bumped `@tryghost/custom-theme-settings-service`
- fixes errors when a previously seen theme setting has been removed from the theme when syncing
- fixes settings for non-active theme being deleted/updated instead of just settings for the current theme
2021-10-04 12:17:41 +01:00
cjlightnsound
91b1e87ad8
Updated spelling in README (#13369)
We've swapped from British -> American spelling, but this one was missed
2021-10-04 12:16:08 +01:00
Hannah Wolfe
8743931c7c
Removed unused doesTranslationKeyExist fn from i18n
- With the recent removal of i18n from error handling, we've removed the usecase for this function
- Cleaning up as we slowly get rid of i18n :)
2021-10-04 11:52:10 +01:00
Hannah Wolfe
e8c5a3bc26
Replaced i18n.t w/ tpl in error handler middleware
refs: #13380

- This is part of the ongoing push to get rid of the deprecated i18n.t calls
- In this case, it highlights just how little work we've done on API errors - we should have a full list of action messages, but there's just 1 :(
2021-10-04 11:52:10 +01:00
Hannah Wolfe
ec64ead47d
Added help & ghostErrorCode properties to API errors
- This is initial ground work to enable us to do a full error audit
- We want to prevent Ghost admin from ever showing any unhandled errors
- Additionally we want to ensure all handled errors are well worded & have context+help
2021-10-04 11:52:10 +01:00
Kevin Ansfield
25b0657784 Fixed inconsistent theme settings state after toggling customThemeSettings labs flag
no issue

If Ghost was booted or a theme activated with the `customThemeSettings` flag disabled but with a theme that has custom settings, enabling the flag later on wouldn't show the settings in Admin or make the settings available in the front-end. Similarly, disabling `customThemeSettings` when Ghost had been booted/or theme activated with it enabled meant that settings were still available on the front-end.

- added an event listener for `settings.labs.edited` that fully re-activates a theme so that it's passed through gscan again and the custom theme settings passed back are included/excluded based on the flag value and any required settings sync with the database is performed
2021-10-04 11:23:46 +01:00
Fabien O'Carroll
d07fc708ab Exported Offer model from models
refs https://github.com/TryGhost/Team/issues/1088
refs https://github.com/TryGhost/Ghost/commit/78d0644d

This was forgotten in the references commit and is required to be able
to use the model
2021-10-04 11:05:42 +02:00
Ozan Uslan
b97aadd840
Replaced i18n.t w/ tpl helper in spam-prevention (#13425)
refs: TryGhost#13380

The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-04 10:03:21 +01:00
Ozan Uslan
acf4a4b227
Replaced i18n.t w/ tpl helper in email and integrations (#13424)
refs: #13380

The i18n package is deprecated. It is being replaced with the tpl
package.

* Replaced i18n.t w/ tpl helper in email
* Replaced i18n.t w/ tpl helper in integrations
2021-10-04 10:02:27 +01:00
Kenneth Fitzgerald
31b998e1e1
Replaced i18n.t w/ tpl helper in permissions (#13419)
refs: #13380

The i18n package is deprecated. It is being replaced with the tpl package.

Co-authored-by: Kenneth Fitzgerald <fitzgeraldkd@gmail.com>
2021-10-04 09:58:42 +01:00
Megharth Lakhataria
1e73f0b07a
Replaced i18n.t w/ tpl helper in email-post.js and email-preview.js (#13418)
refs: #13380

- this is to replace i18n.t with tpl because i18n.t is deprecated
- Replaced i18n.t with tpl helper in email-post.js
- Replaced i18n.t with tpl helper in email-preview.js
2021-10-04 09:57:08 +01:00
Ania Kowalska
4e4d092988
Replaced i18n.t w/ tpl helper (#13403)
refs: #13380

* Replaced i18n.t w/ tpl helper in authentication.js
* Replaced i18n.t w/ tpl helper in authors-public
2021-10-04 09:55:30 +01:00