-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Implement multiple
option for select field.
#3426
Comments
Hey @Paul-Bob. Could this be assigned to me. I presume this is the newly opened issue you had referenced earlier on. |
Yes @zhephyn sure! Thank you! Let me know how it goes and if you need any assistance! |
Hei @zhephyn I just added a loom on the description, hope it helps |
Hey @Paul-Bob. Thanks for the added context. I've been working on the issue so far, and I think I'll have a PR ready shortly. |
Hey @Paul-Bob. I've successfully made the required changes on the back end, however on testing out the feature, I get an "un permitted params" error. Which is most definitely because the stage field has not been updated to accept an array of values instead of a single value as part of the create action. I checked the projects controller and it turns out the code for specifying the params is not here. Also, given that the controller had no code, it seemed non reasonable to make the changes here. Could you direct me about where this controller functionality exists in the code base. Specifically where I can make the change to allow the stage params to accept an array instead of a single value. Thanks in advance |
I've been following Avo pretty closely for some time now and have been using it extensively in my day job. I want to thank you both, @adrianthedev, and the rest of the community for the work you're doing here. Anyway, to answer your question @zhephyn, I think you'd want to override the I hope this helps! |
Amazing news @zhephyn!
You took the right path and you're right, the projects controller is generated for the specific project model so it's not reasonable to make the changes there.
As @ObiWanKeoni mentioned, we need to override the |
Hi @ObiWanKeoni, thank you for the feedback, we truly appreciate it!
Also thank you for your contribution! Great guidance here =) |
Hey @Paul-Bob and @ObiWanKeoni. Thanks for the guidance. Let me get on it ASAP. |
Hey @Paul-Bob. Finally got the feature working. I realized though that I ought to write tests for the feature before submitting the PR. Could you please guide me on how to approach this? Are we testing that the feature works for both new and edit project forms? Or it's just for one of them? Thanks in advance |
Hi @zhephyn, amazing!
Sure, we have some tests for the select field, I'll include the path here. Let me know if you can inspire yourself from those or you need a more detailed approach.
When
Anytime, thank you! |
Hey @Paul-Bob . After banging my head against the wall trying to figure this out, i thought it would be better to seek out your guidance. The approach i had used, while it had worked had involved me deleting the enum declaration in the project model, which now coming to think of it, might not be the best approach for solving this. Is there a way i could make this work while at the same type keeping the enum declaration in the project.rb model file, because as much as my stage column has been modified to accept array values as per the schema.rb, i keep on running into the same "Argument error " when i submit the create form. Stating that "["idea", "drafting", "discovery"] is not a valid stage name. |
Hello @zhephyn. Thanks for reaching out. Let's keep the current Project configuration and add another column, for example add The current |
Hey @Paul-Bob. Yeah most of the tests I looked into were linked to the stage column, so any changes applied to it would certainly require modifications to those test cases. Anyway, about the new column, should I add a provision for it in the UI too, such that the user can select the options from there when creating the project as part of the form? Thanks again for the feedback 🙏 |
Yes something like |
Hey @Paul-Bob. Is the approach for testing this implementation the same as that for the projects? Should the tests be only for the select_field_spec.rb file? |
Yes, since we're still testing the select field, it makes sense to keep the tests for multiple option on the same file |
This issue has been marked as stale because there was no activity for the past 15 days. |
Hey @Paul-Bob . Hope all is well on your end. I've submitted a PR for this issue. I would appreciate it if you looked at it. |
Thank you, happy new year! Let's continue the discussion on the PR |
Feature
Right now the select field do not allow multiple selections. Let's add the
multiple
option for the select field which will enable the multiple-select mode.Approach
https://www.loom.com/share/7cdb77e591de4c27bb6115afab147b7f?sid=0748b730-efc4-45ad-b08e-8c5ad71a4dbc
multiple
option on the select field that defaults tofalse
field.multiple
option to the form helper on the view componentsmultiple
option including the version since its availablehttps://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple
The text was updated successfully, but these errors were encountered: