Skip to content

Conversation

@mdperez86
Copy link
Contributor

@mdperez86 mdperez86 commented Oct 21, 2022

All Submissions:

Changes proposed in this Pull Request:

Closes #35191.

  • 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 the Add new product page
  2. The only field with (required) hint on the right side of its label should be the Name and the (optional) hit should not be shown for any field
  3. This also apply to the New shipping class dialog form

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 changelog add --filter=<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.

@mdperez86 mdperez86 added Enhancement The issue is a request for an enhancement. focus: product management labels Oct 21, 2022
@mdperez86 mdperez86 self-assigned this Oct 21, 2022
@github-actions github-actions bot added focus: react admin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Oct 21, 2022
@mdperez86 mdperez86 marked this pull request as ready for review October 21, 2022 19:12
@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2022

Test Results Summary

Commit SHA: 146d796

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests21100202130m 48s
E2E Tests186006019218m 4s

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.

joshuatf
joshuatf previously approved these changes Oct 24, 2022
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! Left one optional change, but pre-approving! ✅

label={ interpolateComponents( {
mixedString: __(
'Slug {{span}}(optional){{/span}}',
'Name {{span}}(required){{/span}}',
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if passing just an {{required/}} component would make this slightly easier on translators.

E.g.,

components: {
  optional: {
    <span className="woocommerce-add-new-shipping-class-modal__optional-input">{ __( '(required)', 'woocommerce' ) }</span>
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool!!! This is way better. Thanks and Done!!!

@mdperez86 mdperez86 force-pushed the enhancement/35191-improve-req-opt-labels branch from 026d0f8 to 794baad Compare October 25, 2022 13:25
@mdperez86 mdperez86 requested a review from joshuatf October 25, 2022 13:27
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.

Beautiful! Still testing well and LGTM 🚢

@mdperez86 mdperez86 merged commit 1bca35c into trunk Oct 25, 2022
@mdperez86 mdperez86 deleted the enhancement/35191-improve-req-opt-labels branch October 25, 2022 19:49
@github-actions github-actions bot added this to the 7.2.0 milestone Oct 25, 2022
@github-actions
Copy link
Contributor

Hi @mdperez86, 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

Enhancement The issue is a request for an enhancement. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Improve the communication around required and optional fields

3 participants