Commit Graph

185 Commits

Author SHA1 Message Date
Renovate Bot
4078483bb7 Update dependency eslint-plugin-ghost to v1.4.0 2020-05-06 18:15:04 +00:00
Rish
8c42813666 v0.3.3 2020-05-01 23:20:53 +05:30
Rish
e8b25fc6e4 Fixed plan value in paid account home
no issue

- The plan value we get from API for a member is in cents and needs to be converted to dollars before showing.
2020-05-01 23:20:12 +05:30
Rish
21661e8eb8 v0.3.2 2020-05-01 22:24:44 +05:30
Rish
614c3f02fc Added fixture for paid member
no issue

- Adds fixture for paid member for local development
2020-05-01 22:23:37 +05:30
Rish
7abeb0a247 Updated local env file example to use default page
no issue

- Updates local env file to specify a default page for local UI development
2020-05-01 22:21:44 +05:30
Rish
eac5035451 Updated default page handling for paid member
refs https://github.com/TryGhost/members.js/issues/20

- Adds default page handling for paid member to open paid account area
- Refactors dev mode default page to be picked from env file if available
2020-05-01 22:21:16 +05:30
Rish
094d32a88d Added new paid account home area
refs https://github.com/TryGhost/members.js/issues/20

- Adds new page for home account area of paid member
- Updates popup modal to add paid account home page in list
2020-05-01 22:20:18 +05:30
Rish
26e1fd9dd3 Updated custom trigger button popup state classes
no issue

- Fixes custom trigger button not getting close class through any other way other than trigger
- Updates class name for open and close state by adding `gh-members-` namespace
2020-05-01 21:26:19 +05:30
Rish
2789ea3a10 v0.3.1 2020-05-01 20:58:55 +05:30
Rish
a61ce9c690 Fixed lint 2020-05-01 20:58:29 +05:30
Rish
216d8b1a14 Added subscribe navigation to account home
refs https://github.com/TryGhost/members.js/issues/20

- Adds navigation and last page setup for account home -> account plan chooser
2020-05-01 20:56:46 +05:30
Rish
767fbc1112 Cleaned up checkoutPlan action
no issue

- Removed checkoutUrls as we use default value for now
2020-05-01 20:55:20 +05:30
Rish
7dd4282520 Added back action to action list
no issue

- Adds back action to action list to allow pages to navigate back to last page
2020-05-01 20:54:48 +05:30
Rish
ec407eae5f Added new account plan page to popup modal flow
no issue

- Adds modal style and page value for new account plan page to modal
2020-05-01 20:53:48 +05:30
Rish
c6cf81664c Added new accountPlan page
no issue

- Adds new page for choosing a plan for logged in member
2020-05-01 20:52:56 +05:30
Rish
859b5502eb Refactored swtichPage action call syntax
no issue

Updates switchPage syntax to pass object so we can pass `lastPage` value as well for back button
2020-05-01 20:52:18 +05:30
Rish
4931ea68bd Updated plans section component plans prop
no issue

- Updates plans section component to take simpler plans array as prop for rendering plans
2020-05-01 20:49:35 +05:30
Rish
9cc5badd2f Added new switch component for toggle UI
no issue

- Mimics behavior and UI of toggle button in Ghost Admin
2020-05-01 20:12:13 +05:30
Rish
ee1dfbc0af v0.3.0 2020-05-01 17:18:54 +05:30
Rish
dae6d75f17 Fixed lint 2020-05-01 17:17:09 +05:30
Rish
98354e9de0 Updated script usage in readme to remove explicit init and adminUrl
refs https://github.com/TryGhost/members.js/issues/25

- No dependency on adminUrl anymore as endpoints exist on site url
- Members.js script is auto initialized, no need for explicit init in themes anymore
- No local .env values need to be set for development as script loads data from fixtures directly
2020-05-01 17:10:17 +05:30
Rish
2aef0d57f8 Refactored app initialization to remove admin url dependency
closes https://github.com/TryGhost/members.js/issues/25

- Remove dependency on admin url for initialization as member endpoints now exist on site directly
- Auto initializes the script on load as need not wait on any external dependency
- API fetch cleanup in parent container
- Updates tests
2020-05-01 17:06:58 +05:30
Rish
e291e7075b Updated api endpoints to use new member endpoints on site
refs https://github.com/TryGhost/members.js/issues/25

- Members endpoints were refactored in core to exist directly on site as `<SITE>/members/api/<RESOURCE>`
- All endpoints needed are now directly on SITE and removes the need for AdminURL
- Init method is updated to read site data from fixtures for local development, as no admin endpoint exists now

Core Refs:
0cba02b370
fa4dfa1b21
c70c49258e
2020-05-01 17:00:52 +05:30
Rish
a373239fcb Added small style hack to insert css inside iframe components
no issue

-  By default, CRA's webpack bundle combines and appends the main css at root level, so they are not applied inside any iframe.
- JSX Styles don't work for `:hover` and other similar selectors which is needed to style certain components like checkboxes
- This uses a hack where we append `<style> </style>` tag with all CSS inside the head of iframe dynamically as string
- We can create separate variables to keep styles grouped logically, and export them as one appended style string to apply styles in iframe.
2020-05-01 16:03:07 +05:30
Rish
d4f604d091 v0.2.4 2020-05-01 13:05:23 +05:30
Rish
29c4b6be0f Updated yarn ship script
no issue

