Commit Graph

784 Commits

Author SHA1 Message Date
Rishabh
08d740133f Updated site and member data to load in parallel
This reverts commit 841793e4d3.
2021-05-24 19:22:07 +05:30
Rishabh
674f6f8e1e Added firing of portal-ready post message for preview""
This reverts commit 5650b8d716.
2021-05-24 19:20:32 +05:30
Rishabh
9129fa7cf9 v1.4.3 2021-05-24 19:14:23 +05:30
Rishabh
841793e4d3 Revert "Updated site and member data to load in parallel"
This reverts commit 8ac6364d3a.
2021-05-24 19:13:55 +05:30
Rishabh
5650b8d716 Revert " Added firing of portal-ready post message for preview"
This reverts commit 347805d4d0.
2021-05-24 19:13:37 +05:30
Rishabh
edba56fbfb v1.4.2 2021-05-24 18:32:42 +05:30
Rishabh
347805d4d0 Added firing of portal-ready post message for preview
no refs

This adds a way for top level site/admin to detect when Portal is loaded on the site and is ready to render, which allows dynamic UI handling specially in Preview mode in Admin.
2021-05-24 18:12:08 +05:30
Rishabh
8ac6364d3a Updated site and member data to load in parallel
no refs

Previously, the site and member data needed by Portal were loaded sequentially, which delayed the first load slightly as both the requests can be instead made in parallel. This change updates the API init to load both requests in parallel.
2021-05-24 18:10:48 +05:30
Rishabh
9472a29568 v1.4.1 2021-05-19 00:27:11 +05:30
Peter Zimon
97fdd037ca Design refinements + fixes
- replaced invite only default icon
- removed unused function include
- reseted fixtures
2021-05-18 16:54:39 +02:00
Peter Zimon
afb3e9ad64 UI refinements
- removed cadence indicator from prices
- refined spacings for prices
2021-05-18 16:43:30 +02:00
Peter Zimon
ef10fce723 Setting site title as default title 2021-05-18 16:36:48 +02:00
Rishabh
d4fe243d43 Added signup access setting to preview
no refs

Allows Portal preview to use `members_signup_access` setting from the URL instead of relying on saved setting to change the preview without saving on Admin.
2021-05-18 17:43:18 +05:30
Rishabh
8044dc836a v1.4.0 2021-05-18 14:57:42 +05:30
Rishabh
370f721deb 🐛 Fixed falsy value not used in preview
no refs

For some boolean preview keys like `allowSelfSignup` and `disableBackground`, we ignored setting the falsy value which is incorrect and doesnt' load the expected Portal preview
2021-05-18 14:55:37 +05:30
Rishabh
fd6fee4c9d 🐛 Fixed extra email sent for logged in members on upgrade
refs https://github.com/TryGhost/Team/issues/695
refs 212be5fb02 (Patch)

Currently when we have a successful Stripe checkout session, we will always send the member an email confirming their signup when using data-members-* attributes.

This is considered a bug for members who have signed up as a free member first, meaning they have already received this email. This change passes a `checkoutType` metadata same as Portal to not send the email when member is already logged in.
2021-05-18 09:19:00 +05:30
Rishabh
4e14d811bf 💡 Handled updated API response for logged out member
refs https://github.com/TryGhost/Team/issues/560
refs 196cdafe6b

The endpoint `/members/api/member/` is used by Portal for fetching member details on site load to setup different flows. The response from this endpoint for logged out member has now changed from 401 Unauthorized to 204 No Content. This updates the API handling in Portal for updated response status.

This change also handles the visible error messages on console for Portal when it first loads and tries to establish member logged-in status, and instead handles it now behind the scenes. This also makes Portal functioning more transparent on the site.
2021-05-13 15:32:32 +05:30
Rishabh
9fcad8e31d Updated default currency for free price
no refs

Since custom prices now allow prices with multiple currencies to exist, till we have a default currency for a site, we use the currency for first paid price on the list as default currency for a free price visually on Portal UI
2021-05-13 15:28:52 +05:30
Rishabh
66cbbce917 v1.3.1 2021-05-12 17:13:16 +05:30
Rishabh
52d52c9a9e Updated default page to signin for invite only sites
closes https://github.com/TryGhost/Team/issues/689

