-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add options for select field. #2683
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
base: main
Are you sure you want to change the base?
Conversation
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.
I've read through this
|
There are some merge conflicts on the application.js and application.js.map files. I'm a bit new to |
|
We're going to try updating the builds in each commit/original PR to make things a bit easier, so they'll likely clash now. You can do something like: to get new versions and not worry about the conflicts. |
Introduced a 'selected' option in the Select field to specify a default value when no data is available. Updated the form partial to prioritize 'selected' over data and added related test cases to ensure correct behavior. Updated .gitignore and added .tool-versions for environment settings. Add max_items, selected, multiple and include_blank. Added functionality to select, updated simuluscontroller to listen to the added data attributes, Updated Trix editor
|
I rebased this to see if I could move it along, but it needs a bit more work.
|
|
Thanks for the rebase. I'll look into it when i find the time. Kinda working on my side project (Kamal 2, Rails 8) it does include administrate so i'll look into what i think needs love to reach the new rails standards :D. I do expect time to be limited as i'm awaiting the birth of my firstborn, which is bound to happen 1 or 2 months. |
|
No worries! And of course, completed expected. I was hoping to get the last bit over the line for you, but I'll leave you to it! |
most people won't use this.
Added functionality to select, updated simuluscontroller to listen to the added data attributes, Updated Trix editor
…ild:css Added functionality to select, updated simuluscontroller to listen to the added data attributes, Updated Trix editor
|
So i guess some of this does not work < 7. afaik this does not introduce breaking changes though. Am i right to state that:
Anything else? |
|
I think that's it! |
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.
Could you take a look at the test failures when you get a chance?
| /doc | ||
| *.gem | ||
| .aider.* | ||
| aider.conf.yml |
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.
What are these for?
| @@ -0,0 +1,3 @@ | |||
| class Admin::ProgrammingLanguagesController < Admin::ApplicationController | |||
|
|
|||
| end No newline at end of file | |||
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.
We should include a proper ending newline here, as is usual Unix convention.
| require 'rails_helper' | ||
|
|
||
| RSpec.describe ProgrammingLanguage, type: :model do | ||
| pending "add some examples to (or delete) #{__FILE__}" |
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.
We should make sure we're providing an example spec, if this is in the right place, otherwise not include the file.
|
I'm struggling to find time on this at the moment. My wife got hospitalized, this is still in the back of my mind but not at the top of my list at the moment. |
|
@Thrizian @nickcharlton For example, in a Number input, we might want to specify Once passed via What do you think? |
|
@Thrizian, I'm sorry to hear that! I hope she gets better soon. There's no need to rush, so please take your time. It might be worth pulling out some changes, like @goosys mentions. We can give it a bit of thought. Yesterday, you happened to get a lot of activity because I (finally) managed to spend much of the day working through my notifications and trying to move some things along, there's no urgency from me. |
|
I think we should organize a few things before resuming this PR. Among the options being added, I believe For As for |
|
We may need to consider a different name to distinguish it from the one used in forms. Additionally, in the future, there might be cases where multiple inputs are linked within a single Field form. In such cases, it may also be necessary to use a name that clearly indicates which input the options apply to. |
This PR is a followup of: #2676
I've had another go at this. Since i figured out how to get the application up and running locally, #rtfm. I'm pretty bad at writing tests so perhaps someone can help me with writing some better coverage. Is it sufficient to write a test that validates whether a data attribute is slapped onto the select input? Or do i also need to write tests that validate the working of my PR clientside(the stimulus controller) I have no experience testing stimuluscontrollers.
This should get us a nice start to get some more selectize functionality.
I've used the SelectController Stimulus Controller to handle this. We are using data attributes to get the message passed across.
This PR now adds:
Max items. Allows for selecting items up to max_items.
Multiple selecting multiple options.
Selected, allows for the selection of a specific element or multiple elements.
This also works with [[1, 2],[3,4],[5,6]]