genouest / genouestaccountmanager

Account manager for core facility
GNU Affero General Public License v3.0
5 stars 8 forks source link

Always select newly created groups #480

Closed rsiminel closed 3 months ago

rsiminel commented 3 months ago

@mboudet closes #444

The visible manifestation of the problem was that immediately after group creation using the shortcut button on the user page, the drop-down selector would display the first group in the list, despite everything being correct internally.

All that was needed was to use [ngValue] instead of [value] to bind the group names in the <option> elements of the selector. Indeed, according to the Angular documentation, the ngValue directive "is mainly used on [...] option elements, so that when the element is selected, the ngModel of that element (or its select parent element) is set to the bound value."

This has been by far the most time I've ever spent to fix a bug by changing just three characters.

mboudet commented 3 months ago

@rsiminel Please add to the changelog and I'll merge

mboudet commented 3 months ago

Thanks for the cleanup!