-
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
As a guest, I can register #23
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.
Early feedback
conf/webpack.common.js
Outdated
patterns: [ | ||
{ | ||
from: path.resolve(__dirname, "../assets/images"), | ||
to: path.resolve(__dirname, "../static/images"), |
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 is this needed?
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.
We need to set the static path for the assets/images
folder if we need to use it. But I want to put all static files in static
folder, then I go with this, is it okay?
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 am not sure of the motivation to move images to static/
🤔 Do you mean that once the build is completed, the compiled JS and CSS would go to /static
to you prefer to have images there too?
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.
No, before I couldn't use assets from the assets
folder, I have to set the static path to use it, then I went with putting all the static files in the same folder.
But I changed to use assets
folder in 45a4a02
ebbaaa1
to
111fb1e
Compare
a832eac
to
b30d6e7
Compare
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.
Some early feedback again
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.
Please add the minimum node version can be used in this project as I cannot use version 10 with this project.
controllers/registration.go
Outdated
c.Layout = "layouts/authentication.html" | ||
c.TplName = "registration/new.html" | ||
|
||
c.Data["Title"] = "Create a new account" |
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.
How about move the Create a new account
to const variable as I saw you use this more than one places and also the Layout
and TplName
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 moved them into a new function
forms/registration.go
Outdated
func (registrationForm *RegistrationForm) Valid(v *validation.Validation) { | ||
if registrationForm.Password != registrationForm.PasswordConfirmation { | ||
// Set error messages of Name by SetError and HasErrors will return true | ||
err := v.SetError("Password", "Password confirmation does not match") |
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.
How about this error message?
Password does not match password confirmation
It a little bit confuse what password confirmation does not match with.
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 changed. Actually, we can not say Password confirmation does not match the email
or something else, but to avoid your confusion, it should be changed
forms/registration.go
Outdated
|
||
success, err := valid.Valid(registrationForm) | ||
if err != nil { | ||
logs.Error("Validation error:", err) |
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.
Not sure if this what you expect. When I tried to register with passwords don't match, this printed out to the console
SetError error: Password confirmation does not match
Nothing about Validation error:
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.
This just logs the error when Valid()
doesn't work as expected, I don't know when it will raise that error, but the Valid()
function returns a success value and an error object, so we have to handle the error
views/shared/header.html
Outdated
<div class="navigation-menu"> | ||
<div class="navigation-menu__left"> | ||
<a class="navigation-menu__logo" href="/"> | ||
<img src="/static/images/logo.svg" alt="Go Scraper" /> |
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.
How about use background-image for this. You can find more information here. cc @olivierobert
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 changed to use the background-image
, will research about the SVG inline later
Solve #2
What happened 👀
Insight 📝
/register
routeBaseController
to add some common works that we re-use in several controllerscopy-webpack-plugin
to copy the static assets tostatic
folderProof Of Work 📹
Create successfully
Create failed