Commit Graph

2065 Commits

Author SHA1 Message Date
Ronald Langeveld
539550b481
Bumped packages (#17196)
refs https://github.com/TryGhost/Team/issues/3544

- Bumps required packages to fix an issue on posts that still contains base64 images.

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

Updated `@tryghost/helpers` dependency to fix some helper issues. This
improved the accuracy and security of the `{{reading_time}}` and
`{{encode}}` helpers in Ghost themes.
2023-07-04 11:14:45 +00:00
Simon Backx
1b33634495
🐛 Fixed sending newsletters with counter-reset CSS styles in custom HTML (#17194)
fixes https://github.com/TryGhost/Team/issues/2937

Bumps juice to 9.1.0:
- Support for 'auto' width and height attributes
- Fixed a bug with counter-reset styles
- Dependencies updates
2023-07-04 10:18:16 +02:00
Naz
e22d8e8680 Extracted model event interceptor to separate package
refs https://github.com/TryGhost/Ghost/pull/17065

- This is a follow up cleanup work after introducing even mapper when working on collections refresh mechanism.
- This module manages interception of the Model events and maps/dispatches Domain events that could later be used in different libraries.
2023-07-03 18:47:27 +08:00
Kevin Ansfield
292663f447
Simplified rendered structure of nested lists in beta editor (#17178)
refs https://github.com/TryGhost/Team/issues/1919
refs https://github.com/TryGhost/Koenig/pull/796

Adjusts rendered output of nested lists to make styling easier (and more
typical) for theme developers.

Before:
```html
<ul>
  <li>one</li>
  <li>
    <ul>
      <li>one.one</li>
    </ul>
  </li>
</ul>
```

After:
```html
<ul>
  <li>one
    <ul>
      <li>one.one</li>
    </ul>
  </li>
</ul>
```
2023-07-03 10:44:31 +01:00
Sanne de Vries
4a6a61b29b
Added feature flag for page improvements (#17176)
No ref
2023-07-03 09:24:57 +02:00
Ghost CI
8b164b8dbf v5.53.3 2023-06-30 15:02:52 +00:00
Simon Backx
8b610d46b1
Cleaned up batch email utils (#17165)
no issue
2023-06-29 15:29:16 +02:00
Simon Backx
c90424542e
🐛 Fixed signup card in post plaintext and email preheader (#17163)
fixes https://github.com/TryGhost/Team/issues/3542

The signup card text was included in the post plaintext/excerpt and
email preheader
2023-06-29 14:45:30 +02:00
Simon Backx
e6dbc0bc4c
🐛 Fixed repeating text in plaintext version of emails (#17162)
fixes https://github.com/TryGhost/Team/issues/3541

The email preheader, which is only present in the html version of an
email, is also included in the plaintext version of all emails. This
results in all text being duplicated twice in plaintext emails.
2023-06-29 12:47:17 +02:00
Simon Backx
c41694f5e6
Added E2E Koenig Lexical card tests for paragraphs and signup card (#17159)
refs https://ghost.slack.com/archives/C04TMVA1D7A/p1687987311455289
2023-06-29 11:10:56 +02:00
Ghost CI
a85d455d1b Merged v5.53.2 into main 2023-06-29 08:53:43 +00:00
Ghost CI
1e9844e781 v5.53.2 2023-06-29 08:53:41 +00:00
Ronald Langeveld
04970b4995 🐛 Fixed email breaking when signup card is added
ref https://ghost.slack.com/archives/C04TMVA1D7A/p1687987311455289
2023-06-29 10:34:39 +02:00
Ronald Langeveld
08e1bcd50c Bumped Koenig packages
no issue
2023-06-29 10:11:20 +02:00
Fabien "egg" O'Carroll
d4027a4797 Added BookshelfCollectionsRepository
This implements the CollectionRepository interface and can be swapped out with
the existing repository to persist collections to the database.
2023-06-29 01:40:05 +01:00
Fabien "egg" O'Carroll
724c95cd92 Added bookshelf model for collections
We setup the relations and NQL expansions/replacements here rather than in the
repository, we want to keep all the bookshelf code together in one place.
2023-06-29 01:40:05 +01:00
Fabien "egg" O'Carroll
cf83d169db Added use of a slug generator to offload calculation of slugs
When we end up wiring this to the database, this generator will also ensure
uniqueness by appending/incrementing a number on the end of the slug. Long term
it would be good to offload this to a shared slug service, this could also
ensure that slugs are unique globally or between multiple tables, if desired
2023-06-29 01:40:05 +01:00
Fabien "egg" O'Carroll
9771e1f5c1 Renamed collections service wrapper to service.js
This follows our existing patterns and protects us from th eslint max line rule
when wiring up dependencies. The rule is designed to keep logic out of glue
code, and this file won't have logic, just lots of deps.
2023-06-29 01:40:05 +01:00
Michael Barrett
636c916715
Fixed leaking pivot fields (#17142)
fixes https://github.com/TryGhost/Team/issues/2657

The `omitPivot` option does not have an affect on a models
`_previousAttributes`. When we serialise a model and want to retrieve
the previous attributes we need to ensure we manually remove the pivot
fields

See
7704fbc5e8/lib/base/model.js (L512)
2023-06-28 13:16:50 +01:00
Daniel Lockyer
12deff4a16 Fixed performance issue when checking theme name
refs 1374e3f70c

- see referenced commit for the explanation
- this bumps GScan to bring in that fix
2023-06-27 17:04:34 +02:00
Naz
9767e1f591 Fixed PostEditedEvent data mapping
refs https://github.com/TryGhost/Team/issues/3169

- The "current" part of the payload should always have the "id" included to make the data structure easier to use for the event consumer
2023-06-27 12:52:10 +07:00
Naz
5dd6159ac6 Added handling for 'post.edited' Ghost model event
refs https://github.com/TryGhost/Team/issues/3169

- Adds optomized collection update handling for when post.edited model event is emitted.
2023-06-27 12:52:10 +07:00
Naz
623599af1e Moved DomainEvents to be injected to Collections
refs https://github.com/TryGhost/Team/issues/3169

- With the new architecture all possible dependencies should be  injected rather than required directly - this applies to the DomainEvents module as well.
2023-06-27 12:52:10 +07:00
Naz
1fb8fb9bd5 Reduced the amount of events Collections listens on
refs https://github.com/TryGhost/Team/issues/3169

- When a not yet mapped event is produced by Ghost model the posts belonging to a collection are recalculated in a brute-force way. This causes a lot of strain on the database and times out some of the tests. Right now we only care about a handful of events, so limited the ones we listen to and will be uncommenting the rest when we have an optimal mapping/handling for them.
2023-06-27 12:52:10 +07:00
Naz
f74588f9c2 Fixed date filtering in collections
refs https://github.com/TryGhost/Team/issues/3169

- To be able to apply NQL filtering on Collection Posts the dates should be serialized to be ISO Date Strings instead of raw Dates. Otherwise, NQL filtering fails to compare Date with a Date String.
2023-06-27 12:52:10 +07:00
Naz
58a18d37ea Introduced PostEvent classes to make event handling less generic
refs https://github.com/TryGhost/Team/issues/3169

- When handling a single generic event the code becomes riddled with if statements to detect correct "data" that is being passed with the event. Switching to have a domain event per model event helps solving this problem and makes code more readable.
2023-06-27 12:52:10 +07:00
Naz
e7a0462877 Added model event to domain event bridge
refs https://github.com/TryGhost/Team/issues/3169

- To make the coupling to Ghost's model events as loose as possible added a bridge that maps model events to domain events. These domain events it what the collections module can subscribe to to make necessary updates.
2023-06-27 12:52:10 +07:00
Naz
2eb7f7dd25 Updated collections event initialization
refs https://github.com/TryGhost/Team/issues/3169

- Ghost model events should not be crossing emitted to outside libraries. The wrapper code is a "glue code" that can still listen to model events but transforms them to specific format that is useful for the collections module
- This hooks up the Ghost model events and transforms them into a "CollectionEvent" format.
2023-06-27 12:52:10 +07:00
Daniel Lockyer
1bce363bd3
Updated linting and migration comment to improve practices
refs https://github.com/TryGhost/Toolbox/issues/602

- the new regex allows for the filename to contain seconds, which would have
  helped prevent a bug we had with migrations being in the wrong order
- mentioned filename ordering in the migration review comment to bring
  that to the forefront of the mind
2023-06-26 15:29:37 +02:00
Kuba
9601285c3d
Added bulkEmail.batchSize option to configure batch size
refs https://github.com/TryGhost/Ghost/issues/15725

This pull request adds a new configuration option for the Mailgun email
provider that allows the user to set the maximum number of recipients
per email batch via a new config option `bulkEmail.batchSize`
2023-06-26 12:57:44 +02:00
Ghost CI
f716e31122 v5.53.1 2023-06-23 17:50:26 +00:00
Daniel Lockyer
6b89522c76
🐛 Fixed ordering of Collections migrations
fixes https://github.com/TryGhost/Ghost/issues/17125

- both collections migrations have the same timestamp so they're ordered
  based upon their slug name, and the one that creates
  `collections_posts` is ordered before the one that created
  `collections`
- as a result, the migration fails because the table does not exist
- this commit pushes the `collections_posts` migration after the other
  one by bumping the timestamp
2023-06-23 19:36:02 +02:00
Ghost CI
4c72f45676 v5.53.0 2023-06-23 15:12:57 +00:00
Ghost CI
fb8689f10b 🎨 Updated Casper to v5.5.1 2023-06-23 15:12:56 +00:00
Ronald Langeveld
5247d28a80
Added beta of the new Signup Card (#17124)
no issue

Keep an eye on Ghost's changelog (https://ghost.org/changelog/) for the
full feature announcement.


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

This pull request removes the `signupCard` feature flag and enables the
signup card for all users in the Lexical editor. This is part of the
Lexical editor beta release, which is a new editor for Ghost that
provides a better writing experience and more features for content
creators.
2023-06-23 16:59:46 +02:00
Fabien "egg" O'Carroll
bd6e476c57 Added tables to persist Collections
refs https://github.com/TryGhost/Team/issues/3427
2023-06-23 16:11:55 +02:00
Simon Backx
24df9628db
Corrected signup card css for responsive images (#17122)
no issue

The padding for the background image was wrong on smaller devices
2023-06-23 15:36:26 +02:00
Simon Backx
da72f8998e
Updated @tryghost/kg-lexical-html-renderer and @tryghost/kg-default-nodes (#17121)
no issue
2023-06-23 14:35:07 +02:00
Simon Backx
78405a9cb8
Corrected image CORS (#17119)
refs
018f97e679
2023-06-23 14:33:00 +02:00
Sag
9085ae1266
Reduced boilerplate required when building a new Lexical card (#17118)
refs https://github.com/TryGhost/Team/issues/3365

- bumped koenig-lexical, kg-default-nodes and kg-lexical-html-renderer
to a new minor
2023-06-23 13:48:11 +02:00
Simon Backx
c7f5ea4560
Added CSS changes for signup card picture/img elements (#17117)
refs https://github.com/TryGhost/Team/issues/3523

Instead of background images, we now use picture elements (with img
tags).
2023-06-23 13:42:14 +02:00
Michael Barrett
6f5baca849
Add endpoint to record mail events (#16990)
refs https://github.com/TryGhost/Team/issues/3319
2023-06-23 12:22:01 +01:00
Simon Backx
018f97e679
Added Access-Control-Allow-Origin: * to image assets (#17115)
refs https://ghost.slack.com/archives/C025584CA/p1687506966658799
refs https://ghost.slack.com/archives/C04TMVA1D7A/p1687426009256949

This change is required because we otherwise hit CORS issues when admin
tries to load an image and calculate the average color (to determine the
text color).
2023-06-23 11:10:48 +02:00
Daniel Lockyer
55b7bef9ad Fixed disabling search via config
fixes https://github.com/TryGhost/Ghost/issues/16120

- if you set `sodoSearch.url` to `false` in config, it'll currently
  crash because we're not correctly handling the types correctly
- the first part of the fix is ensuring the value is a string so we can
  call `.includes` on it
- second, the `false` value is passed into the output as a string, so we
  should detect if we passed a false value and early return with an
  empty string if so
- credits to https://github.com/ltoinel for the fix inspiration
2023-06-23 10:51:43 +02:00
Sanne de Vries
710d2143c2
Updated signup card background image positioning (#17113)
No ref
2023-06-23 10:27:20 +02:00
Princi Vershwal
5a1dcbc9a5
Removed Bluebird Promise.map from user.js file (#17112)
refs https://github.com/TryGhost/Ghost/issues/14882

Co-authored-by: Princi Vershwal <princi.vershwal@Princis-MacBook-Pro.local>
2023-06-23 10:13:02 +02:00
Daniel Lockyer
08e2fbeacb Removed Bluebird from tests
refs https://github.com/TryGhost/Ghost/issues/14882

- we're moving away from using Bluebird in favor of native Promises, so
  this commit removes nearly all instances from tests
2023-06-23 10:03:03 +02:00
Princi Vershwal
2798d43663
Removed Bluebird Promise.each from db.utils (#17032)
refs https://github.com/TryGhost/Ghost/issues/14882

Co-authored-by: Princi Vershwal <princi.vershwal@Princis-MacBook-Pro.local>
Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2023-06-23 09:46:41 +02:00
Princi Vershwal
cc95c39dbb
Removed Bluebird Promise.map from settings.js file (#17086)
refs https://github.com/TryGhost/Ghost/issues/14882

Co-authored-by: Princi Vershwal <princi.vershwal@Princis-MacBook-Pro.local>
2023-06-23 09:16:16 +02:00
Princi Vershwal
d9c739efb7
Removed Bluebird Promise.map from apps index.js file (#17073)
refs https://github.com/TryGhost/Ghost/issues/14882

Co-authored-by: Princi Vershwal <princi.vershwal@Princis-MacBook-Pro.local>
2023-06-23 09:13:29 +02:00