patternfly / react-topology

MIT License
8 stars 17 forks source link

feat(ControlBar): Add expand/collapse all buttons #203

Closed jeff-phillips-18 closed 1 month ago

jeff-phillips-18 commented 1 month ago

What

Closes #196

Description

Adds the ability for applications to show an expand all and collapse all button on the control bar. The application must handle the callback and call the new Graph method expandAll or collapseAll. If the application is using a pipeline layout with generate spacer nodes and edges, it must recreate the model and relayout the view.

An example of just how this is done can be found in: PipelineGroupsDemo.collapseAllCallback

Note that there are 2 new methods added to the Graph interface and an optional parameter leafOnly to the getAllChildren method on the Node interface. Any application that is current implementing these interfaces without extending the base implementation will need to adjust accordingly.

Type of change

Screen shots / Gifs for design review

image

jeff-phillips-18 commented 1 month ago

Demo app surge: https://expand-collapse-all.surge.sh/

patternfly-build commented 1 month ago

Preview: https://react-topology-pr-topology-203.surge.sh