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

Use updateItem mutations #2017

Merged
merged 12 commits into from
Dec 12, 2019
Merged

Conversation

sirugh
Copy link
Contributor

@sirugh sirugh commented Dec 5, 2019

Description

Updates the cartOptions to use the updateCartItems mutation for simple products.
As there is no update mutation for configurable products we just remove then add the new configuration in place of a singular update call.
I also added some logic to disable the Update Cart button until either the quantity or the options have been touched.

Related Issue

Closes PWA-143.

Acceptance

Verification Stakeholders

Specification

Verification Steps

Simple product

  1. Add a simple product to the cart.
  2. Open the edit form. The update button should be disabled.
  3. Change the quantity. The update button should enable.
  4. Click the update button. The product should update in the cart.

Configurable product

  1. Add a configurable product to cart.
  2. Open the edit form. The update button should be disabled.
  3. Change the quantity. The update button should enable.
  4. Click the update button. The product should update in the cart.
  5. Open the edit form. The update button should be disabled.
  6. Change an option like color or size. The update button should enable.
  7. Click the update button. The product should update in the cart.

Screenshots / Screen Captures (if appropriate)

Checklist

  • I have updated the documentation accordingly, if necessary.
  • I have added tests to cover my changes, if necessary.

@sirugh sirugh added the version: Major This changeset includes incompatible API changes and its release necessitates a Major version bump. label Dec 5, 2019
@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Dec 5, 2019

Messages
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Associated JIRA tickets: PWA-143.

Generated by 🚫 dangerJS against 6eebf9d

…e products. Also disables update button until an option has changed.
@sirugh sirugh force-pushed the rugh/updateItemInCart-graphql branch from 4657762 to 2bedea9 Compare December 5, 2019 21:01
Copy link
Contributor

@tjwiebell tjwiebell left a comment

Choose a reason for hiding this comment

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

Looks good, just a question about preventing that double render on update.

tjwiebell
tjwiebell previously approved these changes Dec 12, 2019
Copy link
Contributor

@tjwiebell tjwiebell left a comment

Choose a reason for hiding this comment

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

Looks good with loading indicator fix, nice work!

Copy link
Contributor

@tjwiebell tjwiebell left a comment

Choose a reason for hiding this comment

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

Even better now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:peregrine pkg:venia-ui version: Major This changeset includes incompatible API changes and its release necessitates a Major version bump.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants