Commit Graph

39141 Commits

Author SHA1 Message Date
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
Michael Barrett
ffbcb5a69e
Refactored ActivityPub tabs to make tabs more maintainable (#20692)
no refs

Refactorings include:

- Formatting JSX to be more readable
- Filtering activities before rendering
- Fixing invalid inbox empty state HTML (nesting div inside ul)
- Adding initial support for announce activities in the inbox
2024-07-31 09:57:10 +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
Michael Barrett
61641bc7c6
Fixed ActivityPub app tabs content (#20690)
no refs

The `Activity` and `Likes` tabs of the AcitivityPub app were not showing
the correct content. This commit fixes that.
2024-07-30 15:23:34 +01:00
Steve Larson
f7a592e761
🐛 Fixed dark mode for standalone html editors in Admin X (#20689)
ref https://linear.app/tryghost/issue/DES-591
- finished wiring up the darkMode prop through the context providers 

The main impact here was that the formatting toolbar was not respecting
the dark mode settings.
2024-07-30 09:18:51 -05:00
Fabien 'egg' O'Carroll
178c98c17f
Fixed handling of single item collections (#20688)
Fedify will not use an array for the `items` key of collections when
there is only a single item, which wasn't being handled in our
activitypub api module.

Now we always return an array so that the components recieve consistent
data.
2024-07-30 17:33:25 +07:00
Djordje Vlaisavljevic
bbec5c0ba6
Added support for displaying different types of Mastodon notes (#20684)
- Added logic for displaying different attachments for Mastodon Notes
(images, audio, video)
- Centered the feed on the screen for better focus and made the Feed
layout the default one
- Moved Following and Followers counters to the new “Profile” tab

---------

Co-authored-by: Fabien O'Carroll <fabien@allou.is>
2024-07-30 10:40:10 +01:00
renovate[bot]
f7ec72488a Update tiptap monorepo to v2.5.8 2024-07-30 07:48:45 +00:00
renovate[bot]
fd335d3f4c Update dependency i18next to v23.12.2 2024-07-30 07:48:15 +00:00
renovate[bot]
8afdc10ec9 Update dependency tailwindcss to v3.4.7 2024-07-30 09:30:41 +02: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
Steve Larson
a109b255f0
🐛 Fixed no redirect on Portal signin when trying to access newsletters (#20683)
ref https://linear.app/tryghost/issue/ENG-1464
- added redirect to sign in page when trying to access newsletter
management

If a user tries to access newsletter management when not logged in,
Portal requires sign in via magic link. This magic link didn't previous
redirect the user back to newsletter management, requiring some extra
clicks.
2024-07-29 15:58:08 +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
Daniel Lockyer
103672ef57 🐛 Fixed spurious errors when loading modal before provider
fix https://linear.app/tryghost/issue/SLO-190/error-no-dispatch-method-detected-did-you-embed-your-app-with

- we've spuriously been seeing `No dispatch method detected, did you
  embed your app with NiceModal.Provider` when browsing to a URL that
  loads a modal in Safari
- it looks like DesignSystemProvider (via DesignSystemApp) contains the
  NiceModal.Provider, but this is loaded within the RoutingProvider that
  could trigger a modal to load
- I tried switching around RoutingProvider and DesignSystemApp but many
  other tests failed, so my fix here is to add a NiceModal.Provider to
  wrap the RoutingProvider
- unfortunately, this bug is flaky to occur and I've only been able to
  reproduce it on Safari, so writing a test for this would be very
  tricky
2024-07-29 13:38:05 +02:00
renovate[bot]
184ef6274a Update dependency tailwindcss to v3.4.6 2024-07-29 12:35:12 +02: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
renovate[bot]
6da911e578 Update tiptap monorepo to v2.5.7 2024-07-26 14:12:21 +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
renovate[bot]
4f2a31aa2f Update tiptap monorepo to v2.5.6 2024-07-24 16:39:32 +00: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]
59d4ad91d2 Update dependency tailwindcss to v3.4.5 2024-07-24 10:37:37 +02: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
Fabien O'Carroll
bfd3ee1209 Wired up ActivityPubAPI w/ ReactQuery
This is a bit of a stopgap, we'll want to eventually pull these hooks out into
a shared file, but for now this is fine.

This almost decouples us from admin-x-framework, but we're still using it to
get the site url as well as some types that we can pull out later.
2024-07-24 13:38:08 +07:00
Fabien O'Carroll
c6e407fb7e Created ActivityPubAPI module
ref https://linear.app/tryghost/issue/MOM-288

Instead of having all of our network code inside of admin-x-framework, we're
moving it into activitypub to make it easier to work with. We've also added
support for using identity tokens for authentication with the ActivityPub API.
2024-07-24 13:38:08 +07:00
Fabien O'Carroll
bef58e1069 Removed nx build from test:unit script
This slows down TDD workflows way too much
2024-07-24 13:38:08 +07:00
Fabien O'Carroll
63261d7d88 Updated vite config to allow sibling test files 2024-07-24 13:38:08 +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
Kevin Ansfield
4465e09f2f Fixed missing space after account name when disconnecting Stripe
no issue

- line wrap immediately after the variable meant whitespace was being ignored
2024-07-23 15:05:21 +01: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
renovate[bot]
f493ce9abe Update tiptap monorepo to v2.5.5 2024-07-22 12:00:54 +00:00
renovate[bot]
74a67855f4 Update dependency rimraf to v5.0.9 2024-07-22 12:36:54 +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