oui
oui copied to clipboard
Add count prop to OuiTreeView #934
Description
Added count prop to display the number of children components in TreeView with an OuiFacetButton
Issues Resolved
Fixes #934
Check List
- [ ] New functionality includes testing.
- [ ] New functionality has been documented.
- [ ] All tests pass
- [ ]
yarn lint - [ ]
yarn test-unit
- [ ]
- [ ] Update CHANGELOG.md
- [ ] Commits are signed per the DCO using --signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Could you add a before and after screenshot for this change?
sure!
@keskami According to the issue description: "Count prop should reflect the number of OuiTreeNode children, and should be optional to include". It seems like you need to modify the props that sent into the OuiTreeView component. For example:
<OuiTreeView items={items} showCount={true} aria-label="Sample Folder Tree" />
Some suggestions:
- Add some unit tests for this new functionality
- (Maybe?) Add a toggle for the
Tree viewdemo to demonstrate that this is an optional feature