Commit Graph

2117 Commits

Author SHA1 Message Date
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
Ghost CI
a7292cbf1f v5.54.1 2023-07-14 15:03:30 +00:00
Daniel Lockyer
704fc18856 Removed duplicate build step during tarballing
- we don't need to define this in `prepack` because Nx can be configured
  to do this for us
2023-07-14 14:29:14 +02:00
Daniel Lockyer
9f40c90e07 Switched to Nx runner for more tasks
- this switches us to using Nx for `ghost:dev`, which means we can
  configure its dependencies and ensure that the TS projects are built
  beforehand
- also switches to Nx for `ghost:archive` so we don't need to run
  `build:ts` for all `yarn` commands
2023-07-14 08:52:01 +02:00
Naz
382d7fa25f Removed unused collections repositories
no issue

- These repositories were leftover from first phases of collections development. Not needed any longer as we have more specialized bookshelf repositories in the core code
2023-07-14 14:20:37 +08:00
renovate[bot]
6a13e5e737 Update dependency postcss to v8.4.26 2023-07-14 08:16:06 +02:00
Kevin Ansfield
3fdf5adbfd
Moved show_title_and_feature_image to @page.show_title_and_feature_image (#17353)
no issue

- updated frontend's `formatResponse` method to add `@page` to the local template data
  - added here because it's the first place we have both context and page data available
  - makes the property available outside of the page context so it can be used to modify layouts
- updated `prepareContextResource()` to delete `show_title_and_feature_image`
  - ensures `@page.show_title_and_feature_image` is the only way of accessing that property
  - method is used when rendering multiple entries so it also prevents differences in context data between looped pages and single pages
2023-07-13 14:26:33 +00:00
renovate[bot]
eec68d876b Update sentry-javascript monorepo to v7.58.1 2023-07-13 15:08:54 +02:00
renovate[bot]
672a19f78e Update sentry-javascript monorepo to v7.58.0 2023-07-13 06:03:29 +02:00
Steve Larson
42d87d1437
Updated koenig lexical packages (#17325)
no refs
-updated to get collections card changes
2023-07-12 10:59:20 -05:00
Daniel Lockyer
2aa7da3a0b Improved monorepo tooling setup
refs https://github.com/TryGhost/DevOps/issues/45

- this switches the monorepo over to using Nx instead of Lerna, because
  we don't currently need the versioning+publishing capabilities
- this also adds an `nx.json`, which allows us to enable task caching
- also adds `build:ts` to the TS projects, which is cached for fast execution
- how these interact with the dev.js script will hopefully soon be
  reworked to be a better experience
2023-07-12 16:27:39 +02:00
renovate[bot]
828d3e4a1a Update dependency @playwright/test to v1.36.0 2023-07-11 20:53:08 +02:00
Daniel Lockyer
f7c767d473 Removed unused Bluebird import
refs https://github.com/TryGhost/Ghost/issues/14882

- this is no longer used so we can remove it as we move towards removing
  Bluebird from the codebase
2023-07-11 17:49:26 +02:00
Princi Vershwal
e9dd016079
Refactored to use native Promise.all in place of Bluebird (#17026)
refs https://github.com/TryGhost/Ghost/issues/14882

-  removed Bluebird Promise.props from files in favor of native Promise.all
2023-07-11 17:36:03 +02:00
Daniel Lockyer
afdf555fe0
Removed more Bluebird usages (#17302)
refs https://github.com/TryGhost/Ghost/issues/14882

- we're nuking our use of Bluebird in favor of native Promises, so this commit removes most of the usage we have in the core module
2023-07-11 15:07:16 +00:00
Halldor Thorhallsson
49f6477ad5 Removed bluebird from core/server/api/endpoints
refs https://github.com/TryGhost/Ghost/issues/14882
2023-07-11 16:05:36 +02:00
renovate[bot]
7dce046786 Update Test & linting packages 2023-07-11 15:26:07 +02:00
renovate[bot]
7cafe20275 Update dependency yjs to v13.6.6 2023-07-11 12:42:32 +00:00
Sanne de Vries
83aa247fba Updated padding for full width signup card
No ref
2023-07-11 14:38:07 +02:00
renovate[bot]
49643b5b98 Update dependency socket.io to v4.7.1 2023-07-11 12:20:21 +00:00
renovate[bot]
fa9f64f59f Update dependency sanitize-html to v2.11.0 2023-07-11 11:09:37 +00:00
renovate[bot]
40e616eea8 Update sentry-javascript monorepo to v7.57.0 2023-07-11 12:54:56 +02:00
renovate[bot]
69e34fd704 Update dependency @extractus/oembed-extractor to v3.2.1 2023-07-11 10:31:11 +00:00
renovate[bot]
44ed7c47db Update dependency mysql2 to v3.5.1 2023-07-11 07:49:20 +00:00
Vigneshwaran
45bd4ec39a
Updated error message grammar for rate limiting (#17243)
fixes https://github.com/TryGhost/Ghost/issues/17233

- this reads better to the end-user
2023-07-11 08:41:05 +02:00
Naz
cdae2a978d Added ability to fetch collection posts by slug
closes https://github.com/TryGhost/Arch/issues/27

- We need a more convenient method of fetching posts belonging to a collection than by collection's "id". This change adds an alias to the existing endpoint `GET /collections/:id/posts/`. A non-valid ObjectID in the parameter is treated as a slug.
2023-07-11 09:30:01 +08:00
Steve Larson
76b5222bd1
Updated koenig lexical packages (#17275)
no refs
2023-07-10 15:08:27 +00:00
Daniel Lockyer
aa303414cb ℹ️ Bumped minimum Node 16 version to 16.14.0
fixes https://github.com/TryGhost/DevOps/issues/42

- several of our dependencies require this so making the minor bump to
  increase the version helps keep them updated
2023-07-10 16:41:34 +02:00
Steve Larson
5d39e4c612
Added alpha flag for collections card (#17246)
no refs
-alpha flag for collections card for pages
2023-07-10 13:43:24 +00:00
Ronald Langeveld
4a07e857e2
Added Header Card V2 feature flags (#17263)
refs https://github.com/TryGhost/Product/issues/3508

- added a feature flag for Header Cards that's being upgraded.

---

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

This pull request adds a new feature flag `headerUpgrade` to the server
and the admin settings, which allows the user to opt-in to a new header
design. The feature flag is only available if the labs toggle is
enabled.
2023-07-10 13:53:42 +02:00
renovate[bot]
0e5a98e43e Update dependency postcss to v8.4.25 2023-07-10 10:20:30 +02:00
renovate[bot]
ae8be7c937 Update dependency semver to v7.5.4 2023-07-10 10:15:37 +02:00
Daniel Lockyer
6f5f608bcd Fixed resetting database in migrations tests
- due to schema changes between versions, we need to completely nuke the
  DB between these tests
- this is definitely not the best way to do it but I'll fix properly next week
2023-07-07 18:42:18 +02:00
Ghost CI
7dfbaefa3e v5.54.0 2023-07-07 16:05:47 +00:00
Ghost CI
2ecdd01abf 🎨 Updated Casper to v5.5.3 2023-07-07 16:05:47 +00:00
Kevin Ansfield
d8d0bc8bd9
Moved posts_meta.hide_title_and_feature_image to posts.show_title_and_feature_image (#17239)
no issue

`show_title_and_feature_image` leads to more intuitive logic in themes and we can use `posts` rather than `posts_meta` as there are no longer row-length issues with MySQL 8.

- removed original add-column migration that was never in a release
- added new add-column migration that puts
`show_title_and_feature_image` column with a default of `true` on the `posts` table
- renamed property and default value everywhere
- bumped `@tryghost/admin-api-schema` to allow the new property through at the API level
2023-07-07 16:40:22 +01:00
Fabien "egg" O'Carroll
2808df7f87 Switched to bookshelf repository 2023-07-07 14:24:42 +08:00
Chris Raible
fc7e150cc2
Fixed importer breaking any posts written in the new editor (#17230)
refs @TryGhost/Product#3551

- PostsImporter would convert the HTML from the import file into
Mobiledoc, even if the post was written in Lexical
- As a result, the imported posts would have both mobiledoc & lexical
fields populated, which prevents the post from being updated in the
Lexical editor
- Added a check to see if the post was written in Lexical, and if so,
skip the HTML > Mobiledoc conversion
2023-07-06 18:37:19 -07:00
Kevin Ansfield
5d8ea79788
Implemented pages.hide_title_and_feature_image property in API (#17211)
closes https://github.com/TryGhost/Product/issues/3557

- bumped `@tryghost/admin-api-schema` to allow passthrough of the new property in API requests
- updated output mapper to ensure property always returns a boolean rather than `null` in the case where `posts_meta` doesn't exist for a page
- updated `PostsService.copyPost()` to include the new property when copying
- updated `checkResponse` test util and snapshots to expect `hide_title_and_feature_image` property in page API responses
- fixed pages e2e test so it doesn't inadvertently modify the match object breaking later tests
2023-07-05 14:01:24 +00:00
Kevin Ansfield
2a340bcab9
Added migration and schema change for posts_meta.hide_title_and_feature_image (#17187)
closes https://github.com/TryGhost/Team/issues/3550

We want to allow an option to hide the title and feature image on a
per-page basis, to do that we need somewhere to store the setting value.
The existing `posts_meta` table is the simplest candidate, especially as
this is a single setting and we don't have a desire to introduce many
such settings.

- added migration that adds the `hide_title_and_feature_image` column to
the `posts_meta` table with a `boolean` data type and a default value of
`false` (matches behaviour of all existing pages)
- updated schema file for initial database creation
- removed property from API output via serializers to keep migration PR
minimal
2023-07-05 14:48:25 +01:00
Naz
4372a7e1a8 Added feature flag for flatUrls
refs https://github.com/TryGhost/Arch/issues/24

- Enables generating Post and Page URLs in a flat `{slug}-{id}` format
2023-07-05 17:41:28 +08:00
Daniel Lockyer
289e459283 Added tests for migrations
refs https://github.com/TryGhost/DevOps/issues/39

- up until now, we've had a CI job which does a really basic test for
  migrations, but it barely functions and misses bugs all the time
- this commit removes that and switches to an actual test suite for our
  migrations, so we can ensure they function as expected
- also removes the env var hack I came up with for those migrations
  tests
- this should lead to safer migrations and faster tests
2023-07-05 11:00:06 +02:00
Ghost CI
d9480f9569 Merged v5.53.4 into main 2023-07-04 14:25:45 +00:00