Commit Graph

105 Commits

Author SHA1 Message Date
Sanne de Vries
8ddbf471dd
Updated donation success modal styles (#20859)
REF PLG-152
2024-08-28 15:48:57 +00:00
Kevin Ansfield
c689414497
Added missing translation entries for Portal field placeholders, labels, and errors (#20858)
no issue

- added `t()` around static strings to allow them to be translated
- updated translation files, with context provided in `context.json`
2024-08-28 15:43:03 +00:00
Kevin Ansfield
32edc12cc2 Fixed error closing donation success modal
no issue

- when redirecting from Stripe back to Ghost after making a donation the URL contained a double slash (`//#/portal/...`) which triggered browser security errors when Portal modified the browser history stack when navigating
- the above could prevent the donation success modal from closing
2024-08-28 12:38:14 +01:00
Steve Larson
8a1274517d
🐛 Added integrity token to one click subscribe (#20836)
ref https://linear.app/tryghost/issue/ONC-269

When we added the integrity token to all `send-magic-link` callers in
Portal, we missed one.
2024-08-27 21:17:19 +00:00
Kevin Ansfield
f613f42bec Updated donation success states
closes https://linear.app/tryghost/issue/PLG-152

- switched member success to a notification
- updated non-member success modal to include signup and signin links
2024-08-27 19:30:27 +01:00
Steve Larson
22fcd21fbb
Fixed Portal honeypot field (#20825)
ref INC-97
ref https://github.com/TryGhost/Ghost/issues/20767
- finishes wiring up the honeypot fied
- updates state handing to properly set the value
- maintains honeypot field across page changes within portal

There isn't a single previous commit to point to here since they didn't
get squashed. We added a honeypot field to help mitigate bot signup
activity. It's hidden, and if filled out, we can anticipate it's a bot.
Right now this just logs to Ghost while we collect data.
2024-08-26 22:51:57 +00:00
Sam Lord
0a9d2fadba Added honeypot field to prevent bot signup/signin
ref KTLO-1
Should prevent untargeted attacks using headless browser bots.
2024-08-22 22:32:04 +01:00
Sam Lord
ef4f79370f Added support in Portal for integrity tokens on magic link API
ref KTLO-1
These tokens should prevent untargeted attacks, as the magic link
endpoint needs a token that was generated by the server, similar to a
CSRF token, but without needing any server-side state, or a cookie to
be set for unauthenticated users.
2024-08-22 22:23:16 +01:00
Ronald Langeveld
ad3751bfa6
Added i18n support to tips and donations on portal (#20812)
ref PLG-159

- wrapped strings inside the translate function in Portal
- added new strings to i18n files
2024-08-22 15:28:08 +07:00
Steve Larson
dac2561252
🔒 Added uuid verification to member endpoints not requiring a session
ref https://linear.app/tryghost/issue/ENG-1364
ref https://linear.app/tryghost/issue/ENG-1464

- credits to https://github.com/1337Nerd
- added a hashed value to endpoints that do not require a member sign in in order to verify the source of the link and resulting request
- added redirect to sign in page when trying to access newsletter
management
2024-08-20 16:24:02 +02: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
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
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
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
46f0efe463
Fixed flaky Portal test (#20286)
no issue

- the signup flow tests check whether the benefits of the available
tiers are rendering correctly. The test is based on a text match, which
sometimes fails because of duplicate benefit descriptions
- this fix makes the benefit descriptions less likely to be the same, by
using a timestamp in the randomisation function
2024-05-30 06:25:50 +02:00
Djordje Vlaisavljevic
4b4af65fce Fixed spacing bug
closes https://linear.app/tryghost/issue/DES-258/not-receiving-emails-link-is-offset-on-account-page
2024-04-24 13:13:21 +01:00
Peter Zimon
e4b908479e
Fix free tier benefit not showing up (#19879)
ref ENG-760

The benefits for Free tier was not showing up for some old & new logic.

---------

Co-authored-by: Sag <guptazy@gmail.com>
2024-03-19 09:51:59 +01:00
Steve Larson
ae5df293c3
Fixed button spacing in Portal unsubscribe popup footer (#19815)
no ref
- The 'Get help' button was only adding margin on the left when accessed
through account management even though it is also shown on the
unsubscribe page accessed via link.
2024-03-06 14:53:02 +00:00
Steve Larson
cbb27c2d53
Fixed TZ dependency in Portal helpers test (#19804)
no refs
- Tests run locally (US TZ) often always failed because the dates are
pushed to the en-GB locale. The test now forces the same TZ onto the
compared to date.
2024-03-05 15:44:07 -06:00
Steve Larson
2bb566f18f
Added Portal tests for newsletter subscriptions (#19802)
refs https://linear.app/tryghost/issue/ENG-677

- Portal was completely missing tests for `UnsubscribePage`
- `UnsubscribePage` is unique for Portal in that it needs to be able to
handle logged in and not-logged-in member state/interactions
- Various parts of Portal don't use a shared `GhostApi` instance, making
mocking all functionality impossible
- `UnsubscribePage` was updated to use `onAction` to bring it in line
with other Portal interactions while logged in
- Added checks for UI components for more precision in tests checking subscriptions within the UI

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-03-05 19:22:50 +00:00
Peter Zimon
6d6969f4b0
Portal signup page spacing fixes (#19791)
refs.
https://linear.app/tryghost/issue/DES-161/portal-signup-window-spacing-problem

The products section is returned even if there's only a free product in
the publication. This results in an extra, unnecessary space between the
signup form inputs and the signup button.
2024-03-04 16:27:30 +01:00
Steve Larson
c2f3ffaca7
🐛 Prevented newsletter subscriptions from getting out of sync in Portal (#19768)
refs https://linear.app/tryghost/issue/ENG-677
- UnsubscribePage is intended to be able to be used without logging in
to Portal. The app context (member state) was not synchronized when
logged in, causing conflicts in the client data vs. database.
- Now when a logged in member is found, the member object is manually
updated to reflect the API response(s).
2024-02-28 13:57:19 -06:00
Sag
e9f5af110c
🎨 Added option to change the name of the free tier (#19715)
ref ENG-607

- also added the option to show the monthly pricing by default during
signup

Co-authored-by: Simon Backx <simon@ghost.org>
Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2024-02-20 12:54:41 +01:00
Ryan Feigenbaum
4d6aaf0f68
Update grammar and fix missing word in Email receiving FAQ (#19637)
There were two changes in the Email receiving FAQ page.

1. Add "a" to "If you're not receiving the email newsletter you've
subscribed to, here are a few things to check."
2. Remove unnecessary hyphens from "to-and-from this address."

@jonhickman
2024-01-31 16:16:40 -05:00
Sag
1e988cccff
Revert Portal changes (#19594)
no issue

- This revert recent changes made to Portal, that may be causing the
Free tier to not render properly on Ghost sites
2024-01-27 01:46:59 +01:00
Djordje Vlaisavljevic
9a3aa6310b Updated portal price toggle design
refs DES-24 DES-25
2024-01-25 12:08:33 +00:00
Ronald Langeveld
52e99f904e
Added Portal Frame conditions (#19549)
no issue

- adds 2 addition conditions for when the Portal iframe should be
visible.
- waits an extra 100ms before making it visible to give portal time to
properly load.

---------

Co-authored-by: Princi Vershwal <vershwal.princi@gmail.com>
2024-01-23 12:31:08 +00:00
Djordje Vlaisavljevic
d37a46a400
Updated yearly discount indicator copy PROD-299 (#19540)
refs PROD-299
2024-01-22 14:53:57 +00:00
Sodbileg Gansukh
ea04f74a82
Fixed dashed border width issue for offers preview in Portal (#19427)
fixes PROD-282
2024-01-03 06:48:47 +00:00
Sodbileg Gansukh
b7648e7bc2
Added design improvements to the Portal preview in offers (#19349)
fixes PROD-251, PROD-252, PROD-254
2023-12-13 06:17:12 +00:00
Djordje Vlaisavljevic
5c19249473
Added yearly discount indicator to monthly/yearly toggle PROD-60 PROD-222 PROD 223 (#19276)
refs PROD-60, PROD-222, PROD-223, PROD-89, PROD-94

- Indicator shows up in the monthly/yearly toggle if there are any paid
tiers with yearly discount, and shows the highest discount in order to
nudge visitors towards checking out yearly plan
- A couple of smaller portal improvements: typos, spacing, alignment

---------

Co-authored-by: Simon Backx <simon@ghost.org>
2023-12-12 09:32:56 +00:00
Sanne de Vries
61a91f7dbd
Flipped thumbs-down icon horizontally in email and Portal (#19306)
Refs https://github.com/TryGhost/static/pull/3
- This way the thumbs-down is facing the opposite direction as the
thumbs-up
2023-12-11 13:05:11 +00:00
Sag
1fb22c8aca
Removed hardcoded title for single free tier in Portal (#19289)
fixes PROD-68
2023-12-07 19:28:14 +00:00
Simon Backx
3f6ea04c43
Added portal default plan setting (#19238)
fixes PROD-61

This adds a new default plan setting. It defaults to yearly, which is
the current default selected interval in Portal.

Behind the new portal improvements feature flag, the default plan can be
changed. It will also change automatically if the available intervals
are changed.

This PR also wires up passing the new setting to the Portal preview.
2023-12-06 11:39:58 +01:00
Sag
545cf8c258
Updated logic to allow a different name for the free tier (#19229)
fixes PROD-69
2023-12-05 18:05:16 +00:00
Sag
fd1a08641e
🐛 Fixed links in signup terms (#19235)
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
2023-12-05 10:47:27 -03:00
Sodbileg Gansukh
9914eb753b
Offers modal and preview improvements (#19192)
fixes ADM-20

- increased the width of the modals
- smaller width for the portal preview for better balance
2023-11-30 05:43:37 +00:00
Sag
f8ad5fb2ea
Updated Portal to use calculated support and default email addresses (#19163)
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
2023-11-29 09:48:05 -03:00
Simon Backx
57d43d2d72 🐛 Fixed Portal default page handling
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.
2023-11-28 16:18:01 +01:00
Simon Backx
75bb53f065
🔒 Added support for logging out members on all devices (#18935)
fixes https://github.com/TryGhost/Product/issues/3738
https://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
2023-11-15 17:10:28 +01:00
Simon Backx
395c109c67 🐛 Fixed UI glitch on unsubscribe page in Portal
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.
2023-11-08 15:05:47 +01:00
Djordje Vlaisavljevic
7e01bdbf18 Removed unnecessary spacing
refs https://github.com/TryGhost/Product/issues/4106
2023-11-07 11:39:32 +00:00
Michael Barrett
094ea1d2b0
🐛 Fixed plan upgrade not cancelling trial (#18699)
closes https://github.com/TryGhost/Product/issues/4036

Fixed a bug where a member on a trial plan would not have their trial
cancelled when they upgraded to a paid plan
2023-10-20 08:52:08 +01:00
Simon Backx
9abd466397
Renamed reason to description in recommendations table (#18527)
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
2023-10-09 11:19:44 -03:00
Simon Backx
7b3a0c6863
🐛 Fixed outboundLinkTagging setting affected whether member sources are tracked (#18498)
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.
2023-10-05 12:25:21 +02:00
Simon Backx
1882b7048d
Added click tracking for recommendations helper (#18496)
fixes https://github.com/TryGhost/Product/issues/4001
2023-10-05 11:37:02 +02:00
Michael Barrett
d406d2ba6a
🐛 Fixed incorrect subscription status text when subscription is comped (#18369)
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.
2023-09-27 08:46:55 +01:00
Sag
b304a88a63
Hooked 'Maybe Later' button in the Recommendations modal (#18337)
closes https://github.com/TryGhost/Product/issues/3824
2023-09-25 15:25:28 +00:00
Djordje Vlaisavljevic
21bdd38b37 Added "Maybe later" button to recommendations modal
refs https://github.com/TryGhost/Product/issues/3824
2023-09-25 15:29:38 +01:00
Djordje Vlaisavljevic
99e455a4f5 Fixed recommendations modal heading issue
no ref
2023-09-22 14:42:16 +01:00