For invite only sites, the default page should be signin as it makes more sense and is actionable than a static signup page
2021-05-12 17:11:48 +05:30
Peter Zimon
0bbdccea72 Refined billing period indicator 2021-05-10 21:05:46 +02:00
Rishabh
4d9579e11c Added interval to prices on Plan UI
closes https://github.com/TryGhost/Team/issues/673
2021-05-11 00:07:55 +05:30
Rishabh
39b7c01909 v1.3.0 2021-05-10 23:09:02 +05:30
Rishabh
56756ff9b6 Fixed lint 2021-05-10 23:05:02 +05:30
Peter Zimon
280181720b Fixed modal width logic 2021-05-10 23:05:02 +05:30
Rishabh
9ac53e5b27 Fixed legacy price names link/data-attribute not working
closed https://github.com/TryGhost/Team/issues/683

The legacy price names `monthly` / `yearly` should still redirect to checkout flows as a special exception.
2021-05-10 23:05:02 +05:30
Rishabh
1ca383df5d Updated default free price fixture
refs https://github.com/TryGhost/Team/issues/648

We use sentence case everywhere for labels, the default description for free price should be the same
2021-05-10 23:05:02 +05:30
Rishabh
bc79df66e8 Added sorted prices in Portal plans UI
refs https://github.com/TryGhost/Team/issues/641

Updated prices list to be sorted on `currency` -> `amount` which is consistent with price list on Admin.
2021-05-10 23:05:02 +05:30
Rishabh
e9d8f25773 Updated old members data attribute handling for custom prices
refs https://github.com/TryGhost/Team/issues/643

With custom products and prices, the old data attributes for members functionality - `data-members-plan` - was still using the plan name for checkout session which won't work as it now expects a price ID. This change reworks how we setup to listen to `data-members-*` attributes and moves them inside App.js so they can work with API data fetched from site settings and use the price ID for the `monthly` and `yearly` names as fallback.
2021-05-10 23:05:02 +05:30
Rishabh
12500c3b95 Added fallback discount description
refs https://github.com/TryGhost/Team/issues/671

When turning on custom products, existing sites should have default price description that retains current behaviour. This change adds custom description with discount value for Yearly Plans to keep the existing behavior for sites that mimic the old setup.
2021-05-10 23:05:02 +05:30
Rishabh
9f154dbcd2 Added free price details handling
refs https://github.com/TryGhost/Team/issues/637

Since we allow setting custom name and description for free price now, this wires up the values for free membership price settings to API
2021-05-10 23:05:02 +05:30
Rishabh
b73fdf66d1 Added interval fallbacks for monthly/yearly plans
refs https://github.com/TryGhost/Team/issues/643

Previously, we always expected `Monthly` or `Yearly` prices to be available for attribtues/links as those were the only prices allowed in Portal. With custom prices, as prices can have dynamic names, we still support Monthly/Yearly prices for backwards compatibility.

The way Monthly/Yearly prices are determined with custom prices is first trying to find the first price by the name same as `Monthly` / `Yearly`, followed by finding a plan having interval `month`/`year`. This gives us the best possible window to continue supporting Monthly/Yearly till all themes have time to adapt to custom prices
2021-05-10 23:05:02 +05:30
Rishabh
815e00c761 Handled custom prices query in links/attributes
refs https://github.com/TryGhost/Team/issues/643

Previously, Portal only worked with hardcoded `Monthly` and `Yearly` plans as those were the only possible prices available to members. With custom prices and products, Portal is now expanded to work with any number of custom prices as well as allow links/attributes for them to work via IDs.

Also, to continue backwards compatibility with Monthly/Yearly, Portal will support their data attributes/links, finding the first relevant Monthly/Yearly plan by nickname, falling back on interval if needed.
2021-05-10 23:05:02 +05:30
Rishabh
811067b7a7 Added product name and description to title 2021-05-10 23:05:02 +05:30
Peter Zimon
d52f054410 Added product description to signup 2021-05-10 23:05:02 +05:30
Rishabh
3358847e78 Updated fixtures for preview mode 2021-05-10 23:05:02 +05:30
Rishabh
33308c61b5 Updated fixtures
no refs
2021-05-10 23:05:02 +05:30
Peter Zimon
fb772638b0 Refined price alignment and sizes 2021-05-10 23:05:02 +05:30
Peter Zimon
d49b3f40e7 Refined price name and value alignment 2021-05-10 23:05:02 +05:30
Peter Zimon
4260ff59a4 Updated dynamic modal width logic 2021-05-10 23:05:02 +05:30
Peter Zimon
80cd22bfaa Updated plan section styles 2021-05-10 23:05:02 +05:30
Rishabh
816560b7ce Updated preview to work in setup mode
refs https://github.com/TryGhost/Team/issues/644

In Preview mode during launch wizard in Admin, we show owners dummy Monthly/Yearly plan since the prices are not yet created but will be created if everything looks good in the next step. This change handles the dummy Monthly/yearly prices without actually having the values in DB or settings.
2021-05-10 23:05:02 +05:30
Rishabh
a7de8e9c47 Fixed tests
no refs

