Commit Graph

1985 Commits

Author SHA1 Message Date
renovate[bot]
c1d90df181 Update dependency @playwright/test to v1.35.1 2023-06-16 10:03:32 +02:00
renovate[bot]
d6664b70fd Update dependency semver to v7.5.2 2023-06-16 09:56:57 +02:00
Naz
1d214361ad
Refactored posts browsing to posts service
refs https://github.com/TryGhost/Team/issues/3423

- This refactor allow for smaller and cleaner change that's coming up when dealing with `?collection=` query parameter
2023-06-16 14:52:55 +07:00
Ronald Langeveld
cfbc97b033
🐛 Fixed revisions relation not linked to Posts api (#17037)
no issue

This was a bit of an oversight from our feature built at the retreat. We
didn't take revisions into account for pages at all, but luckily it made
revisions without issues regardless.
It just wasn't accessible and users weren't able to restore via ADMIN
because the API didn't serve them at all.

This wires up the revisions relation to be served by the API so we can
retrieve it in Admin.
2023-06-16 09:49:12 +02:00
Daniel Lockyer
02eadc32d3
Switched to only enabling retries in CI
refs https://ghost.slack.com/archives/C02G9E68C/p1686841987067309?thread_ts=1686761234.035659&cid=C02G9E68C

- enabling retries has helped reduce the number of flaky tests we see,
  but it means it's causing issues with local development and snapshots
- this moves the retry config to the CI specific commands so we don't
  have retries enabled locally
- also deduped test:base and test:single
2023-06-16 09:47:03 +02:00
Fabien "egg" O'Carroll
0d7f98f4d1 Supported adding/removing post to collection via Posts API
We've got some fairly simple diffing logic here to update the collections which
a post is in, the bulk of the changes here are to support the return of a DTO
rather than Bookshelf Model. This also helps improve the architecture because
we are step closer to removing infrastructure concerns (HTTP Response Headers)
from the business logic layer.

For now there is a crappy EventString which can be passed back to the
controller which can then handle any HTTP related concerns, although long term
these should be actual events like PostPublished or PostUpdated.
2023-06-16 09:28:19 +02:00
Fabien "egg" O'Carroll
f3f9e5a2f3 Moved serialisation of formats into the serialiser-layer
This prepares us to return a DTO rather than BookshelfModel to the serialiser
layer. When passing a BookshelfModel, the serialisation layer uses the model to
read from when building computed properties. By stripping values out in the
toJSON method it means that the DTO will be missing them and the computed
properties won't be able to be calculated. Instead we return ALL values to the
serialisation layer, and then strip out the ones that weren't requested in the
"clean" step.

This also inadvertently fixes the issue with `reading_time` requiring the
`html` field to be requested, we can now request just `reading_time`, as well
as have it included by default.
2023-06-16 09:17:47 +02:00
Fabien "egg" O'Carroll
41716a06ae Fixed mutation of shared state for matcher
This can cause bugs due to the matcher constraints changing in each test
2023-06-16 09:17:47 +02:00
Fabien "egg" O'Carroll
53eea00d21 Fixed check for god_mode param
Rather than require the string 'true', we allow any value to be passed, this
works with any parsing of params into booleans.
2023-06-16 09:17:47 +02:00
Fabien "egg" O'Carroll
229875d67d Bumbed @tryghost/admin-api-schema to latest version
This includes the changes necessary to allow the `collection` property to be
passed on posts
2023-06-16 09:17:47 +02:00
Daniel Lockyer
4b6cfa8f28
Added yarn archive to produce a build tarball
fixes https://github.com/TryGhost/Ghost/issues/16835

- this reimplements a command to product a tarball with Ghost after we
  took over `yarn build` for package-specific build steps
2023-06-15 15:42:39 +02:00
Naz
6335033466
Added full post data when returning collection's posts
refs https://github.com/TryGhost/Team/issues/3423

- When querying for posts that belong to a collection we should be returning full post information just like we do for Posts API.
2023-06-15 18:35:58 +07:00
Elena Baidakova
26abeb0ad2 Hide announcement bar script if visibility wasn't chosen
no issue
2023-06-15 15:03:04 +04:00
Ghost CI
a22317305e Merged v5.51.2 into main 2023-06-15 08:11:45 +00:00
Ghost CI
ab119ec96e v5.51.2 2023-06-15 08:11:43 +00:00
Daniel Lockyer
ecc28c5acd
Revert "Update dependency expect to v29.5.0"
This reverts commit 155c08bc61.
2023-06-14 14:56:03 +02:00
renovate[bot]
155c08bc61 Update dependency expect to v29.5.0 2023-06-14 14:43:08 +02:00
Aileen Booker
00131de0b6 Simplify logic when to call stripeService.connect() 2023-06-14 08:18:19 -04:00
Aileen Booker
10859b9b01 Fixed e2e tests 2023-06-14 08:18:19 -04:00
Aileen Booker
d27bb8f075 Added new Stripe events to DomainEventsAnalytics
no issue

- We need to send information about Stripe being enabled or disabled in live mode to analytics
- This hooks up the Domain events listeners in the analytics service and processes this information accordingly
2023-06-14 08:18:19 -04:00
Aileen Booker
48f9e85e09 Expose Stripe events in package 2023-06-14 08:18:19 -04:00
Aileen Booker
98fd6a7dbf Hooked up Stripe service connect method on Stripe public key update
no issue

- Withing the `SettingsBREADService` we want to call the `connect` method of the Stripe Service, which then dispatches the `DomainEvent`
- In order to ensure that the Stripe service is connected in 'live' mode, we compare the public key and make sure no live key was set before so to avoid multiple triggers of this call.
2023-06-14 08:18:19 -04:00
Simon Backx
dbf6ccf29e Added missing cover style for signup card in frontend 2023-06-14 10:18:32 +02:00
Naz
34f7b77190
Fixed collections snapshot
no issue

- The snapshot has save a wrong amount of "pages" for collections and was falsely passing after a retry. The correct amount should be 6.
2023-06-14 14:17:23 +07:00
renovate[bot]
52af10fef5 Update dependency lib0 to v0.2.78 2023-06-14 08:55:45 +02:00
Daniel Lockyer
01e90dfb65 Extracted regression tests to a separate workflow
refs https://github.com/TryGhost/Toolbox/issues/592

- this commit extracts the regression tests into a separate workflow
- this means they run in parallel and reduce the time we have to wait
  for DB tests in general
- also fixes a test that was reliant on being run after the E2E
  tests (!)
2023-06-13 16:47:19 +02:00
Daniel Lockyer
082ab6dc3e Refactored truncateAll util to async-await
refs https://github.com/TryGhost/Toolbox/issues/592

- async-await makes the code easier to read
- also performs a small optimization to only load the foreign_keys
  pragma once for SQLite
2023-06-13 14:46:57 +02:00
Daniel Lockyer
264773ccd1 Reset URL service between test boots
refs https://github.com/TryGhost/Toolbox/issues/592

- we should reset the URL service to avoid event listeners piling up and
  slowing down CI due to the number of events it has to process
2023-06-13 12:52:03 +02:00
Daniel Lockyer
cedfb14924 Fixed random timeouts with mysql2 library during tests
refs https://github.com/TryGhost/Toolbox/issues/592

- heads up, I'm not really sure about this fix
- when we're wrapping `setTimeout`, time stops and mysql2 starts doing
  weird things because we then shift time and it hits timeouts
- apparently `shouldAdvanceTime` should fix this by automatically
  incrementing time along with the system clock
- given the problem is quite difficult to hit, I could just be seeing a
  lack of this due to some other factor
- also removed unnecessary sinon sandbox creation as this is superfluous
2023-06-13 12:52:03 +02:00
Naz
7717021331 Added GET /collections/:id/posts endpoint
refs https://github.com/TryGhost/Team/issues/3423

- The Admin API endpoint allows to browse collection posts and paginate over them
2023-06-13 17:23:09 +07:00
Jono Mingard
731858e9e0 Added tier and label selection in default recipients
refs https://github.com/TryGhost/Team/issues/3151
2023-06-13 18:48:45 +12:00
Ghost CI
6c25f4cb08 Merged v5.51.1 into main 2023-06-13 05:52:58 +00:00
Ghost CI
e990bf5a94 v5.51.1 2023-06-13 05:52:56 +00:00
Steve Larson
d857e0ef15 Upgraded koenig lexical dependencies
no refs
2023-06-12 16:49:21 -05:00
Steve Larson
e742283ec8 Bumped koenig lexical dependencies
no refs
-added a couple more fixes: callout card rendering, code editor wrapping
2023-06-12 16:48:18 -05:00
Steve Larson
fd7b30fac0 Updated koenig lexical dependencies
no refs
-various fixes, including renderer for embed cards
2023-06-12 12:17:46 -05:00
Steve Larson
1345afdd71 Updated koenig lexical dependencies
no refs
-updated to fix embed card rendering
2023-06-12 12:08:19 -05:00
Daniel Lockyer
af8c0dc7a5 Prevented registering multiple Slack event listeners
refs https://github.com/TryGhost/Toolbox/issues/592

- in tests, we boot Ghost over and over
- this inits all the services each time
- it turns out that the Slack event listener is registered 80+ times
- to prevent this, we can check if it has already been registered, like
  we do with webhooks: 4639396c3a/ghost/core/core/server/services/webhooks/listen.js (L67-L69)
- not sure about this pattern in general, but it's something we can
  review in coming weeks
2023-06-12 15:04:11 +02:00
Daniel Lockyer
4639396c3a
Collected Ghost boot timing in test framework
refs https://github.com/TryGhost/Toolbox/issues/592

- this should help us track and calculate how much time is being spent
  in the boot/DB reset process during tests
2023-06-12 12:07:04 +02:00
Daniel Lockyer
3ac28c7a95
Fixed snapshot for settings
- this deviated somewhere, which I am investigating
2023-06-12 10:04:50 +02:00
Naz
bb4e2fcadb
Added "index" built in collection
closes https://github.com/TryGhost/Team/issues/3425

- Index collection is needed to support one of the usecases we have in the near future where we'd hold all posts that would be displayed on the "index" page.
2023-06-12 12:57:52 +07:00
Naz
6421e202e5
Removed API endpoints adding posts to collections
closes https://github.com/TryGhost/Team/issues/3431

- We don't currently have a clear usecase to use the new pattern of updating posts as nested resource (of a collection). To simplify the API we are sticking with the approach of controlling where the post belongs to only through the Posts Admin API.
2023-06-12 12:08:37 +07:00
Steve Larson
d1b5bf0a80 Updated koenig lexical dependencies
no refs
2023-06-09 12:22:01 -05:00
Steve Larson
88c3412cd4 Updated koenig lexical dependencies
no refs
2023-06-09 12:11:37 -05:00
Ghost CI
2744d9a58b v5.51.0 2023-06-09 15:03:06 +00:00
Naz
f7e2f82089 Enabled collections permissions in controller
refs https://github.com/TryGhost/Team/issues/3220

- With permissions in place in the database, they can be enabled on controller level.
2023-06-09 21:13:06 +07:00
Naz
05bb82cf1a Added collections CRUD permissions
refs https://github.com/TryGhost/Team/issues/3220

- Added permissions for collection resources
2023-06-09 21:13:06 +07:00
Simon Backx
2a263c1024 Updated Signup Form to v0.1
no issue
2023-06-09 14:32:17 +02:00
Simon Backx
5e7edb9da5 Added embeddable signup form
refs https://github.com/TryGhost/Team/issues/3274

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
Co-authored-by: Jono Mingard <reason.koan@gmail.com>
Co-authored-by: Sag <guptazy@gmail.com>
2023-06-09 11:30:03 +02:00
Fabien "egg" O'Carroll
643fbbbb1f Removed collections from stable list in Admin API
We had to add these so that they could be played with programatically
but now we have a god_mode flag, we can remove them.
2023-06-09 09:31:44 +02:00