human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

All dropdown lists should be in human alphabetical order

Open cielf opened this issue 1 year ago • 22 comments

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

cielf avatar Aug 11 '24 15:08 cielf

Difficulty-Intermediate is due to size.

cielf avatar Aug 11 '24 15:08 cielf

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.

awwaiid avatar Aug 11 '24 15:08 awwaiid

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 🙂

ajistrying avatar Sep 20 '24 03:09 ajistrying

Sounds good !

cielf avatar Sep 20 '24 12:09 cielf

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.

github-actions[bot] avatar Oct 21 '24 00:10 github-actions[bot]

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Oct 28 '24 00:10 github-actions[bot]

If this issue still needs to be addressed, I'd like to take a swing at it 👍🏽 @cielf

Gabe-Torres avatar Dec 05 '24 21:12 Gabe-Torres

Please do!

cielf avatar Dec 05 '24 23:12 cielf

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.

github-actions[bot] avatar Jan 05 '25 00:01 github-actions[bot]

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Jan 12 '25 00:01 github-actions[bot]

Hi @cielf I'd like to give it a try if it still need to be addressed.

auliafaizahr avatar Jan 17 '25 12:01 auliafaizahr

Please do!

cielf avatar Jan 17 '25 14:01 cielf

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

auliafaizahr avatar Feb 05 '25 15:02 auliafaizahr

@dorner Can you weigh in on this? Thanks!

cielf avatar Feb 05 '25 16:02 cielf

Ideally all sorting should happen in the model.

dorner avatar Feb 07 '25 19:02 dorner

Ok, let me try to arrange all sorting on model.

auliafaizahr avatar Feb 08 '25 11:02 auliafaizahr

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!

auliafaizahr avatar Feb 26 '25 17:02 auliafaizahr

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.

cielf avatar Feb 26 '25 18:02 cielf

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.

github-actions[bot] avatar Mar 29 '25 00:03 github-actions[bot]

Automatically unassigned after 7 days of inactivity.

github-actions[bot] avatar Apr 05 '25 00:04 github-actions[bot]

Hi @cielf, if this issue is still unresolved, I could try to resolve it?

GiovannyCordeiro avatar Jun 18 '25 15:06 GiovannyCordeiro

Hey @GiovannyCordeiro Please do.

cielf avatar Jun 18 '25 17:06 cielf

Hi Cielf, I'm going to start this issue this week

GiovannyCordeiro avatar Jun 30 '25 13:06 GiovannyCordeiro

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!

GiovannyCordeiro avatar Jul 18 '25 13:07 GiovannyCordeiro

Ok. I'll unassign you for now.

cielf avatar Jul 18 '25 23:07 cielf

Actually -- this is a subset of #4948 - so I'm going to close this issue, leaving that one open.

cielf avatar Jul 19 '25 00:07 cielf