Commit Graph

18598 Commits

Author SHA1 Message Date
Fabien "egg" O'Carroll
b64be18e74 Export Offer from @tryghost/members-offers
This will allow us to implement the Repository outside of the package, as it
needs access to the Entity factory to create instances.
2023-09-02 16:58:48 +07:00
Fabien "egg" O'Carroll
00072a204f Simplified use of ValueObject in OfferRepository
I don't think we need to instantiate and use the `equals` method here. It adds
an extra dependency to the Repository implementation, but it is slightly more
"correct" as it means that we leak internals by comparing strings exactly?

The ValueObject pattern here was very much a trial and isn't something we're
necessarily sticking with, so I don't see a problem with this string comparison.
2023-09-02 16:58:48 +07:00
Fabien "egg" O'Carroll
a97383f2de Moved Offer event logic into the Offer Entity
We do not want our Repositories to implement business logic like deciding which
events should be created. As that creates too tight of a coupling, and makes it
harder to swap out repositories in future. Instead they should only be concerned
with the storage, retrieval and hydration of Entities from the persistence engine.
2023-09-02 16:58:48 +07:00
Fabien "egg" O'Carroll
af9be12a08 Fixed @tryghost/domain-events relying on NODE_ENV
When using this package without setting a NODE_ENV environment variable it would
completely crash.
2023-09-02 16:58:48 +07:00
Simon Backx
b49d5a6964
Wired up saving title when editing recommendations (#17930)
no issue

- Also fixes a backend issue with nullable fields
- Fixes blurring the url input and setting the value to '/'
automatically while we expect absolute urls
- Added autoFocus to inputs
2023-09-01 15:19:25 +00:00
Ghost CI
31d9165296 v5.61.0 2023-09-01 15:04:56 +00:00
Kevin Ansfield
127cbfa62d
Improved save-waiting when leaving beta editor (#17929)
no issue

- adds explicit waits for the two save tasks when leaving the editor before any other checks or saves are triggered
- cleans up some errors around task cancellation that could be triggered when leaving the editor with an existing save running
2023-09-01 14:51:18 +00:00
Daniel Lockyer
c6cb35074a Updated linting and testing packages 2023-09-01 15:51:17 +02:00
Kevin Ansfield
d67a7bdc58
Fixed console error when leaving new post screen with beta editor (#17928)
no issue

- when a post is new it has no revisions but in the `willTransition` hook we were using `lastRevision.get` even though `lastRevision` was null
- adjusted the `hasChangedSinceLastRevision` conditional to always be `false` for new posts
2023-09-01 13:35:59 +00:00
Kevin Ansfield
a4f6a33fee
Fixed "new post" button showing 500 error when editor beta is enabled (#17926)
refs https://github.com/TryGhost/Ghost/pull/17876

- the redirect added for the beta editor was always redirecting to `lexical-editor.edit` even when accessing `editor.new` which resulted in an incorrect route params error and a 500 screen
- switched to redirecting to the correct new/edit route based on the route we're trying to access
2023-09-01 13:31:40 +00:00
Simon Backx
8600ccf387 Added BookshelfRepository and BookshelfRecommendationRepository
refs https://github.com/TryGhost/Product/issues/3800
2023-09-01 15:10:34 +02:00
Simon Backx
d5c8804e23 Updated InMemoryRecommendationRepository to follow newer pattern
refs https://github.com/TryGhost/Product/issues/3800
2023-09-01 15:10:34 +02:00
Raka Afp
b447bda89d
Updated Bahasa Indonesia translations for Portal (#17921)
refs https://github.com/TryGhost/Product/issues/2795
2023-09-01 14:27:00 +02:00
Sanne de Vries
5ca082cd7c
Added CSS variable to adjust card width when sidebar is open (#17919)
Refs https://github.com/TryGhost/Product/issues/3713
2023-09-01 09:18:31 +00:00
Sag
96d9099195
Revert "Added support for importing Stripe Coupons as Offers (#17415)" (#17915)
refs https://github.com/TryGhost/Product/issues/3674
refs https://github.com/TryGhost/Product/issues/3675

- this reverts commits 8a32941ae8 and
b587429008
- the reverted commits added some logic to create offers based on a
Stripe coupon. However, the logic bypassed the Offer entity, and
therefore skipped any validations/constraints — causing invalid data in
the database and some sites to crash.
2023-09-01 09:49:29 +02:00
Sanne de Vries
a19883ac75
Fixed signup and header card split layout bug on frontend (#17916)
No ref
2023-09-01 07:20:17 +00:00
Naz
608d4dfa10 Optimized the amount of logs produced by collections module
refs https://github.com/TryGhost/Arch/issues/82

- Collections logs are too verbose causing noise.
- Moved some of the logs to use "debug" for now and made summarized logs for the information that we still need while collections code is actively monitored. The event info logs can be removed once we are passed the active phase of rolling out the collections feature
2023-09-01 12:40:54 +08:00
Kevin Ansfield
ea60b40a4c
Bumped @tryghost/bookshelf-plugins (#17913)
no issue

- adds additional debug data to `UpdateCollisionError`
2023-08-31 16:19:22 +00:00
renovate[bot]
a2d16ab7de Update dependency ember-cli-babel to v8 2023-08-31 17:46:50 +02:00
renovate[bot]
bde3465af5 Update dependency @types/luxon to v3.3.2 2023-08-31 17:40:59 +02:00
Kevin Ansfield
ca6e7dfb88
Added drop of intermediate post saves between current running and latest triggered (#17912)
no issue

- every triggered save was being added to a queue resulting in an unnecessary number of requests in some circumstances because it means every triggered save would be run sequentially even though the intermediate saves could be safely thrown away if we're still waiting on a response to a previous one
- switched from a standard queue to ember-concurrency's `keepLatest` behaviour
  - drops intermediate saves if multiple saves are triggered whilst still waiting on a previous save
  - http://ember-concurrency.com/docs/task-concurrency#keepLatest
2023-08-31 15:18:02 +00:00
renovate[bot]
de13a7ff65 Update dependency socket.io to v4.7.2 2023-08-31 15:17:43 +00:00
Simon Backx
96fefaea69
Added well known recommendations service (#17895)
fixes https://github.com/TryGhost/Product/issues/3797 
fixes https://github.com/TryGhost/Product/issues/3776 
fixes https://github.com/TryGhost/Product/issues/3798

- Added support for storing json webmentions
- Improved handling deleted webmentions (set deleted to true instead of verified to false)
2023-08-31 14:57:18 +00:00
renovate[bot]
e97b71dc52 Update dependency i18next to v23.4.6 2023-08-31 14:57:02 +00:00
renovate[bot]
311674b629 Update dependency entities to v4.5.0 2023-08-31 14:54:46 +00:00
renovate[bot]
e2bc680160 Update dependency terser to v5.19.3 2023-08-31 14:44:25 +00:00
renovate[bot]
b32825cb46 Update metascraper 2023-08-31 14:43:35 +00:00
renovate[bot]
b891b8be6b Update dependency mysql2 to v3.6.0 2023-08-31 14:32:07 +00:00
renovate[bot]
13837b166d Update dependency handlebars to v4.7.8 2023-08-31 13:26:36 +00:00
Gab
3dca1f09f0
Updated Spanish translations (#17816)
refs https://github.com/TryGhost/Product/issues/2795
2023-08-31 15:12:12 +02:00
renovate[bot]
8192b4bc7c Update dependency mailgun.js to v9.2.1 2023-08-31 11:50:35 +00:00
Kevin Ansfield
b15d4b0c2b
Bumped Koenig packages (#17891)
no issue

- includes fix for posts showing as edited and requiring save after automatic mobiledoc->lexical conversion (https://github.com/TryGhost/Koenig/pull/898)
2023-08-31 11:38:13 +00:00
Sag
f56c36ca24
Wired up recommendations in Portal (#17888)
closes https://github.com/TryGhost/Product/issues/3796
refs https://github.com/TryGhost/Product/issues/3770

- also added a public endpoint for Recommendations in the Content API
2023-08-31 10:07:49 +00:00
Simon Backx
875fe939a5
Wired up adding recommendations via admin-x (#17878)
refs https://github.com/TryGhost/Product/issues/3773
2023-08-31 11:26:12 +02:00
Ronald Langeveld
37512a712d
Added email settings links to point to Admin X (#17883)
refs https://github.com/TryGhost/Product/issues/3349

- added conditions to change the url links to point admin X in staff
emails where the user have admin X enabled in Labs.

---

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

This pull request enables the staff service to support the new admin
settings UI feature flag. It modifies the `StaffServiceEmails` and
`StaffService` modules to use the `labs` dependency and generate the
staff URL accordingly. It also updates the email templates that include
the staff URL.
2023-08-31 16:16:45 +07:00
renovate[bot]
eab974687f Update dependency express-lazy-router to v1.0.6 2023-08-31 08:52:28 +00:00
Daniel Lockyer
b8b2f20f03 Updated i18n keys
- these had become out of sync with the ones Portal uses
2023-08-31 10:38:19 +02:00
Sodbileg Gansukh
c759f419a1 Added max padding limit to Signup and Header cards
refs https://forum.ghost.org/t/anyone-else-seeing-page-too-wide-errors/40695

- google search console snapshots websites with their full height instead of scrolling
- that makes the value of vmax too much, especially when a page has lots of content
- this fixes the issue by adding max limit to the padding values with vmax
2023-08-31 16:16:20 +08:00
Kevin Ansfield
5f5ad4d5dd
Added automatic conversion of old content when opening in beta editor (#17876)
no issue

Previously the beta editor only worked for newly created posts/pages, any older content would open with the original editor. This change enables automatic conversion of old content to the new content format when a post/page is opened in the admin interface allowing new features like signup and advanced header cards to be used on existing content.

- removed `convertToLexical` feature flag
  - where necessary switched to using just the `lexicalEditor` feature flag in its place
- moved the "L"/"M" indicators on the posts list to a new `lexicalIndicators` feature flag to make debugging/development easier
- added a redirect to the original editor route so that any route to opening the editor (such as the `/edit` front-end shortcut, or other areas of Admin) will open in the beta editor
  - avoids confusing/inconsistent behavior
2023-08-30 16:54:03 +01:00
Sanne de Vries
c3a7e43286
Updated old Spirit class to stop overriding of Tailwind in editor (#17874)
No ref
2023-08-30 14:41:49 +00:00
Djordje Vlaisavljevic
feb55ccc00
Recommendations settings design tweaks (#17875)
refs https://github.com/TryGhost/Product/issues/3791

- Added realistic recommendations placeholders
- Slightly improved Recommendations list design
2023-08-30 14:39:36 +00:00
Simon Backx
310f01da0b
Wired up deleting recommendations from admin x (#17873)
fixes https://github.com/TryGhost/Product/issues/3793
2023-08-30 14:24:55 +02:00
renovate[bot]
d418a431be Update sentry-javascript monorepo to v7.66.0 2023-08-30 14:00:40 +02:00
Lasse Stolley
ee8bb2a724
Updated German translations (#17840)
refs https://github.com/TryGhost/Product/issues/2795
2023-08-30 13:49:59 +02:00
Simon Backx
78ae776c5e
Added Recommendations browse API to admin-x-settings (#17870)
refs https://github.com/TryGhost/Product/issues/3786
2023-08-30 10:25:31 +00:00
Naz
b54191dbe4 Added killswitch for collection sync functionality
refs https://github.com/TryGhost/Arch/issues/80
refs 3960bfac1d

- The killswitch (a setting in host settings) is needed to control the feature on a hosted environment, so we can safely turn it off if it causes any major issues.
2023-08-30 18:22:22 +08:00
Daniel Lockyer
cc085bafe9 Added function names to all Express middleware
refs https://github.com/TryGhost/DevOps/issues/68

- without a name, tools such as New Relic report the function as
  `<anonymous>`, which makes it incredible hard to follow the code flow
- this commit adds a function name to all middleware I can find that
  doesn't already have one, which should fill in a lot of those gaps
2023-08-30 11:47:50 +02:00
Daniel Lockyer
eb718276e8 Configured New Relic to load earlier in the process
refs https://github.com/TryGhost/DevOps/issues/68

- we want New Relic to be one of the first modules to load so it can
  instrument the rest of our code
- previously this would not have been the case, and it would have missed
  out on instrumenting the config and logging code
- this moves the require to be the first step in the process if the
  PRO_ENV env var is set
2023-08-30 11:47:50 +02:00
Sag
f1cd6432a8
Added new setting to enable Recommendations (#17856)
closes https://github.com/TryGhost/Product/issues/3772

- Recommendations are disabled by default and will get enabled when a
first recommendation is added. The "recommendations_enabled" setting
will be not shown explicitly in Admin, it will rather be set implicitly
based on whether there is at least one recommendation
- The "recommendations_enabled" setting belongs to a new setting group
called "recommendations"

Tech Spec: https://www.notion.so/ghost/Recommentions-Tech-Spec-598f09e4109f4eef8d9e32db7245a90c?pvs=4
2023-08-30 08:56:21 +00:00
Sag
89e9e4a2b8
Added Recommendations table (#17862)
closes https://github.com/TryGhost/Product/issues/3775

- Recommendations tech spec:
https://www.notion.so/ghost/Recommentions-Tech-Spec-598f09e4109f4eef8d9e32db7245a90c?pvs=4#d59dd64cf40144bc944319b65436a730
2023-08-30 10:33:49 +02:00