-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve the UI for login #157
base: 131-forms-ui
Are you sure you want to change the base?
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.
Nice work Jonathan
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.
Can you also move the material-symbols.woff2
file into this fonts folder?
{% endfor %} | ||
</select> | ||
</div> | ||
<div class=""> |
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.
You don't like the bulma styling for dropdowns? I kinda like the font and coloring a bit better.
src/public/css/styles.css
Outdated
@@ -0,0 +1,96 @@ | |||
/* app colors */ | |||
/* font sizes */ |
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.
Is all this scss form somewhere? Did you write it by hand?
Did you attempt to achieve the look you're going for with bulma and need to use all this custom css?
From a maintenance perspective, it's a bit unfortuneate to go from like... 1 line of custom css to all this.
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.
- yes this is compiled from ./src/scss/styles.scss should we move this to a dist folder to eliminate confusion?
- Yes tried to do this with custom scss i fill like bulma makes the html look bloated
with this we compile only whats required (performance wink wink)
makes it look not clean :)
overall i think html looks cleaner with this approach
do you have strong opinions on bulma? i can try it again there lmk
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.
iwhen it comes to maintainability yes it can get complicated
but be trying to make it understandable and organized
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.
gonna try it in with bulma!
<input name="password" class="input" type="password" placeholder="password"> | ||
</div> | ||
{% if errors %} | ||
<div class="error center"> |
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.
Can we use hx-disable to disable all inputs and the login button to prevent multiple clicks?
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.
cant seem to get this to work sos
</p> | ||
{% endif %} | ||
<div class = ""> | ||
<button class=" login-btn"> |
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.
When I click login
, it sometimes takes like 4-5 seconds before I see an error.
When I retry the login, the error remains and there is no indication that anything is happen. I find this state a bit difficult - waiting, with an error visible, with no indication anything is happening.
Can we do something? Maybe hx-disable is enough (feedback above). Maybe we could do something with hx-indicator like in #142?
<div class="control"> | ||
<input name="password" class="input" type="password" placeholder="password"> | ||
</div> | ||
{% if errors %} |
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 think it'd be great if we actually showed login errors. Even if we have different messaging for credential problems vs "all other problems".
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.
it looks like this is out of scope for this PR as the server response rn is just a catch all
src/public/css/styles.css
Outdated
/* font sizes */ | ||
.theme, html, | ||
body { | ||
background-color: #323232; |
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.
Is it confusing to copy the look and feel of CHT? Or is that what we want to do here?
I'm concerned that user managers sometimes have to use the cht and sometimes they have to use this management tool; and if they look too similar this might be confusing for some of them.
Maybe we shouldn't match one prominent thing like the background color? I also think this color is difficult since we have text in the logos. You're using a white font on this background; but the logo for Kenya has black font. We can't use a white font in the logo because it is also used on the other pages which have a white background.
src/public/css/styles.css
Outdated
font-size: 1em; | ||
cursor: pointer; | ||
text-decoration: none; | ||
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.5); } |
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.
Can we have the login button on the same elevation as the card it's on? Dropping a shadow from the login button makes it look a level higher than the other elements on the card.
<span>Login Failed. Please Try Again</span> | ||
</div> | ||
|
||
<div id="spinner" class="spinner"></div> |
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.
Can we have this spinner show in the login button? I feel like that would be a better indicator of the operation's progress
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.
Take a look at https://v1.htmx.org/attributes/hx-indicator/ and how it's currently used eg in https://github.com/medic/cht-user-management/blob/main/src/liquid/place/bulk_create_form.html
<div id="spinner" class="spinner"></div> | ||
|
||
<div> | ||
<button class="login-btn" hx-disable>Login</button> |
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.
You should add this to the form https://htmx.org/attributes/hx-disabled-elt/
</div> | ||
</div> | ||
|
||
<div id="error-msg" class="error center"> | ||
<span>Login Failed. Please Try Again</span> |
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.
Can we show this below the login button?
src/public/css/styles.css
Outdated
background-color: #F8F8F8; | ||
font-family: Noto, sans-serif; } | ||
|
||
.btn, .login-btn { |
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.
If this is our new button style, can we target all buttons instead of the class btn
?
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 is a compiled file from the scss
src/routes/authentication.ts
Outdated
@@ -35,6 +35,8 @@ export default async function authentication(fastify: FastifyInstance) { | |||
try { | |||
chtSession = await ChtSession.create(authInfo, username, password); | |||
} catch (e: any) { | |||
// TODO: fine tune error codes to match response | |||
resp.status(400); |
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 are we setting the status code to 400 and not 401?
967d8b9
to
a9de676
Compare
@freddieptf this is ready for review |
@freddieptf requesting review here this is ready |
Description
This PR is 1/3 of #172 and #168
Fixes #131
Fixes #117
Changes