Commit Graph

19378 Commits

Author SHA1 Message Date
Kevin Ansfield
4ceb5dc16b
Fixed error when deleting post (#19369)
closes https://github.com/TryGhost/Product/issues/4230

- deleting a post could cause React components to trigger save tasks during teardown which then threw errors because they attempt to set properties on a deleted model instance
- added checks to the `beforeSaveTask()` to abort if the post object has been deleted
2023-12-13 17:45:23 +00:00
Kevin Ansfield
b74a611fbd
🐛 Fixed hang in editor when back button is pressed whilst feature image caption is focused (#19367)
closes https://github.com/TryGhost/Product/issues/4228

- when leaving the editor via back button the feature image caption editor's blur handler was called by the React editor component after Ember had torn down the route resulting in an attempt to use `post.set()` when `post` doesn't exist
- the error also caused Lexical to re-render to try and recover which then triggered the blur handler again resulting in an infinite loop
- adding a check to ensure `this.post` exists was enough to fix the problem
2023-12-13 17:25:00 +00:00
Daniel Lockyer
bba95ce034 Enabled persistent filesystem caching for Ember builds
fixes https://github.com/TryGhost/DevOps/issues/123

- ember-auto-import supports webpack v5 and v5 supports persistent file
  caching
- this stores a cache of built files across warm boots, so Admin built
  via `yarn dev` should be faster next time
- also ensures that recursive `node_modules` folders are emptied upon
  `yarn fix`, as the webpack cache is stored in `node_modules` under
  `ghost/admin`
- locally, this speeds up a warm build by 2x (!)
2023-12-13 16:40:18 +01:00
Peter Zimon
58d9b8e382
Update migration in settings (#19278)
refs.
7b40393d77

We're improving the usability and possibilities for publishers to
migrate from other platforms such as Substack, Medium or Mailchimp. This
PR applies changes to Ghost Settings to support the new flows, more
specifically:

- moves import and export functions out of Labs to its own setting,
directly available from search and the menu
- adds direct access to various platform migrations
- moves "Delete all content" to a dedicated setting group at the bottom
of all setting

---------

Co-authored-by: Jono Mingard <reason.koan@gmail.com>
2023-12-13 16:25:29 +01:00
renovate[bot]
820c5a4175 Update dependency mailgun.js to v9.4.0 2023-12-13 11:53:07 +00:00
Daniel Lockyer
20b0890a02 Cleaned up duplicate await
- noticed whilst bouncing around the codebase
- shouldn't change anything but it gets rid of some tsserver warnings
2023-12-13 11:54:31 +01:00
Chris Raible
c90e033fcf
Added an email rendering test for all Koenig cards (#19059)
refs TryGhost/Product#4125

This PR adds two new integration tests to ensure all our Koenig cards
are rendered properly after going through the EmailRenderer. Although we
have thorough tests for the cards themselves in the Koenig repo, the
EmailRenderer does post-processing on the rendered HTML, such as
inlining CSS, which can adversely impact the rendered output of our
cards in email clients (usually Outlook).

Since email newsletters are a core feature of Ghost, these bugs are
typically fairly urgent, and since it is email, they are also quite
difficult to troubleshoot and fix. These two tests are intended to
prevent bugs of this sort, which in the past have been created by
seemingly harmless changes like bumping dependencies that are used in
the EmailRenderer.

The idea is to create a 'Golden Post' which has at least 1 of every card
from Koenig, run that post through the EmailRenderer, and take a
snapshot of the rendered HTML. In the future, if we make any changes to
the EmailRenderer or the Koenig cards themselves, this will trigger us
to carefully consider the changes, and it provides an 'expected' output
to compare our changes against.

Additionally, the second test simply checks that all cards from
`kg-default-nodes` are included in the 'Golden Post'. This protects
against any new cards that we will add in the future — as soon as we add
them to Koenig and bump `kg-default-nodes` in Ghost, this test will
fail, prompting us to add the new card to the Golden Post and update the
snapshots.

We should also run the 'Golden Post' through a test in Litmus, which
allows us to visually inspect the rendered email across many different
email clients. Ideally we would create a process to review the output of
the 'Golden Post' in Litmus whenever we update the snapshot as well.
2023-12-12 16:05:04 -08:00
renovate[bot]
3346606d77
Update dependency @tryghost/koenig-lexical to v1.0.8 (#19301)
refs https://github.com/TryGhost/Ghost/pull/19343

- bump was missed in earlier commit
2023-12-12 22:26:12 +00:00
-Nut-
876a0d6b2d
Added Thai translations (#19305)
I've just pushed a commit with the Thai translation. This should be a
sufficient translation but there is always room for improvements and a
second pair of eyes.

---------

Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
2023-12-12 16:39:24 -05:00
Shaun Roselt
0ffbc198be
Updated Missing Afrikaans Translations (#19325)
I added missing Afrikaans Translations

- [x] There's a clear use-case for this code change, explained below
- [x] Commit message has a short title & references relevant issues
- [x] The build will pass (run `yarn test:all` and `yarn lint`)

We appreciate your contribution!
2023-12-12 16:36:12 -05:00
renovate[bot]
45891f83b1 Update dependency ws to v8.15.1 2023-12-12 21:10:38 +00:00
renovate[bot]
d1b41f8f0b Update dependency i18next to v23.7.9 2023-12-12 19:42:27 +00:00
Chris Raible
24910a6ef2
Added Sentry logging in BatchSendingService (#19321)
refs ARCH-25

- Added a log message if the email_count on an email differs from the
totalCount calculated while creating batches by more than 1%, so we can
investigate further.
2023-12-12 11:28:43 -08:00
Kevin Ansfield
565b9b245e
🐛 Fixed callout card not rendering all inline formats (#19343)
refs https://github.com/TryGhost/Ghost/issues/19129

- bumps Koenig packages containing fix for callout card rendering
2023-12-12 19:00:32 +00:00
Kevin Ansfield
b586b63ac9
🐛 Fixed inability to drag-select text in caption alt inputs (#19342)
refs https://github.com/TryGhost/Koenig/pull/1134

- bumps Koenig to version including fix for dragging to select text in caption alt inputs
2023-12-12 18:26:10 +00:00
Kevin Ansfield
9706754d6a
🐛 Fixed quote and aside formatting being lost in single-block snippets (#19341)
refs https://github.com/TryGhost/Product/issues/4197

- bumped Koenig packages containing fix for snippets capturing plain text when only the text of an aside or quote block is selected
2023-12-12 17:56:21 +00:00
Simon Backx
60fb2e3139
Added quantities and seed option to the data generator (#19330)
ref PROD-243
2023-12-12 12:50:55 +01:00
Jono M
2b85980302
Fixed theme template picker state syncing with AdminX (#19328)
refs PROD-235

Special case where we need to set the old theme to inactive after
activating a new theme.
2023-12-12 11:27:59 +00:00
Michael Barrett
95eaaad459
Added custom Sentry integration for Knex.js (#19315)
no refs

Added custom Sentry integration for Knex.js to trace database queries in
Sentry
2023-12-12 11:09:49 +00:00
Sanne de Vries
98ff45647c
🎨 Updated editor layout to be more mobile friendly (#19327)
Refs https://github.com/TryGhost/Ghost/issues/18690
2023-12-12 11:51:59 +01:00
Djordje Vlaisavljevic
5c19249473
Added yearly discount indicator to monthly/yearly toggle PROD-60 PROD-222 PROD 223 (#19276)
refs PROD-60, PROD-222, PROD-223, PROD-89, PROD-94

- Indicator shows up in the monthly/yearly toggle if there are any paid
tiers with yearly discount, and shows the highest discount in order to
nudge visitors towards checking out yearly plan
- A couple of smaller portal improvements: typos, spacing, alignment

---------

Co-authored-by: Simon Backx <simon@ghost.org>
2023-12-12 09:32:56 +00:00
renovate[bot]
8bc3aae20b Update dependency @babel/plugin-proposal-decorators to v7.23.6 2023-12-12 10:31:38 +01:00
Djordje Vlaisavljevic
090c8b59da
Updated Serbian translations (#17841)
refs https://github.com/TryGhost/Product/issues/2795
---

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

This pull request improves the localization of the portal feature for
Serbian users by adding or updating translations in the `portal.json`
file.
2023-12-11 13:22:05 -05:00
Steve Larson
ccc9c9bdd8
Removed emoji picker feature flag (#19314)
closes TryGhost/Product#4109
- requires new editor packages which are bumped in this commit
2023-12-11 09:51:37 -06:00
Jono M
9ff482f985
Updated AdminX routing to work with and without a leading slash (#19312)
no issue
2023-12-11 14:43:06 +00:00
Sanne de Vries
61a91f7dbd
Flipped thumbs-down icon horizontally in email and Portal (#19306)
Refs https://github.com/TryGhost/static/pull/3
- This way the thumbs-down is facing the opposite direction as the
thumbs-up
2023-12-11 13:05:11 +00:00
Kevin Ansfield
1479c55068
🐛 Fixed video uploads hanging in editor when using iOS (#19302)
refs https://github.com/TryGhost/Koenig/issues/1121

- bumps `@tryghost/koenig-lexical` to version including fix (https://github.com/TryGhost/Koenig/pull/1122)
2023-12-11 11:27:59 +00:00
Ronald Langeveld
c969dd18a8
Revert "Fixed private mode cookie for local development (#17938)" (#19298)
This reverts commit f303eee8a4.

refs https://ghost.slack.com/archives/C0568LN2CGJ/p1702277420152709
https://linear.app/tryghost/issue/PROD-46/rss-url-for-private-mode-site-is-hardcoded
2023-12-11 09:18:03 +00:00
renovate[bot]
9fae565673 Update sentry-javascript monorepo to v7.86.0 2023-12-11 09:48:49 +01:00
renovate[bot]
1375a72fbf Update dependency html-validate to v8.7.4 2023-12-11 09:48:39 +01:00
renovate[bot]
2caf1ec93a Update dependency ws to v8.15.0 2023-12-11 03:41:38 +00:00
renovate[bot]
996ca6ac87 Update dependency ts-node to v10.9.2 2023-12-09 10:51:51 +01:00
renovate[bot]
8cbf133614 Update dependency newrelic to v11.6.1 2023-12-07 19:41:46 +00:00
renovate[bot]
b84cb87d90 Update dependency terser to v5.26.0 2023-12-07 15:59:56 +00:00
Kevin Ansfield
309aaf98aa
Added TK support to feature image caption editor (#19285)
closes https://github.com/TryGhost/Product/issues/4227

- added `@onTKCountChange` to `<KoenigLexicalEditorInput>`
  - when present the `isTKEnabled` flag will be turned on and the `<TKCountPlugin>` registered
- added `@registerAPI` support to `<KoenigLexicalEditorInput>` so we can focus the caption editor when its TK indicator is clicked
- added manual display of TK indicator for the caption input
  - default editor indicator positioning doesn't work for this input because its container is not full editor width
  - hid it by adding `overflow: hidden` to the inner caption container
  - added custom indicator button shown when we have a non-zero count
2023-12-07 15:46:23 +00:00
Kevin Ansfield
4b5718f6e3
Added error reporting when editor instances fail to load (#19284)
no issue

- recently we introduced code that broke the editor in older versions of
Safari but we weren't alerted to it until we started getting customer
reports
- we have an `ErrorBoundary` around the React editor components but this
wasn't reporting the error anywhere and simply showed an error message
- updated the boundary to report to Sentry when configured so we can
notice and fix any editor-breaking issues faster
2023-12-07 14:11:07 +00:00
Daniel Lockyer
845d3cf759 Fixed generating multiple members_newsletters records
refs https://github.com/TryGhost/DevOps/issues/119

- members_newsletters needs members_subscribe_events, but it was also
  then generating `subscriptions` records and the whole thing was really
  slow
- for now, subscriptions is not a used table so we can remove use of it
- also adds support for generating more than one subscription record
  with an 80% chance of being subscribed
2023-12-07 14:44:00 +01:00
Daniel Lockyer
db16e565bc Added --print-dependencies to data generator
refs https://github.com/TryGhost/DevOps/issues/119

- this allows you to debug the dependency chain to understand why a
  particular table is being generated
2023-12-07 14:44:00 +01:00
Daniel Lockyer
ff34a98b94 Deduplicated batch insertion code
refs https://github.com/TryGhost/DevOps/issues/119

- this function can simply call the `import` function, which performs
  the same code as we had here
- this makes the code cleaner to read and understand
2023-12-07 14:44:00 +01:00
Daniel Lockyer
76455cb64a Decreased likelihood of duplicate member emails
refs https://github.com/TryGhost/DevOps/issues/119

- we can just expand the range here so it becomes extremely unlikely to
  ever hit duplicate emails
2023-12-07 14:44:00 +01:00
Daniel Lockyer
bb99a4c394 Removed unnecessary await
refs https://github.com/TryGhost/DevOps/issues/119

- this is not needed and tsserver was flagging it up
2023-12-07 14:44:00 +01:00
Daniel Lockyer
739c690a29 Fixed generating duplicate newsletter names
refs https://github.com/TryGhost/DevOps/issues/119

- this switches away from using a static list of names in favor of ones
  generated by faker, so we don't run into duplicate names
- also minor code re-arranging
2023-12-07 14:44:00 +01:00
renovate[bot]
8197a740b1 Update dependency metascraper to v5.41.0 2023-12-07 12:36:19 +00:00
Chris Raible
1b43b5c60a
Added Sentry performance monitoring to Ghost Server (#19243)
refs ARCH-21

- We currently have NewRelic setup for a few of our largest customers
for monitoring performance, but it is too expensive to enable across all
sites
- Sentry has similar (but simpler) performance monitoring tools to keep
track of response times that are available to us for free, but we just
haven't configured them
- This PR sets up Sentry Performance monitoring for API requests so we
can have one place for monitoring errors + performance so we can stay on
top of response times more easily.
- Tracing is disabled by default, so there is no additional overhead
unless `sentry.tracing.enabled` is set to `true` in the site's config.
Additionally, `sentry.tracing.sampleRate` should be set to a decimal
value between 0 and 1. This value defaults to 0 to avoid accidentally
blowing through quota, and requires a value to explicitly be set in
order to send the traces to Sentry.
2023-12-06 15:04:35 -08:00
renovate[bot]
a87804be57 Update dependency i18next to v23.7.8 2023-12-06 20:43:02 +00:00
renovate[bot]
1c04bdbdb2 Update dependency typescript to v5.3.3 2023-12-06 21:29:30 +01:00
renovate[bot]
24f73321ce Update metascraper to v5.40.0 2023-12-06 20:10:16 +00:00
Kevin Ansfield
1071317780
Fixed TK indicators not being correct when opening post with TKs (#19263)
no issue

- bumps `@tryghost/koenig-lexical` which includes fix and performance improvement for TKs
2023-12-06 17:38:33 +00:00
Steve Larson
549aaa4c5a
Added tests for TK indicators within editor (#19262)
closes TryGhost/Product#4225
- added basic tests for TK detection in title
- added coverage for TK reminder modal popping up
2023-12-06 11:29:27 -06:00
Kevin Ansfield
8f43cc9ad2
Fixed horizontal positioning of TK indicators on wider cards (#19257)
no issue

- bumped `@tryghost/koenig-lexical` for improved positioning behaviour
2023-12-06 12:12:37 +00:00