-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
Maybe we should look at vee-validate. It has error messages for each validation rule. Creating rules are simple, just in component/input. I'm using it in my projects |
okey .. do you also suggest using Vuetify? I feel its a little tiny bit annoying defining forms in bootstrap 4. have you tried Vuetify? |
Yes, I'm using vuetify, it has very friendy api for all components. But sometimes we writes some hacks, to handle our needs |
I can try to use Vuetify and Vee-Validate, but lets keep our sanity and try to avoid the most hacks :) |
We are hacking it by creating new components, using original with some addons ;) No any hack of original source |
👍 in practice, the tests i have made, should pass after i make the switch. Tests cannot be underestimated! 💃 |
oh and btw.. we have a global store.. but i am not using a global store for creating stuff. I really hate redux and how almost everyone uses it for everything without even thinking . so .. axios in a method on the component .. is a pragmatic and conscious choice by me ;) |
My God that is a lot of extra code just to validate in vuetify. Are you sure you want to maintain all this vee provider stuff? yikes. I am going to make a version with just vuetify and simple validations ... and then you can explain to me how we can refactor it together with vee-validate... |
Nope. giving up for now. This was too difficult. There is no web app without tests, and therefore no vuetify until i have resolved how to test a component using vuetify. |
you know what, what I really liked about Vue is the fact that you are allowed to mock up and express a html gui fairly quickly. I have worked with angular, and I know too well how far it can go with custom directives. I feel its a bit problematic that we introduce providers and observers and custom directives ONLY to validate a form, I mean .. come on :) Bootstrap html markup is pretty standard stuff. Its easy to understand and easy to use. Especially with Bootstrap 4. Trying to make something inherently simple, overly complex by adding a material ui library like vuetify, will only lead to problems. What I am saying is that if you really want to create an awesome app, don't try to pull in library after library that seem to be popular. Think about what you want to make and how easy it will be to extend and modify. And think tests! I would suggest that we go for bootstrap 4 integration in vue and vuelidate, for now, and then you can give me a working example of something else, like for example rewriting this view, or creating another one. Problem is of course, having two ui frameworks compete won't work, so you will have to remove the import statements for bootstrap css. |
Providing custom directives, are normal for vue. All things can be passed by props. For me, dirty are this code Writing 6 or more additional lines, to show errors, which would be the same in whole project And components are simple wrappers, sometimes changing tags only:
three tags, for one thing. Maybe we can look at other css frameworks, like lightweight Bulma |
If we are going to do use vuetify we need tests anyhow. I will make one more try at it. But If i dont manage to port it vuetify and get the tests to pass. You would need to step in and show me how its done :) |
Oh and btw. The point about |
|
Currently in my project, I'm using other test suite, based on Selenium and all test are written in php. Testing in this way, are so hard and I understand you. I'm throwing suggestions. Yesterday I prepared my PC to maintain freeacs, I'm bought new NVME disk, to install Linux as normal OS. Today I will try to write some code with other concepts... |
Oh my. I understand if you think its difficult if you are using php and selenium! The most low hanging and simple tests should be done in frontend project. Ok then. Ill try to continue on and elaborate on bootstrap-vue and you try other concept. Deal? |
Deal :D |
i have done my part. I changed it to using tags. I actually saved a couple of lines, because bootstrap vue components automatically adds divs and classes etc. In addition i used an example from bootstrap-vue here https://bootstrap-vue.js.org/docs/reference/validation/#vuelidate-example ... i didnt try the vee-validate version but i felt it didn't speak to me right now .. maybe ill try it tomorrow. |
I tried vee-validate together with bootstrap-vue but there is a bug |
@pingwiniasty I have tried to make the tests pass, but I am not able to assert the error message displayed in the form that I see when testing the app live. I would like to get this working. Right now I can only assert that no error is present on the form after submitting, or that an error is present. |
Can you take a look? I have merged in develop into this branch, so its up to date. and tests pass. But I would like to assert the error messages. |
Sure, give me some time :) |
I tested everything what I can. There must be some bug, when displaying errors in test case... Currently, you can use |
Ok :) I am overriding. Merging now. We can figure this out later. To cut to the case right away, i am not too much awed by VueJS yet. But we have met a middleground on typescript in Vue. So for me its like emyea. It works. |
Issue #3