-
-
Notifications
You must be signed in to change notification settings - Fork 472
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
Make dropdown lists alphabetical order ( Part 1) #4663
base: main
Are you sure you want to change the base?
Make dropdown lists alphabetical order ( Part 1) #4663
Conversation
@@ -71,7 +71,6 @@ class User < ApplicationRecord | |||
validate :password_complexity | |||
|
|||
default_scope -> { kept } | |||
scope :alphabetized, -> { order(discarded_at: :desc, name: :asc) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't being used anywhere, so I opted to remove it and look to order user select fields on the instance vars defined in relevant controller files.
include_blank: "", | ||
collection: @items, | ||
prompt: "Choose an item", | ||
include_blank: false, # We've got a prompt, so no need for an include blank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -10,7 +10,8 @@ | |||
label: label, | |||
error: error, | |||
selected: storage_location_for_source(source.object), | |||
include_blank: true, | |||
include_blank: false, | |||
prompt: "Choose a storage location", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password_confirmation: 'password!' | ||
password_confirmation: 'password!', | ||
organization: user_data[:organization], # Any reason not to set this? | ||
name: user_data[:email].split('@').first # Any reason not to set this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a reason why we weren't ensuring that an organization and name were in place for users?
Resolves #4663
Description
NOTE: Part of a multi-part effort to convert all relevant dropdown lists throughout the app to lower-case alphabetical order
There's a need to ensure that dropdown lists are ordered alphabetically by their lowercase options. I opted to go for tweaking existing
alphabetized
scopes where possible, and where that wasn't possible I would sort the list of options in place usually at the site of the instance variable being instantiated in the relevant controller.Type of change
This isn't a bug fix in the strict definition, more like a tweak to existing functionality.
How Has This Been Tested?
Screenshots