From 07dbeb4194757cfcd3157fc43dfb7d53c44e3aa6 Mon Sep 17 00:00:00 2001 From: Gandharv Date: Fri, 30 Jul 2021 10:17:45 +0530 Subject: [PATCH 1/5] fix login button staying disabled (#267) When an error occurs the login button stays disabled, --- components/auth/LoginView.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/auth/LoginView.tsx b/components/auth/LoginView.tsx index 35ff98f66..5e513deb9 100644 --- a/components/auth/LoginView.tsx +++ b/components/auth/LoginView.tsx @@ -38,6 +38,7 @@ const LoginView: FC = () => { } catch ({ errors }) { setMessage(errors[0].message) setLoading(false) + setDisabled(false) } } From 34d0a0b97828345505887eed3c648b406a50fb0c Mon Sep 17 00:00:00 2001 From: thegoodcode Date: Fri, 30 Jul 2021 05:50:55 +0100 Subject: [PATCH 2/5] Fix login error messages (#283) --- framework/bigcommerce/auth/use-login.tsx | 2 +- framework/shopify/auth/use-login.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/bigcommerce/auth/use-login.tsx b/framework/bigcommerce/auth/use-login.tsx index 3ebacc9b7..d366b5260 100644 --- a/framework/bigcommerce/auth/use-login.tsx +++ b/framework/bigcommerce/auth/use-login.tsx @@ -16,7 +16,7 @@ export const handler: MutationHook = { if (!(email && password)) { throw new CommerceError({ message: - 'A first name, last name, email and password are required to login', + 'An email and password are required to login', }) } diff --git a/framework/shopify/auth/use-login.tsx b/framework/shopify/auth/use-login.tsx index d4369b7c2..e1de89c99 100644 --- a/framework/shopify/auth/use-login.tsx +++ b/framework/shopify/auth/use-login.tsx @@ -22,7 +22,7 @@ export const handler: MutationHook = { if (!(email && password)) { throw new CommerceError({ message: - 'A first name, last name, email and password are required to login', + 'An email and password are required to login', }) } From 44ce537b57c7a46386167f790a42b041499386ae Mon Sep 17 00:00:00 2001 From: Gandharv Date: Fri, 30 Jul 2021 10:27:02 +0530 Subject: [PATCH 3/5] remove spread operator from component (#263) * remove spread operator from component * Remove props destructuring Co-authored-by: Luis Alvarez --- components/product/ProductCard/ProductCard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index 39c19db00..95f2f3f07 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -7,6 +7,7 @@ import Image, { ImageProps } from 'next/image' import WishlistButton from '@components/wishlist/WishlistButton' import usePrice from '@framework/product/use-price' import ProductTag from '../ProductTag' + interface Props { className?: string product: Product @@ -23,7 +24,6 @@ const ProductCard: FC = ({ className, noNameTag = false, variant = 'default', - ...props }) => { const { price } = usePrice({ amount: product.price.value, @@ -38,7 +38,7 @@ const ProductCard: FC = ({ ) return ( - + {variant === 'slim' && ( <> From 1375d8817194b0bdd384a1a50ae8c88836839235 Mon Sep 17 00:00:00 2001 From: ikoruk Date: Sat, 31 Jul 2021 02:13:23 +0200 Subject: [PATCH 4/5] add default values to fix case where there are no values for product option (like text input) (#255) Co-authored-by: Luis Alvarez D --- framework/bigcommerce/lib/normalize.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/bigcommerce/lib/normalize.ts b/framework/bigcommerce/lib/normalize.ts index cd1c3ce5a..82a22de00 100644 --- a/framework/bigcommerce/lib/normalize.ts +++ b/framework/bigcommerce/lib/normalize.ts @@ -10,7 +10,7 @@ function normalizeProductOption(productOption: any) { const { node: { entityId, - values: { edges }, + values: { edges = [] } = {}, ...rest }, } = productOption From e8b577b83f4850d9f2ddae55a10b276e193ad171 Mon Sep 17 00:00:00 2001 From: ryanford <20901017+ryanford@users.noreply.github.com> Date: Mon, 2 Aug 2021 06:46:36 +0800 Subject: [PATCH 5/5] optionsSelections takes an array of options objs (#364) * optionsSelections takes an array of options objs * use options array to match API expectations Co-authored-by: Ryan Ford --- framework/bigcommerce/api/utils/parse-item.ts | 2 +- framework/bigcommerce/types/cart.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/bigcommerce/api/utils/parse-item.ts b/framework/bigcommerce/api/utils/parse-item.ts index 14c9ac53d..bb59a6ec4 100644 --- a/framework/bigcommerce/api/utils/parse-item.ts +++ b/framework/bigcommerce/api/utils/parse-item.ts @@ -10,7 +10,7 @@ type BCCartItemBody = { product_id: number variant_id: number quantity?: number - option_selections?: OptionSelections + option_selections?: OptionSelections[] } export const parseWishlistItem = ( diff --git a/framework/bigcommerce/types/cart.ts b/framework/bigcommerce/types/cart.ts index 83076ea09..33c01e4c6 100644 --- a/framework/bigcommerce/types/cart.ts +++ b/framework/bigcommerce/types/cart.ts @@ -40,7 +40,7 @@ export type OptionSelections = { export type CartItemBody = Core.CartItemBody & { productId: string // The product id is always required for BC - optionSelections?: OptionSelections + optionSelections?: OptionSelections[] } export type CartTypes = {