Updated tests to work with custom prices
2021-05-10 23:05:02 +05:30
Rishabh
53b63acf40 Cleaned up Signup and Plan pages
Cleanup Account home

Cleanup - Account Plan Page
2021-05-10 23:05:02 +05:30
Rishabh
7d43811600 Handled portal prices data from Admin 2021-05-10 23:05:02 +05:30
Rishabh
c178c60652 Updated api to use price id instead of plan name 2021-05-10 23:05:02 +05:30
Rishabh
41528e90bf Fixed current plan selection not working 2021-05-10 23:05:02 +05:30
Rishabh
92132a567c Added price change handling 2021-05-10 23:05:02 +05:30
Rishabh
4c2a6b9444 Added plan checkout 2021-05-10 23:05:02 +05:30
Peter Zimon
afd51e0e34 Updated no description price name style 2021-05-10 23:05:02 +05:30
Rishabh
38ed4ad61a Added v1 handling for custom prices
refs https://github.com/TryGhost/Team/issues/637
2021-05-10 23:05:02 +05:30
Peter Zimon
3eebae2e11 Updated change plan screen 2021-05-10 23:05:02 +05:30
Peter Zimon
cdb9e0e02c Updated price list 2021-05-10 23:05:02 +05:30
Peter Zimon
725ec2e09a Added product list to account screen 2021-05-10 23:05:02 +05:30
Renovate Bot
ad4168d5b2 Update dependency eslint-plugin-ghost to v2.2.0 2021-05-10 01:30:12 +00:00
Rishabh
4b97830079 v1.2.3 2021-05-03 22:24:15 +05:30
Rishabh
e9556466a2 Fixed Lint
no refs

Removed unused icon
2021-05-03 22:23:36 +05:30
Peter Zimon
68d0bc0248 Updated "Powered by Ghost" badge with new logo 2021-05-03 18:46:10 +02:00
Renovate Bot
9fd67880dd Update dependency eslint-plugin-ghost to v2.1.0 2021-04-30 12:16:47 +00:00
Renovate Bot
9ab5400219 Update actions/checkout action to v2 2021-04-29 09:06:18 +01:00
Rishabh
e9098743f3 v1.2.2 2021-04-28 16:31:02 +05:30
Peter Zimon
d8d2accfe4 Refined styles for invite only modal 2021-04-28 12:54:11 +02:00
Peter Zimon
4a0f3c2403 Updated invite-only styles 2021-04-28 12:40:52 +02:00
Rishabh
a1506b824f 🐛Fixed signup button and icon in invite mode
refs https://github.com/TryGhost/Team/issues/579

We added a new setting to explicitly set `invite-only` mode which was not handled in the signup button and header icon for signup page
2021-04-28 15:51:02 +05:30
Rishabh
c4aee97469 v1.2.1 2021-04-27 23:10:50 +05:30
Rishabh
33221313db Added allow self signup as preview option
refs https://github.com/TryGhost/Team/issues/579

