Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
172 stars 69 forks source link

Loan filter displays in advanced filters even when no loans are available #6621

Open dmallory42 opened 1 year ago

dmallory42 commented 1 year ago

Describe the bug

The advanced filters menu on the Transactions page has Loan as an option - which is related to the Stripe Loans feature. However, if the merchant has no loans, this filter will display with no options to select (normally, you'd expect a select box/dropdown) - and adding this filter has unusual behaviour, the Filter button cannot be clicked until another filter is added, and clicking the Filter button removes the Loan filter.

I think we should completely hide the Loan advanced filter if the user has no loans, to avoid confusion.

Screenshot 2023-06-29 at 10 35 57 Screenshot 2023-06-29 at 10 37 45

To Reproduce

  1. On a store with no loans (a fresh JN store, for example), go to Payments > Transactions
  2. Select Advanced Filters
  3. Click Add a Filter
  4. Select a filter, for example Date and set a date range.
  5. Select the Loan filter.
  6. You'll notice there are no options to select on the Loan filter.
  7. Click the Filter button.
  8. You'll notice Loan will disappear from the filters.

Expected behavior

I would expect Loan should only show as an option if there are loans to choose from on the store. Otherwise, it may cause confusion for users.

htdat commented 1 year ago

This issue impacts Transactions, so assigning to Pulsar (@kalessil as team lead) (based on team responsibilities Pc2DNy-3z-p2). Assigning as part of Gamma Triage process PcreKM-yM-p2.

kalessil commented 7 months ago

Passing the ball to @Automattic/helix here: it's loans related and @brucealdridge already added it to Helixs'board.