Skip to content

Subscriptions Wizard#73

Merged
claudiulodro merged 2 commits into
masterfrom
add/subwizard-2
May 27, 2019
Merged

Subscriptions Wizard#73
claudiulodro merged 2 commits into
masterfrom
add/subwizard-2

Conversation

@claudiulodro
Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

Closes #53 .
Supersedes #15.
Supersedes #64 .

This implementation of the subscriptions wizard does so with all of the state pulled up into the main wizard class, as per @jeffersonrabb's suggestion. I think it was a good suggestion, and this seems easier to maintain and follow the code logic.

How to test the changes in this Pull Request:

  1. npm ci; npm run clean; npm run build:webpack
  2. Go to Newspack > Subscriptions and use the wizard.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@claudiulodro claudiulodro added the [Status] Needs Review The issue or pull request needs to be reviewed label May 24, 2019
@jeffersonrabb jeffersonrabb self-requested a review May 27, 2019 12:26
Copy link
Copy Markdown
Contributor

@jeffersonrabb jeffersonrabb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I left a few comments but all are suggestions, nitpicks, or questions which needn't block merging.

Comment thread assets/src/wizards/subscriptions/index.js
/**
* Get the latest subscriptions info.
*/
refreshSubscriptions() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] In a future PR we should establish a UI pattern for showing that an API call is in progress. Could be a Spinner, graying out the Wizard, etc. cc: @sonjaleix

this.setState( {
subscriptions: subscriptions,
} );
} );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] For a future PR, it would be good to establish a pattern for catching and displaying API errors to the user.

Comment thread assets/src/wizards/subscriptions/index.js Outdated
Comment thread assets/src/wizards/subscriptions/index.js Outdated
Comment thread assets/src/wizards/subscriptions/views/editSubscriptionScreen.js Outdated
const { id, image, name, display_price, url } = subscription;

return (
<Card className="newspack-manage-subscriptions-screen__subscription-card" key={ id }>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Note] I'm planning to make a new component based on this UI that @sonjaleix designed, and when it's ready we can probably swap it in place of the Card here. I'll include support for the image to make this possible.


return (
<Card className="newspack-manage-subscriptions-screen__subscription-card" key={ id }>
<a href={ url } target="_blank">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question] Why are the images links?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we want to let people see the subscription on the frontend somehow. This is the best way IMO.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see - so these would eventually link to the /subscribe page?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It links out to the purchase page for that specific membership.[1] People will be coming to this page from the /subscribe landing page to actually place their order.

[1] e.g. local newspack test_product_onion-level-donor_(iPad Pro)

Comment thread assets/src/wizards/subscriptions/style.scss Outdated
Comment thread includes/wizards/class-subscriptions-wizard.php
@jeffersonrabb jeffersonrabb added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed [Status] Under Review labels May 27, 2019
@claudiulodro
Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review and good suggestions. I've implemented the suggestions in d74b66f

@claudiulodro claudiulodro merged commit 9a899df into master May 27, 2019
@claudiulodro claudiulodro deleted the add/subwizard-2 branch May 27, 2019 16:15
@sonjaleix
Copy link
Copy Markdown

sonjaleix commented May 27, 2019

@claudiulodro This is looking great! The tooltip of the "name your price" checkbox runs pretty wide on my machine – as wide as the copy runs. I'm wondering if we should implement a max width. How is this handled in other places in the WP backend?

We're also missing an "I'm done adding" link at the bottom as soon as the first subscription has been added to close the wizard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wizard: Subscriptions

3 participants