Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const AccountDelegationsTableRow = ({ delegation, index }: Props) => {
sx={{ fontStyle: 'italic', textTransform: 'capitalize' }}
variant="body1"
>
no delegate users added
No Users Added
</Typography>
)}
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ export const UserEmailPanel = ({ activeUser }: Props) => {

const disabledReason = isProxyOrDelegateUserType
? RESTRICTED_FIELD_TOOLTIP
: profileUserName !== activeUser.username
? 'You can\u{2019}t change another user\u{2019}s email address.'
: undefined;
: activeUser.user_type === 'delegate' &&
profileUserName !== activeUser.username
? 'E-mail addresses of delegate users are not displayed.'
: profileUserName !== activeUser.username
? 'You can\u{2019}t change another user\u{2019}s email address.'
: undefined;

// This should be disabled if this is NOT the current user or if the proxy user is viewing their own profile.
const disableEmailField =
Expand Down
19 changes: 16 additions & 3 deletions packages/manager/src/features/IAM/Users/UsersTable/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ export const UsersLanding = () => {
const isSmDown = useMediaQuery(theme.breakpoints.down('sm'));
const isLgDown = useMediaQuery(theme.breakpoints.up('lg'));

const numColsLg = isLgDown ? 4 : 3;
const numColsLg = isLgDown
? isChildOrDelegateWithDelegationEnabled
? 5
: 4
: 3;

const numCols = isSmDown ? 2 : numColsLg;

Expand All @@ -159,8 +163,17 @@ export const UsersLanding = () => {
setSelectedUsername(username);
};

const canCreateUser = permissions.create_user;
const handleDeleteDialogClose = () => {
const removedLastOnPage =
users && users?.data.length % pagination.pageSize === 1;

setIsDeleteDialogOpen(false);
if (removedLastOnPage) {
pagination.handlePageChange(pagination.page - 1);
}
};

const canCreateUser = permissions.create_user;
return (
<React.Fragment>
<Paper sx={(theme) => ({ marginTop: theme.tokens.spacing.S16 })}>
Expand Down Expand Up @@ -256,7 +269,7 @@ export const UsersLanding = () => {
open={isCreateDrawerOpen}
/>
<UserDeleteConfirmation
onClose={() => setIsDeleteDialogOpen(false)}
onClose={handleDeleteDialogClose}
open={isDeleteDialogOpen}
username={selectedUsername}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const defaultProps = {
order: 'asc' as Order,
orderBy: 'username',
},
isChildWithDelegationEnabled: true,
};

describe('UsersLandingTableHead', () => {
Expand Down