Commit Graph

1197 Commits

Author SHA1 Message Date
Peter Zimon
e75a55bbea Single product benefits refinements 2021-06-29 10:22:03 +02:00
Rishabh
96a6f5d993 Updated benefits display for single product behind flag
refs https://github.com/TryGhost/Team/issues/796

- un-hides benefits on the mobile size for single product UI behind flag on signup
2021-06-29 12:30:49 +05:30
Rishabh
c3ead6703f Fixed default portal products in preview
no refs

- `portal_products` is used to determine the feature flag behavior for multiple products, so defaults to null if not passed
2021-06-29 12:18:23 +05:30
Rishabh
112a18bc0b Updated single product with feature flag signup UI
refs https://github.com/TryGhost/Team/issues/796

- adds new helper for explicit feature flag for multiple products
- updated single product signup ui to include benefits
- added new component for single product ui
2021-06-29 12:02:13 +05:30
Renovate Bot
77a8bf4c6f Lock file maintenance 2021-06-28 16:35:34 +00:00
Peter Zimon
8d4035a818 Single product benefits refinements 2021-06-28 16:03:51 +02:00
Rishabh
5d4e5aa4c8 Added hasBenefits helper to manage UI
no refs
2021-06-28 18:43:12 +05:30
Rishabh
d43998eb47 Added benefits to plans section
no refs
2021-06-28 16:22:10 +05:30
Rishabh
f8798952ac Updated benefits text to use name instead of title
no refs

- the benefits text is stored as `name` instead of `title`
2021-06-28 12:53:11 +05:30
Rishabh
43030eb5e3 v1.6.10 2021-06-28 11:08:19 +05:30
Rishabh
cfdd8c93ca Updated portal products check for only multiple products
no refs
2021-06-28 11:07:23 +05:30
Renovate Bot
b60ac8d952 Update dependency eslint-plugin-ghost to v2.4.0 2021-06-28 02:42:17 +00:00
Rishabh
0c8483b8d5 v1.6.9 2021-06-25 13:09:59 +05:30
Rishabh
aabb02fc5f Filtered empty monthly/yearly prices in product
no refs

- in a rare scenario when monthly/yearly price comes as empty object, which happens if the price is missing in DB, this adds a guard to ignore the product than cause an error
2021-06-25 13:08:06 +05:30
Rishabh
d8f121e7b0 v1.6.8 2021-06-25 12:06:26 +05:30
Rishabh
0dcf06da99 Restricted Sentry event capturing to portal events
no refs

- updates Sentry's `beforeSend` method to restrict and send events originated by portal
2021-06-25 12:05:38 +05:30
Rishabh
60c4ba5888 v1.6.7 2021-06-25 09:44:00 +05:30
Rishabh
4ae361f99a Updated Sentry release tag to include full version
no refs

Updates sentry release tag to include full Portal version from env variable
2021-06-25 09:42:06 +05:30
Renovate Bot
f8d6e78de7 Update dependency @testing-library/react to v12 2021-06-24 19:34:18 +00:00
Rishabh
50f69af9d5 Bumped node version for test workflow to 14
no refs
2021-06-24 22:20:29 +05:30
Rishabh
422dd12c14 v1.6.6 2021-06-24 21:48:04 +05:30
Rishabh
38202c1472 Added guard for missing contentDocument
no refs

- in a rare edge case, its possible that `contentDocument` is not available due to component unmount, guards against erroring in such scenarios
2021-06-24 21:47:31 +05:30
Rishabh
87148b789c v1.6.5 2021-06-24 21:08:52 +05:30
Rishabh
447d3571e8 Cleaned up benefits section for products
no refs
2021-06-24 21:08:00 +05:30
Rishabh
05999e0c81 Filtered portal script url for Sentry error reporting
no refs

By default, Sentry will pick up any uncaught error triggered from the site, which adds a lot of noise as we only want to listen to Portal specific errors. This change adds portal's unpkg script as the only allowed url for Sentry error reporting.
2021-06-24 21:01:23 +05:30
Peter Zimon
42eb39df0b Updated benefits for mobile sizes 2021-06-24 14:29:36 +02:00
Peter Zimon
435e9059bc Show benefits only if they exist 2021-06-24 14:16:35 +02:00
Peter Zimon
12599c282a Updated mobile sizes for benefits 2021-06-24 14:10:37 +02:00
Peter Zimon
ab60eed6fe Refined list of available products (upgrade) 2021-06-24 14:10:37 +02:00
Rishabh
f2aab7a5bb v1.6.4 2021-06-24 16:54:00 +05:30
Rishabh
aa9818ed83 Fixed price check for complimentary member
no refs
2021-06-24 16:53:24 +05:30
Rishabh
b2bcad3338 v1.6.3 2021-06-24 13:55:45 +05:30
Rishabh
4fdcd9c4d0 Fixed product filtering for available products
no refs
2021-06-24 13:55:02 +05:30
Rishabh
7fe377d29a Updated plan upgrade UI for multiple products
refs https://github.com/TryGhost/Team/issues/767

- updates plan upgrade page to use multiple products UI if available
- filters products based on active currency if logged in member
2021-06-24 13:23:57 +05:30
Rishabh
21d1c1b9e8 Cleaned site and product helper usage
no refs

- cleans up helpers for site and products to more consistent and predictable usage
2021-06-24 13:21:16 +05:30
Rishabh
c7a3fdc639 Added access control header for start mode
no refs

