Wizard: Update Users review text list
Only the first user got rendered, this should render them all and correctly add password indicator in import/edit mode when `hasPassword` is true.
This commit is contained in:
parent
319880fc0b
commit
0b843a64d9
1 changed files with 10 additions and 21 deletions
|
|
@ -72,13 +72,10 @@ import {
|
||||||
selectLanguages,
|
selectLanguages,
|
||||||
selectKeyboard,
|
selectKeyboard,
|
||||||
selectHostname,
|
selectHostname,
|
||||||
selectUserNameByIndex,
|
|
||||||
selectUserPasswordByIndex,
|
|
||||||
selectUserSshKeyByIndex,
|
|
||||||
selectKernel,
|
selectKernel,
|
||||||
selectUserAdministrator,
|
|
||||||
selectFirewall,
|
selectFirewall,
|
||||||
selectServices,
|
selectServices,
|
||||||
|
selectUsers,
|
||||||
} from '../../../../store/wizardSlice';
|
} from '../../../../store/wizardSlice';
|
||||||
import { toMonthAndYear, yyyyMMddFormat } from '../../../../Utilities/time';
|
import { toMonthAndYear, yyyyMMddFormat } from '../../../../Utilities/time';
|
||||||
import { useGetEnvironment } from '../../../../Utilities/useGetEnvironment';
|
import { useGetEnvironment } from '../../../../Utilities/useGetEnvironment';
|
||||||
|
|
@ -800,20 +797,12 @@ export const TimezoneList = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const UsersList = () => {
|
export const UsersList = () => {
|
||||||
const index = 0;
|
const users = useAppSelector(selectUsers);
|
||||||
const userNameSelector = selectUserNameByIndex(index);
|
|
||||||
const userName = useAppSelector(userNameSelector);
|
|
||||||
const userPasswordSelector = selectUserPasswordByIndex(index);
|
|
||||||
const userPassword = useAppSelector(userPasswordSelector);
|
|
||||||
const userSshKeySelector = selectUserSshKeyByIndex(index);
|
|
||||||
const userSshKey = useAppSelector(userSshKeySelector);
|
|
||||||
const userIsAdministratorSelector = selectUserAdministrator(index);
|
|
||||||
const userIsAdministrator = useAppSelector(userIsAdministratorSelector);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TextContent>
|
<TextContent>
|
||||||
<TextList component={TextListVariants.dl}>
|
{users.map((user) => (
|
||||||
<>
|
<TextList key={user.name} component={TextListVariants.dl}>
|
||||||
<TextListItem
|
<TextListItem
|
||||||
component={TextListItemVariants.dt}
|
component={TextListItemVariants.dt}
|
||||||
className="pf-v5-u-min-width"
|
className="pf-v5-u-min-width"
|
||||||
|
|
@ -821,7 +810,7 @@ export const UsersList = () => {
|
||||||
Username
|
Username
|
||||||
</TextListItem>
|
</TextListItem>
|
||||||
<TextListItem component={TextListItemVariants.dd}>
|
<TextListItem component={TextListItemVariants.dd}>
|
||||||
{userName ? userName : 'None'}
|
{user.name ? user.name : 'None'}
|
||||||
</TextListItem>
|
</TextListItem>
|
||||||
<TextListItem
|
<TextListItem
|
||||||
component={TextListItemVariants.dt}
|
component={TextListItemVariants.dt}
|
||||||
|
|
@ -830,7 +819,7 @@ export const UsersList = () => {
|
||||||
Password
|
Password
|
||||||
</TextListItem>
|
</TextListItem>
|
||||||
<TextListItem component={TextListItemVariants.dd}>
|
<TextListItem component={TextListItemVariants.dd}>
|
||||||
{userPassword ? '●'.repeat(8) : 'None'}
|
{user.password || user.hasPassword ? '●'.repeat(8) : 'None'}
|
||||||
</TextListItem>
|
</TextListItem>
|
||||||
<TextListItem
|
<TextListItem
|
||||||
component={TextListItemVariants.dt}
|
component={TextListItemVariants.dt}
|
||||||
|
|
@ -839,7 +828,7 @@ export const UsersList = () => {
|
||||||
SSH key
|
SSH key
|
||||||
</TextListItem>
|
</TextListItem>
|
||||||
<TextListItem component={TextListItemVariants.dd}>
|
<TextListItem component={TextListItemVariants.dd}>
|
||||||
{userSshKey ? userSshKey : 'None'}
|
{user.ssh_key ? user.ssh_key : 'None'}
|
||||||
</TextListItem>
|
</TextListItem>
|
||||||
<TextListItem
|
<TextListItem
|
||||||
component={TextListItemVariants.dt}
|
component={TextListItemVariants.dt}
|
||||||
|
|
@ -848,10 +837,10 @@ export const UsersList = () => {
|
||||||
Administrator
|
Administrator
|
||||||
</TextListItem>
|
</TextListItem>
|
||||||
<TextListItem component={TextListItemVariants.dd}>
|
<TextListItem component={TextListItemVariants.dd}>
|
||||||
{userIsAdministrator ? 'True' : 'False'}
|
{user.isAdministrator ? 'True' : 'False'}
|
||||||
</TextListItem>
|
</TextListItem>
|
||||||
</>
|
</TextList>
|
||||||
</TextList>
|
))}
|
||||||
</TextContent>
|
</TextContent>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue