ash-project / ash_admin

A super-admin UI dashboard for Ash Framework applications, built with Phoenix LiveView.
https://hexdocs.pm/ash_admin
MIT License
106 stars 48 forks source link

feat: Sort resource_group_labels by given order #225

Closed aifrak closed 4 weeks ago

aifrak commented 4 weeks ago

Let's say, we have this in a domain:

admin do
  show? true
  resource_group_labels group_b: "Group B", group_a: "Group A", group_c: "Group C"
end

Currently, resource_group_labels shows labels in ascending alphabetical order and this will result to this in the domain dropdown:

This PR let resource_group_labels to strictly sort labels as given and this will be the result in the domain dropdown:

The reason is that when I tried ash_admin with ash_paper_trail, I tried to group all resources with Version in a group called Audit log which starts with an A. There is another group called Domain. As result, Audit log group is always at the top and I wanted to actually put this group under the Domain group.

Follow up to https://github.com/ash-project/ash_admin/pull/15

Contributor checklist

zachdaniel commented 4 weeks ago

🚀 Thank you for your contribution! 🚀