Commit Graph

1292 Commits

Author SHA1 Message Date
Naz
c65e62b7df Promoted email-only feature to general availability
closes https://github.com/TryGhost/Team/issues/1125
refs 3c822e0457

- Email-only is not considered a general availability feature and can be used without special flags.
- It allows to publish a new post type "email only" that only goes out as an email newletter and is available through an undescoverable URL (does not appear anywhere publicly similarly to preview posts) on the site.
2021-10-07 12:08:56 +02:00
Deeksha Agrawal
e8ad189511
Replace i18n with tpl in email-preview.js (#13475)
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-07 09:22:32 +01:00
Deeksha Agrawal
e9c01d6ebe Replace i18n with tpl in webhooks.js
refs: TryGhost#13380
Replace i18n with tpl in webhooks.js (v2, v3)
2021-10-07 09:18:40 +01:00
thick-hollins
fa7048c61b Replaced i18n with tpl in webhooks.js
refs: TryGhost#13380
2021-10-07 09:16:20 +01:00
Ania Kowalska
c38b4ef1f7 Replaced i18n.t w/ tpl helper in pages-public.js
refs: #13380
2021-10-07 09:14:15 +01:00
Ania Kowalska
1d534bcd65 Replaced i18n.t w/ tpl helper in pages.js
refs: #13380
2021-10-07 09:14:15 +01:00
Deeksha Agrawal
e49c4a48ad
Replaced i18n.t w/ tpl helper in slugs.js (#13463)
refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-06 11:42:33 +01:00
Deeksha Agrawal
f6d4d67bbd
Replaced i18n.t w/ tpl helper in memberSigninUrls.js (#13462)
refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-06 11:41:37 +01:00
LucasOe
c06c63b92b
Replaced i18n.t w/ tpl helper in members.js (#13456)
refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-06 11:40:32 +01:00
Fabien O'Carroll
ff0b1a61b3 Added initial Offers API
refs https://github.com/TryGhost/Team/issues/1083

This is a WIP for the Offers API so that Admin development can begin to
use it.
2021-10-06 12:33:19 +02:00
Ozan Uslan
68de391c98 Replaced i18n.t w/ tpl in invites.js for canary
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-06 10:19:47 +01:00
Ozan Uslan
027e25a47f Replaced i18n.t w/ tpl in invitations.js for canary
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-06 10:19:47 +01:00
Ozan Uslan
71bf5e5f19 Replaced i18n.t w/ tpl in images.js for canary
refs: TryGhost#13380

- The i18n package is deprecated. It is being replaced with the tpl package.
- Important Note: invalidFile error message does not have fields for variables, but it is being passed variables.
2021-10-06 10:19:47 +01:00
Alex Ward
4b6780f190
Replaced i18n.t w/ tpl helper in validators/input/ (#13460)
refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
2021-10-06 10:17:42 +01:00
Ania Kowalska
dff788c64e
Replaced i18n.t w/ tpl helper in invites.js (#13433)
refs: #13380

* The i18n package is deprecated. It is being replaced with the tpl package.
* Replaced i18n.t w/ tpl helper in invites.js
* Replaced i18n.t w/ tpl helper in labels.js
2021-10-06 09:49:20 +01:00
Alex Nuttall
162502b19e
Replaced i18n.t w/ tpl helper in posts.js (#13455)
refs: #13380

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

Co-authored-by: thick-hollins <alexnuttall@zoho.eu>
2021-10-06 08:59:21 +01:00
Bruno Silva
fd678ddae6
Replace the deprecated dependency i18n with tpl in mail.js files (#13449)
refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
- The changed files are under `core/server/api/v2` and `core/server/api/v3`.
2021-10-05 10:40:00 +01:00
Bruno Silva
8338be3aca
Replace the dependency i18n with tpl in permissions.js files (#13448)
refs: #13380

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

The files changed are under `core/server/api/v2` and `core/server/api/v3`.
2021-10-05 10:39:01 +01:00
Bruno Silva
22546d55e8
Replace the dependency i18n with tpl in all tags.js files (#13447)
refs: #13380 

The i18n dependency is deprecated, it's being replaced by the tpl one.

The `tags.js` files changed is under the following folders:

- core/server/api/canary/
- core/server/api/v2/
- core/server/api/v3/
2021-10-05 10:38:13 +01:00
Bruno Silva
c332d4e475
Replace the deprecated dependency i18n with tpl in users.js files (#13446)
refs: #13380

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

The files changed is under `core/server/api/v2` and `core/server/api/v3`.
2021-10-05 10:37:05 +01:00
Bruno Silva
bf4c5c861d
Replace i18n with tpl in some files under core/server/api/v2 (#13445)
refs: #13380

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

Replace the deprecated dependency `i18n` with `tpl` in the following files under
`core/server/api/v2/`:

- authors-public.js
- pages-public.js
- session.js
2021-10-05 10:36:12 +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
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
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
Ania Kowalska
506f26b5ce
Replaced i18n.t w/ tpl helper in authentication.js (#13402)
refs: #13380
2021-10-04 09:54:15 +01:00
Kenneth Fitzgerald
548e83d665
Replaced i18n.t w/ tpl helper in serializers/output (#13401)
* Replaced i18n.t w/ tpl helper in users

refs: #13380
The i18n package is deprecated. It is being replaced with the tpl package.

* Replaced i18n.t w/ tpl helper in authentication

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-01 19:00:03 +01:00
Fabien O'Carroll
7a7d037176 Updated Members bulk endpoint req body format
refs https://github.com/TryGhost/Team/issues/1077
2021-10-01 14:14:13 +02:00
Kevin Ansfield
59adb9a9cb Added route for updating custom theme settings
refs https://github.com/TryGhost/Team/issues/1070

- bumped `@tryghost/custom-theme-settings-service` for access to `.updateSettings()`
- added `PUT /custom_theme_settings` route that delegates to `customThemeSettingsService.updateSettings()` to perform the db and cache updates
- invalidates the cache in Ghost because a theme setting change will mean the front-end output will change
2021-09-28 16:09:39 +01:00
Naz
8b6a2bb87f Simplified redirects module api
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- Made clear distinction around the methods that are exposed for the API use and for the internal use. Same pattern can be found in themese's module API
2021-09-27 19:39:47 +02:00
Naz
8bda544411 Moved redirects modules to backend
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- These modules should be colocated on the backend side as the frontend should know nothing about "where the config comes from" in terms of file system or any other source.
2021-09-27 19:12:24 +02:00
Naz
dd042d69c9 Moved routing setting hash calculation to backend
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- These were the last bits that had to be moved out of the frontend doing route.yaml related operations
- Next steps will be refactoring a "bag of everything" into smaller modules and reducing dependencies where possible
2021-09-28 04:59:41 +13:00
Naz
4b80fe1ab3 Reworked routeSettings service public API
refs 4da7e7f0cb
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- This rework is mean to give cleaner separation over methods used by the API and internal methods
2021-09-28 04:59:41 +13:00
Naz
58ba14c188 Removed use of 'routes' parameter for getCurrentHash function
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- With a single possible value for setting ('routes') there's no need to pass the parameter around
2021-09-28 04:59:41 +13:00
Kevin Ansfield
2947db0e6b
Added API endpoint for browsing custom theme settings (#13362)
refs https://github.com/TryGhost/Team/issues/1070

- bumped `@tryghost/custom-theme-settings-service` to get access to `.listSettings()` method
- added GET `/api/canary/admin/theme_settings/` route behind `'customThemeSettings'` feature flag that uses the custom theme settings service to return settings resources that are a combination of the theme-provided definition and the saved value
2021-09-27 11:31:47 +01:00
Naz
ed56239523 Moved browse method from settings API controllers
refs https://github.com/TryGhost/Team/issues/694
refs https://linear.app/tryghost/issue/CORE-13

- The browse method didn't throw a complexity warning but was a clear target to get extracted into settings bread service. This way we get rid of a settings cache dependency and reduce code duplication.
2021-09-21 23:05:57 +12:00
Naz
d76ba2852e Removed method complexity in settings API v3 controller
refs https://github.com/TryGhost/Team/issues/694
refs https://linear.app/tryghost/issue/CORE-13

- The controller code is not meant to contain complex business logic. Removed complexity in settings.edit method
- Have brought up to sync v3 controller code to the changes that were done in v4. Didn't touch v2 controller as it had slight API differences, so avoided going on another trip into the unknown
- Migrating v3 controller was pretty straigh forward as it's an exact copy of the v4 one (at least for the methods that were extracted)
2021-09-21 23:05:57 +12:00
Naz
ae3b2fad7c Removed method complexity in settings API controller
refs https://github.com/TryGhost/Team/issues/694
refs https://linear.app/tryghost/issue/CORE-13

- The controller code is not meant to contain complex business logic. Removed complexity in settings.edit method
- The code causing the complexity warning clearly belonged in the validation layer, so has been moved to it's propper location
2021-09-21 23:05:57 +12:00
Naz
e7ec197da1 Removed duplicate logic from settings edit permissions stage
refs https://github.com/TryGhost/Team/issues/694
refs https://linear.app/tryghost/issue/CORE-13

- The removed logic is done more thoroughly on the settings BREAD
service layer.
2021-09-21 23:05:57 +12:00
Naz
6b25b91fa4 Removed method complexity in settings API controller
refs https://github.com/TryGhost/Team/issues/694
refs https://linear.app/tryghost/issue/CORE-13

- The controller code is not meant to contain complex business logic. Removed complexity in settings.edit method
- Have separated the regular editing from "Stripe Data" editing to keep the dependency on the members service still in the controller reducing coupling of the settings BREAD service to the minimum.
- The stripeConnectData passed into `edit` method still feels out of place (maybe it should be passed as an array already that's ready to be merged with the rest of settings, but that was left for another refactor in the future)
2021-09-21 23:05:57 +12:00
Naz
85ee721157 Removed method complexity in settings API controller
refs https://github.com/TryGhost/Team/issues/694
refs https://linear.app/tryghost/issue/CORE-13

- The controller code is not meant to contain complex business logic.
Reduced complexity in the settings.read method
- Broke the usual "xxxService" naming pattern here in favor of "xxxBREADService" pattern that members package has been experimenting with recently (0469707f2e/packages/members-api/lib/services/member-bread.js (L25)). This naming choice was made because we already had a "SettingsService" and it would've become quite convoluted distinguishing the naming or doing renames for the sake of having a new temporary location for read/edit/add methods
- Also duplicated `hideValueIfSecret` method code with an intention to move it fully into the BREAD service once the refactoring is completed
2021-09-21 23:05:57 +12:00
Naz
191b313271 Removed method complexity in webhooks API controller
refs https://github.com/TryGhost/Team/issues/694
refs https://linear.app/tryghost/issue/CORE-14/tackle-webhooksjs

- The controller code is not meant to contain complex business logic.
2021-09-17 10:11:23 +03:00
Naz
cff0c483af Updated v3 Webhook API to match v4 implementation
refs 70627d84a7
refs 44035fd591
refs https://github.com/TryGhost/Team/issues/477

- When v4 Webhook API was changed removing redundant code v3 API code should've been updated as well. Making this change before extracting logic out into a WebhooksService to have clear chain of why the code that doesn't look the same has been substituted
2021-09-17 09:58:44 +03:00
Naz
4744349381 Removed method complexity in integrations API controller
refs https://github.com/TryGhost/Team/issues/694
refs https://linear.app/tryghost/issue/CORE-10/tackle-integrationsjs

- The controller code is not meant to contain complex business logic.
- Added a test case checking 'PUT' endpoint for integrations to ensure
proper 'NotFound' handling. Found that previous implemenation was
buggy - threw a 500 as 'models.Integration.NotFoundError' that was removed
in previous commit didn't catch a needed error.
2021-09-16 14:23:48 +03:00
Fabien O'Carroll
c9325aa2cc Fixed Complimentary subscriptions being created twice
refs https://github.com/TryGhost/Team/issues/1030

The usage of `setComplimentarySubscription` is for pre-Tiers enabled
sites only. We didn't see this issue before because the `comped` flag
was incorrectly being set to `false` by default. Since it was fixed in
https://github.com/TryGhost/Ghost/commit/ae844db60 the `comped` flag was
then getting sent up, and creating the subscription.

We've moved the usage of `setComplimentarySubscription` to behind the
feature flag so that we do not use old behaviour when Tiers are enabled
2021-09-10 14:29:20 +02:00
Fabien O'Carroll
519757faec Cleaned up webhook settings on Stripe disconnect
refs https://github.com/TryGhost/Team/issues/1006

These should have been cleaned up previously as they are no longer used
or valid without a Stripe connection.
2021-09-07 18:58:25 +02:00
Fabien 'egg' O'Carroll
cd89c7e427
Used @tryghost/members-api Stripe disconnect logic (#13290)
refs https://github.com/TryGhost/Team/issues/1006

Moving the logic of disconnecting Stripe into the members-api module
decouples the Ghost API from the Members API internals. This method can
now be updated independently of Ghost, to implement the deletion of
webhooks from Stripe.
2021-09-07 18:25:53 +02:00
Fabien 'egg' O'Carroll
ae844db60b
Fixed handling of Complimentary Stripe subscriptions (#13289)
refs https://github.com/TryGhost/Team/issues/995

Since we reintroduced the comped status, we did not update the
subscription handling to correctly set members to a status of comped
when they were on a 'Complimentary' plan. This meant that 'comped' members
had a status of 'paid'. The changes to @tryghost/members-api ensure that
handling subscriptions going forward will not result in this error.

Since we handle the Complimentary plan correctly now, we do not need to
manually check for the existence of one, we can instead rely on the
status to set the `comped` flag.
2021-09-07 11:31:47 +01:00