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

papercut-fix: perform login on enter button press for basic auth in the login page #434

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

vrajashkr
Copy link
Contributor

What type of PR is this?
papercut-fix

Which issue does this PR fix:
Closes #430

What does this PR do / Why do we need it:
This PR contains the following changes:

  1. When a user presses the Enter button in the login page's username or password fields, it performs submit only if both username and password fields have some data in them (neither of them are blank).
  2. Adds and modifies unit tests to cover the behavior.
  3. Removes props that are not used by the SignIn component from test cases.
  4. Fixes a typo in data-testid for the OpenID Divider to avoid an error being shown in the Unit Test runs.

Testing done on this change:
Pressing Enter on a fresh login page:
image

Pressing Enter on the username field while password is blank:
image

Pressing Enter on the password field while the username is blank:
image

Pressing Enter on password field after entering both username and password results in a successful login.

Automation added to e2e:
N/A

Will this break upgrades or downgrades. Has updating a running cluster been tested?:
N/A - this is a UI-only change for the login page.

Does this change require updates to the CNI daemonset config files to work?:
N/A

Does this PR introduce any user-facing change?:
Yes

Users can now hit enter while focused on either the username input field or the password input field to login to Zot.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.00%. Comparing base (9de2337) to head (2a94069).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #434      +/-   ##
==========================================
+ Coverage   84.85%   85.00%   +0.15%     
==========================================
  Files          63       63              
  Lines        1941     1961      +20     
  Branches      531      532       +1     
==========================================
+ Hits         1647     1667      +20     
  Misses        284      284              
  Partials       10       10              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andaaron andaaron requested a review from raulkele April 1, 2024 07:07
@andaaron
Copy link
Contributor

andaaron commented Apr 1, 2024

Hi @raulkele, can you please review this?

Copy link
Collaborator

@raulkele raulkele left a comment

Choose a reason for hiding this comment

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

lgtm

@andaaron andaaron merged commit c78b303 into project-zot:main Apr 2, 2024
8 checks passed
@andaaron
Copy link
Contributor

andaaron commented Apr 2, 2024

Thanks for the PR!

@vrajashkr vrajashkr deleted the papercut/login-form-keypress branch April 2, 2024 14:21
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.

papercut: pressing enter in login form should submit
3 participants