Hello I'd like to bring into awareness a discussion that's going on in bookmarks PR [1]. This PR demonstrates how to do client side validations using new components for forms. E.g. this is how we define that the field is required and can't be too long [2]. We have similar validations defined in our model.
One concern I had is that we'll duplicate the definition, both in UI and our data model. I'd prefer to have UI validation rendered based on server definition. There are cases where the UI field is not related to the specific model attribute so we also need the option to explicitly define client validations. Similarly, strings that are normally rendered server side are now duplicated at [3]. That can end up in out of sync error messages for users using UI and API. Of course this can be refactored later, but if we start to hardcode too many things, the motivation for later refactoring will be lower. Also I'd like to have good form helpers from the beginning since changes to them will have impact on many plugins later. I'm definitely not going to block the PR on this. But I'd like to hear opinions of others, suggestions for improvements or any other feedback. [1] https://github.com/theforeman/foreman/pull/4807 [2] https://github.com/theforeman/foreman/pull/4807/ files#diff-6011fb23e8f8bacb536ab442e57b874cR48 [3] https://github.com/theforeman/foreman/pull/4807/ files#diff-6254f272d0e11d7caaacec9ece0c6669R6 Thanks -- Marek -- You received this message because you are subscribed to the Google Groups "foreman-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
