Conversation
vinyll
left a comment
There was a problem hiding this comment.
I was guessing that the purpose was to pre-fill the form for the demo user to get straight to the main interface.
However it doesn't happen on my localhost with the current branch and the form is still empty.
How can I experiment the proposal?
|
|
||
| function onDemoMode() { | ||
| saveAuthenticatedUser({ | ||
| email: 'john.doe@email.com', |
There was a problem hiding this comment.
@example.com, @example.org are protected domain dedicated for this kind of usage
src/js/utils.js
Outdated
|
|
||
| function isEmailValid(email) { | ||
| return email.match(/[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*/) | ||
| return email && email.match(/[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*/) |
There was a problem hiding this comment.
Why do you need to check the existance of email here before returning and why is the structure so difference than isIbanValid()?
I guess returning a boolean would make more sense as well
There was a problem hiding this comment.
At some point while testing, an error was popping in the console because the patient didn't have any email, so email was undefined and email.match was throwing an error. Even if, at the end, all patients have an email, I added this check to prevent any error.
You're right about IBAN. I think it is code evolution that led to this difference. It's now fixed and homogenized. For RCC validation too.
When clicking on "Essayer en mode démo" on the authentication panel, the panel should close itself and "Cabinet de John" should be displayed in the upper left corner. When clicking on it, the user panel should show up with all the informations pre-filled. Tell me if it won't, we can check it together |
9764c04 to
2209833
Compare
Add a demo user so demo are easier to run : you no longer have to fill in the whole form.