https://avo.cool logo
In actions, are `required` fields truly require...
# avo-2
m
Thread automatically created by rickychilcott in #740893011994738751
s
I'd love it to be client-side required (i.e. not a round trip to the server), but that may not be possible for all field types.
l
yeah. big debate there too 🙂
whether to client-side or not
the perfect scenario to me would be if we had a library that can make those server-side validations into client-side validations
maybe formulus will do that at some point
then we'd have plug-and-play validations on the client side
the second best thing would be if you could add any type of attributes to the field from avo.
field :name, as: :text, field_attributes: { required: true, wtv: value }
we'd merge a PR for this if we had one
this way you can add wtv you'd like to those fields
maybe the
html
option can be improved somehow 🤷‍♂️
> In filters, are required fields truly required for anyone did you really mean the filters, or actions?
if it's actions, then no, no enforcement is made by Avo in required fields
it will just add the red asterix on the field label
you could try to enforce it on the action using conditionals and the
error
response alert
s
Oh Boy.. I mean actions.. yes.
l
all good! I figured
s
Is there a reason it's not enforced?
I'd be happy to enforce it in
handle
but it'd be nice to have
error_and_keep_open
. To not kill off the work that's already been done.
of course it could be
error "message here", keep_open: true
l
I know
s
🙂
I haven't dug in. Is it some js thing that's "closing" the modal?
l
the reason is that you can already enforce that in Rails using validations. I know that it doesn't cover actions
s
gotcha
l
I dont' know off the top of my head, but it could be a turbo action
redirect is by default, so that hides the modal as the HTML is overriden
s
Yeah, I wonder if it became a turbo stream response to close the modal. Would you rather these changes be in Avo 3 at this point? As I'm assuming Avo 2 goes into maintenance mode sometime soon.
We never got the bandwidth to upgrade to Avo 3 because of our rebrand and launch of Causey. I'm hoping to make that migration before the end of the year.
l
> I wonder if it became a turbo stream response to close the modal. I see that as something we coudl do. I'd love to rely more on turbo stream responses
> As I'm assuming Avo 2 goes into maintenance mode sometime soon. that is correct. starting with early 2024
we can help you with that. we did a few of these upgrades for customers
s
I'll keep that in mind. Let me see if it's going to be easy or hard for us - based on our plans and work required.
l
sure. let me know
l
Hi, I'm a bit late but I think this is what you're looking for 😄 https://docs.avohq.io/2.0/actions.html#keep_modal_open
l
never too late when you bring the goodies 😛
s
Wow. I'm blind.
l
nope. it's a lot of information there. we're hoping that the AI revolution will help with this