All dropdown lists should be in human alphabetical order
Summary
All dropdown lists should be in human alphabetical order
Why
prevention of confusion
Details
The usual machine-based alphabetical order separates lower case and upper case. This is problematic for surnames (ex la Rue, de la Croix, van der Welt), but also if the banks are inconsistent in their entry of item names and other bank-entered choices.
Throughout the system, make any alphabetic orders alphabetic by lower case.
(the size of this is about 60 things that need to be looked at)
Hint: do look at filter_select and form.select or field.select
Criteria for completion
- [ ] order is correct as described above
- [ ] automated tests to support this behaviour
Difficulty-Intermediate is due to size.
NOTE -- Totally fine for this to be more than one pull request. It is good to have easy-to-review and deployable changes. We don't have to do it all in one go.
Hello, I'd like to grab this issue. It would allow me to get something done while I get my bearings as a first time contributor to this app 🙂
Sounds good !
This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.
Automatically unassigned after 7 days of inactivity.
If this issue still needs to be addressed, I'd like to take a swing at it 👍🏽 @cielf
Please do!
This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.
Automatically unassigned after 7 days of inactivity.
Hi @cielf I'd like to give it a try if it still need to be addressed.
Please do!
I noticed that sorting is implemented in different places—some in the model, some in the controller, and some in the views. What would be the preferred approach? Should I follow the existing pattern (keeping sorting in the same place but adding the lowercase rule), or would you prefer to standardize everything in one place (model/controller/views)? Here I put some example, some using this method scope :alphabetized, -> { order(:name) } in model, some use this in views
<%= f.input :source,
collection: Donation::SOURCES.values,
selected: donation_form.source,
include_blank: true,
label: "Source",
error: "What effort or initiative did this donation come from?",
wrapper: :input_group %>
as for the views, I was planning to add sorting after choosing the values (in views), and somehow it works, but there might be a preferred way to handle it, so wdyt? Should I follow the existing pattern (keeping sorting in the same place but adding the lowercase rule), or would you prefer to standardize everything in one place (model/controller/views)? Thankyou
@dorner Can you weigh in on this? Thanks!
Ideally all sorting should happen in the model.
Ok, let me try to arrange all sorting on model.
Hi,
I've been working on implementing alphabetical ordering and found that many changes were needed. Regarding sorting, some of it is handled in the model and some in the controller. Based on previous guidance, it’s best to perform sorting in the model, but in some cases, sorting still needs to be done in the controller due to dependencies. As for testing, I wrote RSpec tests in the model for sorting that happens there, and for sorting in the controller, I added system tests (view specs). My question is: should I also write system tests for the sorting that's already covered in the model, or is that unnecessary? or how should it done generally?
Also, when I create the PR, should I separate commits by controller/model changes, or should I merge them into one commit?
Thanks!
Mostly we avoid system specs, preferring request specs, unless we can't test the behaviour that way.
I would merge them all in one commit.
This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.
Automatically unassigned after 7 days of inactivity.
Hi @cielf, if this issue is still unresolved, I could try to resolve it?
Hey @GiovannyCordeiro Please do.
Hi Cielf, I'm going to start this issue this week
Hi @cielf probablyI probably won't be able to do this issue. I ended up getting very busy with some University issues, I'll have to be away for a while unfortunately, as soon as I have more time I'll come back and collaborate more with the project!
Ok. I'll unassign you for now.
Actually -- this is a subset of #4948 - so I'm going to close this issue, leaving that one open.