Skip to content

Commit

Permalink
Wizard: Add Administrator field to review step
Browse files Browse the repository at this point in the history
this commit add administrator field to review step
  • Loading branch information
mgold1234 authored and regexowl committed Feb 3, 2025
1 parent e9876f6 commit 5f7f958
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import {
selectUserPasswordByIndex,
selectUserSshKeyByIndex,
selectKernel,
selectUserAdministrator,
} from '../../../../store/wizardSlice';
import { toMonthAndYear, yyyyMMddFormat } from '../../../../Utilities/time';
import {
Expand Down Expand Up @@ -792,6 +793,8 @@ export const UsersList = () => {
const userPassword = useAppSelector(userPasswordSelector);
const userSshKeySelector = selectUserSshKeyByIndex(index);
const userSshKey = useAppSelector(userSshKeySelector);
const userIsAdministratorSelector = selectUserAdministrator(index);
const userIsAdministrator = useAppSelector(userIsAdministratorSelector);

return (
<TextContent>
Expand Down Expand Up @@ -824,6 +827,15 @@ export const UsersList = () => {
<TextListItem component={TextListItemVariants.dd}>
{userSshKey ? userSshKey : 'None'}
</TextListItem>
<TextListItem
component={TextListItemVariants.dt}
className="pf-v5-u-min-width"
>
Administrator
</TextListItem>
<TextListItem component={TextListItemVariants.dd}>
{userIsAdministrator ? 'True' : 'False'}
</TextListItem>
</>
</TextList>
</TextContent>
Expand Down
2 changes: 1 addition & 1 deletion src/store/wizardSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export const selectUserSshKeyByIndex =

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

export const selectKernel = (state: RootState) => {
Expand Down

0 comments on commit 5f7f958

Please sign in to comment.