Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout options #319

Merged
merged 35 commits into from
Nov 19, 2018
Merged

Checkout options #319

merged 35 commits into from
Nov 19, 2018

Conversation

Serunde
Copy link
Contributor

@Serunde Serunde commented Oct 2, 2018

This PR is a:

[x] New feature
[ ] Enhancement/Optimization
[ ] Refactor
[ ] Bugfix
[ ] Test for existing code
[ ] Documentation

Summary

When this pull request is merged, it will enable rudimentary remove, edit, and 'add to favorites' actions to Venia items inside the shopping cart. This PR also includes the relevant Storybook configuration required for running its UI tests.

Addresses #265

cartoptionsdemo

Additional information

New components:

  • Kebab
  • Section

These changes contain a workaround for a discovered issue where the last item removed from a guest cart puts the cart in an invalid state, and the next item added to this empty cart has a price of zero. Now, when the last item is removed, the cart is reset.

REST/GraphQL support for the 'add to favorites' feature is currently insufficient.

@coveralls
Copy link

coveralls commented Oct 2, 2018

Coverage Status

Coverage increased (+1.5%) to 17.555% when pulling dc43f99 on bargreenellingson:checkout-options into 1541400 on magento-research:release/2.0.

@PWAStudioBot
Copy link
Contributor

Fails
🚫

The following file(s) did not pass ESLint. Execute npm run lint locally for more details

packages/venia-concept/src/components/MiniCart/__stories__/Kebab.js
packages/venia-concept/src/components/MiniCart/__stories__/ProductList.js

Generated by 🚫 dangerJS

`cartItemCount` defaults to 0 if `cart.details` is null or undefined
Test no longer uses inline snapshot for validation, and instead checks 
that a second request is made in response to a 404.
@zetlen
Copy link
Contributor

zetlen commented Oct 8, 2018

Hey @Serunde and @JStein92 and @pcvonz and the rest of the Bargreen folks, how does this relate to #260 ?

@Serunde
Copy link
Contributor Author

Serunde commented Oct 8, 2018

Do you mean in terms of dependencies, or just interactions between the two? As far as I'm aware, the changes involved were done in separate components. I also made these changes in a separate branch off of master, excluding all the changes from #260.
Although I believe some other changes were made to Checkout since we had submitted the PR on #260.

zetlen
zetlen previously approved these changes Oct 16, 2018
Copy link
Contributor

@zetlen zetlen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification. We're ready to merge this; please backmerge release/2.0 and resolve conflicts, and then we'll drop it in!

@zetlen
Copy link
Contributor

zetlen commented Oct 22, 2018

I was very excited about this PR, so I backmerged release/2.0 into it for you. I'm looking forward to getting this merged, but I do have one question for you.

Copy link
Contributor

@zetlen zetlen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick question about the CSS.

.active {
position: absolute;
transform: scale(1);
transition: all 0.25s cubic-bezier(0.5, 1.8, 0.9, 0.8);
Copy link
Contributor

@zetlen zetlen Oct 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice feeling transition. Maybe we should put it in a central place, so that other appear/disappear actions can have a similar feel.

Have you tested it on a low-powered device to make sure its framerate is ok?

Copy link
Contributor Author

@Serunde Serunde Oct 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as devices go, it's only been tested using the Chrome performance tab. With 6x CPU slowdown and some artificial performance overhead, I didn't notice any significant difference (in terms of animations). If you have a target device in mind and want to take a look, the checkout options branch is live at https://upward.bargreen.io

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zetlen Right now we're only using CSS custom properties when we want to store reusable values. Timing functions could certainly be stored as such, though.

@Serunde Consider limiting transition-property to the properties being transitioned, rather than using all. 😅

/* index.css */
html {
  --venia-anim-bounce: cubic-bezier(0.5, 1.8, 0.9, 0.8);
}

/* kebab.css */
.myElement {
  transition: transform 256ms var(--venia-anim-bounce);
}

@Serunde
Copy link
Contributor Author

Serunde commented Oct 22, 2018

My apologies for missing your earlier request to backmerge this PR!

@zetlen
Copy link
Contributor

zetlen commented Oct 23, 2018

@jimbo Since there are UI innovations in this PR and you are back, I think it should get your review before we merge! But it's ready.

.active {
position: absolute;
transform: scale(1);
transition: all 0.25s cubic-bezier(0.5, 1.8, 0.9, 0.8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zetlen Right now we're only using CSS custom properties when we want to store reusable values. Timing functions could certainly be stored as such, though.

@Serunde Consider limiting transition-property to the properties being transitioned, rather than using all. 😅

/* index.css */
html {
  --venia-anim-bounce: cubic-bezier(0.5, 1.8, 0.9, 0.8);
}

/* kebab.css */
.myElement {
  transition: transform 256ms var(--venia-anim-bounce);
}

packages/venia-concept/src/components/MiniCart/kebab.js Outdated Show resolved Hide resolved
packages/venia-concept/src/reducers/cart.js Show resolved Hide resolved
packages/venia-concept/src/components/MiniCart/section.css Outdated Show resolved Hide resolved
@Serunde
Copy link
Contributor Author

Serunde commented Nov 9, 2018

@jimbo New changes added to address your review, let me know if you have any other feedback!

Copy link
Contributor

@jimbo jimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Serunde Thanks for addressing all my feedback! Just a couple small items left. 👍

packages/venia-concept/src/components/MiniCart/section.css Outdated Show resolved Hide resolved
packages/venia-concept/src/components/MiniCart/kebab.css Outdated Show resolved Hide resolved
jimbo
jimbo previously approved these changes Nov 12, 2018
@jimbo
Copy link
Contributor

jimbo commented Nov 12, 2018

@Serunde Looks good now! Thanks for making changes. We just need to resolve conflicts and this will be set for merge.

Copy link
Contributor

@jimbo jimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually merged with work from #505. This is ready. 👍

@jimbo jimbo merged commit 7a4cbf3 into magento:release/2.0 Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants