oui icon indicating copy to clipboard operation
oui copied to clipboard

Add count prop to OuiTreeView #934

Open keskami opened this issue 1 year ago • 4 comments

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.

keskami avatar Nov 02 '23 18:11 keskami

Could you add a before and after screenshot for this change?

BSFishy avatar Nov 02 '23 18:11 BSFishy

sure! Screen Shot 2023-11-02 at 2 50 08 PM Screen Shot 2023-11-02 at 2 51 27 PM

keskami avatar Nov 02 '23 18:11 keskami

@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" />

willie-hung avatar Nov 03 '23 04:11 willie-hung

Some suggestions:

  1. Add some unit tests for this new functionality
  2. (Maybe?) Add a toggle for the Tree view demo to demonstrate that this is an optional feature Screenshot 2023-11-02 at 11 48 25 PM

willie-hung avatar Nov 03 '23 04:11 willie-hung