Skip to content

Commit 453033c

Browse files
svenefftingeroboquat
authored andcommitted
[admin] avoid global queries in SaaS
1 parent a9faf6f commit 453033c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

components/dashboard/src/admin/WorkspacesSearch.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { getProject, WorkspaceStatusIndicator } from "../workspaces/WorkspaceEnt
2525
import WorkspaceDetail from "./WorkspaceDetail";
2626
import { PageWithAdminSubMenu } from "./PageWithAdminSubMenu";
2727
import Alert from "../components/Alert";
28+
import { isGitpodIo } from "../utils";
2829

2930
interface Props {
3031
user?: User;
@@ -78,6 +79,11 @@ export function WorkspaceSearch(props: Props) {
7879
}
7980

8081
const search = async () => {
82+
// Disables empty search on the workspace search page
83+
if (isGitpodIo() && !props.user && queryTerm.length === 0) {
84+
return;
85+
}
86+
8187
setSearching(true);
8288
try {
8389
const query: AdminGetWorkspacesQuery = {
@@ -88,6 +94,9 @@ export function WorkspaceSearch(props: Props) {
8894
} else if (matchesNewWorkspaceIdExactly(queryTerm)) {
8995
query.workspaceId = queryTerm;
9096
}
97+
if (isGitpodIo() && !query.ownerId && !query.instanceIdOrWorkspaceId && !query.workspaceId) {
98+
return;
99+
}
91100

92101
const result = await getGitpodService().server.adminGetWorkspaces({
93102
limit: pageLength,

0 commit comments

Comments
 (0)