Commit Graph

14658 Commits

Author SHA1 Message Date
Ghost CI
e1e5a7b35e v5.19.3 2022-10-18 16:18:29 +01:00
Simon Backx
a822c5a8c5 Added test to check if feedback buttons are hidden if alpha flag is disabled 2022-10-18 16:47:06 +02:00
Simon Backx
8ecf0a5858 🐛 Fixed alpha feature visible in new newsletters
no issue
2022-10-18 16:38:59 +02:00
Ghost CI
14a259b828 v5.19.2 2022-10-18 09:51:41 +01:00
Simon Backx
d1e6870740
🐛 Fixed large mailgun recipient data (#15638)
fixes https://github.com/TryGhost/Team/issues/2096

When generating the recipient data for emails, the email clicks
implementation is resulting in a recipient variable being added called
replacement_xxx once for each link containing the same UUID.

This generates a lot of unnecessary data overhead for emails, and it
turns out that mailgun has a 25MB message limit. We wouldn't have come
close if we only included the uuid once.
2022-10-18 10:32:50 +02:00
Ghost CI
9a2fcba68a v5.19.1 2022-10-17 11:45:59 +01:00
Naz
66c2d3748a
🐛 Fixed 404 collection links for new tags
closes https://github.com/TryGhost/Ghost/issues/15608
closes https://github.com/TryGhost/Toolbox/issues/437
refs https://github.com/bookshelf/bookshelf/issues/2111
refs https://github.com/knex/knex/issues/1641

- When new tag was attached to the post the tag collection link returned 404 - instead of a collection with one post
- The root cause of the issue and it's flaky behavior (sometimes the collection link was returning correctly) was a race condition between event propagation in routing for "tag.attached" event and the post+tag+relations transaction completion
- The race condition was happening as the bookshelf-transaction-events plugin was emitting the 'committed' event BEFORE the transaction was committed!
2022-10-17 18:21:10 +08:00
Daniel Lockyer
eb30e464d3
Added handling for unsuccessful comments API requests
refs https://github.com/TryGhost/Team/issues/2082

- in the event the API doesn't return a 200 OK, we shouldn't be
  processing the response from it, as we can end up doing weird things
  if, for example, an error object is returned
2022-10-17 12:07:18 +07:00
Daniel Lockyer
7ac0fdb23d
Fixed unnecessary requests with loading comment counts
refs https://github.com/TryGhost/Team/issues/2082

- if a site has comments enabled but doesn't use the `comments_count`
  helper, the comments-count.min.js will still be loaded and it'll send
  a POST request to Ghost with an empty array of post IDs to fetch
- this is unnecessary and we should avoid this extra request for pages
  that don't need to show comment counts
- this commit prevents the comment-counts JS from sending the request if
  there are no post IDs to fetch
2022-10-17 11:51:14 +07:00
Ghost CI
4e3afadfef v5.19.0 2022-10-14 16:00:45 +01:00
Elena Baidakova
e831be6bc2
Added the feedback buttons in the emails (#15619)
closes TryGhost/Team#2046
closes TryGhost/Team#2045
- Added feedback buttons markup.
- Added feedback links generation.
2022-10-14 18:12:17 +04:00
James Morris
e074676e12 Updated engagement bar metrics so when no link it doesn't hover
no issue
2022-10-14 12:19:29 +01:00
James Morris
60ce10be9f Fixed up more like this and newsletter clicks table at narrower viewports
no issue
2022-10-14 11:18:56 +01:00
Fabien "egg" O'Carroll
370ded5c77 Stored price and currency data on Tiers when creating & editing
refs https://github.com/TryGhost/Team/issues/2029

This will allow us to start decoupling the Stripe side of things once we've got
the core data stored. We've also add some integrity checks on the incoming
monthly_price and yearly_price to ensure they are the same currency.
2022-10-14 16:31:26 +07:00
Fabien 'egg' O'Carroll
8afc6777c0
🐛 Removed redirects from search engine indexing (#15617)
refs https://github.com/TryGhost/Team/issues/2072

Google is indexing our redirects and storign the redirected content
against the redirect URL in search results. This seems to be caused by
us using a 302 redirect rather than 301. We don't want to switch to a
301 however, so that we can support the ability to update redirects in
the future.
2022-10-14 15:51:43 +07:00
Fabien 'egg' O'Carroll
bd0f4b4b8c
Added Tier price and currency data to products table (#15366)
refs https://github.com/TryGhost/Team/issues/1765

In order to better handle deleted objects in Stripe we want to decouple
Members from Stripe.

These changes allow us to have the Tier concept completely independent
of the Stripe tables, such that the Stripe data can be generated as/when
it's needed - which will help to protect against missing data.
2022-10-14 06:40:17 +01:00
Barno
5c361670ce
Replaced Promise.each() with .all() in models/base/bookshelf (#15509)
refs: https://github.com/TryGhost/Ghost/issues/14882

- Removing bluebird specific methods in favour of native promises so we can remove the bluebird dependency.

Co-authored-by: Carol-Barno <cbarno@innovexsolutions.co.ke>
Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
2022-10-13 15:24:05 +01:00
renovate[bot]
63f90c2305
Pinned dependencies (#15612)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-13 18:48:09 +07:00
jbenezech
75811f35bc
🐛 Fixed embedded cards for non-utf8 content (#15578)
closes: https://github.com/TryGhost/Ghost/issues/14973

- When fetching content using a non-standard charset, characters were notproperly decoded to utf-8 resulting in mangled text in the editor -> Detect charset and use iconv to decode the page text

- When requesting a non bookmark card, if no oembed data could be foundand we fallback to bookmark, a second network request to fetch the content was issued. This seemed unnecessary -> refactored to avoid that
2022-10-13 12:19:47 +01:00
Kritika Sharma
76e906d498
Added e2e tests for post.tag.detached webhoo (#15610)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.

Co-authored-by: Kritika Sharma <kritikasharma@Kritikas-MacBook-Pro-2.local>
2022-10-13 11:53:18 +01:00
Prathamesh Gawas
3424222597
🐛 Fixed redirects with special characters (#15533)
closes: https://github.com/TryGhost/Ghost/issues/15267

- This was because the URLs were not being encoded and matched correctly - it is solved by encoding the URL before adding to the router.
2022-10-13 11:41:20 +01:00
Shubhadeep Das
e2124314ed
Added e2e tests for page.scheduled webhook (#15609)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-13 11:20:42 +01:00
Halldor Thorhallsson
74f7b7b3ee
Added e2e test for site.changed webhook event (#15595)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-13 11:05:31 +01:00
Rishabh Garg
e05889cd53
🐛 Fixed missing accent color for default content cta (#15611)
refs https://github.com/TryGhost/Casper/issues/901

- the site accent color property on default cta for upgrade link had a typo and was using wrong property
2022-10-13 13:42:21 +05:30
Elena Baidakova
2c7ade78d7
🐛 Fixed color of member alert email links (#15582)
closes TryGhost/Team#2015
- Gmail wraps emails in link and added them custom styles. Was added fix
to reset Gmail styles.
2022-10-13 10:42:04 +04:00
Elena Baidakova
67b65538cf
Added toggle to enable/disable audience feedback in admin (#15601)
closes TryGhost/Team#2043
- Added ability to enable like/dislike buttons for each newsletter.
- Buttons color calculated from accent color.
2022-10-13 10:24:46 +04:00
Daniel Lockyer
bd3add9747
Switched to US spelling of cancelled in schema validation
refs https://github.com/TryGhost/Team/issues/2030

- we tend to use US spellings in the code and this was merged with the
  British spelling
- nothing has been added to this table yet so it's safe to switch
2022-10-13 11:53:07 +07:00
Naz
4db0be603f Added subscriptions table
refs https://github.com/TryGhost/Team/issues/2030

- adds `subscriptions` table to the DB schema
- this new table is aimed to support a native "subscription" primitive in Ghost
  that most resembles previously used `members_stripe_customers_subscriptions` table
2022-10-13 11:19:13 +07:00
Daniel Lockyer
74e1d52d6a Fixed incorrect maximum length definition in schema
refs https://github.com/TryGhost/Toolbox/issues/441

- whilst reviewing another PR, I noticed we were incorrectly using
  `maxLength` instead of `maxlength` in the schema column definition
- it turns out we've already been doing this wrong for a while with
  other columns
- this key is not acted upon, so the maximum column length was not applied
- fixing up the DB to the correct maximum length is something to fix in the
  future but right now, the schema does not reflect the size of the
  column that actually got created
- the fallback when `maxlength` is not provided is currently 191 [0], so
  this commit switches the schema and migrations to using the correct
  key name and column length that they are using when applied

[0]: 24670aa555/ghost/core/core/server/data/schema/commands.js (L27)
2022-10-13 09:58:19 +07:00
Daniel Lockyer
143ae857c9 Removed bool type from schema
refs https://github.com/TryGhost/Toolbox/issues/441

- we tend to have a mix of `bool` and `boolean` in the schema and
  migrations, which has become a real nit for me at this point
- we don't do any special handling between `bool` and `boolean`, it's
  just something we pass to Knex
- `bool` is an alias for `boolean` but `boolean` is actually documented - https://knexjs.org/guide/schema-builder.html#boolean
- this commit switches Ghost to only using `boolean` in the schema and
  migrations, and removes `bool` from the allowlist in tests to prevent
  us from adding it again in the future
- this should make absolutely no difference to the DB because both
  resulted in the same column
2022-10-13 09:37:38 +07:00
renovate[bot]
3917a058a4 Update dependency ember-classic-decorator to v3.0.1 2022-10-13 09:07:30 +07:00
Naz
5b8b18ded1
Moved csv parser utility method
refs https://github.com/TryGhost/Toolbox/issues/430

- The 'readCSV' method was only exposed to be used in the unit tests. To keep the module code to the minimum moved readCSV to the unit test itself - the only place where it's used and belongs to.
2022-10-13 09:53:16 +08:00
Naz
9e20544927
Fixed typo 2022-10-13 09:53:16 +08:00
Naz
71bed4f926
Fixed jsdoc to only mention used parameters
refs https://github.com/TryGhost/Toolbox/issues/430

- It's a minor cleanup while exploring the referenced bug surface area. Fixes distracting "missing parameters" warnings
2022-10-13 09:53:16 +08:00
Daniel Lockyer
24670aa555
Fixed validating numbers as booleans in schema validator
refs https://github.com/TryGhost/Toolbox/issues/441

- I'm currently working on cleaning up our uses of `bool` and `boolean`
  in favor of `boolean`, and I've noticed we only handle converting
  numbers into booleans when the type is `bool`, so validation would
  otherwise fail
- given these can be used interchangeably, we should also support
  converting the numbers into booleans when the type is `boolean`
- this is going to get cleaned up again when I remove `bool` but this
  fixes the validation bug for now
2022-10-13 08:20:31 +07:00
renovate[bot]
f5774fad0c Update dependency postcss to v8.4.18 2022-10-13 08:08:05 +07:00
renovate[bot]
fd2b068e3f
Update dependency cron-validate to v1.4.4 2022-10-12 21:11:14 +00:00
Kritika Sharma
2cb4282fa8
Added e2e tests for post.tag.attached webhook (#15576)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.

Co-authored-by: Kritika Sharma <kritikasharma@Kritikas-MacBook-Pro-2.local>
2022-10-12 21:53:02 +01:00
jennyxchang
0bc31ded1b
Added e2e tests for post.scheduled event (#15561)
refs https://github.com/TryGhost/Ghost/issues/15537

- Added e2e test for post.scheduled event to increase webhook test coverage
2022-10-12 21:18:08 +01:00
Christa
87d21662bc
🐛 fixed error message code for HB translate helper (#15529)
closes: https://github.com/TryGhost/Ghost/issues/15500

- Per the issue, Ghost has a policy to never throw 500 Internal Server errors for theme issues. This change adds a check inside of `ghost\core\core\frontend\helpers\t.js` if `text` or `options` is undefined, to throw an `IncorrectUsageError` error within the function.
- Messaging was borrowed from `ghost\core\core\frontend\web\middleware\error-handler.js`.
2022-10-12 21:14:53 +01:00
Shubhadeep Das
8374c73e52
Added e2e tests for tag.edited webhook (#15555)
refs: https://github.com/TryGhost/Ghost/issues/15537

- this adds an e2e test and test snapshot for the `tag.edited` webhook so we can prevent regressions and bugs in the future

Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
2022-10-12 20:00:04 +01:00
Sam Lord
0c18060f61 Added metric for sending transactional email with mailgun
refs: https://github.com/TryGhost/Toolbox/issues/439

This case completes the monitoring of mailgun.js usage within Ghost.
2022-10-12 16:52:51 +01:00
Hannah Wolfe
168fa64395
Updated webhook snapshot for member.deleted
refs: 3ae1e48917
refs: 1221ba5d1d

- We added a new field between the PR being raised and merged, so the snapshot went out-of-date
2022-10-12 16:04:57 +01:00
illiteratewriter
3ae1e48917
Added e2e tests for member.deleted webhook (#15570)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-12 14:35:24 +01:00
Kritika Sharma
2ce0727794
Added e2e tests for post.deleted webhook (#15572)
refs: https://github.com/TryGhost/Ghost/issues/15537

- Added  missing e2e tests for post.deleted webhook to increase coverage 

Co-authored-by: Kritika Sharma <kritikasharma@Kritikas-MacBook-Pro-2.local>
2022-10-12 14:32:01 +01:00
jbenezech
3d44e37cbd
🐛 Fixed sitemaps with no content (#15571)
closes: https://github.com/TryGhost/Ghost/issues/14981

- Taxonomy-specific sitemaps were invalid xml when there was no data
- These invalid empty sitemaps were referenced in the index sitemap causing SEO tools to report errors
2022-10-12 14:11:19 +01:00
jbenezech
b9dd9f066d
🐛 Fixed settings overriden when updated from multiple tabs (#15536)
closes: https://github.com/TryGhost/Ghost/issues/15470

- When multiple browser tabs are open, each manipulate a different copy of ember data model, changes to the model in one tab are not reflected in the model of the other tab.
- When updating some settings, all current settings were sent to the API.
- As a result, when updating two different categories of settings (navigation/code inspection) in different tabs, the second update was overriding the first one.
- From a user perspective, this is not a natural behaviour. Only settings visible on-screen when clicking save should be modified.

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2022-10-12 14:03:54 +01:00
Daniel Lockyer
845f8d965e
Added test to validate schema structure
refs https://github.com/TryGhost/Toolbox/issues/441

- this is only v1 of the test I would like but it validates the keys on
  a column definition are part of an allowlist
- this has already uncovered a bug with `maxLength` (vs `maxlength`)
2022-10-12 19:19:33 +07:00
renovate[bot]
178df69ae2 Update dependency @playwright/test to v1.27.1 2022-10-12 17:55:29 +07:00
Daniel Lockyer
5aeaa977fd
Pinned moment dependency
- this shouldn't make any difference because `moment` has a resolution but we take
  the approach of pinning all our dependencies in this repository
2022-10-12 15:42:46 +07:00