Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Sort resource_group_labels by given order #225

Merged

Conversation

aifrak
Copy link
Contributor

@aifrak aifrak commented Nov 3, 2024

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:

  • Group A
  • Group B
  • Group C
  • (resources without group)

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

  • Group B
  • Group A
  • Group C
  • (resources without group)

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 #15

Contributor checklist

  • Bug fixes include regression tests
  • Features include unit/acceptance tests

@aifrak aifrak changed the title feat: resource_group_labels is sorted by given order feat: Sort resource_group_labels by given order Nov 3, 2024
@zachdaniel zachdaniel merged commit 75f8e5a into ash-project:main Nov 3, 2024
17 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

@aifrak aifrak deleted the aifrak/improve-order-resource-groups branch November 4, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants