fixes https://github.com/TryGhost/Product/issues/4222
fixes PROD-197
- links in signup terms were not opening properly, as we open Portal
within an iframe
- the previous fix in place did not work anymore, as the HTML structure
of the signup terms has changed
refs https://ghost.slack.com/archives/C02G9E68C/p1701344186524289
- changed the ship command in portal to avoid checking the status of
files in all of Ghost and just checks for the status of files inside
Portal before publishing to NPM.
---------
Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
fixes GRO-72
- added "default_email_address" and "support_email_address" to the
public settings
- when available, use these addresses in Portal. Otherwise, fallback to
current logic
fixes GRO-88
Instead of going to the previous page when visiting /#/portal, it will now go to the default page:
- Sign up if you are not signed in
- Account home if you are signed in
Previously, it had the same behaviour, with the difference that it would also go to the previous page if there was any.
fixes https://github.com/TryGhost/Product/issues/3738https://www.notion.so/ghost/Member-Session-Invalidation-13254316f2244c34bcbc65c101eb5cc4
- Adds the transient_id column to the members table. This defaults to
email, to keep it backwards compatible (not logging out all existing
sessions)
- Instead of using the email in the cookies, we now use the transient_id
- Updating the transient_id means invalidating all sessions of a member
- Adds an endpoint to the admin api to log out a member from all devices
- Added the `all` body property to the DELETE session endpoint in the
members API. Setting it to true will sign a member out from all devices.
- Adds a UI button in Admin to sign a member out from all devices
- Portal 'sign out of all devices' will not be added for now
Related changes (added because these areas were affected by the code
changes):
- Adds a serializer to member events / activity feed endpoints - all
member fields were returned here, so the transient_id would also be
returned - which is not needed and bloats the API response size
(`transient_id` is not a secret because the cookies are signed)
- Removed `loadMemberSession` from public settings browse (not used
anymore + bad pattern)
Performance tests on site with 50.000 members (on Macbook M1 Pro):
- Migrate: 6s (adding column 4s, setting to email is 1s, dropping
nullable: 1s)
- Rollback: 2s
refs https://github.com/TryGhost/DevOps/issues/104
- `info` is very verbose as it prints all files and their sizes
- we often don't care about this, so we can do away with `info` in favor
of `warn`
refs https://vitejs.dev/config/build-options.html#build-reportcompressedsize
- this should make building a little bit quicker because it doesn't have
to calculate the gzip size (I don't think we're likely to hit this
because we don't have large projects, but it's still nice to clean up
the output)
refs https://ghost.slack.com/archives/C02G9E68C/p1699391515110759
When the unsubscribe page first showed, member is set to `undefined`. This cause the normal NewsletterManagement page to be visible, but with the wrong settings. This caused the switches to quickly change between on/off state, making it look like some setting was changed when it was not.
To fix this, I added a loading page to the unsubscribe page.
Apart from this, the current error page now will get shown correctly when the uuid in the url is invalid. And the toast message on the top will be hidden if the newsletter uuid in the url is missing or invalid.
fixes https://github.com/TryGhost/Product/issues/4005
We no longer use the 'reason' of a recommendation, but allow a flexible
description instead. Because this is a breaking change in the API, we do
this before making this feature GA.
- Added new database utils for renaming a column
- Added new migration to rename the column
- Updated all references in code
no issue
- During the one click subscribe flow, the outboundLinkTagging should
affect whether we send a history or not to the signup endpoint. But for
internal history this is the members_track_sources setting. This happens
in the backend normally.
- Do not send a (constructed) history to external sites (= one click
subscribe flow in recommendations) if outboundLinkTagging is false
- Do always send a history internally for local signups (backend handles
whether to store it based on the members_track_sources setting that is
currently not exposed in the frontend). The history is not built if this
setting is disabled, but we could have an old history entry if this
setting was enabled in the past.
refs https://github.com/TryGhost/Product/issues/3963
The subscription status text was incorrect when a subscription was
comped and a member had multiple subscriptions (i.e a cancelled sub and
a comped sub). This was because the methods used to determine the status
of a subscription only took into account the status of the first
subscription associated with a member.
no issue
- Do not set ?ref in recommendations if analytics is disabled
- Do not send url_history if analytics is disabled
- Expose outboundLinkTagging as a public setting
no refs
When `data-members-newsletter` was used with checkboxes, if no
checkboxes were selected then the backend would subscribe the member to
the default newsletters which is not what we want - We want to subscribe
the members only to the newsletters they have selected
fixes https://github.com/TryGhost/Product/issues/3822
fixes https://github.com/TryGhost/Product/issues/3838
This PR became a bit big because it affected multiple parts of Ghost
that needed to be updated to prevent breaking anything.
### Backend
- Added pagination to the recommendations API's
- Updated BookshelfRepository template implementation to handle
pagination
- Allow to pass `page` and `limit` options to Models `findAll`, to allow
fetching a page without also fetching the count/metadata (=> in the
repository pattern we prefer to fetch the count explicitly if we need
pagination metadata)
- Added E2E tests for public recommendations API (content API)
- Extended E2E tests of admin recommendations API
### Portal
- Corrected recommendations always loaded in Portal. Instead they are
now only fetched when the recommendations page is opened.
### Admin-X
- Added `usePagination` hook: internally used in the new
`usePaginatedQuery` hook. This automatically adds working pagination to
a query that can be used to display in a table by passing the
`pagination` and `isLoading` results to the `<Table>`
- Added placeholder `<LoadingIndicator>` component
- Added a loading indicator to `<Table>`. This remembers the previous
height of the table, to avoid layout jumps when going to the next page.
refs https://github.com/TryGhost/Product/issues/3809
When an input is added to a custom sign-up form with the attribute
`data-members-newsletter`, the value of the input will be used as the
newsletter to subscribe the member to.
refs https://github.com/TryGhost/Product/issues/3770
- Site is not always defined, so the things broke when using the signup action without a defined site, where it wants to read the recommendations_enabled setting
- Fixed this by removing the welcome page and looking for the existing query params instead
fixes https://github.com/TryGhost/Product/issues/3820
- This adds a new public site endpoint in the members API to check if a
site can offer the one-click-subscribe feature
- This is implemented on the members API as a copy of the `site`
endpoint because the admin API site endpoint is protected by CORS and
mainly because it can be served on a different domain than the
recommended site and this is hard to detect reliably from the frontend
- Added a new calculated setting `allow_self_signup`, which can replace
the setting that is currently used in Portal (best to do this after a
release otherwise we risk creating issues if a patch release happens)
refs https://github.com/TryGhost/Product/issues/3815
- recommendations are rendered in a random order, using Fisher-Yates
shuffle
- only 5 recommendations are rendered by default, the other ones are
hidden behind a "Show all" button
- recommendations are fetched all at once from the backend, as we assume
there won't be more than 100-ish recommendations per publication
refs https://github.com/TryGhost/Product/issues/3771
- if recommendations are enabled, render the recommendation modal on
sign up, in Portal
- for free signups, the recommendations modal is rendered after clicking
on the magic link
- for paid signups, the recommendations modal is rendered after Stripe
Checkout
- the recommendations modal is not rendered on a free to paid upgrade
fixes https://github.com/TryGhost/Product/issues/3753
The validation for the terms checkbox was being executed when the terms
checkbox was not being rendered. The validation checks needed to be
updated to account for if the checkbox was rendered or not. Basically
the same as this:
45a70a3f4c
refs TryGhost/Product#3743
- Users should be able to hide the free plan from Portal, which removes it as an option on the main portal /signup page
- However, they should still be able to use the /signup/free link to allow members to signup for the free plan. Currently if the free plan is hidden from portal, the /signup/free link renders the main /signup page, with only paid plans available.
- This PR fixes that by allowing the /signup/free link to work even if the free plan is hidden from portal, but only by directly accessing the /signup/free link
closes https://github.com/TryGhost/Product/issues/3661
- until now, Portal was not loaded if members were disabled. With the
introduction of Tips & Donations, signed-off readers can also make
payments, using the Portal link /#/portal/support.
- now, Portal is loaded when Tips & Donations are enabled, even if
Memberships are disabled
- depending on the member signup access, the top bar / trigger button
Portal buttons are hidden as before (signup/subscribe hidden if access is set to none, subscribe hidden if
access is set to invite-only)
- for any other signup / signin Portal links (e.g., added by the theme,
or added via a Post/Page), a new popup informs the reader when
Memberships are disabled: "Memberships unavailable, contact the site
owner for access".
no issue
- When clicking back button in the browser when on the checkout page,
will not open Stripe again
- Does not open Stripe checkout in peek and pop mode in Arc
closes https://github.com/TryGhost/Product/issues/3661
- until now, Portal was not loaded if members were disabled. With the
introduction of Tips & Donations, signed-off readers can also make
payments, using the Portal link /#/portal/support.
- now, Portal is loaded when Tips & Donations are enabled, even if
Memberships are disabled
- depending on the member signup access, the "sign in" / "subscribe"
Portal buttons are hidden (both hidden if none, signup hidden if
invite-only)
- for any other signup / signin Portal links (e.g., added by the theme,
or added via a Post/Page), a new popup informs the reader as such when
Memberships are disabled: "Memberships unavailable, contact the site owner for access".
refs https://github.com/TryGhost/Product/issues/3650
- adds '/support', '/support/success' and 'support/error' pages
- support page calls the '/members/api/create-stripe-checkout-session'
backend endpoint on mount, then renders an error or success page
accordingly
refs https://github.com/TryGhost/DevOps/issues/50
- `react-app` comes from `eslint-config-react-app`, which is a CRA package
- we're moving away from that so this commit switches the linting over
to a more recently updated plugin
- once that was removed, we started using a newer version of
`@typescript-eslint/eslint-plugin`, so there were plenty of
updates/exemptions to make
no issue
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at e0f948c</samp>
This change updates the `portal` package to the latest version, which
fixes some bugs and enhances the user experience of the members feature.
refs TryGhost/Product#3563
- For a member on a paid plan, which had subsequently been hidden from
portal, the member was unable to unsubscribe/change plan because the
'Change' button was hidden
- This change restores the 'Change' button for members on a paid plan,
even if the plan is hidden from portal
- This change also makes some modifications to the 'Change Plan' page,
like showing the current active plan even if it is hidden, and displays
a message to comped members to contact support if they want to change
their plan
---------
Co-authored-by: Sodbileg Gansukh <sodbileg.gansukh@gmail.com>
no issue
- bumped portal to a new minor after publishing.
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 7e70d04</samp>
Updated the portal package to version 2.33.7 with some bug fixes and
improvements. The `apps/portal/package.json` file reflects the new
version number.
closes https://github.com/TryGhost/Product/issues/3613
- Strings around the buttons was still hardcoded.
- This replaces them with the `i18n` integration.
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 068d0d6</samp>
Added internationalization support to the `ProductsSection` component
using the `t` function and the `Interpolate` component. This enables the
component to display product information in different languages and
currencies.