Commit Graph

18117 Commits

Author SHA1 Message Date
Renovate Bot
55c065df62 Update dependency @tryghost/color-utils to v0.1.17 2022-05-16 09:40:55 +01:00
Renovate Bot
a2c5993625 Update dependency @tryghost/helpers to v1.1.68 2022-05-16 09:40:46 +01:00
Hannah Wolfe
8f90ca949d Updated plaintext to be a partial doc
refs: https://github.com/TryGhost/Ghost/issues/11407

- there's no need for us to process the whole document as it's only used for excerpts
- emails need the whole document, but they're managed seprately now
- this is more efficient and means we could potentially do it on the fly 🤔
2022-05-16 09:38:16 +01:00
Hannah Wolfe
9d4d6688d8 Removed links and figcaptions from excerpts
refs: https://github.com/TryGhost/Team/issues/1609
refs: https://github.com/TryGhost/Ghost/issues/11532
refs: https://github.com/TryGhost/Ghost/issues/11407

- these don't read correctly in an excert context
2022-05-16 09:38:16 +01:00
Hannah Wolfe
338dc3ae6c Refactored html-to-plaintext to have two functions
refs: https://github.com/TryGhost/Team/issues/1609

- Split html-to-plaintext into a function for excerpts and emails
- Updated all usages so they use the correct function
- There's currently no difference between the two
2022-05-16 09:38:16 +01:00
Hannah Wolfe
f73a84abac Update dependency html-to-text to v8
refs: https://github.com/TryGhost/Ghost/pull/13035
refs: https://github.com/TryGhost/Team/issues/1609

- Upgraded to the latest html-to-text
- Matched the options to what we had as close as we can
- The output changes slightly, but in most cases those are bugfixes
- We are going to tune this output more soon, so accept the changes for now
2022-05-16 09:38:16 +01:00
Hannah Wolfe
f436d23f87 Removed 80 char wordwrap in excerpts
refs: https://github.com/TryGhost/Team/issues/1609

