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

Keeps current Accordion sections open #2147

Merged
merged 5 commits into from
Feb 10, 2020

Conversation

supernova-at
Copy link
Contributor

Description

This PR fixes the problem where Accordion sections were "resetting" back to their initial state after mutations occurred in subsections (add a coupon, apply a gift card, etc.).

This was because the useEffect function that enforced the initial setting of which sections should be open or closed was firing whenever Accordion children changed, which includes the contents of the Accordion sections. And these sections children were often changing based on the results of a mutation. For example: a list of gift cards would appear once you apply a gift card.

This PR also sets the price adjustments accordion to have all sections closed initially.

Related Issue

Closes PWA-359.

Acceptance

Verification Stakeholders

Specification

Verification Steps

  1. Go to the /cart page
  2. Verify that the price adjustments accordion initially doesn't have any sections open
  3. Open the Coupon or GiftCard section
  4. Apply or remove a coupon or gift card
  5. See that the section remains open and that the Accordion doesn't reset back to no sections open.

Screenshots / Screen Captures (if appropriate)

Checklist

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

@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Feb 7, 2020

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-359.

Generated by 🚫 dangerJS against 2d3e33d

@supernova-at supernova-at added the version: Patch This changeset includes backwards compatible bug fixes. label Feb 7, 2020
@sirugh
Copy link
Contributor

sirugh commented Feb 7, 2020

This PR also sets the price adjustments accordion to have all sections closed initially.

@tjwiebell just told me that UX says to keep the shipping methods open initially.

@tjwiebell
Copy link
Contributor

This PR also sets the price adjustments accordion to have all sections closed initially.

@tjwiebell just told me that UX says to keep the shipping methods open initially.

Until this bug is merged; latest mocks have all sections collapsed on first render.

@supernova-at supernova-at added version: Patch This changeset includes backwards compatible bug fixes. and removed version: Patch This changeset includes backwards compatible bug fixes. labels Feb 7, 2020
revanth0212
revanth0212 previously approved these changes Feb 7, 2020
@m2-community-project m2-community-project bot moved this from Ready for Review to Reviewer Approved in Pull Request Progress Feb 7, 2020
schensley
schensley previously approved these changes Feb 7, 2020
Copy link

@schensley schensley left a comment

Choose a reason for hiding this comment

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

UX approved

@supernova-at
Copy link
Contributor Author

PR Updated:

  • Fixed merge conflicts

dpatil-magento
dpatil-magento previously approved these changes Feb 10, 2020
Copy link
Contributor

@dpatil-magento dpatil-magento left a comment

Choose a reason for hiding this comment

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

Approved latest commits.

@dpatil-magento dpatil-magento merged commit 61f6f22 into develop Feb 10, 2020
@dpatil-magento dpatil-magento deleted the supernova/359_accordion_open_sections branch February 10, 2020 18:47
@m2-community-project m2-community-project bot moved this from Reviewer Approved to Done in Pull Request Progress Feb 10, 2020
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: Patch This changeset includes backwards compatible bug fixes.
Development

Successfully merging this pull request may close these issues.

None yet

7 participants