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 purchase task to experimental task lists #33178

Merged
merged 8 commits into from Jun 6, 2022
Merged

Add purchase task to experimental task lists #33178

merged 8 commits into from Jun 6, 2022

Conversation

joshuatf
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

Adds the missing purchase task to the 2 experimental task lists.

Closes #33125 .

How to test the changes in this Pull Request:

  1. Proceed through OBW, and select the paid theme "Blooms" on the final step.
  2. Be sure to opt into Marketing^
  3. When brought to the Homescreen, notice that the "Add Blooms to my store" task appears.
  4. Install WCAdmin Test Helper plugin, and use it to enable woocommerce_tasklist_setup_experiment_1_*
  5. Refresh the Homescreen.
  6. Note that the purchase task exists
  7. Enable the woocommerce_tasklist_setup_experiment_2_* experiment
  8. Refresh the homescreen.
  9. Note the purchase task exists

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 run tests with your changes locally?
  • Have you created a changelog file for each project being changed, ie pnpm nx changelog <project>?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@joshuatf joshuatf requested a review from a team May 24, 2022 15:40
@joshuatf joshuatf self-assigned this May 24, 2022
@github-actions github-actions bot added focus: react admin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels May 24, 2022
@botwoo
Copy link
Collaborator

botwoo commented May 24, 2022

📊 Test reports for this pull request have been published and are accessible through the following links:

Latest commit referenced in the reports: Fix theme title in purchase task 02d9f91
This comment will automatically be updated with the latest referenced commit when you push new changes to this pull request.


Visit the WooCommerce Test Reports homepage to view all published reports. See the FAQs page if you're having problems accessing them.

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

Overall tested well, but left some comments in relation to styling and copy that should match the design of the task list. I think the copy change mentioned at the end here, would be the biggest item, we could do without the header (or do that as part of a separate PR).

For experiment 1 we have headers for each task, but don't have a header for this one, I think we would want to create one.
Screen Shot 2022-05-25 at 4 06 30 PM
vs
the header of ways to get paid:
Screen Shot 2022-05-25 at 4 07 22 PM
@jarekmorawski might have some suggestions?

Also we want to update the titles to match the copy of the new task list.
For example for both experiments, the completed copy says:
'Add paid extensions to my store' but all the others are in past tense, maybe we should change it to 'You added paid extensions to your store'?
See an example of the logic here: https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Products.php#L43-L49

@jarekmorawski
Copy link

'Add paid extensions to my store' but all the others are in past tense, maybe we should change it to 'You added paid extensions to your store'?

Absolutely! I added the updated designs here: G9vi4e286yjdzyIdg8hBb1-fi-1761%3A159201

Here's how the copy would go:

Task title

  • Add %1$s and %2$s (incomplete)
  • You added %1$s and %2$s (complete)

Description

  • Continue to checkout to to add amazing new features to your store.

For the experiment 1 (single task list), the button should say Continue. Let me know if this helps!

@joshuatf
Copy link
Contributor Author

Thanks for all the input and help on this, @jarekmorawski!

@louwie17 I've updated based on the discussion in p1653660464272079-slack. Also updated the width/height of illustrations in 4044869 which needs a sanity check, but I think will confine proportions well.

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

Thanks for the updates Josh, the header looks great, I did notice a minor issue with the CSS changes.
I also left some comments in relation to the action button and the completed copy.

Also sorry if some of these comments show up twice, Github is being annoying....

$additional_count = count( $products['remaining'] ) - 1;

if ( $this->get_parent_option( 'use_completed_title' ) && $this->is_complete() ) {
return count( $products['remaining'] ) === 1
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be purchaseable right? As the remaining array will always be empty if this task is completed.
As currently I am getting this weird title:
Screen Shot 2022-06-01 at 3 43 14 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Same probably goes for $addtional_count and line 79.
For additional_count probably need a $completed_additional_count.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya, good point. This doesn't work well as you complete purchases. Updated.

$additional_count,
'woocommerce'
),
$products['remaining'][0],
Copy link
Contributor

Choose a reason for hiding this comment

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

Also in the $products['purchaseable'] the items are array's of plugins, so this will probably be $products['purchaseable'][0]['label']

<Button
isSecondary={ task.isComplete }
isPrimary={ ! task.isComplete }
onClick={ goToTask }
Copy link
Contributor

Choose a reason for hiding this comment

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

This should actually do something different, as it navigates to the purchase task screen which doesn't exist.
It should show a popup like this instead:
Screen Shot 2022-06-01 at 4 07 39 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 I think ultimately if we keep this variant of the task list we should strive to dry up these headers and actions a bit. There is a lot of duplication between components and even backend data being replicated on the frontend that is going to cause headaches down the road.

<Button
isSecondary={ task.isComplete }
isPrimary={ ! task.isComplete }
onClick={ goToTask }
Copy link
Contributor

Choose a reason for hiding this comment

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

See the custom purchase task item we have here: https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-admin/client/tasks/fills/purchase.js

I know for other headers like WooCommerce Payments we copied that custom logic to the header also instead of using goToTask -> https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-admin/client/two-column-tasks/headers/woocommerce-payments.js#L86

img {
max-height: 150px;
width: auto;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this works well for all the tasks in the two column layout, I screwed around with that for a while to, maybe we still want to add a max-width?
Screen Shot 2022-06-01 at 4 15 23 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add max width and max height. Seems to be working well on my end, can you double check on yours?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good on my end now to :)

@louwie17
Copy link
Contributor

louwie17 commented Jun 1, 2022

@joshuatf
Copy link
Contributor Author

joshuatf commented Jun 3, 2022

Hey @louwie17, updated that old test and added another for better coverage around titles. Could you give this another look?

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

Thanks for the updated changes @joshuatf , nice work on this, this tested well and changes look great 👍 💯

@joshuatf joshuatf merged commit 12625ae into trunk Jun 6, 2022
@joshuatf joshuatf deleted the add/33125 branch June 6, 2022 11:58
@github-actions github-actions bot added this to the 6.7.0 milestone Jun 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2022

Hi @joshuatf, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the release: add testing instructions label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Purchase task missing from task list experiments
4 participants