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 custom order fields drop-down to custom fields metabox under HPOS #44739

Merged
merged 15 commits into from Feb 29, 2024

Conversation

jorgeatorres
Copy link
Member

@jorgeatorres jorgeatorres commented Feb 17, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR brings to HPOS the dropdown of custom fields that is available for regular posts in the WP admin edit screen.
This dropdown lists a selection of non-private meta keys from all other orders allowing easy re-use.

Screenshot 2024-02-23 at 11 04 39 Screenshot 2024-02-23 at 11 04 45

Closes #44029.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Make sure HPOS is the selected order datastore in WC > Settings > Advanced > Features.
  2. Ideally, start with a 0 orders setup.
  3. Go to WC > Orders > Add order and confirm that no dropdown appears in the "Custom Fields" metabox and instead you see a regular input:
    Screenshot 2024-03-01 at 10 53 32
  4. Fill out the order fields and make sure to also add a few meta keys / values inside the "Custom Fields" metabox. Make sure to add at least a few that don't start with _ as those are considered private.
  5. Click "Create" to save the order.
  6. Confirm that the "Add New Custom Field" form inside the "Custom Fields" metabox has a drop-down listing meta keys from other orders.
  7. Test that you can add metadata to the order by choosing a meta key from the dropdown and specifying the value.
  8. Test that you can add metadata to the order by clicking "Enter new" and entering any meta key / value combination.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 17, 2024
Copy link
Contributor

github-actions bot commented Feb 17, 2024

Test Results Summary

Commit SHA: 1ca9389

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests2460010103478m 11s

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.

@jorgeatorres jorgeatorres marked this pull request as ready for review February 23, 2024 14:03
@jorgeatorres jorgeatorres requested review from a team and coreymckrill and removed request for a team February 23, 2024 15:35
Copy link
Contributor

Hi @coreymckrill,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Collaborator

@coreymckrill coreymckrill left a comment

Choose a reason for hiding this comment

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

👍 Tests all worked out fine. I left a few specific comments inline to discuss. I also noticed a discrepancy in where the "Add Custom Field" button lives between the CPT order screen and the HPOS order screen:

CPT
cpt

HPOS
hpos

This is also present in trunk, so it wasn't introduced by this PR, but this might be a good opportunity to include a fix if it's simple. (Also fine if you'd rather not address that here.)

@jorgeatorres
Copy link
Member Author

Hi @coreymckrill!

Thanks for the review 🙇‍♂️. I've addressed most of your feedback, including the UI discrepancy. Please let me know what you think.

Also, don't forget to rebuild so you get the CSS that fixes the form's looks.

Copy link
Collaborator

@coreymckrill coreymckrill 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! Thanks for adding the fix for the button location in the UI.

@coreymckrill coreymckrill merged commit 21efa92 into trunk Feb 29, 2024
35 checks passed
@coreymckrill coreymckrill deleted the fix/44029 branch February 29, 2024 01:00
@github-actions github-actions bot added this to the 8.8.0 milestone Feb 29, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 29, 2024
@alopezari alopezari added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Mar 1, 2024
Konamiman pushed a commit that referenced this pull request Mar 13, 2024
…#44739)

This PR brings to HPOS the dropdown of custom fields that is available for regular posts in the WP admin edit screen.
This dropdown lists a selection of non-private meta keys from all other orders allowing easy re-use.

Fixes #44029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom order fields drop-down not available under HPOS
4 participants