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

Wrap CheckBoxInput in InputWrapper to provide visual feedback #2423

Merged
merged 8 commits into from
Sep 14, 2023

Conversation

ewanharris
Copy link
Contributor

@ewanharris ewanharris commented Aug 4, 2023

Changes

Wrap the CheckBoxInput in InputWrapper to allow for providing feedback as to what is wrong when a user clicks submit without the checkbox being selected. Below is an example of what this looks like, rather than highlight using a border like other fields we change the text to red.

This image is outdated see below
Screenshot 2023-08-04 at 12 03 18

I did also see what it looked like without the red text, which is a little less obvious.

Screenshot 2023-08-04 at 11 59 11

This is if we add a border around the entire element like the other components
Screenshot 2023-08-04 at 11 05 07

I did also try a border/outline around the checkbox element but it looked bad due to inability to set the border radiu

Happy to change this up if there's a general preference that looks better.

Current status:

Invalid hint text provided
Invalid hint text is red and aligned with checkbox text

No invalid hint text provided
Checkbox text is red

References

#2400

Testing

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language

Checklist

@ewanharris ewanharris requested a review from a team as a code owner August 4, 2023 14:21
@@ -491,6 +491,12 @@ loadingSize = 30px
span
display block
margin-left 20px
.auth0-lock-input-wrap
background #ffffff
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are needed otherwise we inherit the grey background/border from the InputWrap which is not desired

let blockClassName = `auth0-lock-input-block auth0-lock-input-${name}`;
if (!isValid) {
blockClassName += ' auth0-lock-error';
}

if (className) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed a way to maintain the CSS for the CheckBoxInput so added this className proper to allow that

stevehobbsdev
stevehobbsdev previously approved these changes Aug 22, 2023
@ewanharris ewanharris temporarily deployed to internal September 5, 2023 10:27 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 5, 2023 10:27 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.15% 🎉

Comparison is base (33915dc) 41.55% compared to head (3439895) 41.71%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2423      +/-   ##
==========================================
+ Coverage   41.55%   41.71%   +0.15%     
==========================================
  Files         120      120              
  Lines        3025     3028       +3     
  Branches      325      327       +2     
==========================================
+ Hits         1257     1263       +6     
+ Misses       1674     1673       -1     
+ Partials       94       92       -2     
Files Changed Coverage Δ
src/field/custom_input.jsx 90.00% <ø> (ø)
src/ui/input/checkbox_input.jsx 57.14% <100.00%> (+7.14%) ⬆️
src/ui/input/input_wrap.jsx 85.71% <100.00%> (+27.38%) ⬆️

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

@ewanharris ewanharris temporarily deployed to internal September 5, 2023 11:12 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 5, 2023 11:12 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 5, 2023 11:16 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 5, 2023 11:16 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 5, 2023 12:42 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 5, 2023 12:42 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 14, 2023 11:14 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 14, 2023 11:14 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 14, 2023 11:14 — with GitHub Actions Inactive
@ewanharris ewanharris temporarily deployed to internal September 14, 2023 11:18 — with GitHub Actions Inactive
@ewanharris ewanharris added this pull request to the merge queue Sep 14, 2023
Merged via the queue into master with commit ff14592 Sep 14, 2023
10 checks passed
@ewanharris ewanharris deleted the fix/2400-checkbox-validation branch September 14, 2023 12:55
@ewanharris ewanharris mentioned this pull request Sep 15, 2023
github-merge-queue bot pushed a commit that referenced this pull request Sep 15, 2023
**Added**
- Wrap CheckBoxInput in InputWrapper to provide visual feedback
[\#2423](#2423)
([ewanharris](https://github.com/ewanharris))
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.

CheckboxInput does not display any InvalidHint to the user
2 participants