-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(deps-dev): bump eslint-plugin-react from 7.37.1 to 7.37.2
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.37.1 to 7.37.2. - [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases) - [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](jsx-eslint/eslint-plugin-react@v7.37.1...v7.37.2) --- updated-dependencies: - dependency-name: eslint-plugin-react dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Wizard: Add `Users` step to the wizard (HMS-4902) This commit adds a new step 'Users' that is enabled only in stage-preview, and will enable it in stage-stable once IQE tests are ready. The step is not functional yet, this is just the first step. this commit add new step 'Users' that enabled only in stage-preview
- Loading branch information
1 parent
f85e660
commit 4080666
Showing
10 changed files
with
292 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
src/Components/CreateImageWizard/steps/Users/component/UserInfo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import { | ||
Checkbox, | ||
Form, | ||
FormGroup, | ||
FormHelperText, | ||
HelperText, | ||
HelperTextItem, | ||
Text, | ||
TextVariants, | ||
} from '@patternfly/react-core'; | ||
|
||
import { useAppDispatch, useAppSelector } from '../../../../../store/hooks'; | ||
import { | ||
selectUserName, | ||
selectUserPassword, | ||
selectConfirmUserPassword, | ||
selectUserAdministrator, | ||
setUserName, | ||
setUserPassword, | ||
setConfirmUserPassword, | ||
changeUserAdministrator, | ||
} from '../../../../../store/wizardSlice'; | ||
import { useUserValidation } from '../../../utilities/useValidation'; | ||
import { HookValidatedInput } from '../../../ValidatedTextInput'; | ||
|
||
const UserInfo = () => { | ||
const dispatch = useAppDispatch(); | ||
const userName = useAppSelector(selectUserName); | ||
const userPassword = useAppSelector(selectUserPassword); | ||
const confirmUserPassword = useAppSelector(selectConfirmUserPassword); | ||
const userAdministrator = useAppSelector(selectUserAdministrator); | ||
|
||
const handleNameChange = ( | ||
_event: React.FormEvent<HTMLInputElement>, | ||
name: string | ||
) => { | ||
dispatch(setUserName(name)); | ||
}; | ||
const handlePasswordChange = ( | ||
_event: React.FormEvent<HTMLInputElement>, | ||
password: string | ||
) => { | ||
dispatch(setUserPassword(password)); | ||
}; | ||
const handleConfirmPasswordChange = ( | ||
_event: React.FormEvent<HTMLInputElement>, | ||
confirm: string | ||
) => { | ||
dispatch(setConfirmUserPassword(confirm)); | ||
}; | ||
const handleCheckboxChange = ( | ||
_event: React.FormEvent<HTMLInputElement>, | ||
userAdministrator: boolean | ||
) => { | ||
dispatch(changeUserAdministrator(userAdministrator)); | ||
}; | ||
|
||
const stepValidation = useUserValidation(); | ||
return ( | ||
<Form> | ||
<FormGroup isRequired label="Username" fieldId="blueprint-user-name"> | ||
<HookValidatedInput | ||
ariaLabel="blueprint user name" | ||
value={userName} | ||
onChange={handleNameChange} | ||
placeholder="Enter username" | ||
stepValidation={stepValidation} | ||
fieldName="user name" | ||
/> | ||
<FormHelperText> | ||
<HelperText> | ||
<HelperTextItem> | ||
Can only contain letters, numbers, hyphens (-), and | ||
underscores(_). | ||
</HelperTextItem> | ||
</HelperText> | ||
</FormHelperText> | ||
</FormGroup> | ||
|
||
<FormGroup isRequired label="password" fieldId="blueprint-user-name"> | ||
<HookValidatedInput | ||
ariaLabel="blueprint user password" | ||
value={userPassword} | ||
onChange={handlePasswordChange} | ||
placeholder="Enter password" | ||
stepValidation={stepValidation} | ||
fieldName="user name" | ||
/> | ||
</FormGroup> | ||
<FormGroup | ||
isRequired | ||
label="confirm password" | ||
fieldId="blueprint-confirm-password" | ||
> | ||
<HookValidatedInput | ||
ariaLabel="blueprint confirm password" | ||
value={confirmUserPassword} | ||
onChange={handleConfirmPasswordChange} | ||
placeholder="confirm password" | ||
stepValidation={stepValidation} | ||
fieldName="confirm password" | ||
/> | ||
</FormGroup> | ||
|
||
<FormGroup> | ||
<Checkbox | ||
label="Administrator" | ||
isChecked={userAdministrator} | ||
onChange={handleCheckboxChange} | ||
aria-label="Administrator" | ||
id="user Administrator" | ||
name="user Administrator" | ||
/> | ||
</FormGroup> | ||
</Form> | ||
); | ||
}; | ||
export default UserInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.