Skip to content

Commit

Permalink
Revert "wizard: add confirm password to users step (HMS-4903)"
Browse files Browse the repository at this point in the history
This reverts commit ba70753.
  • Loading branch information
mgold1234 authored and lucasgarfield committed Jan 8, 2025
1 parent d3e76c6 commit b3a8597
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import { ExternalLinkAltIcon } from '@patternfly/react-icons';
import { GENERATING_SSH_KEY_PAIRS_URL } from '../../../../../constants';
import { useAppDispatch, useAppSelector } from '../../../../../store/hooks';
import {
selectUserConfirmPassword,
selectUserNameByIndex,
selectUserPasswordByIndex,
selectUserSshKeyByIndex,
setUserConfirmPasswordByIndex,
setUserNameByIndex,
setUserPasswordByIndex,
setUserSshKeyByIndex,
Expand All @@ -23,8 +21,6 @@ const UserInfo = () => {
const userName = useAppSelector(userNameSelector);
const userPasswordSelector = selectUserPasswordByIndex(index);
const userPassword = useAppSelector(userPasswordSelector);
const userConfirmPasswordSelector = selectUserConfirmPassword(index);
const userConfirmPassword = useAppSelector(userConfirmPasswordSelector);
const userSshKeySelector = selectUserSshKeyByIndex(index);
const userSshKey = useAppSelector(userSshKeySelector);

Expand All @@ -42,15 +38,6 @@ const UserInfo = () => {
dispatch(setUserPasswordByIndex({ index: index, password: value }));
};

const handleConfirmPasswordChange = (
_event: React.FormEvent<HTMLInputElement>,
value: string
) => {
dispatch(
setUserConfirmPasswordByIndex({ index: index, confirmPassword: value })
);
};

const handleSshKeyChange = (
_event: React.FormEvent<HTMLInputElement>,
value: string
Expand Down Expand Up @@ -85,16 +72,6 @@ const UserInfo = () => {
fieldName="userPassword"
/>
</FormGroup>
<FormGroup isRequired label="Confirm Password">
<HookValidatedInput
ariaLabel="blueprint user confirm password"
value={userConfirmPassword || ''}
onChange={(_e, value) => handleConfirmPasswordChange(_e, value)}
placeholder="Confirm Password"
stepValidation={stepValidation}
fieldName="userConfirmPassword"
/>
</FormGroup>
<FormGroup isRequired label="SSH key">
<HookValidatedInput
ariaLabel="public SSH key"
Expand Down
20 changes: 0 additions & 20 deletions src/store/wizardSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export type ComplianceType = 'openscap' | 'compliance';

export type UserWithAdditionalInfo = {
[K in keyof User]-?: NonNullable<User[K]>;
} & {
confirmPassword: string;
};

type UserPayload = {
Expand All @@ -65,11 +63,6 @@ type UserSshKeyPayload = {
sshKey: string;
};

type UserConfirmPasswordPayload = {
index: number;
confirmPassword: string;
};

export type wizardState = {
env: {
serverUrl: string;
Expand Down Expand Up @@ -380,11 +373,6 @@ export const selectUserPasswordByIndex =
return state.wizard.users[userIndex]?.password;
};

export const selectUserConfirmPassword =
(userIndex: number) => (state: RootState) => {
return state.wizard.users[userIndex]?.confirmPassword;
};

export const selectUserSshKeyByIndex =
(userIndex: number) => (state: RootState) => {
return state.wizard.users[userIndex]?.ssh_key;
Expand Down Expand Up @@ -847,13 +835,6 @@ export const wizardSlice = createSlice({
) => {
state.users[action.payload.index].password = action.payload.password;
},
setUserConfirmPasswordByIndex: (
state,
action: PayloadAction<UserConfirmPasswordPayload>
) => {
state.users[action.payload.index].confirmPassword =
action.payload.confirmPassword;
},
setUserSshKeyByIndex: (state, action: PayloadAction<UserSshKeyPayload>) => {
state.users[action.payload.index].ssh_key = action.payload.sshKey;
},
Expand Down Expand Up @@ -929,6 +910,5 @@ export const {
setUserNameByIndex,
setUserPasswordByIndex,
setUserSshKeyByIndex,
setUserConfirmPasswordByIndex,
} = wizardSlice.actions;
export default wizardSlice.reducer;

0 comments on commit b3a8597

Please sign in to comment.