- Updates `yarn script` to use same consistent format we use across org
- Removes use of `npm` in publish
- Adds `preship` to run lint - ideally should run tests but react tests run in interactive mode and are very slow atm, need to sort that out first.
2020-05-01 13:02:27 +05:30
Rish
c67ec1f730 Added no-op subscribe button handling
refs https://github.com/TryGhost/members.js/issues/20

- adds no-op method to handle subscribe option in account page
- fixes lint
2020-05-01 12:46:20 +05:30
Rish
67a07893b0 Updated account home page UI for free member
refs https://github.com/TryGhost/members.js/issues/20

- Updates UI for free member's account page based on spec
- Updates popup to show account home page like normal modal
- Updates tests
2020-05-01 12:41:33 +05:30
Rish
21df87e388 Updated trigger to use member gravatar when logged-in
refs https://github.com/TryGhost/members.js/issues/20

Updates trigger default icon to use member's gravatar if logged in via common component, which fallbacks to user icon when gravatar is blank.
2020-05-01 12:36:57 +05:30
Rish
d2098a783e Added common members avatar component
refs https://github.com/TryGhost/members.js/issues/20

- Adds a common component to render member gravatar with backup of user icon where gravatar is not available or is blank.
- Used in both Trigger component for logged in member as well as account areas.
2020-05-01 12:35:51 +05:30
Rish
462eb1c1b2 Reset popup state to default on closing magic link
closes https://github.com/TryGhost/members.js/issues/21

- Resets popup state to default page when magic link popup message is closed
2020-04-30 20:35:26 +05:30
Rish
49606f8fdf Added explicit npm registry in publishConfig
no issue

The members-js package is published on npm and this ensures `yarn ship` attempts to push to correct registry instead of yarn registry in case not set globally.
2020-04-30 17:37:29 +05:30
Rish
02d968dd4e 0.2.3 2020-04-30 17:25:36 +05:30
Rish
d11afe363f Updated checkout flow to pre-fill member email
refs https://github.com/TryGhost/members.js/issues/10

- Takes advantage of change here - 24b83bdc49 - to pre-fill customer email in anonymous checkout flow
- Member cannot change their email in this checkout session, allowing consistency and correct linking post checkout
2020-04-30 17:23:23 +05:30
Rish
f813185cc3 Added stripe url handling for checkout success
refs https://github.com/TryGhost/membersjs/issues/10

We use stripe query param `?stripe=<state>` for redirects from checkout session, this handles the magic link popup for checkout success state on redirect.
2020-04-30 11:55:16 +05:30
Rish
712ac5cd74 Updated tests for magiclink page
no issue

- Add test for close button firing correct action(closePopup) on magic link page
- Use common test utils setup
2020-04-30 11:49:18 +05:30
Rish
30a14023cf Fixed close action handling on magic link page
no issue

Fixes magic link action button using incorrect action method - `handleSignin` - which failed on click, replaced with close popup action.
2020-04-30 11:39:19 +05:30
Rish
9aefe26ba7 Fixed lint 2020-04-30 00:24:31 +05:30
Rish
24e98cfb21 Used common plans section component in signup page
refs https://github.com/TryGhost/members.js/issues/10

We want to use the common UI component for rendering the plans section. Also fixes the weird dom sync problem with checkboxes by adding a timeout for small lag to keep the state in sync.
2020-04-30 00:19:28 +05:30
Rish
886ee7e9ec Added new component for membership plans
refs https://github.com/TryGhost/members.js/issues/10

Create common plans section UI component as its used in multiple places in app
2020-04-30 00:17:16 +05:30
Rish
9edb3d2e58 Reworded usage section in readme
Simple rewording to make usage section shorter and to point
2020-04-29 13:38:29 +05:30
Rish
87215f56a0 0.2.2 2020-04-28 23:41:52 +05:30
Rish
f237a6ee37 Updated unpkg link in readme to use latest version
no issue

Instead of pinning to specific released version, we use `@latest` for picking the last released version automatically
2020-04-28 23:41:20 +05:30
Rish
7fee47b9a7 Added yarn ship for publishing to npm/unpkg
refs https://github.com/TryGhost/members.js/issues/5

We use `yarn ship` across all our packages for publishing new versions.
2020-04-28 23:38:24 +05:30
Rish
4d99e881d7 Added basic anoymous checkout flow setup
refs https://github.com/TryGhost/members.js/issues/10

Adds happy path flow for triggering anonymous checkout from signup page when monthly or yearly plan is selected. Opens the stripe checkout session with empty email, and currently doesn't handle the success or failure redirect.
2020-04-28 23:33:22 +05:30
Rish
e0c222f25c Fixed incorrect default page load
no issue

Missed passing `member` param while fetching default page, which then always returns `signup` page even if member is signed in
2020-04-28 23:31:20 +05:30
Rish
7da315acba Switched to recommended absolute test-utils path setup
refs https://github.com/TryGhost/members.js/issues/5

Switched to using absolute path for default test-utils setup file as relative imports become too messy when we keep tests for a component next to it. This setup allows using absolute path for common test-utils file which is used in almost all tests for initial setup.
2020-04-28 23:29:56 +05:30
Rish
d83382ffb5 Allowed .env file in source control for test-utils setup
refs https://github.com/TryGhost/members.js/issues/5

- We want to allow .env in source control mainly to use react-testing-library's recommended setup for common test-utils. It uses .env file to define NODE_PATH, which helps in avoiding relative imports in tests as we keep test files next to UI components.
- CRA also by default suggests committing .env files to source control
2020-04-28 23:15:09 +05:30
Rish
c3907f24dd Fixed tests
Fixed incorrect fixtures path
2020-04-28 13:12:11 +05:30