Commit Graph

16360 Commits

Author SHA1 Message Date
Naz
d2e9a98846 Updated version test suite to play nicely with 5.0
refs https://github.com/TryGhost/Toolbox/issues/335

- When eventually the major will be bumped next week the returned version will become `5.0.0` which changes the `content-length` header in all of the responses using the version from package.json
- The version number is dynamic, so it's expected the content-length to float as minor and patch versions fluctuate in 1-2 digit numbers. For lon-term easy maintenance it's best to set the content-length to any number (or maybe some sort of floating range in the future?)
2022-05-19 13:27:40 +08:00
Naz
f97b141a3a Added "anyContentVersion" and anyContentVersion matchers to e2e framework
refs https://github.com/TryGhost/Toolbox/issues/335

- Similarly to `anyEtag` pattern for `etag` headers there's a need to match dynamic content-length and content-version headers.
- The `anyContentLength` is the same as `anyStringNumber` matcher, created a separate one to show the intention over a function when reading the code (maybe we could introduce something like floating number range matcher in the future to be more precise in situations where we expect the content-length to float in +-2 length range)
2022-05-19 13:19:05 +08:00
Naz
9e7bea5bb3 Added "anyStringNumber" matcher to e2e framework
refs https://github.com/TryGhost/Toolbox/issues/335

