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

Improve organisation select on role organisations page #2417

Merged
merged 4 commits into from
Oct 10, 2023

Conversation

chrislo
Copy link
Contributor

@chrislo chrislo commented Oct 10, 2023

Trello: https://trello.com/c/R9bKDyi5

The current "Your Organisation" dropdown on /account/role_organisation is hard to navigate. This PR improves things a bit by excluding closed organisations from the list and sorting the organisations alphabetically by name.

@chrislo chrislo force-pushed the improve-organisation-select-on-role-organisations-page branch from 3ef31be to 209611b Compare October 10, 2023 12:14
@chrislo chrislo marked this pull request as ready for review October 10, 2023 12:28
Copy link
Contributor

@floehopper floehopper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good to me, but I've added a bunch of subjective comments. I'm happy to leave you to decide whether/how to address them, so I'll mark this as approved.

One thing it might be worth changing is the "Sort organisation options alphabetically by name (with abbreviation)" commit subject line. From what I can tell the sorting is by name and not abbreviation. If that's correct, I found "(with abbreviation)" bit of the commit title confusing!

app/helpers/role_organisations_helper.rb Outdated Show resolved Hide resolved
test/helpers/role_organisations_helper_test.rb Outdated Show resolved Hide resolved
test/helpers/role_organisations_helper_test.rb Outdated Show resolved Hide resolved
@chrislo
Copy link
Contributor Author

chrislo commented Oct 10, 2023

I'm going to rebase the fixup comments and make the change @floehopper suggested to the commit title.

We want to improve these options by sorting alphabetically and
excluding closed organisations. First let's extract a helper method
and add some tests for the existing behaviour.
This hopefully makes it easier for users to find the organisation they
are looking for in the (long) list of options.
We don't want to assign users to closed organisations so it doesn't
make sense to include them in the select list.
@chrislo chrislo force-pushed the improve-organisation-select-on-role-organisations-page branch from 44bba6a to 924e00c Compare October 10, 2023 16:35
@chrislo chrislo merged commit 42b2e27 into main Oct 10, 2023
6 checks passed
@chrislo chrislo deleted the improve-organisation-select-on-role-organisations-page branch October 10, 2023 16:54
chrislo added a commit that referenced this pull request Oct 11, 2023
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.
chrislo added a commit that referenced this pull request Oct 11, 2023
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.
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