From b7502d13353d7fc7782e005158ba0146527e24ff Mon Sep 17 00:00:00 2001 From: Genisio Alcantara Date: Mon, 7 Nov 2022 13:50:21 -0300 Subject: [PATCH 1/4] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba05763d..f09bbcbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added +- Schema to the `checkout button`, this makes it possible to define via admin where the user will be directed after the click + ## [2.63.5] - 2022-07-28 ### Fixed From f1933a0b9a347b33af25f5c5807af9de1131198b Mon Sep 17 00:00:00 2001 From: Genisio Alcantara Date: Mon, 7 Nov 2022 13:51:09 -0300 Subject: [PATCH 2/4] Create store function componente global type --- react/typings/global.d.ts | 28 ++++++++++++++++++++++++++++ react/typings/global.ts | 20 -------------------- 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 react/typings/global.d.ts delete mode 100644 react/typings/global.ts diff --git a/react/typings/global.d.ts b/react/typings/global.d.ts new file mode 100644 index 00000000..78b1bbf1 --- /dev/null +++ b/react/typings/global.d.ts @@ -0,0 +1,28 @@ +import { FC } from 'react' + +declare global { + interface StoreFunctionComponent

extends FC

{ + schema?: object + } + + type QuantityDisplayType = 'always' | 'never' | 'not-empty' + + type MinicartTotalItemsType = + | 'total' + | 'distinct' + | 'totalAvailable' + | 'distinctAvailable' + + type SlideDirectionType = + | 'horizontal' + | 'vertical' + | 'rightToLeft' + | 'leftToRight' + + type MinicartVariationType = + | 'popup' + | 'drawer' + | 'link' + | 'popupWithLink' + | 'block' +} diff --git a/react/typings/global.ts b/react/typings/global.ts deleted file mode 100644 index 31ca3a4f..00000000 --- a/react/typings/global.ts +++ /dev/null @@ -1,20 +0,0 @@ -type QuantityDisplayType = 'always' | 'never' | 'not-empty' - -type MinicartTotalItemsType = - | 'total' - | 'distinct' - | 'totalAvailable' - | 'distinctAvailable' - -type SlideDirectionType = - | 'horizontal' - | 'vertical' - | 'rightToLeft' - | 'leftToRight' - -type MinicartVariationType = - | 'popup' - | 'drawer' - | 'link' - | 'popupWithLink' - | 'block' From ef5ac937a415463447d25bc37944a306977e874c Mon Sep 17 00:00:00 2001 From: Genisio Alcantara Date: Mon, 7 Nov 2022 13:51:47 -0300 Subject: [PATCH 3/4] Add checkout button schema --- react/CheckoutButton.tsx | 11 +++++++++-- store/interfaces.json | 12 +++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/react/CheckoutButton.tsx b/react/CheckoutButton.tsx index 49e581cb..f09b481e 100644 --- a/react/CheckoutButton.tsx +++ b/react/CheckoutButton.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react' +import React from 'react' import { FormattedMessage } from 'react-intl' import { Button } from 'vtex.styleguide' import { CssHandlesTypes, useCssHandles } from 'vtex.css-handles' @@ -13,7 +13,10 @@ interface Props { classes?: CssHandlesTypes.CustomClasses } -const CheckoutButton: FC = ({ finishShoppingButtonLink, classes }) => { +const CheckoutButton: StoreFunctionComponent = ({ + finishShoppingButtonLink, + classes, +}): JSX.Element => { const { url: checkoutUrl } = useCheckoutURL() const { handles } = useCssHandles(CSS_HANDLES, { classes }) const goToCheckout = useCheckout() @@ -32,4 +35,8 @@ const CheckoutButton: FC = ({ finishShoppingButtonLink, classes }) => { ) } +CheckoutButton.schema = { + title: 'store/finish-shopping-button-label', +} + export default CheckoutButton diff --git a/store/interfaces.json b/store/interfaces.json index 8ee2313c..eb84dfb2 100644 --- a/store/interfaces.json +++ b/store/interfaces.json @@ -22,7 +22,17 @@ "allowed": ["product-list"] }, "minicart-checkout-button": { - "component": "CheckoutButton" + "component": "CheckoutButton", + "content": { + "title": "store/finish-shopping-button-label", + "properties": { + "finishShoppingButtonLink": { + "type": "string", + "title": "admin/editor.minicart.linkButtonFinishShopping.title", + "default": "/checkout/#/cart" + } + } + } }, "minicart-summary": { "component": "Summary", From e92aa6c1bc833b5c27eeb526586e85b1f3d26797 Mon Sep 17 00:00:00 2001 From: "Filipe W. Lima" <381395+filipewl@users.noreply.github.com> Date: Thu, 22 Dec 2022 11:24:45 -0300 Subject: [PATCH 4/4] Attempt to trigger PR checks that were stuck w/ an empty commit `vtex-io/docs-outdated-select` and `vtexio/build` were stuck forever. Not sure this will work though.