Skip to content

Conversation

@octaedro
Copy link
Contributor

@octaedro octaedro commented Jan 11, 2023

All Submissions:

Changes proposed in this Pull Request:

This PR adds a new setting in Settings > Advanced > Features.
The setting should be disabled by default unless it was enabled through the flows described in #36161 and #36162
Include a tooltip to describe the new exp briefly.

Closes #36163.

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

  1. Go to WooCommerce > Settings > Advanced > Features.

  2. Verify the option New product editor is available to toggle. The description is: "Try the new product editor (Beta)" and the tooltip text says: "Enable to try the new, simplified product editor (currently in development and only available for simple products). No extension support yet."
    Screenshot 2023-01-11 at 16 57 53

  3. Enable the New product editor and verify that the new experience is turned on.

  4. Verify that the toggle works correctly.

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 plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Jan 11, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2023

Test Results Summary

Commit SHA: 347b553

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202611m 9s
E2E Tests189006019518m 23s

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.

@octaedro octaedro changed the title Add/36163 advanced setting option Add advanced setting option Jan 11, 2023
@octaedro octaedro requested a review from a team January 11, 2023 20:02
@octaedro octaedro self-assigned this Jan 11, 2023
@octaedro octaedro marked this pull request as ready for review January 11, 2023 20:03
Copy link
Contributor

@joshuatf joshuatf 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 and the toggle is working well! My tooltip HTML is coming out escaped though. Is there another branch or some setting needed for this to work?

Screen Shot 2023-01-11 at 12 12 04 PM

Additionally, the warning from the other plugins being active prevents activation of the feature. This does not need to be tackled in this PR, but seems a little opinionated and prevents us from using features as intended to roll out experimental features.

cc @Konamiman if you have more context around those decisions.

@Konamiman
Copy link
Contributor

Hi @octaedro and @joshuatf. There's a legacy features array in the class: $this->legacy_feature_ids = array( 'analytics', 'new_navigation' );. new_product_management should be added to this list, not only for the is_legacy_feature method to work as expected, but also because this will prevent the "incompatible plugins" warning from being shown.

This warning exists to keep site admins informed about the declared compatibility of other plugins with newly introduced WooCommerce features. Maybe this could be selectively disabled by adding a new flag in the features array that is generated in the constructor, but as you said that would be a job for a different pull request.

@octaedro octaedro force-pushed the add/36163_advanced_setting_option branch from a5075db to 039ff46 Compare January 12, 2023 14:47
@octaedro octaedro requested a review from joshuatf January 12, 2023 14:50
@octaedro
Copy link
Contributor Author

Thank you @Konamiman and @joshuatf for your answers.

I just addressed the changes you mentioned. @joshuatf Could you take another look at this PR?

joshuatf
joshuatf previously approved these changes Jan 12, 2023
Copy link
Contributor

@joshuatf joshuatf 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 testing well for me and LGTM, thanks for the changes, @octaedro!

Thanks for the insight, @Konamiman! I think we might look into either making the compatibility catches opt-in or at least changing the terms legacy so that we can ship new features without risk of them being unusable.

@octaedro do you want to create a follow-up issue around that or would you like me to?

@octaedro octaedro requested a review from joshuatf January 13, 2023 18:31
Copy link
Contributor

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work getting those e2e tests fixed up 🎉

@octaedro octaedro merged commit c5a27cb into trunk Jan 13, 2023
@octaedro octaedro deleted the add/36163_advanced_setting_option branch January 13, 2023 20:04
@github-actions github-actions bot added this to the 7.4.0 milestone Jan 13, 2023
?>
<tr valign="top" class="<?php echo esc_attr( implode( ' ', $visibility_class ) ); ?>">
<th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ); ?></th>
<td class="help-tooltip"><?php echo isset( $value['tooltip'] ) && '' !== $value['tooltip'] ? wc_help_tip( esc_html( $value['tooltip'] ) ) : ''; ?></td>
Copy link
Member

Choose a reason for hiding this comment

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

Interestingly, this new cell creates an issue on the WooCommerce ▸ Settings ▸ Advanced ▸ Custom Data Stores screen, effectively displacing some other settings (because the rows above and below contain just two table cells):

wc-settings-advanced-custom-data-stores

I haven't had a chance to look in any depth—I just noticed while working on some HPOS stuff—but I wonder if this is causing a problem on other screens, too (and/or what the best solution is).

cc @octaedro

Copy link
Member

Choose a reason for hiding this comment

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

Does indeed impact a few places:

settings-advanced

(Settings > Advanced)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @barryhughes for reporting this.
I just created a PR to fix that.

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.

Advanced setting option

5 participants