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
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Fix Users & Grants filtering error based on `user_type` ([#10230](https://github.com/linode/manager/pull/10230))
15 changes: 6 additions & 9 deletions packages/manager/src/features/Users/UsersLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ export const UsersLanding = () => {
const pagination = usePagination(1, 'account-users');
const order = useOrder();

const showProxyUserTable =
flags.parentChildAccountAccess &&
(profile?.user_type === 'child' || profile?.user_type === 'proxy');

const usersFilter: Filter = {
['+order']: order.order,
['+order_by']: order.orderBy,
['user_type']: showProxyUserTable ? 'child' : undefined,
};

if (flags.parentChildAccountAccess) {
usersFilter['user_type'] = { '+neq': 'proxy' };
}

const { data: users, error, isLoading, refetch } = useAccountUsers({
filters: usersFilter,
params: {
Expand All @@ -61,10 +62,6 @@ export const UsersLanding = () => {

const isRestrictedUser = profile?.restricted;

const showProxyUserTable =
flags.parentChildAccountAccess &&
(profile?.user_type === 'child' || profile?.user_type === 'proxy');

const showChildAccountAccessCol = Boolean(
flags.parentChildAccountAccess && profile?.user_type === 'parent'
);
Expand Down Expand Up @@ -100,7 +97,7 @@ export const UsersLanding = () => {
<UsersLandingTableBody
error={proxyUserError}
isLoading={isLoadingProxyUser}
numCols={numCols}
numCols={4}
onDelete={handleDelete}
users={proxyUser?.data}
/>
Expand Down