Skip to content
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

Open
wants to merge 9 commits into
base: 131-forms-ui
Choose a base branch
from
Open

Conversation

jonathanbataire
Copy link

@jonathanbataire jonathanbataire commented Apr 25, 2024

Description

This PR is 1/3 of #172 and #168
Fixes #131
Fixes #117

Changes

  • dropped "tool" in the system name so "CHT User Management"
  • rename "sign in" to "login"

Copy link
Member

@kennsippell kennsippell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Jonathan

Copy link
Member

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?

src/liquid/app/view.html Outdated Show resolved Hide resolved
src/liquid/auth/authentication_form.html Outdated Show resolved Hide resolved
{% endfor %}
</select>
</div>
<div class="">
Copy link
Member

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/liquid/auth/view.html Show resolved Hide resolved
@@ -0,0 +1,96 @@
/* app colors */
/* font sizes */
Copy link
Member

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.

Copy link
Author

@jonathanbataire jonathanbataire Apr 26, 2024

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

Copy link
Author

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

Copy link
Author

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!

src/liquid/auth/authentication_form.html Outdated Show resolved Hide resolved
src/liquid/auth/authentication_form.html Outdated Show resolved Hide resolved
<input name="password" class="input" type="password" placeholder="password">
</div>
{% if errors %}
<div class="error center">
Copy link
Member

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?

Copy link
Author

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">
Copy link
Member

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?

@kennsippell kennsippell changed the title 117 login UI Improve the UI for login Apr 26, 2024
<div class="control">
<input name="password" class="input" type="password" placeholder="password">
</div>
{% if errors %}
Copy link
Member

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".

Copy link
Author

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

/* font sizes */
.theme, html,
body {
background-color: #323232;
Copy link
Member

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.

font-size: 1em;
cursor: pointer;
text-decoration: none;
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.5); }
Copy link
Collaborator

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>
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<div id="spinner" class="spinner"></div>

<div>
<button class="login-btn" hx-disable>Login</button>
Copy link
Collaborator

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>
Copy link
Collaborator

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?

background-color: #F8F8F8;
font-family: Noto, sans-serif; }

.btn, .login-btn {
Copy link
Collaborator

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?

Copy link
Author

@jonathanbataire jonathanbataire Jun 6, 2024

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

@@ -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);
Copy link
Collaborator

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?

@kennsippell kennsippell self-requested a review May 17, 2024 20:17
@jonathanbataire jonathanbataire changed the base branch from main to 131-forms-ui June 6, 2024 06:45
@jonathanbataire
Copy link
Author

@freddieptf this is ready for review

@jonathanbataire
Copy link
Author

@freddieptf requesting review here this is ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Design Changes - Directive changes Design Change - Login Page
3 participants