Skip to content

Commit

Permalink
fix: [UIE-8386] - fix redirects to old route (#11539)
Browse files Browse the repository at this point in the history
Fix redirects from /account/ to /iam/ when editing the username or deleting the user.
  • Loading branch information
aaleksee-akamai authored Jan 22, 2025
1 parent 163c899 commit 7634e11
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

fix redirects from /account to /iam ([#11539](https://github.com/linode/manager/pull/11539))
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const DeleteUserPanel = ({ user }: Props) => {
</Typography>
<UserDeleteConfirmation
onClose={() => setIsDeleteDialogOpen(false)}
onSuccess={() => history.push(`/account/users`)}
onSuccess={() => history.push(`/iam/users`)}
open={isDeleteDialogOpen}
username={user.username}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const UsernamePanel = ({ user }: Props) => {
const user = await mutateAsync(values);

// Because the username changed, we need to update the username in the URL
history.replace(`/account/users/${user.username}`);
history.replace(`/iam/users/${user.username}/details`);

enqueueSnackbar('Username updated successfully', { variant: 'success' });
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,15 @@ export const CreateUserDrawer = (props: Props) => {
<Controller
render={({ field }) => (
<FormControlLabel
control={
<Toggle
onChange={(e) => {
field.onChange(!e.target.checked);
}}
checked={!field.value}
data-qa-create-restricted
/>
}
label={`This user will have ${
field.value ? 'limited' : 'full'
} access to account features.
This can be changed later.`}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
field.onChange(!e.target.checked);
}}
checked={!field.value}
control={<Toggle data-qa-create-restricted />}
sx={{ marginTop: 1 }}
/>
)}
Expand Down

0 comments on commit 7634e11

Please sign in to comment.