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
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-13399-fixed-1771414399036.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

IAM Delegation: incorrect landing page after account switch, wrong top menu username, pagination disappears in the User Delegations table ([#13399](https://github.com/linode/manager/pull/13399))
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const SwitchAccountDrawer = (props: Props) => {
userType: isProxyUserType ? 'proxy' : 'delegate',
});
onClose(event);
location.reload();
location.replace('/linodes');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was the decision made to redirect to /linodes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was agreed upon in the Figma discussion (UIE-10203), where /linodes was chosen as the default landing page.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just heads up that the default page for managed users isn't /linodes tho i am not sure it is super important

} catch {
// Error is handled by createTokenError.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as React from 'react';

import { DebouncedSearchTextField } from 'src/components/DebouncedSearchTextField';
import { PaginationFooter } from 'src/components/PaginationFooter/PaginationFooter';
import { MIN_PAGE_SIZE } from 'src/components/PaginationFooter/PaginationFooter.constants';
import { Table } from 'src/components/Table';
import { TableBody } from 'src/components/TableBody';
import { TableCell } from 'src/components/TableCell';
Expand All @@ -25,11 +26,13 @@ import { usePaginationV2 } from 'src/hooks/usePaginationV2';

import type { Theme } from '@mui/material';

const USER_DELEGATION_ROUTE = '/iam/users/$username/delegations';

export const UserDelegationsTable = () => {
const { username } = useParams({ from: '/iam/users/$username' });
const { isIAMDelegationEnabled } = useIsIAMDelegationEnabled();
const { company } = useSearch({
from: '/iam/users/$username/delegations',
from: USER_DELEGATION_ROUTE,
});
const navigate = useNavigate();

Expand All @@ -39,13 +42,13 @@ export const UserDelegationsTable = () => {
order: 'asc',
orderBy: 'company',
},
from: '/iam/users/$username/delegations',
from: USER_DELEGATION_ROUTE,
},
preferenceKey: 'user-delegations',
});

const pagination = usePaginationV2({
currentRoute: '/iam/users/$username/delegations',
currentRoute: USER_DELEGATION_ROUTE,
preferenceKey: 'user-delegations',
initialPage: 1,
searchParams: (prev) => ({
Expand Down Expand Up @@ -79,7 +82,7 @@ export const UserDelegationsTable = () => {
const handleSearch = (value: string) => {
pagination.handlePageChange(1);
navigate({
to: '/iam/users/$username/delegations',
to: USER_DELEGATION_ROUTE,
params: { username },
search: { company: value || undefined },
});
Expand Down Expand Up @@ -134,7 +137,7 @@ export const UserDelegationsTable = () => {
<TableCell>{childAccount.company}</TableCell>
</TableRow>
))}
{(childAccounts?.results ?? 0) > pagination.pageSize && (
{(childAccounts?.results ?? 0) > MIN_PAGE_SIZE && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious why it's not a table + footer ( like in AccountDelegations or Users)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn’t part of the changes in this PR, so I don’t have context on the original decision. We can handle the refactoring in a separate ticket if needed.

<TableRow>
<TableCell
colSpan={1}
Expand Down Expand Up @@ -162,4 +165,4 @@ export const UserDelegationsTable = () => {
</Stack>
</Paper>
);
};
};