Skip to content

Conversation

@joelclimbsthings
Copy link
Contributor

@joelclimbsthings joelclimbsthings commented Nov 22, 2022

All Submissions:

Changes proposed in this Pull Request:

Reworking CES modal to present two distinct questions for every CES event site wide, although with subtle styling and UI changes.

Closes #35124 .

Screenshots

image

How to test the changes in this Pull Request:

  1. Checkout this branch on a fresh site.
  2. Run localStorage.setItem( 'debug', 'wc-admin:tracks' ); in the console to view tracks events.
  3. Complete the steps below to trigger each CES event, and then click "Give feedback" in the notice at the lower-left corner. Ensure that the modal appears as it does in the screenshot above, and the verbiage of the questions and title make sense for that event.
  4. For each event, observe the console and ensure that the tracks event wcadmin_ces_feedback fires with the correct action, score, score_second_question and score_combined properties.

Change settings

  • Navigate to WooCommerce -> Settings and change any setting.
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Add attribute

  • Go to Products > Attributes.
  • Add a new attribute.
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Add product category

  • Go to Products > Categories.
  • Add a new category.
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Add product tag

  • Go to Products > Tags.
  • Add a new tag.
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Add new product

  • Go to Products > Add new.
  • Create your first product and hit "publish."
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Update product

  • Go to Products > All Products.
  • Click the product you just created.
  • Update title or description in any way and hit "publish."
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Update order

  • Go to WooCommerce > Orders.
  • Click "Add Order," add the product you just created, and change status to "processing."
  • Click "Create."
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Search

  • Go to Products > All Products
  • Enter any term into search field in top-right and hit enter.
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Import products

  • Go to Products > All Products.
  • Click the "Export" button at the top.
  • Click "Generate CSV."
  • Go to Products > All Products.
  • Click the "Import" button at the top.
  • Select the CSV you just generated, and click "Continue."
  • Click "Run the importer."
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Filter Analytics

  • Go to Analytics > (any report)
  • Enter any filter above and click "Up- Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.date."
  • Click "Give feedback" in notice that appears in the bottom-left and complete steps 3-4 above.

Setup task list

  • Complete the setup task list on the Homescreen
  • You should see this simple CES component displayed:
    image
  • Select a score of 1-2.
  • Observe the CES modal open and complete steps 3-4 above.

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 created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?

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.

@github-actions github-actions bot added focus: react admin package: @woocommerce/customer-effort-score issues related to @woocommerce/customer-effort-score plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Nov 22, 2022
@joelclimbsthings joelclimbsthings marked this pull request as draft November 22, 2022 23:32
@github-actions
Copy link
Contributor

github-actions bot commented Nov 22, 2022

Test Results Summary

Commit SHA: 28d7ca3

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 55s
E2E Tests186006019215m 7s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@joelclimbsthings joelclimbsthings self-assigned this Nov 23, 2022
@joelclimbsthings joelclimbsthings marked this pull request as ready for review November 23, 2022 01:56
@joelclimbsthings joelclimbsthings requested a review from a team November 23, 2022 01:56
comments: string
) => void;
title: string;
firstQuestion: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a note that these are currently hardcoded in fairly brittle fashion, but that was the approach decided on in the original issue.

@octaedro octaedro requested review from octaedro and removed request for a team November 23, 2022 13:00

$this->enqueue_to_ces_tracks(
array(
'action' => self::SHOP_ORDER_UPDATE_ACTION_NAME,
Copy link
Contributor

Choose a reason for hiding this comment

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

This event is also triggered when the order is created, is that expected?

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 noticed this as well, but this was the preexisting behavior so I'd assumed it was expected. We could loop in @pmcpinto . I know it's triggered when we create the order manually through wc-admin. Glancing at the code it's triggered by a change in the order post status.

Choose a reason for hiding this comment

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

the way it's working now is fine. Thanks for the heads up.

Copy link
Contributor

@octaedro octaedro left a comment

Choose a reason for hiding this comment

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

Nice job @joelclimbsthings! This is testing well here and code looks mainly good. I just left a couple of small comments and questions.

@joelclimbsthings
Copy link
Contributor Author

Thanks @octaedro , I believe I've made the requested changes, although pending Pedro's feedback if we like regarding the order creation event.

I also had to direct some attention to the customer effort score tests. It seems that they're not run when you run the command from the root of the monorepo? 🤔

Copy link
Contributor

@octaedro octaedro left a comment

Choose a reason for hiding this comment

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

Great job @joelclimbsthings!

It seems that they're not run when you run the command from the root of the monorepo?

I would create a new issue to handle that in a follow-up PR.

I'm going to pre-approve this PR, waiting for Pedro's feedback.

@joelclimbsthings joelclimbsthings merged commit 4db5c0d into trunk Nov 29, 2022
@ecgan
Copy link
Contributor

ecgan commented Jan 2, 2023

Hi @joelclimbsthings , just want to let you know that the changed CustomerEffortScore component is causing an issue in Google Listings and Ads extension that make use of the component. See issue woocommerce/google-listings-and-ads#1836.

I noticed that the https://github.com/woocommerce/woocommerce/blob/16386238cccdb2dfe2197832d0c169c3df261958/packages/js/customer-effort-score/README.md is outdated and does not match the code in https://github.com/woocommerce/woocommerce/blob/16386238cccdb2dfe2197832d0c169c3df261958/packages/js/customer-effort-score/src/customer-effort-score.tsx. Could you get it updated please? It would be really helpful for us who use the component.

Will there be a new npm package version release for https://www.npmjs.com/package/@woocommerce/customer-effort-score?

@puntope
Copy link
Contributor

puntope commented Jan 3, 2023

is causing an issue in Google Listings and Ads

I would suggest to do the next tweaks to make the component backwards compatible:

  • Make title parameter optional. In case it's not set fallback to __( 'Please share your feedback', 'woocommerce' )
  • Name firstQuestion as label
  • Name secondQuestion as secondLabel or labelSecondQuestion
  • Only show the second question if it's defined by the user.
  • Add the required new params in the propTypes

@joelclimbsthings
Copy link
Contributor Author

Thanks @ecgan and @puntope . Good observations. Looking at this now, and I'll try to get this prioritized.

@puntope
Copy link
Contributor

puntope commented Jan 4, 2023

Here you can find a PR I did yesterday. I guess that covers the main pain point which is to have second Option as not mandatory and the fallback for the title

#36270

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

Labels

package: @woocommerce/customer-effort-score issues related to @woocommerce/customer-effort-score plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CES: Add additional question to CES modal

6 participants