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

Gift Cards #2124

Merged
merged 60 commits into from
Feb 7, 2020
Merged

Gift Cards #2124

merged 60 commits into from
Feb 7, 2020

Conversation

supernova-at
Copy link
Contributor

@supernova-at supernova-at commented Jan 29, 2020

Description

This PR adds Gift Card support to the new Cart page.

Known issues out of scope:

  • The PriceAdjustments accordion resets back to the original set of sections that are open (isOpen={true}) after mutations occur.
  • Applying an invalid card spits an error to the console

Related Issue

Closes JIRA-78.

Acceptance

Verification Stakeholders

@schensley

Specification

Verification Steps

Since Gift Cards is an enterprise edition feature, first set your MAGENTO_BACKEND_EDITION to EE.

  1. yarn watch:all
  2. Go to the /cart page
  3. Check the balance of a valid card: 02Y0LCHUNDRZ .
  4. Attempt to check the balance of an invalid card: no_work.
  5. Apply a valid card: 02Y0LCHUNDRZ .
  6. Attempt to apply an invalid card: no_work.
  7. Remove a card.
  8. Simulate a remove card failure by applying a card, turning off your network, and clicking "remove". You should see an error message Toast appear.

Set your MAGENTO_BACKEND_EDITION back to CE (CE is also the default), and observe that the Cart page doesn't even show a Gift Card section in the Accordion.

Screenshots / Screen Captures (if appropriate)

Screen Shot 2020-01-29 at 11 19 54 AM

Checklist

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

jimbo
jimbo previously approved these changes Feb 5, 2020
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.

@supernova-at Great work. Looks much better to me. 👍

jimbo
jimbo previously approved these changes Feb 5, 2020
@dpatil-magento
Copy link
Contributor

@supernova-at https://pr-2124.pwa-venia.com/cart running on EE but dont see Gift Cards accordion. Also when run on local with CE, dont see any of the accordion.

@supernova-at
Copy link
Contributor Author

@supernova-at https://pr-2124.pwa-venia.com/cart running on EE but dont see Gift Cards accordion. Also when run on local with CE, dont see any of the accordion.

Resolved in-person. New MAGENTO_BACKEND_EDITION environment variable is needed.

@dpatil-magento
Copy link
Contributor

@supernova-at EE looks good but CE does not show any of the accordion (Shipping, Coupon, Gift options). Does this work for you?

@supernova-at
Copy link
Contributor Author

@supernova-at EE looks good but CE does not show any of the accordion (Shipping, Coupon, Gift options). Does this work for you?

It does:

Screen Shot 2020-02-07 at 8 09 38 AM

Do you have items in your cart? That's the only thing I can think of that hides the entire accordion.

Copy link
Contributor

@sirugh sirugh 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 changing the query to lazy. Aside from the CE vs EE issue that @dpatil-magento is seeing this looks good to me.

@supernova-at
Copy link
Contributor Author

Fixed the issue!

Check out commit 24b7fb5.

Verify:

  1. View the graphql network call to getCartDetails
  2. In CE, verify the GiftCardFragment and GiftCardSummaryFragment in the query:
fragment GiftCardFragment on Cart {
  id
  __typename
}
fragment GiftCardSummaryFragment on Cart {
  id
  __typename
}
  1. In EE, verify the GiftCardFragment and GiftCardSummaryFragment in the query:
fragment GiftCardFragment on Cart {
  applied_gift_cards {
    code
    __typename
  }
  id
  __typename
}
fragment GiftCardSummaryFragment on Cart {
  id
  applied_gift_cards {
    applied_balance {
      value
      currency
      __typename
    }
    __typename
  }
  __typename
}

Thanks @dpatil-magento @sirugh @tjwiebell !

Copy link
Contributor

@sirugh sirugh left a comment

Choose a reason for hiding this comment

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

Noice.

@tjwiebell tjwiebell merged commit 18fd612 into develop Feb 7, 2020
@dpatil-magento dpatil-magento deleted the supernova/78_gift_cards branch September 14, 2020 22:02
@sirugh sirugh mentioned this pull request Feb 11, 2021
6 tasks
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: Minor This changeset includes functionality added in a backwards compatible manner.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants