manager: sort groups and capabilities

This commit is contained in:
weishu
2023-10-24 10:39:25 +08:00
parent 64f849dc10
commit ec5d9e6368

View File

@@ -191,7 +191,9 @@ fun GroupsPanel(selected: List<Groups>, closeSelection: (selection: Set<Groups>)
var showDialog by remember { mutableStateOf(false) }
if (showDialog) {
val groups = Groups.values()
val groups = Groups.values().sortedWith(compareBy<Groups> {
it != Groups.ROOT
}.then(compareBy { it.name }))
val options = groups.map { value ->
ListOption(
titleText = value.display,
@@ -257,7 +259,7 @@ fun CapsPanel(
var showDialog by remember { mutableStateOf(false) }
if (showDialog) {
val caps = Capabilities.values()
val caps = Capabilities.values().sortedBy { it.name }
val options = caps.map { value ->
ListOption(
titleText = value.display,