-
Notifications
You must be signed in to change notification settings - Fork 53
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
wizard: add user information step (HMS-4903) #2551
base: main
Are you sure you want to change the base?
Conversation
0d89bee
to
fe5208c
Compare
There is a bug now - if you fill in the user information, click next, visit the Users step again, and change some of the fields, all of the contents of the other fields get deleted. Screencast.From.2024-11-21.17-44-57.mp4Other than that, it looks good, I think. :) |
9b3fe35
to
ef687e3
Compare
dd38a0c
to
2654a27
Compare
2654a27
to
3383ce0
Compare
This still happens in case that I:
|
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.
Added some questions, the step is looking really good ✨
<FormHelperText> | ||
<HelperText> | ||
<HelperTextItem> | ||
Can contain at least 3 different character classes (uppercase |
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 guess we require three different character classes, I'd change the wording a bit.
Can contain at least 3 different character classes (uppercase | |
Must contain at least 3 different character classes (uppercase |
if (additionalLogic) { | ||
additionalLogic(updatedUser); | ||
} | ||
// Determine if user exists by index, not name |
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.
Why not name? Shouldn't the user name be unique? 🤔
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 think keeping track of the user via an id makes sense to me.
Imagine an edge case where you have a user called user
. Then you want to add a second user, user2
. As you are typing in user2
, there will be a brief moment in time where you have two users with the same name (user
).
We will still want to enforce uniqueness in the validation, of course, but using an id to keep track of the users would help us avoid problems like the one above.
return ( | ||
<EmptyState variant={EmptyStateVariant.lg}> | ||
<EmptyStateHeader | ||
icon={<EmptyStateIcon icon={UserIcon} />} | ||
headingLevel="h4" | ||
/> | ||
<EmptyStateFooter> | ||
<Button variant="secondary" onClick={() => {}}> | ||
<Button variant="secondary" onClick={onAddUserClick}> |
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.
Switching between the empty and user creation states could be handled in a similar way like FSC I think, we could introduce a helper into the users structure called userMode
or smth like that and then switch what renders on the step based on a store value.
But this might also be a follow up.
userState: { | ||
users: UserWithAdditionalInfo[]; | ||
userInfo: UserWithAdditionalInfo; | ||
}; |
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.
What blocks us from doing just:
userState: { | |
users: UserWithAdditionalInfo[]; | |
userInfo: UserWithAdditionalInfo; | |
}; | |
users: UserWithAdditionalInfo[]; |
and accessing the users by their name value?
This way we have a complex structure that includes an array and then just one item of the array that is stored outside of it
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.
it becomes very complicated to implement the change of every field. and like in this way, the verifaition of every filed stay simple
@avitova very strange, it is not happend to me, are you looking into the last commit? Screen.Recording.2024-11-26.at.12.16.32.mov |
@mgold1234 Yes, your are right, then dismiss my comment. You fixed it, I accidentally tested different version. |
This commit introduces the user information step with the following fields: (*) `userName` field with validation according to Red Hat guidelines: https://access.redhat.com/solutions/30164 (*) `password` field with validation using the pam_pwquality module, which enforces strict password policies for Linux systems. This module enhances security by enforcing minimum length, complexity, and avoiding weak passwords. More info: https://access.redhat.com/solutions/6979714 Validation is configured based on the requirements defined for our systems: https://github.com/osbuild/osbuild-composer/tree/main/test/data/manifests https://github.com/osbuild/images/pkg/distro/rhel/rhel10 (*) `confirm password` field that check if confirm password equal to password (*) `ssh key` field - implement the same validation as we have in edge. [x] [wip> unit tests- in progress because I want to make sure that all new fields are in a good shape.
!( | ||
userName === '' && | ||
userPassword === '' && | ||
userSshKey === '' |
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 think this should be either password OR SSH key.
if (additionalLogic) { | ||
additionalLogic(updatedUser); | ||
} | ||
// Determine if user exists by index, not name |
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 think keeping track of the user via an id makes sense to me.
Imagine an edge case where you have a user called user
. Then you want to add a second user, user2
. As you are typing in user2
, there will be a brief moment in time where you have two users with the same name (user
).
We will still want to enforce uniqueness in the validation, of course, but using an id to keep track of the users would help us avoid problems like the one above.
wizard: add user information step (HMS-4903)
This commit introduces the user information step with the following fields:
()
userName
field with validation according to Red Hat guidelines: https://access.redhat.com/solutions/30164()
password
field with validation using the pam_pwquality module, which enforces strict password policies for Linux systems.This module enhances security by enforcing minimum length, complexity, and avoiding weak passwords.
More info: https://access.redhat.com/solutions/6979714
Validation is configured based on the requirements defined for our systems:
https://github.com/osbuild/osbuild-composer/tree/main/test/data/manifests
https://github.com/osbuild/images/pkg/distro/rhel/rhel10
()
confirm password
field that check if confirm password equal to password()
ssh key
field - implement the same validation as we have in edge.[x] [wip> unit tests- in progress because I want to make sure that all new fields are in a good shape.