-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Verify] Update new-architecture input fields on base screens to pass through all textfield props #461
Conversation
Visit the preview URL for this PR (updated for commit 7501b30): https://blui-react-login--pr461-4302-adding-textfi-dox9hmyf.web.app (expires Fri, 15 Sep 2023 10:35:14 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 1e9064d2e35ed37fe01e053587ea5f209719a043 |
@@ -99,6 +100,7 @@ export const ChangePasswordDialogBase: React.FC<ChangePasswordDialogProps> = (pr | |||
id="current-password" | |||
label={currentPasswordLabel} | |||
value={currentPassword} | |||
{...currentPasswordTextFieldProps} |
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.
Do we need to merge OnPasswordChange here like https://github.com/etn-ccis/blui-react-workflows/blob/dev/login-workflow/src/screens/AccountDetailsScreen/AccountDetailsScreen.tsx#L142.
Same comment for other screens
And ensure you update docs too, including the readmes and jsdocs |
@@ -84,13 +86,15 @@ export const SetPassword: React.FC<React.PropsWithChildren<SetPasswordProps>> = | |||
inputRef={passwordRef} | |||
label={newPasswordLabel} | |||
value={passwordInput} | |||
error={shouldValidatePassword && !isValidPassword()} | |||
sx={TextFieldStyles(theme)} | |||
{...passwordTextFieldProps} |
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.
Any particular reason the passwordTextFieldProps
is spreaded here as opposed to spreaded towards the end of this props list? I'd like to hear your reasoning.
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.
Same for the other spreads you added in this pull request
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.
To override the defaults which we set in the base screen components, spreaded the TextFieldProps
towards the end of the props list.
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 do not understand. I see that you still have onChange
, onKeyUp
and onBlur
under the {...passwordTextFieldProps}
, so this is not the end of the props list of PasswordTextField
?
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.
Just had a discussion with Joe in Office hours regarding this, so we need to merge events with TextFieldProps
like we did for WorkFlowActions
.
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.
Please resolve the conflicts.
login-workflow/src/components/ChangePasswordDialog/ChangePasswordDialogBase.tsx
Outdated
Show resolved
Hide resolved
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.
Please resolve the conflicts.
onChange={(evt: ChangeEvent<HTMLInputElement>): void => onPassChange(evt.target.value)} | ||
error={shouldValidatePassword && !isValidPassword()} | ||
sx={TextFieldStyles(theme)} | ||
{...passwordTextFieldProps} |
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.
just so I know, why do we have both of these? just for theme aware items? plus additional sx styles?
sx={TextFieldStyles(theme)}
{...passwordTextFieldProps}
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.
Raised a PR for removed passing theme object to functions to generate styles. sx prop is for adding styles.
Spreading passwordTextFieldProps
to pass text field specific props. Like variant
, onChange
and etc.
Fixes #BLUI-4302 .
Changes proposed in this Pull Request:
To Test:
Any specific feedback you are looking for?