auraphp / Aura.Input

Tools to describe HTML form fields and values.
MIT License
65 stars 11 forks source link

Update Filter to support multiple rules per field #31

Closed rossey closed 11 years ago

rossey commented 11 years ago

Signed-off-by: Alex Ross alex@wearebase.com

harikt commented 11 years ago

Thank you for looking and implementing this, but it has been removed for #13 , #11 .

conclusion is Aura.Input is not the final filtering system.

rossey commented 11 years ago

Hi Harikt,

It's not clear from the documentation that you can only have one rule for one field. I would expect to add multiple rules to a field e.g. when checking an e-mail address is a) required, b) valid, c) not already in use?

Thanks!

pmjones commented 11 years ago

Hi @rossey --

We wanted to provide some level of filter functionality, but we want to stop way short of building in a full filtering system; a single closure seemed like a good compromise there. The idea is that you can have as much filtering logic in the "one rule" for that field as you like.

Your comment on the documentation is well-made; I'll update it to address the issues you raise here.

I hope that helps a little; I won't close this issue until I hear back from you.

Thanks for the report!

rossey commented 11 years ago

Hi @pmjones,

That is a fair point. I suppose the issue I was trying to solve was trying to return different error messages for the same input, do you know if that is possible?

Thanks :)

pmjones commented 11 years ago

I get that. No, not with the limited filter system that exists now. :-/

(As a side note, different errors for the same input might lead to user frustration as they correct one error but are presented with another, but that may not be pertinent here.)

rossey commented 11 years ago

That's fine. I suppose it's a small use case that I'm trying to implement and probably only valid when trying to filter an e-mail address that is a) required, b) valid, c) not already in use.

Yes I agree there is a UX issue with different errors for the same input!

Thanks for you time @pmjones and I really like the Aura components and framework :)

P.S. As your Filter is nicely decoupled from the Form I've extended the Filter to provide this functionality for our application.

pmjones commented 11 years ago

As your Filter is nicely decoupled from the Form I've extended the Filter to provide this functionality for our application.

Right on, man, that was exactly the intent. Glad you're finding it useful! :-)

harikt commented 11 years ago

@rossey I hope @pmjones addressed your issues.

Thank you using Aura. We are in the move to v2, and looking for feedbacks.

If you have something to specifically say using the v1 components have a shout at @pmjones . This is the right time https://groups.google.com/d/msg/auraphp/btIVi6Rxkhk/HJu3aS-ElEQJ