-
Notifications
You must be signed in to change notification settings - Fork 894
chore(site): remove users and pagination services #9932
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 1 commit
cda4b4f
9b3adea
9db6ec6
7fb3858
1a6fcfb
04fb5d3
44d8de6
269f67f
b4b7a77
76e94fb
50c861d
93e4e80
579cb11
5eb2321
735fde8
57bb614
23517e3
d2830ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ import { useStatusFilterMenu } from "./UsersFilter"; | |
import { useFilter } from "components/Filter/filter"; | ||
import { useDashboard } from "components/Dashboard/DashboardProvider"; | ||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; | ||
import { getAuthMethods } from "api/api"; | ||
import { roles } from "api/queries/roles"; | ||
import { deploymentConfig } from "api/queries/deployment"; | ||
import { prepareQuery } from "utils/filters"; | ||
|
@@ -26,6 +25,7 @@ import { | |
deleteUser, | ||
updatePassword, | ||
updateRoles, | ||
authMethods, | ||
} from "api/queries/users"; | ||
import { displayError, displaySuccess } from "components/GlobalSnackbar/utils"; | ||
import { getErrorMessage } from "api/errors"; | ||
|
@@ -74,14 +74,9 @@ export const UsersPage: FC<{ children?: ReactNode }> = () => { | |
status: option?.value, | ||
}), | ||
}); | ||
const authMethods = useQuery({ | ||
queryKey: ["authMethods"], | ||
queryFn: () => { | ||
return getAuthMethods(); | ||
}, | ||
}); | ||
const authMethodsQuery = useQuery(authMethods()); | ||
const isLoading = | ||
usersQuery.isLoading || rolesQuery.isLoading || authMethods.isLoading; | ||
usersQuery.isLoading || rolesQuery.isLoading || authMethodsQuery.isLoading; | ||
// Suspend | ||
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. these comments don't really add much value, and feel like the kind that are prone to eventual drift. maybe just separate each group with a blank line? 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. Ok, I personally like to use comments to separate things sometimes 😁 going to remove them and add blank lines instead |
||
const [confirmSuspendUser, setConfirmSuspendUser] = useState<User>(); | ||
const suspendUserMutation = useMutation(suspendUser(queryClient)); | ||
|
@@ -109,7 +104,7 @@ export const UsersPage: FC<{ children?: ReactNode }> = () => { | |
oidcRoleSyncEnabled={oidcRoleSyncEnabled} | ||
roles={rolesQuery.data} | ||
users={usersQuery.data?.users} | ||
authMethods={authMethods.data} | ||
authMethods={authMethodsQuery.data} | ||
onListWorkspaces={(user) => { | ||
navigate( | ||
"/workspaces?filter=" + | ||
|
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.
Do we handle error state? Does
data
always return (empty) if the request errors?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.
yeah, error values are always exposed through
error
andisError