- remove the 80 char wordwrap
- this makes the function the same as used in the post serializer
- updated references everywhere to use the same function
2022-05-16 09:38:16 +01:00
Simon Backx
6b3a657f88
Renamed newsletter_id and email_recipient_filter options (#14798)
refs https://github.com/TryGhost/Team/issues/1596

- Renamed `newsletter_id` to `newsletter` option, the `newsletter` option expects a slug instead of an id
- Renamed `email_recipient_filter` to `email_segment` option
- Default `email_segment` to `all`. Ignored if no newsletter is set
- `email_segment` is ignored if no newsletter is set
- When reverting a post to a draft, both `newsletter` and `email_segment` are reset to their default values (null, all)
- Removed legacy mapping from old email_recipient_filter values 'paid' and 'free' (already a migration in place)
- Dropped legacy throwing errors when email_recipient_filter is paid or free in transformEmailRecipientFilter
- Reorganized transformEmailRecipientFilter parameters for the now required newsletter parameter
- Fixed an issue where the newsletter filter wasn't working because it wasn't in permittedoptions
- Fixed an issue where you could send to an archived newsletter
- Added an extra protection when scheduling to an active, and later archiving the newsletter
- Dropped support for `send_email_when_published` in API
- When importing posts we currently don't have a system in place to set the newsletter_id to map the `send_email_when_published` behaviour. Since this was already the case, I won't include a fix in this PR.
- Stripped `email_recipient_filter`/`email_segment` from Content API (https://ghost.slack.com/archives/C02G9E68C/p1652363211841359?thread_ts=1650623650.233229&cid=C02G9E68C)
- Updated `admin-api-schema` to 3.2.0, which includes the new email_segment property
- Contains a temporary fix for https://github.com/TryGhost/Team/issues/1626, where the `.related('newsletter').fetch` call fails when the newsletter relation is already loaded, because of the overridden `formatOnWrite` method.

Since the `email_recipient_filter` is no longer used without a newsletter, the `none` value is no longer used. A migration transforms all those values to `all`. This should be safe, because we only send an email now when newsletter_id is not null (scheduled posts should already have a newsletter_id, even if at the time of scheduling they didn't add the newsletter_id option, because at that time, we defaulted to the default newsletter).

Admin changes to make this work: https://github.com/TryGhost/Admin/pull/2380
2022-05-16 10:18:04 +02:00
Naz
f83ceb80d6 Removed need for redundant "strip" attribute in schemas
refs https://github.com/TryGhost/Toolbox/issues/314

- Writing schema definitions will become more concise without a need to specify all valid resource properties that could be accepted by the Admin API - no need to define "strip" attribute on every known
2022-05-16 15:44:25 +08:00
Naz
3e1d206d84 Added gscan check for {{@member.products}} helper
refs https://github.com/TryGhost/Toolbox/issues/329

- Adds and improves gscan checks for use of following helpers:
  - @labs.members
  - @member.products
  - @price

@labs.members going in favour @site.members_enabled

@member.products gone in favour of @member.subscriptions

@price and it's variations gone in favour of {{price}} + {{@member.subscriptions}}
2022-05-16 13:27:22 +08:00
Renovate Bot
a599830920 Update dependency c8 to v7.11.3 2022-05-16 05:20:36 +00:00
Renovate Bot
76fbb32163 Update dependency c8 to v7.11.3 2022-05-16 04:53:53 +00:00
Renovate Bot
0c7cf97615
Update dependency glob to v8.0.3 2022-05-13 23:55:59 +00:00
Hannah Wolfe
705a72431d
Removed GET settings/:key route
refs: https://github.com/TryGhost/Team/issues/1625

- there's not really a usecase for this route, so removing so we don't have to maintain it
2022-05-13 23:18:53 +01:00
Hannah Wolfe
37818a1b71
Removed settings that are no longer in use (#14802)
refs: TryGhost/Team#1625
refs: TryGhost/Team#1558

- none of these settings are actively used anymore

Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2022-05-13 21:19:21 +01:00
Renovate Bot
0d71521b3c
Update dependency express-jwt to v7.7.1 2022-05-13 17:31:50 +00:00
Rishabh Garg
96bb441fb3
Removed unused frontend offer endpoint (#14816)
refs https://github.com/TryGhost/Team/issues/1599

- portal now uses offer content api to read offer details from id
2022-05-13 17:20:09 +05:30
Renovate Bot
0f01aa6eea Update dependency @playwright/test to v1.22.0 2022-05-13 12:21:23 +01:00
Renovate Bot
f69fb3214b Update dependency eslint-plugin-ghost to v2.14.0 2022-05-13 09:29:19 +00:00
Simon Backx
a95e9d0b7b
Fixed error in newsletter editing limit checks (#14817)
refs https://github.com/TryGhost/Team/issues/1583
refs https://ghost.slack.com/archives/C02G9E68C/p1652397268702749?thread_ts=1652397192.822389&cid=C02G9E68C

Used `model.status` instead of `model.get('status')`, resulting in undefined, resulting in `!== 'active'` to return true. Also added a test case for editing active newsletters.
2022-05-13 10:15:35 +02:00
Renovate Bot
d3f29e53de Update dependency glob to v8.0.2 2022-05-13 08:00:26 +00:00
Hannah Wolfe
ef79f4eae9
Fixed lint error
refs: 8d30eeb515
refs: https://github.com/TryGhost/Ghost/pull/14806

- somehow this didn't flag up in the PR...
2022-05-13 05:09:14 +01:00
Hannah Wolfe
8d30eeb515 Removed usage of members_paid/free_signup_redirect
refs: https://github.com/TryGhost/Team/issues/1625

- removed code using settings that are about to be removed
2022-05-12 20:05:10 +01:00
Hannah Wolfe
dec6a4d72a Removed unused getPaymentConfig method
refs: https://github.com/TryGhost/Team/issues/1625

- this references unused stripe_product_name setting and defunct stripe_plans setting, but is not used anywhere
2022-05-12 20:05:10 +01:00
Hannah Wolfe
403b311f54 Removed unused getPublicPlans method
refs: https://github.com/TryGhost/Team/issues/1625

- this method makes use of defunct settings
2022-05-12 20:05:10 +01:00
Hannah Wolfe
cd20738d65 Removed support for editing members_from_address
refs: https://github.com/TryGhost/Team/issues/1625
refs: https://github.com/TryGhost/Team/issues/1558

- the members_from_address setting is no longer used, instead we use newsletters from address
2022-05-12 20:05:10 +01:00
Hannah Wolfe
5cc7a54edc
Replaced Products with Tiers API endpoints
ref: https://github.com/TryGhost/Team/issues/1145
ref: 8f8b7e7364

- The /products/ endpoint was replaced with /tiers/ some time ago but we didn't finish the switch
- The work is complete now, so can remove the endpoint entirely and cleanup remaining usages
2022-05-12 19:59:57 +01:00
Hannah Wolfe
a58ac016be
Swapped setup to use tiers API endpoint
refs: https://github.com/TryGhost/Team/issues/1145

- the products endpoint is going away in favour of tiers
2022-05-12 19:48:27 +01:00
Hannah Wolfe
b6d9389124
🔥 Removed legacy product + price helpers from themes
refs: https://github.com/TryGhost/Team/issues/1145
refs: https://github.com/TryGhost/Ghost/issues/14446

- remove legacy members theme helpers @products @product @price and @members.products
- all of these have been replaced with new concepts with the introduction of tiers
2022-05-12 18:58:01 +01:00
Rishabh Garg
afd92813c8
Added subscribe_on_signup to newsletter content API data (#14808)
- portal needs this to show default newsletter subscription during signup
2022-05-12 21:31:50 +05:30
Daniel Lockyer
1e456f7e87
Updated all @tryghost packages
- these packages have had minor code changes or dependency updates but
  needed to be published to please Lerna
2022-05-12 16:50:18 +01:00
Renovate Bot
bfb7cecc8c Update dependency express-session to v1.17.3 2022-05-12 16:45:31 +01:00
Renovate Bot
a364fc3980 Update dependency jwks-rsa to v2.1.2 2022-05-12 16:45:21 +01:00
Matt Hanley
c11b0e822d Published new versions
- @tryghost/custom-theme-settings-service@0.3.3
 - @tryghost/email-analytics-provider-mailgun@1.0.9
 - @tryghost/email-analytics-service@1.0.7
2022-05-12 16:42:53 +01:00
Hannah Wolfe
962971c436
🔥 Removed members/api/site
closes: https://github.com/TryGhost/Team/issues/1599

- remove the now unused members/api/site endpoint
- portal now talks to the content API instead
2022-05-12 16:21:47 +01:00
Matt Hanley
0d379a9264 Added permissions for Authors to read labels
refs https://github.com/TryGhost/Team/issues/1618

- Authors require access to labels as part of the publish + send workflow
2022-05-12 16:07:05 +01:00
Hannah Wolfe
ad9e916700
Removed @blog from theme globals
closes: https://github.com/TryGhost/Toolbox/issues/231
refs: https://github.com/TryGhost/Ghost/issues/14446

- @blog was deprecated before Ghost 3.0, but we're only just removing it now for 5.0
2022-05-12 16:00:00 +01:00
Rishabh Garg
e44d089dbe
Updated portal initilization and multiple newsletter handling (#14803)
- portal now uses content API to load site data
- handles auto unsubscribe for multiple newsletters
- design refinements
- more test coverage
- better fixtures
2022-05-12 20:26:31 +05:30
Rishabh Garg
f321ff2760
Fixed tier monthly/yearly price admin api schema (#14805)
- schema now allows null values for tier prices
2022-05-12 20:22:26 +05:30
Rishabh Garg
f4066067e4
Extended public settings to include portal settings (#14801)
refs https://github.com/TryGhost/Team/issues/1599

- adds `portal_*` settings to public settings endpoint
- adds calculated `firstpromoter_account` setting for public settings endpoint
- also adds Ghost `version` information
2022-05-12 19:54:45 +05:30
Hannah Wolfe
de118b0b04
Renamed lang and session_secret default settings (#14791)
refs: https://github.com/TryGhost/Toolbox/issues/327

- lang / locale has had a lot of churn, but we decided this setting should always be locale
- session_secret is too generic as we have multiples of these
2022-05-12 15:07:05 +01:00
Matt Hanley
1fabd76391 Added newsletter permissions for Editors and Authors
refs https://github.com/TryGhost/Team/issues/1618

- Editors and Authors require read access to newsletters as part of the publish + send workflow
2022-05-12 14:46:55 +01:00
Matt Hanley
78d1132b13
Updated theme card asset default setting (#14789)
refs https://github.com/TryGhost/Team/issues/1611

- For Ghost 5.0 card assets will be included by default, including bookmark and gallery cards
2022-05-12 14:44:31 +01:00
Rishabh Garg
725c2673ea
Added offer read endpoint to content API (#14794)
refs TryGhost/Team#1599

- allows offer details to be fetched via content API directly
2022-05-12 18:16:10 +05:30
Simon Backx
3214186f98
Improved newsletter limit checking (#14780)
refs https://github.com/TryGhost/Team/issues/1583

- Check limits when unarchiving newsletters
- Added tests for more scenarios
- When editing/adding newsletters, the limit check happens in the same transaction.
- `limit-service` was bumped to add transactions support
- Added transaction support for edit in newsletter service
2022-05-12 14:28:45 +02:00
Matt Hanley
3398e0d07d Added test for Author user publishing a post and sending a newsletter 2022-05-12 12:45:42 +01:00
Naz
9236b8a397 Relaxed validation rules + removed unknown properties
refs https://github.com/TryGhost/Toolbox/issues/314

- The API principle guiding this change is the Robustness Principle: "be conservative in what you send, be liberal in what you accept". The API will start accepting any additional properties that are not explicitly defined in the schema for the resource and will be trimming any rogue properties that are sent in the payload
2022-05-12 18:06:38 +08:00
Matt Hanley
371f9996f5
Fixed filter mapping from subscribed to newsletters for bulk operations (#14787)
closes https://github.com/TryGhost/Team/issues/1606

- Fixed filter mapping from subscribed to newsletters for bulk operations
- Updated members-api package
2022-05-12 10:54:20 +01:00
Matt Hanley
5c682d6f37 Published new versions
- @tryghost/members-api@7.0.2
2022-05-12 09:48:58 +01:00
Matt Hanley
f0798578c4 Fixed issue with filter transform not applying to bulk operations 2022-05-12 09:44:30 +01:00