Admin preview screen now sends `allowSelfSignup` as a query param that allows customising the Portal preview UI based on the changes selected by the Admin. This change handles the new query param in Portal
2021-04-27 23:09:57 +05:30
Rishabh
02a21b033d v1.2.0 2021-04-27 21:07:35 +05:30
Rishabh Garg
d690684a56 Updated to handle invite only setting (#139)
refs https://github.com/TryGhost/Team/issues/579

A new setting `members_signup_access` can be set to `invite` by the site owner which explicitly makes Portal to behave invite only, this change updates Portal to handle the setting
2021-04-27 21:04:58 +05:30
Renovate Bot
3bdfe189d9 Update dependency @testing-library/jest-dom to v5.12.0 2021-04-23 16:47:19 +00:00
Fabien O'Carroll
0066732b74 v1.1.1 2021-04-05 16:14:41 +01:00
Fabien 'egg' O'Carroll
6b60e51747 Updated data-attributes to use smart_cancel (#136)
refs https://github.com/TryGhost/Team/issues/530

This makes sure that sites not using the Portal modal will have their
cancel behaviour updated too.

* Added missing newline
2021-04-05 16:13:39 +01:00
Renovate Bot
aaf4cfcffe Update dependency @testing-library/react to v11.2.6 2021-03-31 12:39:55 +00:00
Fabien O'Carroll
62a7542a6c v1.1.0 2021-03-30 12:21:19 +01:00
Rish
778ffe2f81 Updated action for continuing a subscription
refs https://github.com/TryGhost/Team/issues/530

A continueSubscription action has been added to handle continuing
subscriptions as a different flow since we now have `smart_cancel` for the cancellation. The "continue subscription" button in Portal is updated to use the new action to correctly continue a subscription instead of old action which did both cancel and continue.
2021-03-30 12:20:21 +01:00
Fabien O'Carroll
1caaa3f2fe Updated actions to cancel&continue subscriptions
refs https://github.com/TryGhost/Team/issues/530

The members-api now accepts the `smart_cancel` option when updating
subscriptions. This will automatically handle cancelling the
subscription if it is in an overdue state.

A continueSubscription action has been added to handle continuing
subscriptions.
2021-03-30 12:20:21 +01:00
Renovate Bot
b2c380cd60 Update dependency @testing-library/jest-dom to v5.11.10 2021-03-26 22:13:41 +00:00
Rish
d0384f431a Removed hardcoded accent color fallbacks
refs https://github.com/TryGhost/Team/issues/536

From 4.0, we ensure and require that accent colour is always set. This change removes hardcoded accent color fallbacks to avoid confusion as well as cause accidental fallback that is undesired causing themes to look different
2021-03-24 18:12:29 +05:30
Rish
b4b5720643 v1.0.2 2021-03-19 12:55:00 +05:30
Rish
d871166ebb Added class selector to notification iframe
no refs
2021-03-19 12:54:19 +05:30
Rish
8c6c13156f v1.0.1 2021-03-19 12:38:21 +05:30
Rish
2e8eea05ff Replaced membersjs titles to portal
no refs
2021-03-19 12:35:57 +05:30
Rish
627b2238da Updated readme
no refs
2021-03-17 22:34:00 +05:30
Renovate Bot
ed5d975087 Update dependency @testing-library/user-event to v12.8.3 2021-03-11 20:17:49 +00:00
Rish
a49d4b9099 v1.0.0 2021-03-10 22:56:10 +05:30
Rish
99fc9e0388 v1.0.0-rc.16 2021-03-10 15:09:59 +05:30
Rish
b1418e1b52 Fixed lint
no refs
2021-03-10 15:09:13 +05:30
Rish
ea41b38797 Added autofocus to signin and signup pages
no refs

- Adds autofocus on Name/Email field on signup page when opened
- Adds autofocus on Name/Email field on signin page when opened
2021-03-10 15:06:22 +05:30
Rish
74f8d4eb86 Added autofocus option to input fields
no refs

Allows input components to define if they want to autofocus on component load, useful for autofocus on form pages in Portal
2021-03-10 15:05:49 +05:30
Rish
d381382f4e v1.0.0-rc.15 2021-03-10 09:39:20 +05:30
Rish
35e5c2d1b9 Fixed portal link removal on popup close
no refs

Last commit updated the portal link regex to allow for trailing slashes, this updates the check for removing portal link when popup is closed
2021-03-10 09:38:33 +05:30
Rish
5844312552 v1.0.0-rc.14 2021-03-10 09:16:27 +05:30
Rish
54a2d2e39e Handled trailing slash for Portal links
no refs

The portal links were not working in case of a trailing slash at the end, this fix updates the regex to allow and ignore the trailing slashes in portal links as it can be a common mistake to include trailing slashes.

SITE/#/portal/  - Did not work previously, now works
vs
SITE/#/portal  - Works
2021-03-10 09:15:12 +05:30
Rish
3b5fa6db8d Updated default accent color
refs https://github.com/TryGhost/Team/issues/535

Updates default accent color to '#15171A' so as its consistent everywhere
2021-03-09 18:08:17 +05:30
Rish
922c2e64dd v1.0.0-rc.13 2021-03-09 15:15:42 +05:30
Rish
6566cc08e6 Added member data refresh for stripe checkout
no refs

Does member data refresh when hiding notification to ensure subscription data for member is fetched if Stripe webhooks are delayed on server and shows no subscription in first request.
2021-03-09 15:07:18 +05:30
Rish
87f08919b7 Cleaned up stripe success/cancel urls
no refs

Removes old portal specific cancel/success params for stripe checkout/billing update
2021-03-09 12:43:08 +05:30
Rish
97f797b168 v1.0.0-rc.12 2021-03-08 23:07:25 +05:30
Rish
00485dc89b Fixed undefined in subcription confirmation screen
no refs

- We updated site plans to use `currency_symbol` instead of `currency`, but missed updating it here so the popup showed `undefined` for the new plan on confirmation screen
2021-03-08 23:05:58 +05:30
Rish
2e41b24240 Updated number formatter to use locale method
no refs

Updates number formatter to use native `toLocaleString` instead of custom regex
2021-03-08 22:59:13 +05:30
Peter Zimon
3067456a0e Updated currency code formatting 2021-03-08 18:13:35 +01:00