Commit Graph

2159 Commits

Author SHA1 Message Date
Naz
8fa36916d7 Migrated admin and core modules to use nql-filter-expansions
refs https://github.com/TryGhost/Arch/issues/46

- Reused posts expansions from nql-filter-expansions module
2023-07-25 19:01:56 +08:00
Naz
c4351456c6 Made tag snapshots more accurate in collections test suite
refs https://github.com/TryGhost/Arch/issues/46

- Allows to actually verify in the snapshot itself if the tag filter is working correctly or not.
2023-07-25 19:01:56 +08:00
renovate[bot]
3830401d55 Update dependency @playwright/test to v1.36.2 2023-07-25 12:26:15 +02:00
Michael Barrett
8095843939
Added feature flag for import tier functionality (#17480)
refs https://github.com/TryGhost/Product/issues/3629
2023-07-25 10:52:52 +01:00
Sodbileg Gansukh
0b00c653cc Added margin override to the signup card input
no issues

- some themes have global styles applied to inputs and it breaks the card input layout because of the style conflict
- this adds some default margin values to fix the issue
2023-07-25 14:22:44 +08:00
Ghost CI
fc50d1e92c Merged v5.55.1 into main 2023-07-25 02:46:04 +00:00
Ghost CI
95d343a786 v5.55.1 2023-07-25 02:46:02 +00:00
Aileen Booker
eb303ec221 Fixed Segment event named wrong 2023-07-24 15:49:33 +01:00
Daniel Lockyer
d0f9c8cf0c Deduplicated eslint and eslint-plugin-ghost to top-level package.json
refs https://github.com/TryGhost/DevOps/issues/50

- this deduplicates where we define the version of `eslint` and
  `eslint-plugin-ghost` so it's easier to maintain
2023-07-24 16:21:47 +02:00
renovate[bot]
b5453e740e Update dependency yjs to v13.6.7 2023-07-24 10:38:06 +00:00
renovate[bot]
3b9b8009e1 Update dependency mysql2 to v3.5.2 2023-07-24 10:29:26 +00:00
Michael Barrett
184c6ae951
Retain newsletter subscriptions on suppression (#17373)
refs https://github.com/TryGhost/Product/issues/2610
2023-07-24 10:47:57 +01:00
Naz
baf0f4b692 Added /collections/slug/:slug Admin API endpoint
closes https://github.com/TryGhost/Arch/issues/45

- This endpoint is here to keep the convention of being able to fetch the resource by it's slug through a `GET /{resource_name}/slug/:slug`. It has identical output as the `GET /collections/:id` endpoint
- The alternative would be having an alias and try fetching by :id and then by slug if the result for id was null, but that would be a completely new pattern we have not used anywhere else yet.
2023-07-24 14:27:17 +08:00
Ghost CI
1b884a49ac v5.55.0 2023-07-21 15:03:14 +00:00
Fabien "egg" O'Carroll
66f7dcafab Fixed the {{#collection}} helper
We were not passing the `slug` to the `apiOptions` so the posts were not
correctly filtered, and on top of that the `collection` option had not been
added to the allow list of the Posts Content API. With these two fixes the
collection helper works as expected.
2023-07-21 16:23:31 +02:00
renovate[bot]
401c1a0d10 Update dependency postcss to v8.4.27 2023-07-21 14:42:30 +02:00
Naz
08c06129d3 Removed /collections/:id/posts endpoint
refs https://github.com/TryGhost/Arch/issues/16

- We made a decision to limit the API for fetching posts belonging to a certain collection to only the Posts API. The endpoint on the collections was an experiment that only brings unnecessary maintenance at this point of time.
2023-07-21 19:46:22 +08:00
Naz
6361423ff7 Fixed ability to remove post from an automatic collection
refs https://github.com/TryGhost/Arch/issues/16

- Post can be removed from a manual collection, but never from an automatic collection.
2023-07-21 19:46:22 +08:00
Naz
d7bbb0b935 Reworked PostsRepository to use model layer
refs https://github.com/TryGhost/Arch/issues/16

- Using the API directly on the repository level prevented us from ensuring collection consistency through transactions.
- This change migrates the PostsRepository to use Bookshelf model layer directly, which also allows to put queries into transactions.
- Additional optimization here was removing the `getAllPosts` method from CollectionService. This is an attempt to reduce the API surface of the  of the service before calling it a GA.
2023-07-21 19:46:22 +08:00
Naz
ef41fd86c2 Enabled all collection tests
refs https://github.com/TryGhost/Arch/issues/16
refs 97f24338bf

- With introduction of transactional post_collections updates the test flakiness should go away.
2023-07-21 19:46:22 +08:00
Naz
3dc27f505c Wrapped collection's creation in transaction
refs https://github.com/TryGhost/Arch/issues/16

- This is needed to avoid stale data/race conditions when processing collection post updates
2023-07-21 19:46:22 +08:00
Naz
0880770d50 Wrapped collection's post adding logic in transaction
refs https://github.com/TryGhost/Arch/issues/16

- Having transactional collection post updates makes sure there are no race conditions when updating collection_posts relations. Without the transactions collection was prone to update relations based on a stale state causing problems like described in the linked issue
2023-07-21 19:46:22 +08:00
renovate[bot]
3a751e6f84 Update sentry-javascript monorepo to v7.60.0 2023-07-21 12:36:13 +02:00
Steve Larson
22441fe730
Made lexical rendering async (#17438)
-moved lexical rendering to async
-includes rendering for front end and email
-necessary to pull dynamic data into render method, e.g. collections
2023-07-20 17:48:48 -05:00
Sanne de Vries
9e61f26586
Fixed visual bug on signup card frontend html (#17430)
No ref
2023-07-20 10:07:54 +00:00
renovate[bot]
dd328f39f7 Update sentry-javascript monorepo to v7.59.3 2023-07-20 07:27:24 +02:00
Ghost CI
a17b2f024e Merged v5.54.4 into main 2023-07-19 13:18:09 +00:00
Ghost CI
a715b8f3ed v5.54.4 2023-07-19 13:18:06 +00:00
Daniel Lockyer
b7aac3e360
🐛 Fixed ghost.min.css asset compilation
refs https://github.com/TryGhost/DevOps/issues/48

- due to changes in the build workflow, we no longer depended on
  `ghost`'s own `build` before producing the tarball
- as a result, the minified css was not produced and private pages were
  unstyled
- this adds our own `build` step to the list of dependencies for
  `archive`
2023-07-19 14:51:17 +02:00
Ronald Langeveld
5b7bca1f1e
Bumped Koenig Packages (#17418)
no issue

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at bfc259e</samp>

Updated content rendering packages to fix bugs and improve performance.
This affects how Ghost outputs HTML and AMP pages from the
`@tryghost/kg-default-nodes` and `@tryghost/kg-lexical-html-renderer`
modules.
2023-07-19 11:11:15 +00:00
renovate[bot]
b82cbeec04 Update sentry-javascript monorepo to v7.59.2 2023-07-19 07:53:05 +02:00
Naz
53f9f954c1 Added tag filter support to collections
refs https://github.com/TryGhost/Arch/issues/41

- When an new collection is created the relational "tags" filter is now picked up properly and appropriate posts matching the tag filter are assigned and stored in the collection. Example collection filter that is now supported: `tags:['bacon']`
- Additionally cleaned up returned collection post DTOs, so we return as little data as possible and add only the fields that are needed
2023-07-18 20:18:54 +08:00
Ghost CI
367ff21ed6 Merged v5.54.3 into main 2023-07-17 14:18:35 +00:00
Ghost CI
b74e29aa70 v5.54.3 2023-07-17 14:18:33 +00:00
Kevin Ansfield
53096e214c
🐛 Fixed poor performance when rendering beta editor posts (#17388)
no issue

- bumps `@tryghost/kg-lexical-html-renderer` which includes a change to drastically reduce the number of `jsdom` instantiations made when rendering text content
2023-07-17 14:21:37 +01:00
Kevin Ansfield
636b1e67b2
Fixed pages API test snapshot having a flaky cache string (#17391)
no issue

- `x-cache-invalidate` will vary across different runs as the post's preview uuid will be different each time the post is created
2023-07-17 13:21:00 +00:00
Kevin Ansfield
135f5fa287
🐛 Fixed poor performance when rendering beta editor posts (#17388)
no issue

- bumps `@tryghost/kg-lexical-html-renderer` which includes a change to drastically reduce the number of `jsdom` instantiations made when rendering text content
2023-07-17 13:42:55 +01:00
Naz
97f24338bf Commented out flaky collections tests
refs https://github.com/TryGhost/Arch/issues/16

- There's a race condition happening when processing multiple collection updates at the same time. It causes the state to be inconsistent between the runs.
- Once the event handling is improved these tests should be put back into action
2023-07-17 20:02:54 +08:00
Ronald Langeveld
baa84f4765
Added base styles for Header Card v2 (#17387)
refs https://github.com/TryGhost/Product/issues/3508

- copied over styles from the signup card, which is what the new header
card is loosely based on.
- this is meant to be hacked till we have the new header card look
pretty.

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 150aa92</samp>

This change introduces a new header card v2 component that allows users
to create custom headers for their Ghost site. It adds a new CSS file
`header_v2.css` that defines the styles and responsive behavior for the
component. The file uses modern CSS features to achieve a flexible and
consistent design. The file is part of the frontend module of the Ghost
core repository.
2023-07-17 10:49:48 +00:00
Naz
ea2defb76c Updated collection descriptions
refs https://github.com/TryGhost/Arch/issues/25

- Updated collection descriptions to be less wordy and avoid a redundant "Collection" in them.
2023-07-17 18:43:21 +08:00
Naz
c733424cc5 Fixed collections ordering
refs https://github.com/TryGhost/Arch/issues/25

- When run against different DB Engines the returned order of collections belonging to a post is not consistent (SQLite vs MySQL). Having a primitive ordering by slug allows to keep the order compatible
2023-07-17 18:43:21 +08:00
Naz
9bfb197a85 Added fixtures for collection posts
refs https://github.com/TryGhost/Arch/issues/25

- Adds collection_posts fixtures
2023-07-17 18:43:21 +08:00
Naz
b5d1245be1 Added posts_collections table population
refs https://github.com/TryGhost/Ghost/pull/17247

- When the instance is started the posts_collections records should be pre-filled for built-in collections. This is to avoid expensive processing during every instance startup.
2023-07-17 18:43:21 +08:00
Naz
ed91412cd5 Changed "index" collection name to "latest"
https://github.com/TryGhost/Arch/issues/25

- This naming matches how the collection will be visible in the cards and how it's marketed. Naming it "index" even for internal purposes will get confusing.
2023-07-17 18:43:21 +08:00
Naz
acbe3a250e Added built in collection fixtures
refs https://github.com/TryGhost/Arch/issues/25

- The instance should have two built-in collections "latest" (prviously known as "index") and "featured". These have been filled through in-memory tricks before, now they should come pre-populated through fixtures mechanism.
2023-07-17 18:43:21 +08:00
Fabien "egg" O'Carroll
605aa18d6a Added collections helper
This is an initial implementation which uses the Posts Content API rather than
the Collections Content API, this is because we haven't added the Collections
Content API yet, but we can added it later when necessary.
2023-07-17 11:35:30 +01:00
Fabien "egg" O'Carroll
be0dbe3e91 Used posts-service for Posts Content API
We want to keep the differences between the Content & Admin API's in the API
layer, rather than at the service layer. The caching functionality hasn't been
moved yet though, and can be handled separately.
2023-07-17 11:35:30 +01:00
renovate[bot]
8e4393d16f Update dependency @playwright/test to v1.36.1 2023-07-17 09:48:14 +02:00
Chris Raible
b625fe76b1
Updated snapshots to include show_title_and_feature_image in event payload (#17378)
no issue

- Tests were failing for me locally because the snapshot for testing
page event payloads didn't include the new
`show_title_and_feature_image` property
- Updated snapshot to include this property, which also changed a few content lengths and `x-cache-invalidate` headers as a side effect
2023-07-14 16:03:40 -07:00
Ghost CI
fad31e0bca v5.54.2 2023-07-14 15:34:52 +00:00