Automattic / woocommerce-services

WooCommerce Services is a feature plugin that integrates hosted services into WooCommerce (3.0+), and currently includes automated tax rates and the ability to purchase and print USPS shipping labels.
GNU General Public License v2.0
107 stars 20 forks source link

We should only show 5 rates per package #1778

Open c-shultz opened 5 years ago

c-shultz commented 5 years ago

Follow-up to #1773 (see comment https://github.com/Automattic/woocommerce-services/pull/1773#issuecomment-548152025)

We should hide rates behind a "view more" link if there are more than 5 in the rates list for a given package. image (the above screenshot is only showing 4 rates, but if there were more, they should be hidden)

harriswong commented 5 years ago

We have 2 approaches for this and we should decide which one to go instead of testing/updating both PR:

1.

We create sub components and add "Show more" button to each package. This involves refactoring the function to React components, and created a new sub component to handle "packages shipping rates" which has local states to handle the show more event. Each component is responsible to do its own thing, more details in comment here: https://github.com/Automattic/woocommerce-services/pull/1781

2.

We create a "shipping rate with show more" component, but pass down the show more event to its child ShippingRates component. ShippingRates component will render show more using existing function. This also makes it easier to migrate to hooks if we upgrade to 16.8+. More info here: https://github.com/Automattic/woocommerce-services/pull/1782

cc @budzanowski

laurendavissmith commented 5 years ago

We need to make a judgement call here and get this thing closed out, @harriswong since you're the assignee go ahead and make that call and lets get it closed, we have to ship before the next roundtable

budzanowski commented 5 years ago

@laurendavissmith, @harriswong I say let's roll with #1781 as it was tested more. After the release, we will do the react bump and quickly revert to the easiest solution that will be available then.

harriswong commented 5 years ago

Sounds good. We can merge once https://github.com/Automattic/woocommerce-services/pull/1781 is approved.