Commit Graph

20502 Commits

Author SHA1 Message Date
Kevin Ansfield
d6df261446
🐛 Fixed editor unsaved changes modal showing too often (#20787)
ref [ENG-661](https://linear.app/tryghost/issue/ENG-661/) 
ref [ONC-253](https://linear.app/tryghost/issue/ONC-253/)
ref [PLG-174](https://linear.app/tryghost/issue/PLG-174/)

- restored the original but reverted fix for unsaved changes modal from https://github.com/TryGhost/Ghost/pull/20687
- updated code to remove some incorrect early-falsy-return logic in `editorController.hasDirtyAttributes` that prevented save of unsaved changes on the underlying model (e.g. excerpt)
- updated unit tests so they are testing real post model instances and therefore are testing what we expect them to test
- added acceptance tests to ensure autosave is working for title and excerpt fields

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-08-20 08:37:57 +01:00
Kevin Ansfield
b6582e6623
Updated Admin editor unit tests to use real model instances
ref https://linear.app/tryghost/issue/PLG-176

- we recently had to revert code because it caused unexpected problems despite the unit tests passing
- the setup for the editor unit tests was very basic and did not represent the real world because it tested a simple EmberObject instance rather than an Ember Model instance meaning the tests weren't covering the real code paths
- updated the unit test with a more realistic environment ready for re-working the reverted code+tests
2024-08-20 08:37:49 +01:00
Kevin Ansfield
25c31c31c9
🐛 Fixed autosave not triggering when in-editor excerpt is changed (#20785)
ref https://linear.app/tryghost/issue/PLG-174

- added `blur` handler to excerpt field so it acts the same as the title field and triggers a save when it loses focus
2024-08-20 08:37:41 +01:00
Steve Larson
9f4bc9c132
Added Sentry message logging for generating magic links (#20789)
ref https://linear.app/tryghost/issue/ONC-258
2024-08-19 21:28:15 +00:00
Kevin Ansfield
9dfbd3e293 Fixed excerpt blur saving non-draft posts
ref https://linear.app/tryghost/issue/PLG-174

- forcing autosave on excerpt blur caused posts to revert to `draft` and save immediately even when they were published/scheduled
- updated the save-on-excerpt-blur to only autosave drafts
- added acceptance tests for title and excerpt change+blur on published posts
2024-08-19 21:04:15 +01:00
Kevin Ansfield
887f4d3ac2
🐛 Fixed editor unsaved changes modal showing too often (#20787)
ref [ENG-661](https://linear.app/tryghost/issue/ENG-661/) 
ref [ONC-253](https://linear.app/tryghost/issue/ONC-253/)
ref [PLG-174](https://linear.app/tryghost/issue/PLG-174/)

- restored the original but reverted fix for unsaved changes modal from https://github.com/TryGhost/Ghost/pull/20687
- updated code to remove some incorrect early-falsy-return logic in `editorController.hasDirtyAttributes` that prevented save of unsaved changes on the underlying model (e.g. excerpt)
- updated unit tests so they are testing real post model instances and therefore are testing what we expect them to test
- added acceptance tests to ensure autosave is working for title and excerpt fields

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-08-19 18:03:13 +00:00
Kevin Ansfield
64fbf3b9ee Updated Admin editor unit tests to use real model instances
ref https://linear.app/tryghost/issue/PLG-176

- we recently had to revert code because it caused unexpected problems despite the unit tests passing
- the setup for the editor unit tests was very basic and did not represent the real world because it tested a simple EmberObject instance rather than an Ember Model instance meaning the tests weren't covering the real code paths
- updated the unit test with a more realistic environment ready for re-working the reverted code+tests
2024-08-19 16:13:49 +01:00
Kevin Ansfield
21aa1b4378
🐛 Fixed autosave not triggering when in-editor excerpt is changed (#20785)
ref https://linear.app/tryghost/issue/PLG-174

- added `blur` handler to excerpt field so it acts the same as the title field and triggers a save when it loses focus
2024-08-19 14:38:00 +00:00
Peter Zimon
d66a0e3991
Fix browser tests for Radix migration (#20783)
DES-696

We upgraded the AdminX Design System to use Radix UI components. However
browser tests fail for checkboxes at the moment which must be fixed for
release.
2024-08-19 16:22:36 +02:00
Daniël van der Winden
1e3edc0b5a
Adds blur behind 'Share' modal (#20782)
fixes https://linear.app/tryghost/issue/DES-683/add-blur-behind-modal

Adds a blur behind the modal in the new Publish flow.
2024-08-19 14:01:01 +00:00
Daniël van der Winden
f864bde459
Publish flow Close button improvements (#20779)
fixes
https://linear.app/tryghost/issue/DES-682/close-button-improvements

Small updates to the modal in the new Publish flow. Improved margins and
opacity for legibility.
2024-08-19 12:59:10 +00:00
Ronald Langeveld
6ebcd10288
Revert "Fixed draft posts not autosaving without title (#20774)" (#20776)
This reverts commit aad438ba0b.

- reverts the commit so that we can merge it together with PLG-174
2024-08-19 10:19:53 +00:00
renovate[bot]
6a7b8bd3ca Update dependency i18next to v23.14.0 2024-08-19 10:08:00 +00:00
Ronald Langeveld
aad438ba0b
Fixed draft posts not autosaving without title (#20774)
ref [ENG-661](https://linear.app/tryghost/issue/ENG-661/) ONC-253

- Reverts the revert of
93cbb94b90
of the intial bug fix.
- Updated hasDirtyAttributes logic to ensure the dirty state changes
when typing a draft, despite not title.
- Updated tests and added tests missing from the hasDirtyAttributes
logic
2024-08-19 12:21:35 +07:00
Ghost CI
64f92fb460 v5.89.3 2024-08-16 19:50:28 +00:00
Chris Raible
93cbb94b90 🐛 Fixed a bug causing new drafts to only save if the title is populated (#20769)
ref
https://linear.app/tryghost/issue/ONC-253/drafts-only-save-if-the-title-is-populated

- A
[commit](c8ba9e8027)
in `v5.89.1` introduced a bug that caused new drafts to only save if the
post title was populated, causing potential data loss if a user is
working on a new draft without setting the title.
- This commit reverts the one that introduced this bug to prevent data
loss.

This reverts commit c8ba9e8027.
2024-08-16 12:20:28 -07:00
Ghost CI
663e787a1a v5.89.2 2024-08-16 15:05:10 +00:00
renovate[bot]
d50187b35f Update dependency i18next to v23.13.0 2024-08-16 08:22:12 +00:00
Stanislav Traykov
453d0eee42
Added Bulgarian translations to comments UI (#20740)
Update comments.json in BG locale; add initial translation.
2024-08-15 17:57:15 -07:00
renovate[bot]
c02c98529e Update dependency i18next to v23.12.7 2024-08-15 20:30:55 +00:00
renovate[bot]
d72040588a Update dependency i18next to v23.12.4 2024-08-15 15:59:07 +00:00
renovate[bot]
90d60da4ce Update dependency @tryghost/koenig-lexical to v1.3.21 2024-08-15 16:44:51 +01:00
Sanne de Vries
ae628d7520
🎨 Added “Copy post link” to posts list context menu (#20760)
REF DES-321
- Added a "Copy post link" button to the context menu to copy the post URL for published posts, and a "Copy preview link" for draft and scheduled posts.

---------

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2024-08-15 16:09:48 +02:00
renovate[bot]
dc7abe4712 Update sentry-javascript monorepo to v7.119.0 2024-08-15 15:11:53 +02:00
Peter Zimon
46f93ad555
Refined details for new publish flow (#20761)
DES-686

Typography for the new modal was a bit off, needed refinement.
2024-08-15 14:54:50 +02:00
renovate[bot]
d86bcd2873 Update dependency @tryghost/koenig-lexical to v1.3.20 2024-08-15 12:07:08 +01:00
Sodbileg Gansukh
5ee67892dc
Improved publishing flow end screen (#20701)
ref DES-594

- this update introduces some improvements to the publishing flow end screen
- everything's behind a feature flag — publishFlowEndScreen
2024-08-15 18:22:32 +08:00
Ronald Langeveld
37fd9eaad5
🐛 Fixed additional white space appearing at bottom of editor (#20757)
ref ENG-1490

- Regression from the secondary lexical instance.
- Replaced the visibility and positioning styles with width, height, and
overflow to prevent layout space issues.
- Ensured the element takes up no space and is not visible, while
allowing proper initialisation.
2024-08-15 16:37:04 +07:00
renovate[bot]
0eb569ad89 Update Koenig packages 2024-08-14 21:13:36 +01:00
Sag
e6254bbb93
🎨 Removed member bulk deletion safeguard from safe queries (#20747)
fixes https://linear.app/tryghost/issue/ENG-1484

- in Ghost release
[v5.89.0](https://github.com/TryGhost/Ghost/releases/tag/v5.89.0), we
have added a safeguard around bulk member deletion, due to a limitation
in NQL for member filters (commit: 2484a77)
- with this change, we limit the safeguard to only the cases we know are
problematic, and remove it for other useful and safe queries
- more precisely, the safeguard is in place only when:
    - Multiple newsletters exist, and the filter contains 2 or more
newsletter filters
    - If any of the following stripe filters are used even once:
        - Billing period
        - Stripe subscription status
        - Paid start date
        - Next billing date
        - Subscription started on post/page
        - Offers
2024-08-14 15:48:54 +00:00
renovate[bot]
b2d5304c3c Update Koenig packages
no issue

- added passthrough of `feature.contentVisibility` when rendering Lexical to HTML to allow for labs-feature specific rendering of HTML cards
- updated golden post email render test to account for labs flags being on/off
2024-08-14 15:34:44 +01:00
Sanne de Vries
814e03be76
Updated recommendation received notification email design (#20748)
REF PLG-162
- Added publication icon and improved overall layout
2024-08-14 09:49:17 +02:00
Ronald Langeveld
e920888832
Wired up stripeEnabled to Koenig config (#20750)
ref PLG-109

- Added a boolean config property `stripeEnabled` to the configuration.
- This property is now passed down to the Koenig Editor to manage
features based on Stripe connectivity.
2024-08-14 14:32:18 +07:00
renovate[bot]
5ba74b0243
Updated Koenig packages (#20744)
ref https://linear.app/tryghost/issue/ENG-1255

changelog:
- https://github.com/TryGhost/Koenig/pull/1348
2024-08-13 14:36:35 +02:00
renovate[bot]
49b2803dc5 Update dependency terser to v5.31.6 2024-08-13 09:43:56 +00:00
Stanislav Traykov
3c94ad0cb1
Fixed errors in Bulgarian portal translations (#20691)
BG translation fixes in portal.json.
2024-08-12 18:55:26 -07:00
renovate[bot]
c96b1a1140 Update dependency i18next to v23.12.3 2024-08-13 00:40:17 +00:00
renovate[bot]
fa9bc4d446 Update Koenig packages 2024-08-12 22:00:16 +01:00
Kevin Ansfield
a86f9dbdda Cleaned up internalLinking labs flag
closes https://linear.app/tryghost/issue/PLG-15

- removed `internalLinking` GA labs flag
- renamed search providers to `flex` and `basic`
  - keeps old search provider around as it can handle non-English languages unlike the faster flex provider
- updated `search` service to switch from `flex` to `basic` when the site's locale is not english
- bumped Koenig packages to switch from a feature flag for toggling internal linking features to the presence of the `searchLinks` function in card config
- updated tests to correctly switch between flex and basic providers in respective suites
2024-08-12 13:08:29 +01:00
Daniël van der Winden
0412decaec
Excerpt form error fix (#20730)
fixes
https://linear.app/tryghost/issue/DES-435/excerpt-in-post-settings-has-an-inconsistent-error-state

The excerpt form field seemed to not be properly handling errors.
However, it was a case of the error styling being overruled by the
regular styling, causing the red border to only show upon `:focus` when
there is an error in the excerpt.

I've rewritten the logic to be slightly less obfuscated and added some
CSS to circumvent the issue.
2024-08-12 09:35:21 +00:00
Ronald Langeveld
85aed302c1
Bumped Portal to 2.38.0 (#20733)
ref ONC-225

Bumped it a minor since it contains breaking changes.
2024-08-12 14:41:39 +07:00
Ronald Langeveld
da691bf0d7
🐛 Fixed newsletter button not hidden in Portal (#20732)
ref ONC-225

- Wires up the `editor_default_email_recipients` key to the settings
public / content api endpoint.
- This key is then wired up to Portal to determine whether it's hiding or
showing the Member subscribe toggle
2024-08-12 06:00:25 +00:00
Ghost CI
b629dc02ac v5.89.1 2024-08-09 15:05:52 +00:00
Sag
0d9955538d
Removed fallback Ghost icon in staff notifications (#20731)
ref https://linear.app/tryghost/issue/PLG-150

- if the publication has no custom icon, staff notifications do not
render the Ghost icon as fallback anymore
2024-08-08 17:47:51 +02:00
Daniël van der Winden
e0a07c6813
Hide overflow on member list container (#20729)
Fixes
https://linear.app/tryghost/issue/DES-561/horizontal-scroll-on-members-index-shows-on-both-sides-of-table

On resolutions where the members list needed horizontal scrollbars, the
table was overflowing on the left side of the list. This hides that
overflow and fixes the issue.
2024-08-08 14:48:54 +02:00
Sanne de Vries
bdff3d7b5c
Updated paid cancellation notification email design (#20726)
REF DES-572
2024-08-08 14:36:43 +02:00
renovate[bot]
c361bf1afc Update dependency terser to v5.31.5 2024-08-08 11:48:19 +00:00
renovate[bot]
184af30a1c Update dependency terser to v5.31.4 2024-08-07 15:41:11 +00:00
Daniel Lockyer
b2284383bf Fixed matching ignored errors
refs https://ghost-foundation.sentry.io/issues/4907452370/

- we want to ignore these errors but the caret is stopping us from doing
  so because the errors usually start with AbortError
- we can remove the caret to do so and clean up Sentry
2024-08-07 12:39:57 +02:00
Steffo
0d1916505f
🐛 Fixed Content-Type for RSS feed (#20670)
fixes https://github.com/TryGhost/Ghost/issues/20634

- this sets the correct Content-Type (`application/rss+xml; charset=utf-8`) for the RSS Endpoint as mentioned in the referenced issue
- references for this Content-Type: https://datatracker.ietf.org/doc/id/draft-nottingham-rss-media-type-00 and https://stackoverflow.com/questions/595616/what-is-the-correct-mime-type-to-use-for-an-rss-feed
2024-08-07 12:09:54 +02:00
Sanne de Vries
9db1fe9a22
Improved new paid subscription email design (#20718)
REF MOM-340
2024-08-06 16:29:13 +00:00
Ronald Langeveld
61bf3ea57e
Fixed browser tests for unsaved changes (#20717)
no issue

- takes into account that there is an additional editor in the DOM -
which there is now.
2024-08-05 21:40:18 +07:00
Ronald Langeveld
c8ba9e8027
🐛 Fixed unsaved changes confirmation on Lexical schema change (#20687)
refs ENG-661

Fixes a long-standing issue where an outdated Lexical schema in the
database triggered the unsaved changes confirmation dialog incorrectly.
Implemented a secondary hidden Lexical instance that loads the state
from the database, renders it, and uses this updated state to compare
with the live editor's scratch.
This ensures the unsaved changes prompt appears only when there are real
changes from the user.
2024-08-05 12:58:58 +00:00
Sanne de Vries
e378252d36
Improved new free signup email design (#20716)
REF MOM-339
2024-08-05 14:44:24 +02:00
Sanne de Vries
5ed2793369
Added publication icon to donation notification email (#20704)
REF MOM-317
- Added site icon to add some flair and personal branding to the
donation notification email.
2024-08-05 13:43:24 +02:00
renovate[bot]
4b28812861 Update TryGhost packages 2024-08-05 12:12:34 +02:00
renovate[bot]
d82f97efcc Update dependency luxon to v3.5.0 2024-08-05 09:19:48 +02:00
Ghost CI
9d44d62b62 v5.89.0 2024-08-02 15:05:06 +00:00
Chris Raible
7522b74e1f
Backfilled missing offer redemptions (#20647)
ref
https://linear.app/tryghost/issue/ENG-1440/backfill-offer-redemption-data-with-a-migration
    
There was a bug that caused offer redemptions to not be recorded in the
database for some subscriptions that were created with an offer.
However, we still have the `offer_id` attached to the subscriptions, so
we are able to backfill the missing redemptions. The bug was fixed in
bf895e6e99
    
This commit only contains a migration, which queries for subscriptions
that have an `offer_id` but do not have any offer redemptions recorded,
and adds any missing redemptions to the `offer_redemptions` table.
2024-08-01 16:30:50 -07:00
Kevin Ansfield
ad1a00f60d Fixed YT live embeds for non-www URLs
ref https://github.com/TryGhost/Ghost/pull/20706
ref https://linear.app/tryghost/issue/ONC-197

- previous check for YT live match was a little too specific and required the www which should have been optional
2024-08-01 17:22:02 +01:00
Kevin Ansfield
1eab73c76d 🐛 Fixed YouTube live embeds failing in some situations
ref https://linear.app/tryghost/issue/ONC-197

- YouTube has started responding to video page requests with localised content when requested from certain IPs, with that localised content not containing the required `<link rel="alternate" ...>` tag pointing to the oembed endpoint
- we were fetching video pages rather than the oembed endpoint for YouTube Live URLs because they are not recognised by the oembed extraction library we use
- by modifying the URL from a live URL to a watch URL before we perform oembed lookup/extraction we are able to bypass the (localised) page fetch and instead grab the oembed content directly
2024-08-01 16:59:52 +01:00
Princi Vershwal
086ed9e7a9
Optimising count query : Added option param to skip distinct from count query for members events API (#20700)
Ref:
https://linear.app/tryghost/issue/ENG-1470/improve-the-performance-of-the-membersevents-aggregated-click-event
2024-08-01 13:14:40 +05:30
Ghost CI
d2ef1cc8cb Merged v5.88.3 into main 2024-07-31 10:55:37 +00:00
Ghost CI
f4f7b91c12 v5.88.3 2024-07-31 10:55:36 +00:00
Kevin Ansfield
dde7e70f7c
Fixed members import-with-tier alpha creating unexpected invoices (#20695)
ref https://linear.app/tryghost/issue/ONC-199

The `updateSubscriptionItemPrice()` method in our Stripe library used by the importer when moving a subscription over to a Ghost product/price was setting `proration_behavior: 'always_invoice'`. This resulted in invoices being created when changing the subscription (even though no prices were changing as far as the customer is concerned) and in some cases where a customer previously had a one-off discount the customer was incorrectly charged the proration difference because the discount was no longer applied to the new invoice.

- updated `updateSubscriptionItemPrice()` to accept an `options` param allowing the `proration_behavior` property passed to the Stripe API to be overridden on a per-call basis
- updated the `forceStripeSubscriptionToProduct()` method used by the importer to pass an options object with `prorationBehavior: 'none'` when updating the subscription item price so that no invoice and no unexpected charges occur when importing
2024-07-31 11:23:22 +01:00
Kevin Ansfield
ae1ac83fc5
Fixed members import-with-tier alpha creating unexpected invoices (#20695)
ref https://linear.app/tryghost/issue/ONC-199

The `updateSubscriptionItemPrice()` method in our Stripe library used by the importer when moving a subscription over to a Ghost product/price was setting `proration_behavior: 'always_invoice'`. This resulted in invoices being created when changing the subscription (even though no prices were changing as far as the customer is concerned) and in some cases where a customer previously had a one-off discount the customer was incorrectly charged the proration difference because the discount was no longer applied to the new invoice.

- updated `updateSubscriptionItemPrice()` to accept an `options` param allowing the `proration_behavior` property passed to the Stripe API to be overridden on a per-call basis
- updated the `forceStripeSubscriptionToProduct()` method used by the importer to pass an options object with `prorationBehavior: 'none'` when updating the subscription item price so that no invoice and no unexpected charges occur when importing
2024-07-31 11:16:25 +01:00
Princi Vershwal
bb33a84058
Optimising count query : Added option param to skip distinct from count query for members events API
Ref https://linear.app/tryghost/issue/SLO-193/optimise-count-query-skip-distinct-from-count-query-for-members-events

The member events endpoint have many queries like:-

select count(distinct members_subscribe_events.id) as aggregate 
from `members_subscribe_events` 
where `members_subscribe_events`.`created_at` < '2024-07-30 11:30:39'

In these queries, distinct is not required as id is a primary key. Skipping distinct would improve the performance. 

This PR will changed the query to:-

select count(*) as aggregate 
from `members_subscribe_events` 
where `members_subscribe_events`.`created_at` < '2024-07-30 11:30:39'
2024-07-31 09:37:34 +05:30
renovate[bot]
fd335d3f4c Update dependency i18next to v23.12.2 2024-07-30 07:48:15 +00:00
Steve Larson
c61c42ce1d
Improved performance loading posts & pages in admin (#20646)
ref 8ea1dfb
ref https://linear.app/tryghost/issue/ONC-111

* undid the reversion for the performance improvements
* built upon new tests for the posts list functionality in admin,
including right click actions
* added tests for pages view in Admin

This was reverted because it broke the Pages list view in Admin, which
is a thin extension of the Posts functionality in admin (route &
controller). That has been fixed and tests added.

This was originally reverted because the changes to improve loading
response times broke right click (bulk) actions in the posts list. This
was not caught because it turned out we had near-zero test coverage of
that part of the codebase. Test coverage has been expanded for the posts
list, and while not comprehensive, is a much better place for us to be
in.
2024-07-29 16:19:28 +00:00
Sag
f64820b1be
🐛 Disabled bulk deletion when multiple member filters are applied (#20681)
fixes https://linear.app/tryghost/issue/ONC-206
ref https://app.incident.io/ghost/incidents/90

- when multiple member filters are used in combination, NQL sometimes
hit a limitation that results in the wrong members being returned
- while we work on the NQL limitation, we are temporarily disabling bulk
member deletion when more than one member filter has been applied
2024-07-29 17:33:23 +02:00
renovate[bot]
7411724a03 Update dependency terser to v5.31.3 2024-07-29 11:49:29 +00:00
renovate[bot]
dc3539ebca Update dependency html-validate to v8.21.0 2024-07-29 09:41:05 +02:00
Daniel Lockyer
0193ad90bb Protected against quick escapes when loading post
fix https://linear.app/tryghost/issue/SLO-180/typeerror-cannot-read-properties-of-null-reading-displayname

- in the event you click on a post and then press Back really quickly,
  `this.post` will be null because the post is not loaded
- the code here fails because it tries to read a property from `null`
- we can protect against that by using optional chaining on the property
2024-07-29 09:40:54 +02:00
Sanne de Vries
14cabf97df
Updated tips and donations copy in editor button card (#20662)
REF MOM-313
2024-07-29 09:25:09 +02:00
renovate[bot]
768ba8c558 Update dependency mysql2 to v3.11.0 2024-07-29 01:49:09 +00:00
Steve Larson
ed4b57736a
Fixed e2e test for Portal (#20674)
no ref
- updated the locator to use the class
2024-07-27 12:59:45 +00:00
Steve Larson
1f05a7890f
Added test coverage over newsletter flows (#20672)
no ref
- while reviewing the newsletter flows, it was apparent that we were
missing test coverage

Some of the tests in Portal are a bit redundant with tests added for
child components, but it didn't seem worth removing them after getting
them to work. There was a bug in our Portal fixture data that requires a
few changes, as well as some small adjustments for making tests easier
(testing-lib-react has `getByTestId` and simply a `querySelector` to use
alternate test attributes).
2024-07-27 02:20:13 +00:00
Ghost CI
c8df04de1b v5.88.2 2024-07-26 15:05:23 +00:00
Daniel Lockyer
09c59a6569 Lazyloaded several required dependencies
- these dependencies can be pushed to be loaded later than upon boot,
  where boot time is critical
- this commit makes boot about 4% faster
2024-07-26 09:52:26 +02:00
Chris Raible
71d830e1c9
Removed cache buster from client extensions script (#20668)
ref
https://linear.app/tryghost/issue/PA-71/remove-cache-bust-from-projs-in-admin
ref
15ed2eb245

- This cache buster was added in March to mitigate a client side error in pro.js,
to effectively force browsers to redownload the fixed version of the file.
- It's not needed anymore, as the error has been fixed for a few months
now, so we can safely remove it.
2024-07-25 15:40:12 -07:00
Princi Vershwal
23458c664a
Added 90 days filter to Member Count Admin Dashboard query (#20665)
Ref https://linear.app/tryghost/issue/SLO-192/add-90-days-filter-to-member-count-admin-dashboard-query

This API used to fetch the data for all time. We need data for only 90 days for our dashboard. This will optimise the performance of this API.
Also, sorting the rows in memory is lot more efficient than orderBy in db in this case.
2024-07-25 23:15:13 +05:30
renovate[bot]
74b5677e3d
Update dependency gscan to v4.43.2 (#20664)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [gscan](https://ghost.org/)
([source](https://togithub.com/TryGhost/gscan)) | [`4.43.1` ->
`4.43.2`](https://renovatebot.com/diffs/npm/gscan/4.43.1/4.43.2) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/gscan/4.43.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/gscan/4.43.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/gscan/4.43.1/4.43.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/gscan/4.43.1/4.43.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>TryGhost/gscan (gscan)</summary>

###
[`v4.43.2`](https://togithub.com/TryGhost/gscan/compare/v4.43.1...v4.43.2)

[Compare
Source](https://togithub.com/TryGhost/gscan/compare/v4.43.1...v4.43.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-25 17:25:54 +02:00
Sag
1422ad5e6f
🐛 Fixed error in translate helper when invalid parameters are passed (#20663)
ref https://linear.app/tryghost/issue/SLO-182
ref https://github.com/TryGhost/Ghost/issues/15500

- when the {{ t }} helper is used with no parameter or an empty string,
it now returns an empty string
- when the {{ t }} helper is used without options, it now does not throw
an error
2024-07-25 12:45:23 +00:00
Princi Vershwal
42398ce525
Added 90 days filter to Mrr Admin Dashboard query (#20661)
Ref https://linear.app/tryghost/issue/SLO-186/add-90-days-filter-to-mrr-admin-dashboard-query
2024-07-25 17:08:51 +05:30
renovate[bot]
b54e1ad6e7
Update Koenig packages (#20545)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@tryghost/kg-default-nodes](https://togithub.com/TryGhost/Koenig/tree/main#readme)
([source](https://togithub.com/TryGhost/Koenig)) | [`1.1.8` ->
`1.1.9`](https://renovatebot.com/diffs/npm/@tryghost%2fkg-default-nodes/1.1.8/1.1.9)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@tryghost%2fkg-default-nodes/1.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@tryghost%2fkg-default-nodes/1.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@tryghost%2fkg-default-nodes/1.1.8/1.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@tryghost%2fkg-default-nodes/1.1.8/1.1.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@tryghost/kg-html-to-lexical](https://togithub.com/TryGhost/Koenig/tree/main#readme)
([source](https://togithub.com/TryGhost/Koenig)) | [`1.1.9` ->
`1.1.10`](https://renovatebot.com/diffs/npm/@tryghost%2fkg-html-to-lexical/1.1.9/1.1.10)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@tryghost%2fkg-html-to-lexical/1.1.10?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@tryghost%2fkg-html-to-lexical/1.1.10?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@tryghost%2fkg-html-to-lexical/1.1.9/1.1.10?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@tryghost%2fkg-html-to-lexical/1.1.9/1.1.10?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@tryghost/kg-lexical-html-renderer](https://togithub.com/TryGhost/Koenig/tree/main#readme)
([source](https://togithub.com/TryGhost/Koenig)) | [`1.1.11` ->
`1.1.12`](https://renovatebot.com/diffs/npm/@tryghost%2fkg-lexical-html-renderer/1.1.11/1.1.12)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@tryghost%2fkg-lexical-html-renderer/1.1.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@tryghost%2fkg-lexical-html-renderer/1.1.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@tryghost%2fkg-lexical-html-renderer/1.1.11/1.1.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@tryghost%2fkg-lexical-html-renderer/1.1.11/1.1.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@tryghost/koenig-lexical](https://togithub.com/TryGhost/Koenig/tree/master#readme)
([source](https://togithub.com/TryGhost/Koenig)) | [`1.3.12` ->
`1.3.13`](https://renovatebot.com/diffs/npm/@tryghost%2fkoenig-lexical/1.3.12/1.3.13)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@tryghost%2fkoenig-lexical/1.3.13?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@tryghost%2fkoenig-lexical/1.3.13?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@tryghost%2fkoenig-lexical/1.3.12/1.3.13?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@tryghost%2fkoenig-lexical/1.3.12/1.3.13?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>TryGhost/Koenig (@&#8203;tryghost/kg-default-nodes)</summary>

###
[`v1.1.9`](https://togithub.com/TryGhost/Koenig/compare/@tryghost/kg-default-nodes@1.1.8...@tryghost/kg-default-nodes@1.1.9)

[Compare
Source](https://togithub.com/TryGhost/Koenig/compare/@tryghost/kg-default-nodes@1.1.8...@tryghost/kg-default-nodes@1.1.9)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-07-25 11:18:17 +00:00
renovate[bot]
0947b047ef Update dependency testem to v3.15.1 2024-07-25 10:29:40 +02:00
Sag
54449ac98e
Fixed members list when scrolled down too quickly (#20654)
ref https://linear.app/tryghost/issue/SLO-160

- in the Members list, we were using VerticalCollection with
`@bufferSize` set to 20, which means that 20 additional items before and
after the visible items in the viewport were pre-loaded
- however, scrolling down too quickly (e.g. dragging the scrollbar thumb
to the bottom) breaks the list
- with this fix, we adjust `@estimateHeight` parameter to the correct
item size, and reduce the `@bufferSize`
2024-07-24 15:09:53 +02:00
Sanne de Vries
18c5c3bba8
Improved one-time payment notification email design (#20653)
REF MOM-317
2024-07-24 09:57:34 +00:00
Ronald Langeveld
4dc503e9e5
🐛 Fixed broken link to subscription settings (#20651)
no issue

- Fixed a broken link when navigating from Members list to subscription
access settings.
2024-07-24 09:28:32 +00:00
renovate[bot]
b7fd885a08 Update dependency semver to v7.6.3 2024-07-24 10:37:08 +02:00
Sanne de Vries
806fce191d
Updated Tips & Donations settings design (#20649)
REF MOM-315
- Changed to column layout
- Fixed broken currency dropdown
- Included a link to Stripe terms & conditions
- Renamed from "Tips or donations" to "Tips & donations"
2024-07-24 08:26:29 +00:00
Fabien O'Carroll
b3b9c89544 Added role to identity token
Right now identity tokens can only be fetched by the Owner, which means they
implicitly have the Owner role, but we want to expand that. The first step is
adding the role to the token, and then we need to update each place which uses
the token and add an assertion that the role is correct.
2024-07-24 13:49:10 +07:00
Sag
fb71b03c28
Updated dependency koenig-lexical to v1.3.12 (#20645)
ref https://linear.app/tryghost/issue/SLO-181

- this version fixes copy/pasting images from Slack to the editor
2024-07-23 16:03:21 +00:00
Daniel Lockyer
00d2cc9f44 Improved speed of monobundle script
- right now, it loops through all packages serially, which isn't
  effectively using multi-core machines
- by using `concurrently`, we can rely on it to use all the cores it
  can, so this should dramatically speed up the bundling step
2024-07-22 15:45:46 +02:00
Sag
e740cef863
Fixed regex to ignore AbortError in Sentry (#20639)
fixes https://linear.app/tryghost/issue/SLO-175
2024-07-22 07:55:37 +00:00
renovate[bot]
ec019f6a70 Update dependency cssnano to v7.0.4 2024-07-22 09:11:24 +02:00
Ghost CI
f55d1e90c3 v5.88.1 2024-07-20 21:18:14 +00:00
Kevin Ansfield
8ea1dfb957
🐛 Fixed listing pages in Admin (#20633)
closes https://github.com/TryGhost/Ghost/issues/20632

- Revert " Improved performance loading the posts list in admin (#20618)"
2024-07-20 20:49:21 +00:00
Ghost CI
d0db527b8d v5.88.0 2024-07-19 16:04:20 +00:00
Ghost CI
db9bf51091 🎨 Updated Source to v1.3.2 2024-07-19 16:04:20 +00:00
Michael Barrett
4a59e30050
Published new versions of apps to support BS locale (#20629)
refs
[ONC-150](https://linear.app/tryghost/issue/ONC-150/support-escalation-re-trouble-with-new-languages)

Published new versions of apps to support BS locale
- comments-ui@0.17.3
- signup-form@0.1.5
- portal@2.37.10
2024-07-19 09:26:59 +01:00
Sodbileg Gansukh
87c12b5113
Fixed blockquote horizontal spacing on Outlook (#20625)
ref DES-571

- padding does not work well with paragraph inside blockquote as
horizontal spacing on Outlook
- using margin instead of padding makes sure the spacing is consistent
across Outlook versions
2024-07-18 21:01:43 +08:00
Kevin Ansfield
170fba0962 Enforced nested <p> when rendering <blockquote> for Aside nodes in email
closes https://linear.app/tryghost/issue/ENG-1432

- bumps `kg-lexical-html-render` package with required rendering change
2024-07-18 13:30:10 +01:00
Sodbileg Gansukh
7d2787aa32
Fixed blockquote spacing on iOS Mail app (#20621)
ref DES-571

- iOS Mail app ignores spacing on the \<blockquote\> element, but will
respect spacing on the \<p\> element inside it
- for that reason, we started to enforce always rendering \<p\> inside
\<blockquote\> for emails
- these changes move the spacing related styles from blockquote to p
inside
2024-07-18 20:10:29 +08:00
Kevin Ansfield
7488e2e7b2 Enforced nested <p> when rendering <blockquote> in email
closes https://linear.app/tryghost/issue/ENG-1432

- bumps `kg-lexical-html-render` package with required rendering change
- bumps `koenig-lexical` with TypeError fix and improved handling of failed image uploads
- bumps other packages that were missed from previous bumps, fixes split versions of underlying lexical packages
2024-07-18 12:10:58 +01:00
renovate[bot]
7de7d33266 Update dependency mailgun.js to v10.2.3 2024-07-18 10:27:29 +00:00
Sag
c5bb2e5dc7
🐛 Fixed member subscription details in Admin (#20619)
fixes https://linear.app/tryghost/issue/ONC-189

- commit 4084a3d introduced a regression that caused member subscription
details to not be rendered for active/canceled subscriptions
- with this fix, the rendering logic in Admin for member subscription
details has been fully moved to a helper and is now covered by
additional unit tests
2024-07-18 12:14:38 +02:00
Steve Larson
cd17b94e9c
Improved performance loading the posts list in admin (#20618)
ref https://github.com/TryGhost/Ghost/pull/20503
- undid the reversion for the performance improvements
- built upon new tests for the posts list functionality in admin,
including right click actions

This was originally reverted because the changes to improve loading
response times broke right click (bulk) actions in the posts list. This
was not caught because it turned out we had near-zero test coverage of
that part of the codebase. Test coverage has been expanded for the posts
list, and while not comprehensive, is a much better place for us to be
in.
2024-07-17 16:55:47 -05:00
Steve Larson
809e987f32
Extended timeouts on image size test (#20616)
ref e626dd9

There has been some flakiness in Github CI with the new tests for the
probe library. We'll start with extending timeouts in case CI is running
particularly slowly.
2024-07-17 12:07:23 +00:00
Ghost CI
7d8c76d82e Merged v5.87.3 into main 2024-07-17 11:51:32 +00:00
Ghost CI
a7e1d57c4a v5.87.3 2024-07-17 11:51:30 +00:00
Michael Barrett
316a87e7c9
Reverted "Added custom redirects ReDoS validation" (#20614)
Reverts TryGhost/Ghost#20515

This is being reverted due to the validation being run on boot causing custom
redirects to not be loaded
2024-07-17 12:37:19 +01:00
Michael Barrett
63e64686ef
Reverted "Added custom redirects ReDoS validation" (#20614)
Reverts TryGhost/Ghost#20515

This is being reverted due to the validation being run on boot causing custom
redirects to not be loaded
2024-07-17 12:29:05 +01:00
Princi Vershwal
b04452fdb3
Added 90 days filter to Top Sources Admin Dashboard query (#20609)
ref:
https://linear.app/tryghost/issue/SLO-184/add-90-days-filter-to-top-sources-admin-dashboard-query
2024-07-17 07:16:39 +05:30
Steve Larson
2e3eb1da71
Added posts bulk action Admin tests (#20610)
ref https://linear.app/tryghost/issue/ENG-1360

Not *all* functionality has been covered by these tests. There's a few
missing pieces from our mirage build and use that likely doesn't need
full coverage within the admin package. Regardless, this view has
dramatically more coverage at this point.
2024-07-16 12:56:15 -05:00
Daniël van der Winden
bb18e6571e
Updated Lexical version (#20608)
A change was needed to Lexical, for admin-only release.
2024-07-16 10:18:54 +00:00
renovate[bot]
b31e196368 Update dependency mysql2 to v3.10.3 2024-07-15 23:08:04 +00:00
Daniël van der Winden
593e8eabaa
Updated Koenig Lexical version in package.json (#20604)
To do a patch release with fixes to the editor.
2024-07-15 15:51:41 +00:00
Sag
e476eebd2d
🎨 Added staff notification when a sub is canceled due to failed payments (#20534)
ref https://linear.app/tryghost/issue/ENG-1254

- when a subscription is canceled automatically by Stripe (e.g. due to
multiple failed payments), we now send a staff notification
- logic before: if a member cancels a sub in Portal, then send a staff
notification
- logic now: if a subscription was active, but is now set to cancel
immediately or at the end of the billing period, then send a staff
notification.
- with that logic change, we now send a cancellation staff notification
when:
    1. A member cancels their sub in Portal (existing)
    2. A staff member cancels a member sub in Stripe (new)
    3. A staff member cancels a member sub in Admin (new)
    4. A sub is canceled automatically by Stripe because of multiple failed
payments (new)
- the copy of the staff notification email has also been updated to take
into account 1) manual vs automatic cancellations, and 2) immediate vs
end of billing period cancellations
2024-07-15 08:07:18 +02:00
renovate[bot]
16ce66f74e Update dependency i18next to v23.12.1 2024-07-15 00:13:10 +00:00
Ghost CI
8971128046 v5.87.2 2024-07-12 16:04:42 +00:00
Ghost CI
d5b8095066 🎨 Updated Source to v1.3.1 2024-07-12 16:04:42 +00:00
Ghost CI
3d29fecfb7 🎨 Updated Casper to v5.7.4 2024-07-12 16:04:42 +00:00
Steve Larson
3cfdcfb15f
🐛 Removed method="post" on sign in/up forms in Admin (#20598)
ref https://linear.app/tryghost/issue/ONC-160
- POST is incorrect as the form itself doesn't post to any path; all we
want are the authentication flows to kick off on submit

We've had reports of users experiencing a 404 error on attempting to
sign in to Ghost Admin (at /ghost/), where the login form seems to
submit a POST request to the /ghost/ path (we don't have a route for
that method, hence the 404; only GET). While I haven't been able to
reproduce the issue, there's very few places in Ghost that actually
issue a POST request.

Removing this method here has no impact to Ghost auth and may prevent
some unexpected default behavior from the browser.
2024-07-11 17:03:50 -05:00
renovate[bot]
cd15cb8c30 Update dependency webpack to v5.93.0 2024-07-11 20:32:47 +00:00
Steve Larson
e626dd9353
🐛 Fixed image dimension retrieval causing Ghost requests to hang (#20589)
ref https://linear.app/tryghost/issue/ENG-1408/
- added additional safeguards to the image size dimensions probing

For some reason that requires further investigation, the
probe-image-size package was silently failing (neither resolving nor
rejecting) for a particular URL. This was causing Ghost to hang on to
serving the request, and after a few of these came in, ultimately caused
Ghost to stop being responsive.

Rather than trying to patch a dependency, we'll wrap the call to this
package and use the same timeout we pass into the package (which is
ignored in this particular case) as an additional safeguard.
2024-07-11 09:37:44 -05:00
Daniël van der Winden
1d21612ceb
Improved text-wrapping for Resource headers (#20590)
Adds text-wrap: pretty to Resource H3 on Post Analytics page, to avoid
orphans in typography.
2024-07-11 09:50:06 +00:00
Daniël van der Winden
c6717a4ebd
Fixes Resource articles overflowing on Post Analytics (#20584)
Fixes
https://linear.app/tryghost/issue/DES-546/resource-articles-on-post-analytics-overflowing-window

The articles in the Resources box on the Post Analytics page were
previously overflowing their container. These changes fix that, and
allow them to scale up/down more gracefully for different screen sizes.
2024-07-10 15:01:41 +00:00
Daniël van der Winden
22824b9685
Fixed paywall button border radius (#20582)
Fixes
https://linear.app/tryghost/issue/DES-544/upgrade-email-paywall-button-doesnt-match-normal-buttons-in-newsletter

In emails, the button for the paywall wasn't getting the border-radius,
as [Gmail strips out font styling applied to the `td` element in the
HTML](https://stackoverflow.com/a/38041282). Those styles are now moved
out of that element, and look to apply correctly.
2024-07-10 12:45:49 +00:00
Sag
f8966e26c8
Cleaned up "Recommendations" GA feature flag (#20580)
no issue

- "Recommendations" feature was released in Ghost
[v5.71.0](https://github.com/TryGhost/Ghost/releases/tag/v5.71.0)
(commit: 1b82efe5d2)
- [Project
details](https://www.notion.so/ghost/Recommentions-5be89ec0d02a4c9b9310a964f9b22901?pvs=4)
2024-07-10 12:24:27 +00:00
Sag
a8533c9dc9
Cleaned up "Embeddable signup form" GA feature flag (#20577)
no issue

- "Embeddable signup form" feature was released in Ghost
[v5.51.0](https://github.com/TryGhost/Ghost/releases/tag/v5.51.0)
(commit: 5e7edb9)
- [Project
details](https://www.notion.so/ghost/Embeddable-signup-forms-1632735f1f894d01be491aeffb48bd45?pvs=4)
2024-07-10 10:46:04 +00:00
Sodbileg Gansukh
7266ca869f
Set explicit text color to the bookmark card content (#20578)
ref DES-263

- we've recently started forcing white background color to the bookmark
card by default
- the reason was making it look good regardless of the site background
color
- it caused an issue to some sites, mostly in dark mode, because the
text color was inherited from the theme
- this sets explicit color to the bookmark content which is consistent
with the nft card
2024-07-10 10:27:45 +00:00
Sag
83b1603202
Cleaned up "List Unsubscribe Header" GA feature flag (#20573)
no issue

- "List Unsubscribe Header" feature was added in Ghost release
[v5.74.0](https://github.com/TryGhost/Ghost/releases/tag/v5.74.0)
(commit: 69ee4a5)
- [Project
details](https://www.notion.so/ghost/One-click-unsubscribe-from-gmail-2b5cdc81e49f462287e9894c9c368aad?pvs=4)
2024-07-10 09:52:13 +00:00
Michael Barrett
6bfba13937
🐛 Fixed data importer allowing invalid free product to be imported (#20572)
refs
[ENG-1355](https://linear.app/tryghost/issue/ENG-1355/site-boot-cycling-due-to-free-tier-having-a-currency)

Fixed data importer allowing invalid free product to be imported which
could cause Ghost to not start due to the error:

`ValidationError: Free Tiers cannot have a currency`

It should not be possible to import a free product with pricing data (as
that means its not free 😄)
2024-07-10 10:49:56 +01:00
Chris Raible
bf895e6e99
🐛 Fixed offer redemptions for free members redeeming an offer (#20571)
ref
https://linear.app/tryghost/issue/ENG-1251/support-escalation-re-offers-not-tracking

- Offer Redemptions were not being persisted in the database for
existing free members who upgrade to a paid plan with an offer, which
resulted in inaccurate offer redemption counts. This made it difficult
to assess the performance of an offer.
- Previously, Ghost recorded an offer redemption in the DB in response
to the `SubscriptionCreatedEvent`, under the assumption that the offer
details would be included in this event. This assumption was valid for
brand new members starting a subscription with an offer, but not for
existing free members upgrading to a paid plan with an offer.
- For existing free members, the subscription is first stored in Ghost
in response to the `customer.subscription.created` Stripe webhook. At
this point, the offer/discount is not attached to the subscription, so
the `SubscriptionCreatedEvent` triggers without the offer information,
and the offer redemption is not recorded. After the
`checkout.session.completed` webhook is received (which _does_ include
the offer details), the subscription is updated in Ghost, but the Offer
Redemption is not stored.
- For brand new members, the `customer.subscription.created` webhook
no-ops, because the member and Stripe Customer don't exist yet.
Therefore, the subscription is first created in Ghost in response to the
`checkout.session.completed` webhook, which _does_ include the offer
information, so the offer information is included in the
`SubscriptionCreatedEvent` and the offer redemption is recorded as
expected.
- This change adds a new `OfferRedemptionEvent`, which triggers
either: (1) when a new subscription is created with an offer (as in the
case of a brand new member), or (2) when an existing subscription is
first updated to include an offer (as in the case of an existing free
member upgrading with an offer). The Offer Redemption is then persisted
in the DB in response to the `OfferRedemptionEvent` rather than the
`SubscriptionCreatedEvent`.
2024-07-09 16:05:26 -07:00
Steve Larson
9d15aef243
Updated timezone dependency (#20570)
ref https://linear.app/tryghost/issue/ENG-1266
- Mexico changed tz to not participate in DST
- our package was a couple years behind, so we likely have fixes for
other countries/regions, too
2024-07-09 16:31:36 -05:00
Princi Vershwal
81df7ca05b
Added tests for fix - URLs sent in emails containing a % can not be updated (#20569)
ref ENG-1372 ENG-447
2024-07-10 02:04:45 +05:30
Princi Vershwal
81ba4c7f4f
Added tests for dashboard stats service (#20567)
ref: https://linear.app/tryghost/issue/ENG-1374/add-tests-analytics-sources-shouldnt-be-case-sensitive
2024-07-10 00:50:41 +05:30
Sag
d0d0783837
🐛 Fixed pasting product URLs into the editor (#20565)
fixes https://linear.app/tryghost/issue/ENG-1215

- when pasting URLs that return `type: link` from the oembed service, we
now fallback to using a Bookmark card
- previously, this would render a plain link in the editor
- example product URL with `type: link`:
https://indiebeer.co.uk/products/terra-tempo-vinicius-red-wine-ba-wild-ale-with-mango-pineapple-honeydew-melon-and-banana-750ml-7
2024-07-09 18:28:56 +02:00
Steve Larson
00230314db
🐛 Fixed member source attribution for sign-up (Portal) links (#20566)
ref https://linear.app/tryghost/issue/ONC-154
- the query params did not carry through on portal sign up links because
of the hash creating an ignored fragment
(/#/portal/signup?ref=something)

Now when we check link attribution, we'll attempt to run the same logic
for the referrer source after stripping out `#/portal` from the URL.
Otherwise we should continue to treat these fragments as fragments to be
ignored by the client.

NOTE: We do not have e2e tests that cover member signup on the front end
and the data entered in the back end. The tests we have mock only the
server side of things. The test added here only covers the data that is
generated from the front end request (at this time), *not* the front end
request itself, meaning it's fragile.
2024-07-09 16:14:33 +00:00
Sag
8b45af3458
Cleaned up 'Filter by email disabled' GA feature flag (#20554)
no issue

- "Filter by email disabled" feature has been released to GA in [Ghost
v5.74.0](https://github.com/TryGhost/Ghost/releases/tag/v5.74.0)
(commit: 32d0d2b293)
- cf. [Project
details](https://www.notion.so/ghost/Filter-by-email-disabled-2a73f5da5e8b46bcaacb944bd98e0674?pvs=4)
2024-07-09 10:11:26 +00:00
Daniël van der Winden
4084a3d00f
Fixes complimentary subscription display issues (#20563)
Fixes
https://linear.app/tryghost/issue/DES-324/complimentary-plan-issues

We were showing renewal copy for subscriptions that are forever
complimentary. We also had a trailing en-dash in the Member detail
screen when their subscription was complimentary and had no end date.

Those things are solved now. We don't show dates or renewal copy when we
don't need to.
2024-07-09 11:53:02 +02:00
Sag
480f192f75
Updated Ghost Admin README with updated test instructions (#20561)
no issue
2024-07-08 16:57:52 +00:00
Sag
6e884b1a95
🐛 Fixed selection bugs in editor (#20557)
ref https://ghost.slack.com/archives/CTH5NDJMS/p1720422460943619

- bumping 'lexical' from 0.13.1 to 0.14.2 created a few selection bugs
in the editor
- this commit reverts 'lexical' back to 0.13.1 and any related changes
in the editor codebase
2024-07-08 13:34:51 +01:00
Ronald Langeveld
3818445a18
🐛 Fixed bad redirects yaml overriding backed up working yaml file (#20555)
ref ENG-945

- Fixed an issue where upload a broken redirects yaml will override the
last working yaml.
- Instead it will now do the validation before saving and overriding the
yaml.
2024-07-08 16:45:20 +07:00
Ghost CI
bd15ce5c03 v5.87.1 2024-07-05 16:04:15 +00:00
Ghost CI
d260d81348 🎨 Updated Source to v1.3.0 2024-07-05 16:04:15 +00:00
Ghost CI
dc1f9492de 🎨 Updated Casper to v5.7.3 2024-07-05 16:04:15 +00:00
Kevin Ansfield
191a301242
Cleaned up hasPortalImprovements GA feature flag (#20548)
no issue

- the feature has been GA for a long time now so the conditionals are no longer required
2024-07-04 16:21:48 +00:00
Kevin Ansfield
3b87c9be53
Cleaned up websockets experiment (#20547)
no issue

- we're no longer making use of the websockets experiment so it's just bloat
- this is the whole feature in a single commit in case we need to revive it at some point
2024-07-04 16:08:06 +00:00