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

(feat) O3-4100 - Login flow single-page redesign #1192

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

suubi-joshua
Copy link
Contributor

@suubi-joshua suubi-joshua commented Oct 30, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. Ensure your PR title includes a conventional commit label (such as feat, fix, or chore, among others). See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.
  • I have updated the esm-framework mock to reflect any API changes I have made.

Summary

I have basically tried to implement the designs drafted by Ciaran for the login page the designs can be seen via the linked ticket. What I have done is to create a carbon tile in the footer to house the wording in the openmrs logo, also a button that links to the openmrs website. I also moved the logos container to the right bottom of the screen.
There was a suggestion by Ciaran to render password field after validating username but this may pose a security threat as discussed here . But I have still enabled conditional rendering ie the password field renderson the same screen when user inputs username and clicks the continue button.
Also because of the additons in the footer I have tried to make sure that the elements are responsive on different screens.

Screenshots

Screenshot from 2024-10-30 22-16-27

Screenshot from 2024-10-30 22-16-39

Video
Screencast from 30-10-24 22:15:19.webm

Related Issue

https://openmrs.atlassian.net/browse/O3-4100

Other

@suubi-joshua
Copy link
Contributor Author

@denniskigen & @gracepotma
I have tried to do the designs suggested by Ciaran.

@brandones
Copy link
Collaborator

Hi @suubi-joshua , please fix the tests. CI is failing.

Great description on this PR though, that's very helpful and clear!

@suubi-joshua suubi-joshua changed the title (feat) O3-4100 - Login page UI enhancement. (feat) O3-4100 - Login flow single-page redesign Nov 19, 2024
@suubi-joshua
Copy link
Contributor Author

@brandones Thanks for the review fixed the failures. The config for showPasswordOnSeparatescreen was not working when set to false ie both password and username fields showing on same screen.
But now its all working well cc: @denniskigen
Screencast from 19-11-24 21:11:07.webm

Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

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

So, I think the styling is fine, but it seems like this PR introduces functional regressions in the login app, which need to be fixed.

>
<Help size={24} />
</button>
{user && (
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand why we've added this restriction? Seems both unrelated and like we may want the opportunity for implementers to show the HelpMenu on the login screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ibacher sorry about this, I dont know why this is showing up as a change cause it is related to this if the help button appears in that position it blocks the logos.
Yes this is unrelated to this but not sure why it showing as a change since its already part of core.

);

if (!loginProvider || loginProvider.type === 'basic') {
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little concerned about removing this since the support for other loginProviders is a feature that now seems to be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will restore this


const continueLogin = useCallback(() => {
const usernameField = usernameInputRef.current;

if (usernameField.value && usernameField.value.trim()) {
navigate('/login/confirm');
Copy link
Member

Choose a reason for hiding this comment

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

It seems like the loss of navigate() results in a regression in functionality where the username and password are displayed on separate "screens", but if I mess up entering my user name and click continue, I can now no longer go back to fix that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ibacher I kindly ask for more elaboration on this. Cause in the new design after inputing the username and click continue the password field renders below the username field and incase I messed up the username i can edit it just above the password field. Cause I am seeing no need of the back button if I i render the username just above the password field after I continue.
Screencast from 23-11-24 21:24:41.webm

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.

3 participants