-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add demo user #36
base: master
Are you sure you want to change the base?
Add demo user #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: '[email protected]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@example.com
, @example.org
are protected domain dedicated for this kind of usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 👍
src/js/utils.js
Outdated
@@ -80,13 +80,12 @@ export function isPatientValid(patient) { | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.