From e47cec096022512861f762d120ccd8f0e3968a8a Mon Sep 17 00:00:00 2001 From: Chris Lowis Date: Wed, 11 Oct 2023 14:49:54 +0100 Subject: [PATCH] Improve usability of organisation select on batch_invitations/new This makes it easier to select the organisation for a batch of users by excluding closed organisations and sorting the remaining ones alphabetically. We did something similar in #2426 and #2417 - there's enough subtle differences in those two select boxes (indicating a current organisation and adding a "None" option respectively) that I haven't attempted to extract the duplication. I think the new scopes are self-explanatory enough that I'm happy to keep them inline in this view. --- app/views/batch_invitations/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/batch_invitations/new.html.erb b/app/views/batch_invitations/new.html.erb index 80224afd6..19fcab1f0 100644 --- a/app/views/batch_invitations/new.html.erb +++ b/app/views/batch_invitations/new.html.erb @@ -73,7 +73,7 @@ id: "batch_invitation_organisation_id", name: "batch_invitation[organisation_id]", label: "Organisation", - options: policy_scope(Organisation).map { |organisation| { text: organisation.name_with_abbreviation, value: organisation.id } } + options: policy_scope(Organisation).not_closed.order(:name).map { |organisation| { text: organisation.name_with_abbreviation, value: organisation.id } } } %> <% end %>