-
Notifications
You must be signed in to change notification settings - Fork 398
fix: [UIE-10203], [UIE-10223], [UIE-10237] - IAM Delegate Users bug fix #13399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
|---|---|---|
|
|
@@ -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'; | ||
|
|
@@ -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(); | ||
|
|
||
|
|
@@ -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) => ({ | ||
|
|
@@ -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 }, | ||
| }); | ||
|
|
@@ -134,7 +137,7 @@ export const UserDelegationsTable = () => { | |
| <TableCell>{childAccount.company}</TableCell> | ||
| </TableRow> | ||
| ))} | ||
| {(childAccounts?.results ?? 0) > pagination.pageSize && ( | ||
| {(childAccounts?.results ?? 0) > MIN_PAGE_SIZE && ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious why it's not a table + footer ( like in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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} | ||
|
|
@@ -162,4 +165,4 @@ export const UserDelegationsTable = () => { | |
| </Stack> | ||
| </Paper> | ||
| ); | ||
| }; | ||
| }; | ||
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
/linodestho i am not sure it is super important