Commit Graph

18767 Commits

Author SHA1 Message Date
Ronald Langeveld
9339364dce
Added Unsplash selector to AdminX (#18216)
no issue

- Copied over the Unsplash Component from Koenig to AdminX and converted
it to Typescript.
- Changed the business logic to follow a bit of dependency injection to
make it more testable and easier to maintain.
- Ideally we move this out of Admin X Settings and perhaps into it's own
library so we don't need to deal with a duplicate code between Koenig
and Admin X.

---

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

This pull request adds support for selecting images from Unsplash in the
admin settings UI. It introduces a new `UnsplashService` class that
handles the Unsplash API requests and a new `MasonryService` class that
handles the masonry layout of the images. It also adds several new
custom components, such as `UnsplashButton`, `UnsplashGallery`,
`UnsplashImage`, `UnsplashSelector`, `UnsplashZoomed`, and
`UnsplashSearchModal`, that render the Unsplash modal and its elements.
It modifies the existing `ImageUpload`, `App`, `ServicesProvider`, and
`BrandSettings` components to integrate the Unsplash feature and pass
the necessary props. It also adds some new types, constants, and assets
related to the Unsplash data and UI. Finally, it adds some unit tests
for the `UnsplashService` and `MasonryService` classes.
2023-09-21 02:23:45 +00:00
Sag
8515bdf587
Updated uniqueness validation for the Recommendations URL (#18253)
closes https://github.com/TryGhost/Product/issues/3818

- instead of fetching all recommendations and matching URLs on the frontend, we now query the database directly to find an existing Recommendation by URL. When comparing URLs, we don't take into account the protocol, www, query parameters nor hash fragments
2023-09-20 16:53:10 +00:00
Simon Backx
715d658e11
Disabled one-click subscribe when Portal checkbox is required (#18252)
fixes https://github.com/TryGhost/Product/issues/3911

For now we decided that we don't want to enable one-click-subscribe in
case a site has a required checkbox (which isn't shown during the
one-click-subscribe flow)
2023-09-20 15:35:10 +00:00
renovate[bot]
76bd5a4dc2 Update dependency terser to v5.20.0 2023-09-20 14:55:27 +00:00
Sanne de Vries
7cd9864a7a
Updated collection card margins on frontend (#18246)
Closes https://github.com/TryGhost/Product/issues/3909
2023-09-20 12:16:57 +00:00
Sanne de Vries
0886dc00d7
Fixed css typo in collection card (#18245)
No ref
2023-09-20 11:59:24 +00:00
Simon Backx
1e3232cf82
Improved webmention stability in case of slow external servers (#18242)
refs https://github.com/TryGhost/Product/issues/3850

- Added a recheck for recommendation related webmentions after boot (to
check missed webmentions during down time)
- Increased general timeouts to 15s for all webmention related HTTP
requests. Instead, increased retries to 3.
- Increased timeout for fetching webmention metadata from 2s to 15s
- Added more logging about verification and deletion status of
webmentions
2023-09-20 13:09:47 +02:00
renovate[bot]
474923ba8a Update dependency human-number to v2.0.3 2023-09-20 09:57:23 +00:00
Sanne de Vries
1653533ebe
Updated collection card typography on frontend (#18240)
Refs
https://www.notion.so/ghost/Feedback-2d148e43ff704a63b41222a4ec63b8d3?p=77bcb825854045858785272676393b85&pm=s
2023-09-20 09:09:09 +00:00
Zabriskije
77aa29b00a
Updated Italian translations (#18191)
refs https://github.com/TryGhost/Product/issues/2795
2023-09-20 10:48:47 +02:00
Yovko Lambrev
ccdda6f914
Updated Bulgarian translations (#18226)
refs https://github.com/TryGhost/Product/issues/2795
2023-09-20 09:58:46 +02:00
Daniel Lockyer
d46aab5b43 Optimized bundle size of @tryghost/limit-service
refs https://ghost.slack.com/archives/C0568LN2CGJ/p1695149803260239
refs 290bc71d6a

- previous versions of `@tryghost/limit-service` did a full import of
  lodash, which would bloat the bundle size, especially when we only use
  a few of its functions
- I've since fixed that and this commit bumps Ghost to the smaller
  version
2023-09-20 09:54:07 +02:00
renovate[bot]
188b6d3fd8 Update dependency ws to v8.14.2 2023-09-20 08:30:23 +02:00
Ghost CI
ff3c3a904b Merged v5.64.0 into main 2023-09-20 03:59:19 +00:00
Ghost CI
24bebc1ace v5.64.0 2023-09-20 03:59:17 +00:00
Steve Larson
c0f70144fc
🐛 Fixed collection card post excerpts (#18232)
refs TryGhost/Product#3913
- posts starting with a lexical card resulted in blank space in excerpts
2023-09-19 23:12:57 +00:00
Sag
e1c966b6d7
Added filter option to the Recommendations Admin API's browse endpoint (#18233)
closes https://github.com/TryGhost/Product/issues/3907
2023-09-19 20:42:27 +00:00
Jono M
3928b628ca
Update labs settings in Ember when changed in AdminX (#18231)
refs https://github.com/TryGhost/Product/issues/3832
2023-09-19 18:48:47 +00:00
Steve Larson
fada0237b8
Added link to collections card posts (#18228)
closes TryGhost/Product#3905
- added link to collections card posts
2023-09-19 12:05:29 -05:00
Kevin Ansfield
ff3eb63fd8
Revert "Added page html reset and re-render to handle dynamic collection card content (#18146)" (#18229)
This reverts commit 3e9da6df0c.

- changes introduced an error fetching `/admin/pages/` when using MySQL
- "The values in where clause must not be object or array"
2023-09-19 16:59:56 +00:00
renovate[bot]
65838394c3 Update dependency ws to v8.14.2 2023-09-19 15:59:51 +00:00
Kevin Ansfield
3e9da6df0c
Added page html reset and re-render to handle dynamic collection card content (#18146)
no issue

Collection cards contain dynamic data that can change when there's any change to a published post but in Ghost all post/page content is rendered once on save and stored as a static string meaning we need a new approach for triggering a re-render of pages that plays well with caching.

- fixed typo in the relations/authors code that meant we weren't correctly calling the prototype method on the Post model inside the `onFetchedCollection` event handler
- updated Post model to clear the `html` field of all pages when saving or deleting a published post
- updated Post model to re-render `html` fields when fetching individual posts or a collection of posts
- modified `insertExtraPostsTags` fixture util to wrap it's concurrent post edits in a transaction otherwise MySQL errors because it hits a deadlock
2023-09-19 16:46:38 +01:00
Simon Backx
64b472166c Removed required webmentions flag for mentions admin endpoint
fixes https://github.com/TryGhost/Product/issues/3830

This endpoint is required for recommendations to work: admin-x loads the incoming recommendations by querying the mentions endpoint. If the mentions flag was not enabled, this endpoint wasn't available.
2023-09-19 17:31:55 +02:00
Simon Backx
95c8ba11d6
Added E2E tests for Public Site Settings in members API (#18223)
fixes https://github.com/TryGhost/Product/issues/3901
2023-09-19 14:47:34 +00:00
Sag
d5ad5d2dd0
Added read endpoint to the Recommendations Admin API (#18221)
closes https://github.com/TryGhost/Product/issues/3910
2023-09-19 13:56:26 +00:00
Peter Schulz
72110d101e
Updated copy for broken links table (#18220) 2023-09-19 13:49:27 +00:00
Naz
00e5f84d88
Repopulated collections_posts built-in collections data
closes https://github.com/TryGhost/Arch/issues/74
refs b5d1245be1

- We have turned off the collections feature flag after a unsuccessful attempt to make collections GA. With the flag turned off, collections_posts data has gone stale and needs repopulation to function properly again.
- This migration is meant to clear the data on collections_posts table and repopulated it again the same way initial migration did in 5.5/2023-07-10-05-16-55-add-built-in-collection-posts.js script.
2023-09-19 21:23:53 +08:00
naz
826b5be002
Optimized collection repository queries (#18194)
refs https://github.com/TryGhost/Arch/issues/86

- Creating bookshelf models for each collection_post relation created a
massive overhead. On a dataset with 500k collections_posts records the
timing was roughly 7s comparing to 810ms after the optimization.
- Optimized memory and performance of collections fetching by querying post
ids only by default
2023-09-19 21:07:11 +08:00
Daniel Lockyer
5e466a90be Removed libs/ from Admin-X-Settings file path
refs https://github.com/TryGhost/DevOps/issues/80

- this makes the URL a little cleaner by removing a superfluous folder
2023-09-19 13:42:57 +02:00
Daniel Lockyer
723afd9fe1 Added build:dev action as local dependency for build:dev
refs https://github.com/TryGhost/DevOps/issues/80

- this is needed so we run the local `build:dev` and not just the one
  for Admin-X-Settings
2023-09-19 13:42:57 +02:00
Daniel Lockyer
4c8458ef78 Fixed Admin-X path variable
refs https://github.com/TryGhost/DevOps/issues/80

- I'd previously used the wrong one
2023-09-19 11:58:53 +02:00
renovate[bot]
8843d3c25b Update dependency y-protocols to v1.0.6 2023-09-19 09:53:53 +00:00
Daniel Lockyer
f705dda314 Updated Admin-X bundling process
refs https://github.com/TryGhost/DevOps/issues/80

- as part of moving Admin-X-Setting towards GA, we want to change it from
  loading the settings externally via a CDN, to bundling it in with
  Admin
- the bulk of the changes here are removing the config in Ghost, setting
  up the copy to the Admin assets dir, and loading the new path in Admin
- several other changes have come along the way as I've cleaned up
  unneeded code
2023-09-19 11:31:55 +02:00
naz
9cd542dc59
Optimized collection repository queries (#18194)
refs https://github.com/TryGhost/Arch/issues/86

- Creating bookshelf models for each collection_post relation created a
massive overhead. On a dataset with 500k collections_posts records the
timing was roughly 7s comparing to 810ms after the optimization.
- Optimized memory and performance of collections fetching by querying post
ids only by default
2023-09-19 16:02:14 +08:00
renovate[bot]
8cfff3743b Update dependency postcss to v8.4.30 2023-09-19 08:09:20 +02:00
Fabien "egg" O'Carroll
cbea9e8948 Restricted content gating filter to status & tiers
refs https://github.com/TryGhost/Arch/issues/83

As we've only used the status and tiers in the cache key generation (as those
are currently the only ones that are present in DB's) we want to make sure that
content gating doesn't use any other properties, which means the cache behaviour
will match the content gating behaviour
2023-09-19 12:39:50 +07:00
Fabien "egg" O'Carroll
e865f57e88 Customised key generation for Posts Content API
refs https://github.com/TryGhost/Arch/issues/83

The options included are the only ones which have an effect on the response
data, as well as that we are using the properties of members which are used by
content-gating module. For the read operation we need to include the ID too.
2023-09-19 12:39:50 +07:00
Fabien "egg" O'Carroll
cfef41cd8f Added support for custom cache key generation
refs https://github.com/TryGhost/Arch/issues/83

This allows endpoints to implement their own key generation, with access to the
frame object they can be smart about key generation and use only options and
context values that are appropriate.
2023-09-19 12:39:50 +07:00
renovate[bot]
a753ebc0ab Update metascraper to v5.37.1 2023-09-18 21:19:57 +00:00
Steve Larson
0b64247ad2
Bumped Koenig packages (#18211)
no refs
- few improvements to collections card behaviour
2023-09-18 21:18:52 +00:00
Sag
3b1fcb6c16
Added fixed height to avoid jumps in the Recommendations settings (#18184)
closes https://github.com/TryGhost/Product/issues/3881

We observe the height of the recommendation table, and keep it fixed between pages — so that the UX is smoother when navigating between pages.
2023-09-18 17:43:57 +02:00
Simon Backx
b545dfa0cc
Improved recommendation controller structure (#18208)
fixes https://github.com/TryGhost/Product/issues/3900

1. The service never returns a Recommendation Entity, but always plain
objects (which for now is the same as Recommendation without the
methods).
2. Updated the controller to be more readable and minimal (we keep this
controller, in addition to the existing endpoints and serializers)
- The controller does minimal validation and allows for type checking
(so we get compile time errors in case the service expects new fields)
- The controller uses the `UnsafeData` class to easily validate the
input from requests, and throws appropriate errors (with correct field
descriptions — "Expected a string at recommendations.0.title") without
too much boilerplate code. In addition the interface is typed, so we get
compile errors if there are breaking changes in the service.
- Removed `EntityWithIncludes`, since we now use plain objects, we
inject the relations directly into those plain objects (with some new
types that add type support)
- Added new tests to make sure that edits only affect the given fields,
and never undefined fields
2023-09-18 14:36:49 +00:00
renovate[bot]
541b7c6a6d Update dependency mailgun.js to v9.3.0 2023-09-18 14:01:45 +00:00
Sanne de Vries
353c565739
Fixed collection card empty parameters outputting null on frontend (#18205)
Refs https://github.com/TryGhost/Product/issues/3630

- Bumped kg-default-nodes to 0.1.30
2023-09-18 13:49:45 +00:00
Sanne de Vries
a27ba55b50
Fixed reading time not showing up on frontend (#18201)
Refs https://github.com/TryGhost/Product/issues/3630
2023-09-18 10:58:44 +00:00
Sanne de Vries
6273568718
Added default margin to collection cards (#18199)
Refs https://github.com/TryGhost/Product/issues/3630
2023-09-18 10:24:49 +00:00
renovate[bot]
290ff10dad Update dependency yjs to v13.6.8 2023-09-18 10:17:00 +00:00
Kevin Ansfield
45bc917dea
Fixed collections card display when admin/front-end URLs are different (#18196)
no issue

- the Content API is served from the Admin URL not the Frontend URL but we were fetching from the Frontend URL. That resulted in a 302 response with no CORS headers so the request was blocked by the browser
2023-09-18 10:04:28 +00:00
renovate[bot]
a79717e9ba Update dependency @types/jsonwebtoken to v9.0.3 2023-09-18 08:51:04 +02:00
Steve Larson
3001e4c032
Enabled dynamic post rendering (#18183)
no refs
- contains changes for dynamic rendering with lexical posts
2023-09-15 18:18:18 +00:00