...
Task 2: Update the graphql after changes in the CMS repo
Update the package.json with the new version for the Intl-whitelabel-cms
Add the new interfaces in the
add-on-section.graphql
Path:
src/queries/sanity/fragments/add-on-section.graphql
Code Block language graphql fragment AddOnSectionFragment on AddOnSection { ... showSectionItemsOnCart sectionItemsServiceModes { pickUpServiceMode driveThruServiceMode curbsideServiceMode dineInServiceMode tableServiceMode } }
yarn run apollo:generate
Clear the generated file just with the needed changes
Update the Interface for the
use-feature-menu-add-on.tsx
Path:
src/hooks/use-feature-menu-add-on.tsx
Code Block language typescript export interface IAddOnSection { ..., showSectionItemsOnCart: boolean, sectionItemsServiceModes: { pickUpServiceMode: boolean, driveThruServiceMode: boolean, curbsideServiceMode: boolean, dineInServiceMode: boolean, tableServiceMode: boolean, } }
Some unit tests will break and we’ll need to adjust them
Task 3: Refactor UpsellItem comp to be a generic item for the cart
...
Change the
upsell-item.tsx
em rename all the references of the word "upsell" to be "cart"... Ex:cart-item.tsx
(instead ofupsell-item.tsx
)Move necessary styles to the new folder cart-item
Adjust the interface of the comp in a way that the param for the item is optional now
Remember: to adjust the logic that executes the addToCard to pass the item only if received
Motivation: This is necessary because for our new component, we’ll not need to pass the Remember to adjust the
data-testid
that already exists and the unit testsAdjust the
upsell.stories
to use the new cart-item thereGood to have: remove the use of
React.FC
from there and type in the right way
item
but we need to maintain this for the upsell logic....