Closed jorgemd24 closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 63.8%. Comparing base (
6a31818
) to head (c5e4dc3
). Report is 22 commits behind head on update/shippings-settings-phase-1.
Thanks @martynmjones for your helpful comments! I’ve addressed points 1 and 3.
Regards the second one:
Invalid fields aren't highlighted when attempting to save changes. If a merchant is shipping to a number of countries and has different settings for each then it would be quite difficult to spot where the issue is.
I agree that it's not easy to see which one is incorrect, but this behaviour hasn't changed compared to the one in the develop
branch.
I believe the issue is that we're treating shipping_times
as a group of inputs rather than individual inputs, which makes it harder to display errors for each input separately. I'll create an issue for this since I think it goes beyond the scope of this PR.
Changes proposed in this Pull Request:
Part of https://github.com/woocommerce/google-listings-and-ads/pull/2594
Since we're now working with min and max shipping times, the "Edit" and "Add" modals need to be updated to use the stepper component when creating or editing shipping times. This PR introduces a new component,
MinMaxShippingTimes
, which includes steppers for both the minimum and maximum shipping times.The errors in the modals are displayed within the form instead of beneath the stepper component to prevent issues like this:
Screenshots:
Detailed test instructions:
Additional details:
In this commit 8652d24 I updated the
onBlur
function to align withonIncrement
. However, I'm unsure what's best—whether we should allow users to enter any value and display errors in the form, or restrict input to values within the allowed range, like preventing negative numbers. Any advice would be appreciated.Changelog entry