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

[COT] Implement order bulk actions #33687

Merged
merged 7 commits into from Jul 4, 2022

Conversation

jorgeatorres
Copy link
Member

@jorgeatorres jorgeatorres commented Jun 30, 2022

Changes proposed in this Pull Request:

This PR implements order bulk actions for the new implementation of the orders list table for COT (#32864).

  • The PR introduces class Internal\Admin\Orders\PageController to handle registration of the "Orders" menu item and initialization of all things associated to it. For example, it takes care of figuring out which order screen to display, which might be useful for Render order edit page  #33638 (which implements the "edit order" screen and logic).
  • Bulk actions are implemented inside the list table directly, in line with the current CPT implementation, but similar to other TODO's in this file, we might want to move it outside of the table implementation (maybe an "OrderPage" class that the "PageController" manages?).
  • Row-level actions (i.e. not bulk actions) do not require changes to the codebase, as those are handled by an AJAX handler that is datastore & list table implementation agnostic.

Closes #33198.

How to test the changes in this Pull Request:

As there's nothing COT datastore specific in this PR, it should be possible to test by "tricking" the code as described in #

  1. Get the new list table showing.
    • As there's nothing COT datastore specific in this PR, it should be possible to do this by tricking WC into displaying the new table as described in Admin list table [COT] #32864:

      I temporarily tweaked this line of code by adding true || to the start of the condition, to make the new admin list table render anyway.

    • For the full COT-datastore experience, make sure to enable the feature and migrate some orders over to the new tables. Set COT as authoritative and use a snippet like this one to "mock" a query() method implementation.

  2. Use either the top or bottom bulk actions drop-down to apply different statuses to your orders.
  3. Make sure the actions work correctly, including the redirect and admin notices:
    Screen Shot 2022-06-30 at 17 08 00

@jorgeatorres jorgeatorres added the focus: custom order tables / HPOS Issues related to High-Performance Order Storage (HPOS) née Custom Order Tables. label Jun 30, 2022
@github-actions github-actions bot added focus: react admin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Jun 30, 2022
@jorgeatorres jorgeatorres requested review from a team and barryhughes and removed request for a team June 30, 2022 20:10
@botwoo
Copy link
Collaborator

botwoo commented Jun 30, 2022

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

Latest commit referenced in the reports: Add changelog e5c19a0
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
Member

@barryhughes barryhughes 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 great. I added some notes but mostly minor/optional stuff: works really well, thanks!

@barryhughes barryhughes merged commit bddb662 into trunk Jul 4, 2022
@barryhughes barryhughes deleted the add/33198-cot-admin-list-table-actions branch July 4, 2022 23:57
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

Hi @barryhughes, 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
focus: custom order tables / HPOS Issues related to High-Performance Order Storage (HPOS) née Custom Order Tables. plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[COT] Admin List > Implement Actions
3 participants