Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Paid Course Upsell #5169

Merged
merged 31 commits into from
May 24, 2022
Merged

Conversation

fjorgemota
Copy link
Member

@fjorgemota fjorgemota commented May 21, 2022

Fixes #5129

Changes proposed in this Pull Request

  • Add the Paid Course upsell screen;
  • Move the title from the steps in the Editor Wizard to the interior of their content;
  • Add a way to add an image to the right side of each step, as per the designs;

Testing instructions

  1. Checkout this branch;
  2. Guarantee that Sensei Pro isn't installed; (by the way, remember to backup your Sensei Pro directory if you're going to delete it through WordPress...hehe);
  3. Create a new course;
  4. Click "Next" on the modal that appears to see the Paid Course upsell screen;
  5. Verify that the "Get Sensei Pro" button works and opens a new tab on the Sensei LMS page (with some UTM tracking codes in the query string, too). Also, verify that the editor wizard goes to the next step (the Course Pattern step);
  6. Create another new course;
  7. Click on the "Continue with Sensei Free" button and verify that it DOES NOT open a new tab, and just goes to the Course Pattern step;

Screenshot of the current version

Screenshot of the Paid Course Upsell screen

To do

  • Fix price font size;
  • Adjust font style of the text "per year, 1 site" just below the price;
  • Add a background image covering both the content area of the modal + the header (I accept ideas and suggestions here! Still struggling a little bit with the CSS part..hehe) (WIP);
  • Add analytics parameters to the link opened when clicking on the "Get Sensei Pro" button?

Questions

  • I accept suggestions of tests to do; =)
  • I accept any feedback about the quality of the code;

assets/admin/editor-wizard/style.scss Outdated Show resolved Hide resolved
assets/admin/editor-wizard/steps/upgrade-step.js Outdated Show resolved Hide resolved
assets/admin/editor-wizard/steps/upgrade-step.js Outdated Show resolved Hide resolved
fjorgemota and others added 14 commits May 23, 2022 15:30
As suggested by Renatho.
So we can remove margins of the modal and remove the title from the header.

Co-authored-by: Renatho De Carli Rosa <renatho@gmail.com>
So we can customize it easily.

Co-authored-by: Renatho De Carli Rosa <renatho@gmail.com>
And fix pricing and pricing detail font sizes
So we can least look at how other editor wizard steps will behave. =)
So we can know that it applies only for the Course editor wizard easily.
So we can have these strings translated properly :D
So we don't need to go looking around for updating the price in the code..:)
@fjorgemota fjorgemota marked this pull request as ready for review May 24, 2022 00:35
@fjorgemota fjorgemota requested review from a team and renatho May 24, 2022 00:36
@fjorgemota fjorgemota linked an issue May 24, 2022 that may be closed by this pull request
So we can re-use the logic in the FeaturedProductSenseiPro component too! :D
Because I just observed that the image wasn't working in the final plugin build
Copy link
Contributor

@renatho renatho left a comment

Choose a reason for hiding this comment

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

This is looking great! I just added some small suggestions.

I accept suggestions of tests to do; =)

Just in order to merge it earlier, I'd do it in another PR. I'd test the following parts:

  • useSenseiProExtension - We could mock the useSelect, and confirm if it's filtering the Sensei Pro properly.
  • EditorWizardModal - It'd be interesting to check if the upsell step is added when should and not when shouldn't. I think the easier way would be mocking the Wizard component, and checking if CourseUpgradeStep is in the array or not.
  • CourseUpgradeStep - We could also check if the price is rendered correctly and if the actions work properly.

assets/admin/editor-wizard/editor-wizard-modal.js Outdated Show resolved Hide resolved
assets/admin/editor-wizard/steps/course-upgrade-step.js Outdated Show resolved Hide resolved
assets/admin/editor-wizard/steps/course-upgrade-step.js Outdated Show resolved Hide resolved
assets/extensions/use-sensei-pro-extension.js Outdated Show resolved Hide resolved
@renatho
Copy link
Contributor

renatho commented May 24, 2022

Just one other thing while checking the design:

  • The features list should have a font-weight: 700.
  • "per year, 1 site" should have a different spacing above and below the text.
  • I think it's not part of this PR, but if you could, we could take the opportunity to fix the spacing between the buttons in the Actions. It should have a 12px spacing between them. And the padding in the whole Action container should be 18px 30px instead of 30px.

@fjorgemota fjorgemota requested a review from renatho May 24, 2022 18:54
@fjorgemota fjorgemota requested a review from renatho May 24, 2022 20:00
renatho
renatho previously approved these changes May 24, 2022
Copy link
Contributor

@renatho renatho left a comment

Choose a reason for hiding this comment

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

This is very good! Just one final thing.
After that, since it's pretty simple, I think you can merge directly.

assets/admin/editor-wizard/steps/lesson-details-step.js Outdated Show resolved Hide resolved
Copy link
Contributor

@renatho renatho left a comment

Choose a reason for hiding this comment

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

🎉🎉🎉
Great PR!

@fjorgemota fjorgemota merged commit 7e6f68a into feature/course-lesson-wizard May 24, 2022
@fjorgemota fjorgemota deleted the add/paid-course-upsell branch May 24, 2022 21:37
Copy link
Contributor

@aaronfc aaronfc left a comment

Choose a reason for hiding this comment

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

Sorry for the late review! It is looking nice but I found some "flashing" behaviour I reported in a comment.
Maybe we want to look into it.

Comment on lines +110 to +114
if ( ! senseiProExtension || senseiProExtension.is_installed === true ) {
stepsByPostType.course = stepsByPostType.course.filter(
( step ) => step !== CourseUpgradeStep
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is making the Upgrade step flash in/out if you go over the first step somewhat fast.
https://user-images.githubusercontent.com/799065/170244529-f19593a5-145b-42e3-baa5-b493d77157c7.mp4

Any idea on how to workaround that?

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

Successfully merging this pull request may close these issues.

Course Wizard - Create "Paid Course" upsell step
3 participants