- since portal script is loaded with `crossorigin:anonymous` now, we need to pass in the access control headers for script to bypass cors check
2021-06-22 17:07:14 +05:30
renovate[bot]
5548cc9ab8 Pin dependencies (#148)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-06-22 15:52:53 +05:30
renovate[bot]
e01ab51eeb Update dependency chokidar to v3.5.2 (#150)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-06-22 15:52:00 +05:30
Rishabh
2af648e84f Fixed plan page tests
no refs
2021-06-22 12:40:16 +05:30
Rishabh
8d5f5febaa Added access control headers in dev mode
no refs

- adds `access-control-allow-origin: *` headers for dev mode
- portal script will be loaded with `cross-origin=anonymous`, access control header is needed to allow script to load
- mimics unpkg which already adds `access-control-allow-origin: *`
2021-06-22 12:16:49 +05:30
Rishabh
0535fab865 Added Sentry for error tracking
no refs

- adds sentry setup if Sentry DSN is available via Ghost config for better error tracking
2021-06-22 12:16:49 +05:30
Rishabh
4db821f9ee Fixed lint
no refs
2021-06-21 19:46:12 +05:30
Peter Zimon
75d0b40be8 Added benefit fixtures (alpha) 2021-06-21 15:32:55 +02:00
Rishabh
40e86e0a77 Added default product selection handling
refs https://github.com/TryGhost/Team/issues/767

- updates product selection if first available product's id changes between renders
2021-06-21 18:47:40 +05:30
Rishabh
b7d644cc66 Updated available site prices based on products
refs https://github.com/TryGhost/Team/issues/768

- updates available prices data based on available products
- updates available products to check portal products (which is behind a flag)
2021-06-21 18:47:40 +05:30
Peter Zimon
134d6a756a Refined spacing for desktop product card 2021-06-21 14:39:21 +02:00
Rishabh Garg
a8f6ea6aa9 Added portal products handling (#151)
refs https://github.com/TryGhost/Team/issues/768

- handles new `portal_products` to filter products shown on Portal UI (behind the flag for multiple products)
2021-06-21 14:37:53 +05:30
Rishabh
fda3726b93 Fixed lint
no refs
2021-06-20 13:32:46 +05:30
Joakimk
b80ab90d61 Updated dateString method to use cleaner toLocaleDateString (#144)
no refs

- Updates `getDateString` method to use `toLocaleDateString` which is cleaner and shorter with same result
2021-06-20 13:30:46 +05:30
Renovate Bot
df54d8cf34 Update dependency @testing-library/user-event to v13 2021-06-18 14:47:28 +00:00
Renovate Bot
9963696ef9 Update Test & linting packages 2021-06-18 13:36:11 +00:00
Rishabh
aa5b29ae5a v1.6.2 2021-06-17 17:35:33 +05:30
Rishabh
097dfe4452 Handled available Products based on prices
refs https://github.com/TryGhost/Team/issues/767

- takes into account available prices to decide if multiple products screen needs to be shown
2021-06-17 17:18:34 +05:30
Rishabh
d91cd4240e Handled active interval for Products section
refs https://github.com/TryGhost/Team/issues/767

- handles active interval for product section based on available prices as well as switch
2021-06-17 17:17:39 +05:30
Rishabh
3a8e31f065 Handled portal plans selection in products list
refs https://github.com/TryGhost/Team/issues/767

- Portal products UI updates to the available prices from monthly/yearly in list
2021-06-17 14:08:44 +05:30
Rishabh
762c1c53a3 Removed jsdom fourteen dependency on test
refs aa228a8df2

Removes jsdom fourteen dependency for running tests as the latest version of packages doesn't need the fallback
2021-06-16 20:58:44 +05:30
Rishabh
885fe178dd Updated local start mode script
no issues

- adds new start-combined script which combines all chunks in `yarn start` for local portal development
- allows easier loading of local portal bundle in ghost via load-portal script, which needs to inject single script
- updates `yarn start:dev` to use updated script which uses the combined mode for better local development

refs
https://gist.github.com/simpixelated/90a3c16c3ed268fe24f5e5c9585ced2f
2021-06-16 20:58:44 +05:30
Rishabh
6e2952901a Updated Portal build script to use rewired webpack config
no issues

- updates Portal build script to use rewired react-scripts config
- updated config handles css embed as well as output location/name for portal bundle as part of cra build
- makes extra webpack bundling redundant for now
- updates dev mode to map the portal source map useful for testing build version locally
- updates custom webpack config with copy plugin for future use

refs -
https://github.com/facebook/create-react-app/issues/5306#issuecomment-603772477
https://gist.github.com/phdesign/3fd306db2bc53f6368e6f0f73bbeff19
2021-06-16 20:58:44 +05:30
Rishabh
7c5cb61ee5 Updated Ghost config URL for dev mode script
no refs

- updates portal url for Ghost config to use a dynamic URL to work same as start mode script
2021-06-16 20:58:44 +05:30
Rishabh
596cef4df7 Removed unused prop-types dependency
no refs
2021-06-16 20:58:44 +05:30
Rishabh
90c076fc39 🏗 Bumped major versions for React and CRA
no refs

- bumps React version to 17 - https://github.com/facebook/react/blob/master/CHANGELOG.md#1700-october-20-2020
- bumps CRA to v4  - https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md#403-2021-02-22
2021-06-16 20:58:44 +05:30
Rishabh
9061d40c6e Fixed plan name to monthly/yearly by interval
no refs

- Reverts using hardcoded monthly/yearly plan name on Portal UI instead of using the price nickname
2021-06-16 16:07:39 +05:30
Peter Zimon
9acb194214 Fixed signup grid for mobile 2021-06-15 13:44:05 +02:00
Rishabh
37295e32e9 Updated dynamic styling of product grid
refs https://github.com/TryGhost/Team/issues/767

- adds dynamic calculation of frame styles based on site data
- handles product grid style based on no of products available
2021-06-14 20:31:25 +05:30
Rishabh
47c3367396 Updated free product handling in list
refs https://github.com/TryGhost/Team/issues/767

- free product is shown based on other site settings like `allowSelfSignup` and `portalPlans`
- fixed product/price selection to handle selected interval
- updated default product/price handling
2021-06-14 20:13:15 +05:30
Peter Zimon
5e13f964bc Signup product grid update 2021-06-14 13:33:15 +02:00
Rishabh
c98ab9981a Handled price selection for multiple products
refs https://github.com/TryGhost/Team/issues/767

- updated list of site prices to use all prices from products
- handled price selection in product section
2021-06-14 13:55:11 +05:30
Rishabh
d7c645f71a Removed deprecated NODE_PATH usage in tests
no refs

Using NODE_PATH is deprecated in future versions of Create React App in favor of using jsconfig.json , this change removes files relying on NODE_PATH and uses relative path instead till we update usage to jsconfig in future as needed.
2021-06-14 11:55:09 +05:30
Rishabh
00f9481f11 v1.6.1 2021-06-11 20:15:30 +05:30
Peter Zimon
298ada96a2 Minor mobile refinements 2021-06-11 16:29:57 +02:00
Rishabh
a4afeba183 Updated dev mode script to serve on static URL
no refs

- adds static serve path for portal dev mode script same as start mode
2021-06-11 19:55:43 +05:30
Peter Zimon
06817969bb Mobile footer refinements 2021-06-11 16:10:41 +02:00
Peter Zimon
45147cacb2 Multiple products responsive UI 2021-06-11 16:03:35 +02:00
Peter Zimon
f94435dab5 Multiple products desktop UI
Lots of refinement for the desktop multiple products Portal signup and signin page. Alpha version.
2021-06-11 14:56:44 +02:00
Rishabh
bf62b981bd v1.6.0 2021-06-11 14:06:54 +05:30
Rishabh
fc0ef9d164 Fixed lint errors
no refs
2021-06-11 14:06:16 +05:30
Rishabh
950495c836 Updated product selection to work on full card
refs https://github.com/TryGhost/Team/issues/767

- handles product selection on full product card instead of just small surface area on checkbox
- removes dummy product card method
2021-06-11 14:03:20 +05:30
Rishabh
55298cd999 Sorted products by monthly price amount
refs https://github.com/TryGhost/Team/issues/767

- sorts list of products from site by their monthly price amount
2021-06-11 12:55:50 +05:30
Rishabh
1b1133cd47 Updated default product fixtures
refs https://github.com/TryGhost/Team/issues/767

- cleans up default set of products available in fixtures for easy testing
2021-06-11 12:55:24 +05:30
Rishabh
42c8a481c5 Removed dummy products component
no refs

- comments out the dummy products component till needed again for UI development
2021-06-11 12:46:57 +05:30
Rishabh
33adaedc97 Cleaned fixtures data
no refs

- cleans up the products/prices passed to fixtures
2021-06-11 12:45:06 +05:30
Rishabh
8d7988a334 Wired UI for multiple products with site data
refs https://github.com/TryGhost/Team/issues/767

- wires real products data from site/fixtures to multiple products UI
- adds new helpers to manage price display/UI
- cleans up switch default params to clear type errors
2021-06-11 12:41:36 +05:30
Rishabh
7a65caa806 Updated fixtures for products
refs https://github.com/TryGhost/Team/issues/718

- updates `products` fixture to match API and include monthly/yearly price
2021-06-11 12:39:00 +05:30
Rishabh
5ebfbb79a7 Fixed multiple products check helper method
no refs

- fixes incorrect condition in helper that determines if Portal has multiple products or single from site
2021-06-11 12:38:02 +05:30
Rishabh
8d51bc20f0 Fixed tests
no refs
2021-06-11 12:33:45 +05:30
Peter Zimon
5516e348af Alpha version of multiple products
- added Products grid component to signup page with static data
- separate signup design between single vs. multiple products
- alpha!
2021-06-10 17:26:10 +02:00
Rishabh
859043e22e Updated dev mode check with custom site url
no refs

- takes advantage of new dev script by loading Portal in dev mode on ghost site with full features
- restricts some dev mode features only if no custom site url is passed, which is expected with fixture development
2021-06-10 15:26:32 +05:30
Rishabh
f0ba337659 Cleaned dev mode script
no refs

Cleans up dev mode script for lint errors
2021-06-10 15:05:33 +05:30
Rishabh
47c6509bea Added experimental start mode script for local development
no refs

Adds a new `yarn start:dev` command to start portal in development mode that allows development script to be used directly on Ghost site without needing a build for each change. Allows faster development on Portal locally.
2021-06-10 15:05:08 +05:30
Rishabh
a73a04034b Added logic for introducing multiple products
refs https://github.com/TryGhost/Team/issues/767

- Adds new helper to switch UI for multiple products
- Cleans up fixtures
2021-06-09 20:51:18 +05:30
Rishabh
f59711ab1b v1.5.3 2021-06-09 09:22:44 +05:30
Rishabh
c1df8366fb Filtered empty prices from list
no refs

Handles empty price objects in the API and ignores them from UI
2021-06-09 09:21:52 +05:30
Rishabh
928122a8f7 v1.5.2 2021-06-08 18:11:19 +05:30
Peter Zimon
d4c648d79c Fixed signup page pricing responsive layout bug 2021-06-08 14:39:22 +02:00
Rishabh
c45b1abede Added source map explorer for analyzing builds
no refs

`yarn analyze` now launches source map explorer which analyzes the local bundle, helping in keeping Portal size as small as possible.
2021-06-07 15:32:55 +05:30
Rishabh
0b2af14567 Added dev script for Portal development
no refs

The new dev script allows running `yarn dev` on the Portal code to make Portal development easier as well as integrate more easily with Ghost config. The script runs a local development server that serves portal bundle, which allows for static `portal` config to be used in Ghost for pointing to Portal script. It also watches the files for any changes, and auto re-builds and bundles latest Portal code.
2021-06-07 14:22:31 +05:30
Renovate Bot
3240f2670d Update dependency @testing-library/jest-dom to v5.13.0 2021-06-07 01:53:00 +00:00
Rishabh
cf710eb9c2 v1.5.1 2021-06-04 18:30:45 +05:30
Rishabh
d383723f21 Updated available prices for Portal to use multiple products
refs https://github.com/TryGhost/Team/issues/718

Instead of using default prices, Portal goes through active prices of all available products to use for query in data attributes
2021-06-04 18:23:26 +05:30
Rishabh
f3fd043580 Fixed non-default product prices not working
refs https://github.com/TryGhost/Team/issues/718

We passthrough any unknown price ids directly to checkout session as it currently Portal cannot verify prices across all products
2021-06-04 18:09:58 +05:30
Rishabh
82f7d69d8d v1.5.0 2021-06-04 17:09:54 +05:30
Rishabh
ee136bc918 Fixed lint 2021-06-04 14:12:56 +05:30
Rishabh
0f4be436be Handled named plan values in portal_plans setting
refs https://github.com/TryGhost/Team/issues/753

We reverted back to using named plan values - `monthly`, `yearly` - in `portal_plans` setting to allow us to easily handle active prices for a product. This change handles the updated values in `portal_plans` to use new values.
2021-06-04 13:29:22 +05:30
Rishabh
f790cb47ef v1.4.7 2021-06-01 14:37:31 +05:30
Kevin
701ca69053 🐛 Fixed toggle newsletter subscription (#146)
closes https://github.com/TryGhost/Ghost/issues/12996
2021-06-01 14:27:41 +05:30
Renovate Bot
97dd3a0470 Update dependency @testing-library/react to v11.2.7 2021-05-27 13:55:49 +00:00
Rishabh
28de418d9e v1.4.6 2021-05-27 17:53:42 +05:30
Rishabh
07f1d6d3a5 Fixed tests
no refs
2021-05-27 17:52:32 +05:30
Rishabh
6f88adf4b4 Renamed master to main for test workflow and readme
no refs

The master -> main rename was missed for test workflows as well as Readme badge, which caused the error reporting to incorrectly report passing tests on `master` while they were failing on `main`
2021-05-27 17:52:32 +05:30
Rishabh
0bac70c326 💡 Added resize listener for portal container height change
no refs

We need the Portal preview container on Admin to re-adjust based on height of Portal container. This change adds a resizeObserver for portal container and fires a postMessage with height for Admin to listen and update the iframe height based on height of portal container

Updated resize observer to fire on update

Cleanup
2021-05-27 17:52:32 +05:30
Rishabh
817d6650b2 v1.4.5 2021-05-27 13:40:07 +05:30
Rishabh
0f31838b35 Updated target origin to all for portal ready event
no refs

The purpose of broadcasting portal-ready event is it allows Preview in Admin to have better UX with showing Portal when its ready than show the site while its loading. Having a strict target origin like site url won't work when sites have custom domains as it browser security will block the event due to origin mismatch.

Since `portal-ready` is just an event message and doesn't contain any sensitive data that needs to be restricted to origin, this bumps it to `*` which allows any site listening to be able to read the message.
2021-05-27 13:39:23 +05:30
Rishabh
e4cd0034ad v1.4.4 2021-05-24 19:23:02 +05:30
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
Peter Zimon
bb59b019db Added thousands separator
- added thousands separator to helpers and signup screen
2021-03-08 17:24:50 +01:00
Peter Zimon
5cacd0611d v1.0.0-rc.11 2021-03-04 16:26:57 +01:00
Peter Zimon
35fa356a48 Forcing hardware acceleration for transitions 2021-03-04 16:12:56 +01:00
Rish
35e2e2fbe1 v1.0.0-rc.10 2021-03-04 19:07:54 +05:30
Peter Zimon
7aac27edfc Updated modal animation 2021-03-04 14:14:36 +01:00
Rish
07384dc584 v1.0.0-rc.9 2021-03-04 15:30:41 +05:30
Peter Zimon
81e4f1bc79 Minor style changes
- applied blur on modal cover background
- adjusted positioning of modal
- refined sign in / sign up link style
- adjusted magic link envelope icon position and size
2021-03-04 10:58:35 +01:00
Rish
474a4f175b Fixed plans in dev mode
no refs

Plans picked from fixture in dev mode was overwritten by empty object when site data is updated, fixed to update correctly.
2021-03-04 01:40:51 +05:30
Rish
1868542504 Updated webpack config to cleanup warnings
no refs

`yarn build` used to throw up a lot of warnings because the webpack config was not correctly updated to use performance config for portal's usecase, this change -

- Sets the `mode` to explicit `production` instead of implicit which throws a warning
- Updated performance max* sizes to account for a single portal chunk bundled up as an external script
2021-03-04 01:19:56 +05:30
Renovate Bot
c73e80e1fb Update dependency @testing-library/user-event to v12.8.1 2021-03-03 15:08:05 +00:00
Rish
6e15908fd9 Updated master to main in yarn ship
no issue

`master` is now renamed as `main` upstream, this updates the `yarn ship` to push updates to `main` instead of master now.
2021-03-02 18:12:18 +05:30
Rish
80c943a7b6 v1.0.0-rc.8 2021-03-02 18:10:33 +05:30
Rish
d781f4fe3a Updated root div id to use portal naming
closes https://github.com/TryGhost/Team/issues/512

Updates naming of root container to `ghost-portal-root` instead of `ghost-membersjs-root` inline with overall naming to portal everywhere.
2021-03-02 18:09:45 +05:30
Renovate Bot
db97b9a9dd Update dependency @testing-library/user-event to v12.8.0 2021-03-02 02:02:04 +00:00
Peter Zimon
82ed022f95 Added currency styles 2021-02-25 13:06:19 +01:00
Fabien 'egg' O'Carroll
ccde2519a8 Used Intl.NumberFormat to determine currency symbol (#128)
refs https://github.com/TryGhost/Team/issues/473
refs https://github.com/TryGhost/Ghost/pull/12700/commits/006cf434

Ghost no longer sends back currency symbols from the API, so we calculate the currency
symbol using `Intl.NumberFormat`.

We've also renamed the `currency` property to `currency_symbol` - as it does not store a currency.

Depending on currency and locale, currency symbols can be the currency ISO code (e.g. AED).
In order to style these differently we add a different class to the element.
2021-02-25 09:58:19 +00:00
Renovate Bot
b751c1c41e Update dependency @testing-library/user-event to v12.7.3 2021-02-23 15:29:52 +00:00
Rish
5b5110ea64 v1.0.0-rc.7 2021-02-23 17:12:59 +05:30
Fabien 'egg' O'Carroll
7b75255e4e Pass subscription id when editing billing (#126)
refs TryGhost/Team#479

This updates Portal to pass the subscription_id of the subscription we want to edit billing for
2021-02-23 16:50:27 +05:30
Renovate Bot
f76c8c0f56 Update react monorepo to v16.14.0 2021-02-16 21:51:29 +00:00
Renovate Bot
2ff203bfc6 Update dependency react-scripts to v3.4.4 2021-02-16 20:00:41 +00:00
Renovate Bot
12d0ca7ae3 Update dependency @testing-library/user-event to v12.7.1 2021-02-16 18:44:28 +00:00
Hannah Wolfe
9f43272817 v1.0.0-rc.6 2021-02-15 16:57:03 +00:00
Hannah Wolfe
ef7d1a70f8 Added accent color override handling
- This is a temporary solution to being able to pass in the accent color
- Need to review if attributes / links should definitely support all of the current preview query params (probably should)
2021-02-15 16:47:40 +00:00
Renovate Bot
a326e3c76c Update dependency @testing-library/user-event to v12.7.0 2021-02-11 17:32:49 +00:00
Renovate Bot
2622591049 Update dependency @testing-library/react to v11.2.5 2021-02-11 13:19:03 +00:00
Renovate Bot
2e4151cdca Update dependency @testing-library/jest-dom to v5.11.9 2021-02-11 08:00:26 +00:00
Rish
50b81b1520 v1.0.0-rc.5 2021-02-11 00:15:23 +05:30
Rish
9fafbb44de Fixed incorrect plans override for preview
refs b739f14183

While adding plans params in preview mode, the site plans were incorrectly overridden with default empty value from preview mode so plan values didn't show up on the screen at all. This commit updates correct structure for site plans
2021-02-11 00:13:59 +05:30
Renovate Bot
799dc78e30 Update dependency eslint-plugin-ghost to v2 2021-02-10 13:59:56 +00:00
Rish
69a0db2d61 v1.0.0-rc.4 2021-02-09 14:13:27 +05:30
Rish
2f297582e1 Added default opacity to trigger button iframe
no refs

Adds default opacity to trigger button iframe allowing themes like Edition to modify visibility of portal button in preview mode, but doesn't change any existing behavior
2021-02-09 14:12:31 +05:30
Rish
0411fad8f6 v1.0.0-rc.3 2021-02-09 13:32:05 +05:30
Rish
b739f14183 Added currency and pricing preview params
no issue

As part of launch wizard in Ghost-Admin, we allow site owner/admins to try different pricing and currency in Admin preview. This change allows Portal popup to consume and update pricing/currency/background on the preview screen using `monthlyPrice`, `yearlyPrice`, `currency` and `disableBackground` params.

- `monthlyPrice`- Allows updating monthly price value via preview
- `yearlyPrice`- Allows updating yearly price value via preview
- `currency`- Allows updating currency value via preview
- `disableBackground`- Allows disabling preview background for Portal UI
2021-02-09 13:31:05 +05:30
Rish
ded3461a20 v1.0.0-rc.2 2021-02-03 08:46:19 +05:30
Rish
b5a7c92327 Removed portal-action param in favor of action
no issue

With Ghost 4.0, we want to keep a single universal action source so the Ghost core doesn't have to know about portal specific actions
2021-02-03 08:45:34 +05:30
Rish
9228651786 v1.0.0-rc.1 2021-02-03 08:37:37 +05:30
John O'Nolan
14314613c0 2021 2021-01-25 16:35:55 +00:00
Renovate Bot
f7195a5161 Update dependency @testing-library/react to v11.2.3 2021-01-24 19:51:16 +00:00
Rish
933fa87aa8 v0.15.1 2021-01-18 11:45:49 +05:30
Rish
a09ff2ca5c Fixed site domain for FirstPromoter
no issue

Removes http(s) and trailing slashes from FirstPromoter site URL
2021-01-18 11:44:47 +05:30
Rish
569c94272c v0.15.0 2021-01-15 20:03:41 +05:30
Rish
a085063a42 Added FirstPromoter integration
no issue
depends on https://github.com/TryGhost/Ghost/pull/12540

FirstPromoter allows sites to build their own referral programs.
Portal reads FirstPromoter settings from site data and uses them to setup FirstPromoter script to track member referrals
2021-01-15 15:36:13 +05:30
Rish
72c8cad3f5 Updated hash removal logic on close
no refs

Using `location.hash` to remove hash params on Portal still keeps the `#` on browser. Instead, we take advantage of history API to remove Portal hash params from screen
2021-01-11 10:56:14 +05:30
Renovate Bot
d6e4635a8b Update dependency @testing-library/user-event to v12.6.0 2021-01-09 09:53:41 +00:00
Rish
ce33a055aa v0.14.1 2020-12-18 22:37:41 +05:30
Rish
9606f003ec 🐛 Fixed incorrect subscription data picked
no issue

Previously, we only returned active subscription for a member in their list of subscriptions, and Portal picked the first subscription in list for a paid member assuming it as active. This doesn't hold true since we now return list of all subscriptions for a member.

This patch updates to use first "active" subscription for a member in the subscription list instead.
2020-12-18 22:31:55 +05:30
Peter Zimon
b749d76138 Update default accent color (#112)
Updated default accent color to neutral dark grey to make it compatible with more themes.
2020-12-14 09:09:32 +01:00
Rish
e2b594528a v0.14.0 2020-12-01 12:54:17 +05:30
Peter Zimon
3ffe293003 Refined cancellation reason textarea
no refs.
- refined style and copy
2020-11-25 09:42:42 +01:00
Rish
df2e451294 Updated cancellation reason input to use textarea
refs https://github.com/TryGhost/Ghost/issues/12403

- Updates UI component for cancelation reason to use textarea instead of input
- Keep the maxlength to 500 chars for the input
2020-11-25 12:27:08 +05:30
Rish
bf8d949a22 Renamed custom trigger classname to portal
no issue

Custom class is appended to trigger buttons based on popup state to allow UI changes based on different popup state. The class name is updated from using members terminology to new Portal terminology now.
2020-11-25 12:18:06 +05:30
Rish
e36b9360e7 🐛 Fixed support and powered by links not working
closes https://github.com/TryGhost/Ghost/issues/12367

- Support and powered by links were not opened through `href` inside iframe
- Adds support to open these links via `window.open` to bypass iframe restriction
2020-11-24 22:47:29 +05:30
Fabien 'egg' O'Carroll
dff46b99a2 Added cancellation feedback to confirmation screen (#111)
refs https://github.com/TryGhost/Ghost/issues/12403

This gives members the ability to share their cancellation reason with site owners.
The reason is included in the cancellation request and stored both in Ghost & Stripe.

Co-authored-by: Peter Zimon <zimo@ghost.org>
2020-11-24 11:31:42 +00:00
Rish
cfa44b2c77 Updated stripe cancel redirect to existing page
refs https://github.com/TryGhost/Ghost/issues/12365

Stripe back button previously redirected user to site home instead of keeping existing link where the checkout was triggered from. This updates the link to go back to old site URL in case the previous URL was still on the Ghost site.
2020-11-23 13:56:22 +05:30
Rish
3f3c0b4b94 v0.13.1 2020-11-23 11:11:30 +05:30
Peter Zimon
2efeb8f1f7 Updated plan section hover style 2020-11-20 11:01:16 +01:00
Rish
28570bd3ea Fixed portal plan links for data attributes
no refs

- Portal plan checkout links were incorrectly passing empty plan and not opening Stripe checkout, fixed.
2020-11-20 15:13:38 +05:30
Rish
8483ba162d Added listener for portal link changes
refs https://github.com/TryGhost/Ghost/issues/12365

- Listens to portal link changes in URL and opens direct checkout plans
2020-11-20 10:42:03 +05:30
Rish
4dc22ca568 Updated portal stripe actions
no refs

- Updates stripe actions via portal to use custom parameter values to show notifications
- Updated parameter don't interfere with existing theme notifications
2020-11-20 10:27:06 +05:30
Rish
9dac6d9435 Added direct portal link for free signup
refs https://github.com/TryGhost/Ghost/issues/12365

- Added direct portal link handling for - `/signup/free` - to open Portal with Free plan only when available
- In case free plan is not available, Portal will show default signup screen
2020-11-19 18:06:56 +05:30
Rish
de3e5f52d0 Cleared portal checkout link on use
refs https://github.com/TryGhost/Ghost/issues/12365

- Browser back button from Stripe checkout takes users to infinite navigation loop as we were not clearing the direct checkout link
- Clears direct checkout link on load so user can continue navigation as normal
2020-11-19 16:31:34 +05:30
Rish
2a091ac56d Updated direct plan checkout without popup
refs https://github.com/TryGhost/Ghost/issues/12365

- Updated direct checkout to load Stripe without opening popup
2020-11-19 16:04:49 +05:30
Rish
f7fa4e50e6 v0.13.0 2020-11-18 19:56:52 +05:30
Rish
0b1b0b3f63 Removed portal notification for action param
no issue

Portal was showing notification for `action` param as well, which can cause double notification in case theme also handled notification
2020-11-18 19:54:34 +05:30
Rish
11746c1df7 Fixed broken notification state in case of missing member
no issue

- Notification was fetching member's first name which caused error in case the member was not logged in
- Adds check for member to exist before fetching first name
2020-11-18 19:24:25 +05:30
Rish
28ed0fb632 Revert "Revert to 0.10.17 (#110)"
This reverts commit 741bfb637d.

The revert was done to resolve an urgent bug fix which was breaking Portal script in case of any notification
2020-11-18 19:22:26 +05:30
Fabien O'Carroll
fd99540f92 v0.12.0 2020-11-18 13:17:34 +00:00
Fabien 'egg' O'Carroll
741bfb637d Revert to 0.10.17 (#110)
There is a bug in these version where Portal does not load correctly after a successful
Stripe Checkout. We are reverting until we can determine the cause of the bug and fix it

* Revert "v0.11.1"

This reverts commit 828c4d59e2.

* Revert "Fixed incorrect link/path handling"

This reverts commit 9d853be979.

* Revert "v0.11.0"

This reverts commit 16c2224b9b.

* Revert "Updated portal direct checkout links to use path"

This reverts commit d26fad1ef2.

* Revert "Added direct links for monthly/yearly checkout"

This reverts commit bbea4f7ec5.

* Revert "Added user select style to plan container"

This reverts commit a665ca5923.

* Revert "Refined copy"

This reverts commit 32d4949e1d.

* Revert "Account home page refinements"

This reverts commit 6587eca37d.

* Revert "Notification refinements"

This reverts commit 23c75e3acc.

* Revert "Added name to welcome notification"

This reverts commit 7220049830.

* Revert "Refined notification"

This reverts commit d1c091584f.
2020-11-18 13:16:07 +00:00
Rish
828c4d59e2 v0.11.1 2020-11-18 16:03:27 +05:30
Rish
9d853be979 Fixed incorrect link/path handling
no refs

Last release broke the handling of incorrect portal link or attribute as no default value was used for link path
2020-11-18 16:02:31 +05:30
Rish
16c2224b9b v0.11.0 2020-11-17 23:07:13 +05:30
Rish
d26fad1ef2 Updated portal direct checkout links to use path
refs https://github.com/TryGhost/Ghost/issues/12365

Last commit added Portal checkout links using query param on signup link - `signup?plan=monthly/yearly`, this updates the checkout links to use path instead of params on links and data attributes instead.

Portal link for monthly plan checkout - `#/portal/signup/monthly`
Portal data attribute for monthly plan checkout - `data-portal=signup/monthly`

Portal link for yearly plan checkout - `#/portal/signup/yearly`
Portal data attribute for monthly plan checkout - `data-portal=signup/yearly`
2020-11-17 21:15:20 +05:30
Rish
bbea4f7ec5 Added direct links for monthly/yearly checkout
refs https://github.com/TryGhost/Ghost/issues/12365

Currently, while its possible to open Stripe checkout directly on a monthly/yearly plan, Portal links don't allow similar feature. This change allows opening a site on a specific Portal link that can directly open Stripe checkout for monthly/yearly plan, if the plan is allowed.

- Adds handling for new portal signup link for monthly plan - `/#/portal/signup?plan=monthly`
- Adds handling for new portal signup link for yearly plan - `/#/portal/signup?plan=yearly`
2020-11-17 19:06:41 +05:30
Peter Zimon
a665ca5923 Added user select style to plan container
no refs.
- added user-select: none to plan containers to make it feel more like UI and less web content
2020-11-17 09:56:21 +01:00
Peter Zimon
32d4949e1d Refined copy
no refs.
2020-11-10 16:39:37 +01:00
Peter Zimon
6587eca37d Account home page refinements
no refs.
- copy refinements
- added renewal date to paid members' account home
2020-11-10 16:15:27 +01:00
Peter Zimon
23c75e3acc Notification refinements
no refs.
- refined notification styles for single and double lines
- refined copy
2020-11-10 16:00:50 +01:00
Peter Zimon
7220049830 Added name to welcome notification
no refs.
2020-11-10 15:49:52 +01:00
Peter Zimon
d1c091584f Refined notification
no refs.
- added top/bottom padding to notifications
- refined line height
- added line break to welcome notification
2020-11-10 15:44:08 +01:00
Rish
1716771c6a v0.10.17 2020-11-07 01:22:31 +05:30
Rish
f4f037452d Fixed popup close on clicking outside content
no refs

- Popup was not closing when clicked outside in the empty area as listener was firing on wrong element
2020-11-07 01:21:47 +05:30
Rish
2ed016f7d8 v0.10.16 2020-11-06 19:36:08 +05:30
Rish
b3d063b836 Updated request src for signup with stripe checkout
no refs

- Custom requestSrc was not passed when a plan was checkout during signup, which didn't trigger the custom portal action param
2020-11-06 19:35:25 +05:30
Rish
fb698ad972 v0.10.15 2020-10-30 23:27:29 +05:30
Rish
b5277ad1c5 🐛 Fixed billling info update failing
no refs

- Invalid success/cancel URL for billing API due to empty parameter caused failure in opening Stripe
2020-10-30 23:26:49 +05:30
Rish
6163083df8 v0.10.14 2020-10-29 14:02:31 +05:30
Rish
2454e76c04 Fixed incorrect usage of tabindex
no issue

React JSX expects tabindex html property to be camel case - tabIndex
2020-10-29 14:01:24 +05:30
Rish
b590a1fa90 Added upgrade checkout metadata for stripe
no issue

Ghost sends email on successful signup to a paid plan via Stripe checkout, but couldn't differentiate between a Stripe checkout as new member or as an upgrade previously. This led to an extra second email with magic link on upgrading to paid plan while logged in.

Passing `checkoutType` metadata to Stripe checkout allows webhook to ignore second email in case of an upgrade scenario.
2020-10-29 13:59:19 +05:30
Rish
168fb204eb Redirected to home page on signout
no issue

Handles Portal or theme to redirect to home page for a site when signing out
2020-10-29 13:57:25 +05:30
Rish
41f171838a Handled notifications for new custom action param
refs https://github.com/TryGhost/Ghost/issues/12253

- Handles custom action param for requests from Portal by listening on `portal-action` instead of `action` and `portal-stripe` instead of `stripe` in query params for magic link and stripe checkout changes
- Allows theme to continue using the old params so in future Portal doesn't interfere with theme notifications
2020-10-29 13:56:33 +05:30
Peter Zimon
e97e7964ba Added "Publish with Ghost" badge (#106)
added "Publish with Ghost" badge to the bottom left corner of the screen when the portal popup is open
2020-10-19 18:45:14 +02:00
Rish
0b32646944 v0.10.13 2020-10-17 18:31:02 +05:30
Rish
4e39684c43 Updated change email notification message
no refs

- Notification message was missing for change email success/failure
2020-10-17 18:30:11 +05:30
Peter Zimon
59e729e7bd Refined invite-only signup page
no refs.
- added default invitation icon for sites without icon
- refined copy and position of invite only notification
2020-10-16 16:42:46 +02:00
Rish
46366d5066 Fixed popup close in preview mode with Esc
no refs

- Popup shouldn't close with Esc in preview mode on Ghost Admin
2020-10-16 15:07:04 +05:30
Rish
ae2023999a Replaced signup with invite-only screen for no plans
no issue
- If the site owner has no active plan enabled for signup in settings, it implies an invite-only site usecase which needs to be highlighted to he user
- Shows the invite only message along with option to login when SIgnup screen is opened in such scenario
2020-10-16 14:46:19 +05:30
Peter Zimon
510dfd75d9 Removed notifications when cancelling Stripe flows
no refs.
- removed notifications when clicking on the back button Stripe checkout either in update plan or in sign up flows
2020-10-14 16:18:09 +02:00
Peter Zimon
5ec1bdb05e Refined billing update loader icon 2020-10-14 15:13:30 +02:00
Peter Zimon
4d172a6645 Fixed one line notification style 2020-10-14 15:08:11 +02:00
Peter Zimon
6cbe8cca36 Added tabindex to signup and signin input fields 2020-10-14 15:05:40 +02:00
Peter Zimon
5c425fec9c Refined input field animation styles 2020-10-14 14:55:02 +02:00
Peter Zimon
548403dc03 Maximised length of portal button text
no refs.
2020-10-14 14:43:48 +02:00
Peter Zimon
5b7b77a855 Refined account plan page footer padding 2020-10-14 11:32:08 +02:00
Rish
aa6bb75e13 Updated readme usage section
no issue

Updates usage section to correctly highlight directly adding script or enabling via Ghost config setups
2020-10-14 14:24:24 +05:30
Rish
e837446063 v0.10.12 2020-10-13 22:46:57 +05:30
Rish
d0c15e30fc Fixed site fixtures for tests
no issue

- Default site fixtures for tests often break them as tests expect all 3 plans to be present at the moment, change here updates the tests to use custom site fixture with all 3 plans to avoid breaking with any changes for dev testing
2020-10-13 22:17:30 +05:30
Peter Zimon
91414f764d Added halo around signed in trigger button
no refs.
- added an outline on the Portal trigger button for logged in state so that it pops out better on any background with Gravatars
2020-10-13 17:19:06 +02:00
Peter Zimon
e0103647e6 Adjusted drop shadow of Portal trigger button
no refs.
- update Portal trigger button's drop shadow so that it stands out a bit more from the background
2020-10-13 17:19:06 +02:00
Rish
e1c99346c7 Added logic for local switch update for visual flow
no issue

- Currently, the newsletter switch works on the value update from the API which can have slight delay causing sluggish feeling on using the switch
- Adds logic to locally update the switch state before resetting to whatever value comes from the update so the behavior feels instant
2020-10-13 18:22:26 +05:30
Rish
ac162cf1ea Added redirect to account home for complimentary member
no issue

- Complimentary members should be redirected to account home when attempted to open the account plan page via portal link
2020-10-13 18:22:26 +05:30
Rish
da7aee7003 Added loader icon for edit billing update
no issue

- Adds loading indicator for Billing update button while it waits to create and load stripe session
2020-10-13 18:22:26 +05:30
Peter Zimon
b037d98fb8 Removed auto-invert color from primary buttons
no refs.
2020-10-13 14:43:22 +02:00
Peter Zimon
b8a57d6ddf Updated animation timings
no refs.
- removed double trigger of in-popup notifications
- adjusted timing and easing for both in-popup and global notifications
2020-10-13 14:22:05 +02:00
Peter Zimon
e5175555b9 Updated dynamic signup and signin popup width
no refs.
- set popupwidth based on available plans inlcuding if self signup and/or stripe is enabled
2020-10-13 13:00:11 +02:00
Rish
e591770e5e Removed validation check on input blur
no issue

- Removes validation check for fields on focus away to make the form behavior more friendly
2020-10-13 11:29:48 +05:30
Rish
ad488d73ed Cleaned up portal link on popup close
no issue

- On closing portal popup, the hash link was not getting reset which then prevented the popup to be opened again
- Clears portal hash link on popup close
2020-10-13 11:26:01 +05:30
Rish
031bca982a v0.10.11 2020-10-02 22:03:43 +05:30
Rish
048cdbd315 Updated discount calculation round-off
no issue

- Updated yearly plan discount calculation based on rounding down to nearest integer
2020-10-02 20:35:00 +05:30
Peter Zimon
e9df5b5584 Updated billing info notification copy 2020-10-02 17:01:02 +02:00
Peter Zimon
71a8e7355b Updated triggerbutton height 2020-10-02 16:59:01 +02:00
Rish
167cbba36d v0.10.10 2020-10-02 20:02:17 +05:30
Rish
d9cb6597c5 Added back button to account plan and profiles for direct links
no issue

- We had previously removed the Back button for account profile/plan pages when opened directly via Portal link
- This updates the behavior to show the back button which takes back to Account Home as the previous behavior seemed incomplete to users
2020-10-02 19:58:51 +05:30
Rish
74a7232d0c Fixed hash change for links
no issue

- Hash handler was not updating Portal state if it pointed to a Portal link, which caused the need for a full refresh to reflect new link triggers
- Updates hash handler to use handle both preview and link states
2020-10-02 19:57:43 +05:30
Rish
bcf2b5872b v0.10.9 2020-10-02 19:37:55 +05:30
Rish
21fc8ab2b4 Updated billing info popup message
no issue

- Updates stripe billing info update/cancel message in popup notification
2020-10-02 19:35:58 +05:30
Peter Zimon
4b3973c105 Updated mobile size inputs and buttons 2020-10-02 15:50:33 +02:00
Peter Zimon
35366964b7 Updated cancel confirmation copy 2020-10-02 15:40:21 +02:00
Peter Zimon
89c7698f79 Added name and email input attributes 2020-10-02 15:35:11 +02:00
Peter Zimon
7721027783 Updated copy for newsletter setting 2020-10-02 15:27:37 +02:00
Peter Zimon
6c1041cedb Fix back button spacing 2020-10-02 15:20:08 +02:00
Peter Zimon
fe79d42239 Updated link color in popup notifications 2020-10-02 15:15:08 +02:00
Peter Zimon
bc17f41860 Updated name error copy 2020-10-02 14:56:14 +02:00
Peter Zimon
231bafb826 Updated email error copy 2020-10-02 14:51:26 +02:00
Rish
57e83ebe6c v0.10.8 2020-10-02 18:17:32 +05:30
Rish
22a1a5a5fd Fixed loader on account profile update
no issue

- Loader was missing because of `isRunning` state not added for profile update action
2020-10-02 18:00:29 +05:30
Rish
c58fd0c8de Fixed back button for plan confirmation page
no issue

- Back button was removed for confirmation page when opened via Portal link, as we checked for `lastPage` available only
2020-10-02 18:00:01 +05:30
Rish
c4b0aa9b12 v0.10.7 2020-10-02 16:41:20 +05:30
Rish
659340ec3e Fixed back button visible on link pages
no issue

- When account plan/profile pages are opened via Portal Link, the back button is non-functional as we don't have a last page to go to, fix hides the back button in such cases
2020-10-02 16:38:11 +05:30
Rish
f9ab9835e8 v0.10.6 2020-10-02 15:58:50 +05:30
Rish
465793a518 Fixed account plan page for logged out state
no issue

- Account plan page did not handle redirect to signup when no member is logged in
2020-10-02 15:57:58 +05:30
Rish
96c72aa3c9 v0.10.5 2020-10-02 15:45:44 +05:30
Rish
f91aeec3c8 Fixed members form missing data-members-name
refs #12249
refs ce14d8113a

This was incorrectly assuming the presence of the data-members-name
element in the document. By guarding against it and defaulting to
undefined, we fallback to the existing behaviour when the element is not
present.
2020-10-01 22:46:45 +05:30
Rish
39a40034ac Fixed tests
no issue

- Added yearly back to fixtures as tests rely on them
- Long term fix is to directly override fixtures with expected value for tests to not rely on value in file
2020-10-01 17:56:15 +05:30
Rish
884c56f793 Added enter to submit on forms
no issue

- Adds enter to submit on Signin/Signup/AccountProfile pages when focused on an input field
2020-10-01 17:54:39 +05:30
Peter Zimon
15d4a83b1e Updated portal title when there's no logo 2020-10-01 14:00:26 +02:00
Peter Zimon
cf4736d2df Portal notifications style (#103)
- Updated notification style for a less opinionated design so that it works better with any accent color
- Changed full width notificaiton style to smaller to avoid covering navigation
2020-10-01 13:59:32 +02:00
Rish
b414e3b7e4 Fixed empty accent color not set in preview mode
no issue

Current logic ignored empty accent color value coming from the preview url which did not unset the accent color when removed from preview. The fix allows for empty accent color in preview so that it can be reset to default.
2020-10-01 12:18:05 +05:30
Rish
9263a84c09 Updated data attributes script to read member name in form
no issue

- We recently updated Ghost to allow theme developers to pass member's name via `data-members-name` attribute
- The script covers the usecase for any themes using the attribute to fill member's name during the signup process
2020-10-01 12:18:05 +05:30
Peter Zimon
686ad537c7 Updated primary button height 2020-09-30 14:36:14 +02:00
Peter Zimon
3e26b63ec9 Updated focused input border color 2020-09-29 17:09:25 +02:00
Rish
dfd034b624 Updated popup notification behavior for profile update
refs https://github.com/TryGhost/Team/issues/393

- Updates behavior of popup notification for account update
- Updates popup notification clear without animation for manual close and retry click
- Adds redirect to home page correctly for popup notification on success
2020-09-29 12:44:01 +05:30
Peter Zimon
266217e109 Added 'Retry' button to account change 2020-09-28 16:06:21 +02:00
Peter Zimon
8222df0e31 Updated in-popup notification copy and behaviors
no refs.
2020-09-28 16:02:59 +02:00
Peter Zimon
3221fae172 Refined primary button height 2020-09-28 15:38:45 +02:00
Peter Zimon
db9a34cef7 Updated background color of retry button 2020-09-28 15:38:11 +02:00
Rish
a247d54dd9 v0.10.4 2020-09-28 12:21:19 +05:30
Rish
09044a5469 Added stripe checkout cancel notification
no issue

- Adds notification for stripe checkout flow notification for free and new members
2020-09-28 12:20:41 +05:30
Rish
16c4f46f9f v0.10.3 2020-09-28 11:49:40 +05:30
Rish
041de9f045 Cleaned up notification flows
no issue

- Adds success and error notification messages for different actions
- Cleans up notification flows and messages
- Adds new helpers for members and site
- Updates actions for email/name update
2020-09-28 11:48:48 +05:30
Peter Zimon
160e5e6e7d Updated mobile styles for plan selection 2020-09-24 12:45:47 +02:00
Rish
a061771138 Added close handling for popup notification with icon
no issue

- Adds close handling for popup notification with close icon
2020-09-24 16:09:16 +05:30
Peter Zimon
9936dd19ae Refined heading position and spacing 2020-09-24 12:33:45 +02:00
Peter Zimon
1b3706fa1e Updated disabled cookie warning
no refs.
- added different disabled cookie warning messages depending on the context
- disabled input fields, checkboxes and buttons globally if cookies are disabled
- refined copy and visuals
2020-09-24 12:26:25 +02:00
Rish
4f00604ed4 Added helpers to generate portal link for pages
no issue

- Adds new helpers to create portal links on existing site url paths
- Updates retry links for signin and signup to use new helpers
- Helps preventing any unwanted bugs with Portal links by providing consistent link creation
2020-09-24 15:45:39 +05:30
Rish
71fcfb4918 Added cookies disabled check
no issue

- Added dummy banner if cookies are disabled
- Adds new helper to check if cookies are disabled
2020-09-24 13:37:49 +05:30
Peter Zimon
2105872859 Updated order of Portal button icons 2020-09-24 09:52:51 +02:00
Peter Zimon
d7dbe06760 Refined copy of popup notifications 2020-09-24 09:39:17 +02:00
Rish
7a4c14eb1a v0.10.2 2020-09-24 12:36:53 +05:30
Rish
f45b2f24e2 Updated git repo on readme
no issue
2020-09-24 12:36:24 +05:30
Rish
01ca6d0ffe v0.10.1 2020-09-24 12:20:46 +05:30
Rish
04cab22a5c Updated readme
no issue

- Updated badge and portal naming
2020-09-24 12:18:26 +05:30
Rish
d50c105000 Updated package name in readme 2020-09-24 12:02:17 +05:30
Rish
7e19264d34 v0.10.0 2020-09-24 11:58:56 +05:30
Rish
8db1b02558 Updated npm/unpkg name to portal
no issue

- Updates npm/unpkg name to portal from members-js
- Updates script name from `members.min.js` -> `portal.min.js`
2020-09-23 23:43:46 +05:30
Rish
8746acd87a Fixed Lint 2020-09-23 23:29:16 +05:30
Rish
965959c964 Cleared timeouts in App on unmount
no issue

- Clears any timeout on unmount in main App and components to avoid unexpected unmount behaviors
2020-09-23 20:49:16 +05:30
Rish
5cb1f02109 Updated notification handling
refs https://github.com/TryGhost/Team/issues/393

- Updated popup notification handling flow for action success and errors
- Updated global notification handling with show popup
- Updated action handler to create popup notifications
- Removed inline newsletter update message
- Generic cleanup of unused code
2020-09-23 20:36:33 +05:30
Peter Zimon
8ea26be5bb Updated notification copy
no refs.
2020-09-23 12:48:33 +02:00
Peter Zimon
8580f2fec1 Hide popup notifications 2020-09-23 11:15:51 +02:00
Rish
8af2340d42 Updated global notification handling flow
refs https://github.com/TryGhost/members.js/issues/92

- Adds new notification parser util
- Handles slideout animation for notification
- Clear search params on notification hide/close
2020-09-23 14:07:11 +05:30
Rish
81823f531b Updated github repo name to Portal
no issue

- Updated readme and package json to point to new repo name
2020-09-23 12:53:10 +05:30
Peter Zimon
f8f5377447 Added notification slide out animation 2020-09-22 17:07:57 +02:00
Peter Zimon
e537d1dd03 Added in-popup notification component
no refs.
2020-09-22 17:00:22 +02:00
Peter Zimon
306e13cf44 Repositioned popup close button
no refs.
- added CloseButton component to be able to use it in multiple pages
- moved close button inside content container so that it scrolls with the page on smaller screen sizes
2020-09-22 16:21:15 +02:00
Renovate Bot
ed25241ede Update dependency @testing-library/user-event to v12.1.5 2020-09-21 02:06:12 +00:00
Renovate Bot
55d50fe055 Update dependency @testing-library/react to v11.0.4 2020-09-21 01:05:04 +00:00