Commit Graph

894 Commits

Author SHA1 Message Date
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