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

Added custom statuses in Order Filters #6390

Merged
merged 18 commits into from
Mar 15, 2022

Conversation

pmusolino
Copy link
Member

Closes #5498

Description

During the implementation of Order Filters, @jaclync suggested implementing also the support for custom statuses, that could be added to the website using an external plugin to WooCommerce. This is a functionality that was super requested by our users.
So, in this PR for Hack Week, I implemented a way to display all the statuses that we fetch in the Order List, including the custom statuses created from the web. So, from now, merchants will be able to filter orders also by one or more custom statuses.

Testing instructions

Case 1

  1. Make sure to have installed the Order Status Manager on your testing store.
  2. Create some custom statuses, and modify some orders with the new statuses.
  3. Pull this branch and run the app.
  4. Go on Order List.
  5. Open the Order Filters. Under the Order Status filter, you should be able to see the new custom statutes.
  6. Try to filter by one or more of these new filters. You should be able to see just the orders with those statuses.
  7. Re-launch the app. The old filters should be still selected.

Case 2

  1. After test case 1, close the app.
  2. Delete the remote filter from the app (that is still selected in the app).
  3. Re-launch the app.
  4. Go on orders. You should see that the local filters are reset and the order list is no more filtered.

Screenshots


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@pmusolino pmusolino added type: enhancement A request for an enhancement. feature: order list Related to the order list. labels Mar 8, 2022
@pmusolino pmusolino added this to the 8.8 milestone Mar 8, 2022
@peril-woocommerce
Copy link

peril-woocommerce bot commented Mar 8, 2022

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Mar 8, 2022

You can test the changes on this Pull Request by downloading it from AppCenter here with build number: pr6390-084d62d. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@jaclync jaclync self-assigned this Mar 9, 2022
Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

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

Case 1
7. Re-launch the app. The old filters should be still selected.

Somehow the order status filters are reset after relaunching the app or pulling to refresh 🤔 (Feel free to try the test store "fun testing")

simulator.mov

@pmusolino
Copy link
Member Author

Somehow the order status filters are reset after relaunching the app or pulling to refresh 🤔 (Feel free to try the test store "fun testing")

Thanks for discovering the issue! I fixed it here: 8d966cd Ready for another test 👍

@pmusolino pmusolino requested a review from jaclync March 10, 2022 14:05
Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @pmusolino! With test case 2, I ran into a different issue: when syncing the orders with the previously selected filter that was deleted in core, the API threw an error Invalid parameter(s): status most likely because we're passing the deleted status in the /orders request. The orders tab then got stuck on the error state with the top banner and the status filter is still on:

Maybe we want to also call resetFiltersIfAnyStatusFilterIsNoMoreExisting after syncing order statuses like after viewModel.syncOrderStatuses() completes? 🤔

Steps to repro:

  • Set an order to a custom status
  • On the orders tab, tap Filter
  • Tap "Order Status" and select the custom status in the first step and/or any other status
  • Close the app
  • Launch the app
  • Go to the orders tab --> an error top banner appeared, and the only way to get out of this state is to reset the filters

@pmusolino
Copy link
Member Author

Maybe we want to also call resetFiltersIfAnyStatusFilterIsNoMoreExisting after syncing order statuses like after viewModel.syncOrderStatuses() completes?

Discovered the bug. In reality two bugs: there was a missing onCompletion and I optimized the reset filters because the order of the cycle was wrong. 71523a5

Can you take another test now? Thanks for your patience Jaclyn 🙏

@pmusolino pmusolino requested a review from jaclync March 11, 2022 15:08
Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

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

Mostly a request on the assertionFailure call, otherwise LGTM! 🚢

some minor issues that aren't blocking:

  • In case 2, the top banner "We couldn't load your data" still appears and stays. It disappears after pulling down to refresh
  • Maybe we can use the name of the status from the API response? Since the Order Status Manager plugin allows renaming a core status while we localize the core statuses in the app, there might be a mismatch on the status name which might be confusing to merchants with custom naming:
core app
Screen Shot 2022-03-14 at 9 56 39 AM Simulator Screen Shot - iPhone 11 - 2022-03-14 at 09 53 53

@pmusolino
Copy link
Member Author

some minor issues that aren't blocking:
In case 2, the top banner "We couldn't load your data" still appears and stays. It disappears after pulling down to refresh
Maybe we can use the name of the status from the API response? Since the Order Status Manager plugin allows renaming a core status while we localize the core statuses in the app, there might be a mismatch on the status name which might be confusing to merchants with custom naming

TIL that is possible to rename the existing filters. I created a separate issue here #6433 👍

@pmusolino pmusolino merged commit 37de2ec into trunk Mar 15, 2022
@pmusolino pmusolino deleted the issue/5498-add-custom-statuses-in-order-filters branch March 15, 2022 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: order list Related to the order list. type: enhancement A request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order Filters: add custom statuses
3 participants