0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/test/regression
Kevin Ansfield c36e749820
Added support for gating content by member labels and products (#12946)
refs https://github.com/TryGhost/Team/issues/581
closes https://github.com/TryGhost/Team/issues/582

Emails can now be sent to members with specific associated labels or products by specifying an NQL string. We want to bring the same members segment feature to content by allowing `visibility` to be an NQL filter string on top of the `public/members/paid` special-case strings.

As an example it's possible to set `posts.visibility` to `label:vip` to make a post available only to those members with the `vip` label.

- removed enum validations for `visibility` so it now accepts any string or `null`
    - bumped `@tryghost/admin-api-schema` for API-level validation changes
- added nql validation to API input validators by running the visibility query against the members model
- added transform of NQL to special-case visibility values when saving post model
    - ensures there's a single way of representing "members" and "paid" where NQL gives multiple ways of representing the same segment
    - useful for keeping theme-level checks such as `{{#has visibility="paid"}}` working as expected
- updated content-gating to parse nql from post's visibility and use it to query the currently logged in member to see if there's a match
    - bumped @tryghost/members-api to include label and product data when loading member
2021-05-10 19:32:11 +01:00
..
api Added support for gating content by member labels and products (#12946) 2021-05-10 19:32:11 +01:00
exporter Added stripe_products and stripe_prices tables (#12858) 2021-04-08 20:41:00 +05:30
importer Updated bson-objectid calls to match API change 2021-04-21 16:23:52 +01:00
migrations Fixed editors not being able to read labels when assigning member segments (#12934) 2021-05-07 10:51:44 +01:00
models Added support for gating content by member labels and products (#12946) 2021-05-10 19:32:11 +01:00
settings Added routes_hash setting (#12171) 2020-09-07 21:54:55 +12:00
site Expanded requires of lib/common i18n and events 2021-05-03 17:14:52 +01:00
update-check Fixed linting error 2021-01-14 18:39:27 +13:00
README.md Updated acceptance&regression test suite readmes 2021-01-22 16:42:02 +13:00

Regression Tests

These tests should ensure that we don't break Ghost for all available APIs.

The goal is that most of these packages use Ghost's API's to test behaviours, otherwise transform the tests into unit tests.