Fix: Sidebar group should toggle open/close on click (#5263)#5267
Fix: Sidebar group should toggle open/close on click (#5263)#5267Harshit-0413 wants to merge 6 commits intocodecentric:masterfrom
Conversation
| </ul> | ||
| </li> | ||
|
|
||
| <template v-if="customLinksFromMetadata?.length > 0"> |
There was a problem hiding this comment.
Hi @cdprete, that deletion was accidental. I've reverted it in the latest commit , the customLinksFromMetadata template block is restored. Sorry for the noise!
There was a problem hiding this comment.
No worries.
I just wanted to prevent an accidental dropping of the feature.
cdprete
left a comment
There was a problem hiding this comment.
To my understanding, too many things have been changed/removed which are unrelated to the bug itself.
Moreover, if I'm right about https://github.com/codecentric/spring-boot-admin/pull/5267/changes#r3095328671, @SteKoe already knows I would open a regression bug if that feature disappears with no real reason ;)
e99ba38 to
f934555
Compare
| <!-- Le subnav --> | ||
| <ul | ||
| v-if="hasMultipleViews(group) && isActiveGroup(group)" | ||
| v-if="hasMultipleViews(group) && (openGroup === group.id || isActiveGroup(group))" |
There was a problem hiding this comment.
Probably openGroup === group.id could potentially be moved inside isActiveGroup as well.
Also, I think, the condition should a && and not a ||.
To my understanding of your changes, when a group gets closed then you set the openGroup to null.
The above condition, unless I'm missing something, would still evaluate to true because isActiveGroup(group) would still return true as before.
There was a problem hiding this comment.
Moved the toggle logic into a separate isGroupOpen function to keep isActiveGroup clean and unchanged. The subnav now uses isGroupOpen for visibility. Thanks for the review!
There was a problem hiding this comment.
Is it pushed?
I see no changes with the previous review.
|
Please rebase your branch correctly as it contains backend changes that are not related to frontend (obviously). |
Yeah, I wanted to suggest the same, but then I saw there were merge commits added by you and @ulischulte, so I was not sure anymore who the culprit was. 😅 |
Problem
In the instance sidebar, once a group (e.g., "Web") is expanded, clicking it again does not collapse it.
Root Cause
The toggle logic did not correctly reset the open group state when the same group was clicked again.
Solution
Updated the toggle logic to properly toggle between open and closed states.
Notes