- Existing `anyNumber` matcher does not do a job when the number is stringified, so introduced a new string matcher to match stringified numbers
2022-05-19 13:06:50 +08:00
Rishabh Garg
998584f6e1
Fixed members list filtering on tiers (#14859)
- filtering member list on `tier:tier-slug` was failing as it only accepted member.product column
- member table needed to expand the tier filter to use product naming for filtering to work
2022-05-18 20:58:00 +05:30
Fabien 'egg' O'Carroll
09a516a179
Fixed Stripe Connect (#14857)
refs https://github.com/TryGhost/Team/issues/1637

The `stripe_connect_integration_token` setting is required for the Stripe
Connect flow to work. The existing `stripe_connect_*` settings are also not able
to be edited. So we've updated the allow list to remove those, and add the one
required for the Stripe Connect flow.
2022-05-18 13:27:50 +01:00
Rishabh Garg
d90add9cd5
Fixed failing checkout session creation for offers (#14855)
- checkout session creation was failing when setup with `offerId` instead of `tierId` and `cadence`
- updates `members-api` to ignore cadence check to allow creation using `offerId` present in request
2022-05-18 15:10:07 +05:30
Kevin Ansfield
71aa1c58e6 Revert "Cleaned up membersActivityFeed labs flag"
This reverts commit ae3a0e93fc.

- flag is still used in the `@tryghost/members-api` package
- reverting for now pending a more complete commit with a bumped members-api package
2022-05-18 10:31:51 +01:00
Kevin Ansfield
ae3a0e93fc Cleaned up membersActivityFeed labs flag
refs https://github.com/TryGhost/Admin/pull/2309

- the flag was only used in Admin and was cleaned up there a while ago
2022-05-18 10:23:53 +01:00
Kevin Ansfield
227548f004 Cleaned up improvedOnboarding labs flag
closes https://github.com/TryGhost/Team/issues/1421
refs 28ead208b8

- all conditionals in Admin have been removed so the forced-GA flag is no longer required
2022-05-18 10:15:31 +01:00
Renovate Bot
0d8ddd3c5e Update dependency cli-progress to v3.11.1 2022-05-18 10:03:30 +01:00
Matt Hanley
48f1dbc7a5 Added docs for writing new commands 2022-05-17 17:16:44 +01:00
Matt Hanley
99a4e1ea48 Added missing log alias to command 2022-05-17 17:16:44 +01:00
Renovate Bot
efc67b1783 Update dependency @playwright/test to v1.22.1 2022-05-17 15:55:31 +01:00
Matt Hanley
236d07c90a
Added CLI command structure (#14821)
Added CLI commands for REPL and timetravel functionality

- Added TimeTravel command for updating test data with a date offset
- Added REPL command for access to models and knex in development
- Added pattern for creating new CLI commands, including
  - User input
  - Output
  - Validation of `NODE_ENV`
- TimeTravel command is in the main Ghost repo because it requires the schema
2022-05-17 15:40:12 +01:00
Simon Backx
8b973dcfaa
Added subscription.price.tier mapping (#14849)
refs https://ghost.slack.com/archives/C02G9E68C/p1652781104970769
refs https://github.com/TryGhost/Team/issues/1145

- subscription.price.product was not mapped yet, but already used in the admin app.
- removes products property from members
2022-05-17 16:38:25 +02:00
Daniel Lockyer
e258e32f04
Fixed coverage/ directory included in local builds
- without this, the `coverage/` directory gets included in builds
  because `grunt-contrib-copy` doesn't operate on just the folder name
- this avoids us zipping up coverage with builds and helps bring CI and
  local builds closer together
- my commit here was incorrect: 815a2d0f7d
2022-05-17 11:11:52 +01:00
Naz
acb3e25ef0 Removed redundant page attribute deletion
refs https://github.com/TryGhost/Toolbox/issues/332

- 'page' property has been dropped completely from the database schema, so there's no need to clean up this model property in the output serializer
2022-05-17 17:21:38 +08:00
Naz
214949fe8c Fixed comment 2022-05-17 17:21:38 +08:00
Naz
0260ec5a64 Removed useless comment
no issue

- Engines in theme's package json have no effect whatsoever on how Ghost instance runs.
2022-05-17 17:21:38 +08:00
Naz
5c2ece9668 Improved assertions in frontend test suite
no issue

- When the tests were rewritten to async/await they didn't get the same header checks as the old style suite.
2022-05-17 17:21:38 +08:00
Naz
1cc3f66d5f Reworked preview controller output
refs https://github.com/TryGhost/Toolbox/issues/332

- With 'page' property being gone from page/post resources we need consistency across internal "preview API" too
- the handling is still hacky as we are exposing the "type" property to the preview pages, which is not exposed through Content API. this a long outstanding issue will have to be handled separately
2022-05-17 17:21:38 +08:00
Daniel Lockyer
5cd9d97a07
Updated @tryghost packages
- these packages contain small code changes or dependency updates that
  we've been forced to publish because of Lerna
2022-05-17 09:17:11 +01:00
Hannah Wolfe
8ec8a21b71
Renamed "client" references to "admin"
refs: https://github.com/TryGhost/Toolbox/issues/299

- renamed lots of things that reference Ghost admin as "client"
- these things make even less sense in a post core/client world
2022-05-17 09:05:44 +01:00
Renovate Bot
bfc2ddec84 Update dependency knex-migrator to v4.2.10 2022-05-17 08:41:25 +01:00
Hannah Wolfe
64fd6f21fa
Renamed core/client to core/admin (#14837)
closes: https://github.com/TryGhost/Toolbox/issues/299

- core/client doesn't really make sense any more now that we don't have just a client and server folder
- this folder contains ghost admin, so admin makes waaaay more sense
2022-05-17 08:27:13 +01:00
Renovate Bot
68512147f0 Update dependency cssnano to v5.1.8 2022-05-17 07:55:58 +01:00
Rishabh
4d300ee89a Updated portal to use new tiers api structure
refs https://github.com/TryGhost/Team/issues/1575

- updates portal to handle the tiers api structure in new format
2022-05-17 12:23:40 +05:30
Naz
3ff757fbad Fixed /edit shortcut route for pages
refs https://github.com/TryGhost/Toolbox/issues/332
refs f5f1221e14

- Adding an `/edit/` post-fix to a static page URL broke when the `page: true` property support was dropped in the Content API
- The changeset adds tests covering the scenario for both page and post resources
2022-05-17 14:31:31 +08:00
Naz
5abd67809d Cleaned up AMP rendering of "page" resources
refs https://github.com/TryGhost/Toolbox/issues/332

- After dropping support for `page: (true|false)` for post resources in Content API there is no need to check for `body.post.page` in the AMP renderer. Furthermore, the AMP router uses `public-post` controller that **only** returns "post" resources. This check was a redundant, unnecessary piece of logic
2022-05-17 11:39:52 +08:00
Renovate Bot
d8e9cbf9db
Update dependency c8 to v7.11.3 2022-05-17 00:26:57 +00:00
Hannah Wolfe
5090d75d96
Improved theme asset handling - permissible assets
refs: https://github.com/TryGhost/Team/issues/1633

- this makes /assets/ a more permissible folder - it can serve anything _except_ hbs files
- meanwhile the root folder becomes less permissible, and won't serve theme dev files commonly found in the root
2022-05-16 19:54:33 +01:00
Fabien 'egg' O'Carroll
d9e6dfe97e
Updated Tiers API data structure (#14795)
refs https://github.com/TryGhost/Team/issues/1575

- Updates the admin-api-schema to reflect new data structure
- Updates members-api to allow Portal to use new data structure
- Data is only mapped at the serialised level to avoid changing the underlying implementation
- Ensure only one version of domain-events present in yarn.lock
2022-05-16 19:47:18 +01:00
Kevin Ansfield
c14f82fec0 Fixed settings test snapshots
refs 340e30f62d
2022-05-16 18:20:44 +01:00
Kevin Ansfield
340e30f62d Removed "publishingFlow" labs flag
no issue

- all uses of the flag have been removed from Admin so it's no longer needed
2022-05-16 18:12:11 +01:00
Matt Hanley
09804244f5 Added newsletters table to default export
refs https://github.com/TryGhost/Team/issues/1629

- We want to export the default newsletter so that we don't lose the post<>newsletter relationship when exporting
- The newsletter_id is currently ignored in the post importer (https://github.com/TryGhost/Ghost/pull/14720) so imports won't work right now
- This change means that exports created in 5.0+ will work later on with no data loss once the importer supports it
- The counts displayed for the newsletters are a count of email records, not post records - and we don't export/import emails so the count will always be 0 after importing a newsletter
2022-05-16 17:49:25 +01:00
Hannah Wolfe
12aff14dff Removed oauth experiment
refs: https://github.com/TryGhost/Team/issues/1625

- this didn't work the way we wanted to
- removing this will free up the namespaces to start over
2022-05-16 17:37:13 +01:00
Hannah Wolfe
18cf73c3b3
Updated output logic to correctly use excerpt 2022-05-16 15:51:14 +01:00
Hannah Wolfe
6d66fe9e22 Switch settings.edit to use an allow list
refs: https://github.com/TryGhost/Team/issues/1625

- Ensure that we maintain a list of exactly which settings can be edited
- Bypass this for internal settings changes for now
- TODO: use the settingsBreadService internally instead of the api directly
2022-05-16 15:07:31 +01:00
Hannah Wolfe
349cbdfc07 Cleaned settings API to only return key & value
refs: https://github.com/TryGhost/Team/issues/1625

- none of the other fields are useful externally, so don't expose them
- "liberal in what we accept, conservative in what we send"
2022-05-16 15:07:31 +01:00
Hannah Wolfe
51a016ac7f Removed code + test for old type param
refs: https://github.com/TryGhost/Team/issues/1625

- type was renamed to group, and type is used to store the actual value type
- we no longer need any backwards compatibility for the old concept of type
2022-05-16 15:07:31 +01:00
Naz
0c097f6532 Fixed frontend rendering of page resource
refs https://github.com/TryGhost/Toolbox/issues/332

- After removing the concept of a boolean "page: true" from the page/post resources frontend resource rendering didn't have enough information to pick the correct template
- Resolved this issue through passing of additional "context" to the template picker. Something nicer should be worked on in the future, as context pattern feels dirty here.
2022-05-16 22:06:55 +08:00
Naz
44c72ddd81 Removed output of "page" filter in Admin/Content APIs
closes https://github.com/TryGhost/Toolbox/issues/332
refs https://github.com/TryGhost/Ghost/issues/10922

- The "page" attirbute has been deprecated long time ago and was kept around in the output for back compatibility reasons. With Ghost 5.0 there's no longer need to return this field or keep around any of the code supporting "page" attribute processing
2022-05-16 22:06:55 +08:00
Naz
f5f1221e14 Removed output of "page" attributes from APIs
refs https://github.com/TryGhost/Toolbox/issues/332
refs https://github.com/TryGhost/Ghost/issues/10922

- The "page" attirbute has been deprecated long time ago and was kept around in the output for back compatibility reasons. With Ghost 5.0 there's no longer need to return this field or keep around any of the code supporting "page" attribute processing
2022-05-16 22:06:55 +08:00
Kevin Ansfield
27337e5f00
Added newsletter param to email preview endpoint (#14820)
refs https://github.com/TryGhost/Team/issues/1621

We want to allow previewing emails based on the selected newsletter. The post model doesn't get a newsletter attached until a publish occurs so we can't use `post.newsletter` and need to give the option of specifying which newsletter to preview via query params.

- added support for `newsletter` query param on the `GET /email_previews/posts/:id/` endpoint where the value is a newsletter slug
- updated `generateEmailContent()` signature to use an options object because the order of memberSegment/newsletter arguments doesn't matter and is difficult to reason about if not named
- adjusted `generateEmailContent()` to fetch the newsletter matching the provided slug, falling back to the default newsletter if no slug is provided
2022-05-16 12:15:54 +01:00
Hannah Wolfe
3f0172e755 Removed backwards compatibility for slack setting
refs: https://github.com/TryGhost/Team/issues/1625

- we changed slack to be two separate settings some time ago
- this cleans up the compatibility code
2022-05-16 11:38:59 +01:00
Daniel Lockyer
93339b3e42
Removed unused code for logging in MySQL lib
- `mysql2` doesn't support this and we haven't had it enabled for a long time
- if we need this feature, we can re-add it with a working implementation
2022-05-16 10:53:08 +01:00
Hannah Wolfe
9957c2a77c
Revert "Updated plaintext to be a partial doc"
This reverts commit 8f90ca949d.

- plaintext is used in search features so this is probably a bad idea
2022-05-16 10:20:26 +01:00
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