Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

fix(Accordion): generate key for the Accordion.Content#305

Merged
mnajdova merged 3 commits intomasterfrom
bug/missing-key-in-accordion-content
Oct 3, 2018
Merged

fix(Accordion): generate key for the Accordion.Content#305
mnajdova merged 3 commits intomasterfrom
bug/missing-key-in-accordion-content

Conversation

@mnajdova
Copy link
Contributor

@mnajdova mnajdova commented Oct 3, 2018

Fix

This PR fixes #291

TODO

  • Conformance test
  • Update the CHANGELOG.md

There was a bug in the creation of the Content which prevented generation of keys, and a small bug where the complex content for the Accordion.Content was created. Those two are fixed now.

Important note

We support generation of keys, for the component that as content has some primitive value (string, number etc). If the content is something more complex (as in the last example of the docs), that the user is responsible for creating the key.

-fixed complex accordion content example to contain key and content
@codecov
Copy link

codecov bot commented Oct 3, 2018

Codecov Report

Merging #305 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #305   +/-   ##
=======================================
  Coverage   89.63%   89.63%           
=======================================
  Files          62       62           
  Lines        1167     1167           
  Branches      150      150           
=======================================
  Hits         1046     1046           
  Misses        119      119           
  Partials        2        2
Impacted Files Coverage Δ
src/components/Accordion/Accordion.tsx 65.3% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 712c72e...cdc81b8. Read the comment docs.

@mnajdova mnajdova changed the title -fix(Accordion): generate key for the Accordion.Content fix(Accordion): generate key for the Accordion.Content Oct 3, 2018
@layershifter
Copy link
Member

@mnajdova may be the better idea will be to pick the AccordionPanel component for SUIR? PR #3032 contains the updated component that uses Fragment API (AccordionPanel.js).

This allow handle keys on panels:

const panels = [
 {
    key: 'what-is-dog',
    title: 'What is a dog?',
    content: 'A dog is a type of domesticated animal.',
  },
  {
    key: 'kinds-of-dogs',
    title: 'What kinds of dogs are there?',
    content: 'There are many breeds of dogs.',
  },
]

@mnajdova
Copy link
Contributor Author

mnajdova commented Oct 3, 2018

@layershifter thanks for the reference on the AccordionPanel. I would not make that big changes at this moment, as the only issue we hit so far was the generation of the content's key which if fix with this PR. We can however consider refactoring this in the future, but I see having more things that should be considered, as supporting the as property, which would adding additional wrapper that the user doesn't really need. Will keep in mind this, if this component shows some other issues in the future.

@alinais
Copy link
Contributor

alinais commented Oct 3, 2018

@mnajdova @layershifter please create an RFC for further discussion around Accordion panels.

CHANGELOG.md Outdated

### Fixes
- Fix Attachment `styles` prop typing @levithomason ([#299](https://github.com/stardust-ui/react/pull/299))
- Fix generation of key for the Accordion.Content @mnajdova ([#305](https://github.com/stardust-ui/react/pull/305))
Copy link
Contributor

Choose a reason for hiding this comment

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

Accordion.Content ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

meaning, that you can add the `

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, pushed :)

@mnajdova mnajdova merged commit d9e8eae into master Oct 3, 2018
@layershifter layershifter deleted the bug/missing-key-in-accordion-content branch November 9, 2018 09:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing key in AccordionContent

4 participants