Skip to content

Commit fa5deef

Browse files
committed
refactor(hub): remove instance count for functions (#2541)
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
1 parent 6728f28 commit fa5deef

File tree

1 file changed

+1
-41
lines changed
  • frontend/apps/hub/src/routes/_authenticated/_layout/projects/$projectNameId/environments/$environmentNameId._v2

1 file changed

+1
-41
lines changed

frontend/apps/hub/src/routes/_authenticated/_layout/projects/$projectNameId/environments/$environmentNameId._v2/functions.tsx

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import * as Layout from "@/domains/project/layouts/servers-layout";
22
import {
3-
projectActorsQueryOptions,
43
routesQueryOptions,
54
useDeleteRouteMutation,
65
} from "@/domains/project/queries";
7-
import {
8-
useInfiniteQuery,
9-
usePrefetchInfiniteQuery,
10-
useSuspenseQuery,
11-
} from "@tanstack/react-query";
6+
import { useSuspenseQuery } from "@tanstack/react-query";
127
import {
138
createFileRoute,
149
type ErrorComponentProps,
@@ -26,7 +21,6 @@ import {
2621
TableBody,
2722
TableCell,
2823
DiscreteCopyButton,
29-
toRecord,
3024
DropdownMenu,
3125
DropdownMenuTrigger,
3226
DropdownMenuContent,
@@ -45,25 +39,6 @@ function ProjectFunctionsRoute() {
4539
routesQueryOptions(Route.useParams()),
4640
);
4741

48-
usePrefetchInfiniteQuery({
49-
...projectActorsQueryOptions({
50-
projectNameId,
51-
environmentNameId,
52-
includeDestroyed: false,
53-
tags: {},
54-
}),
55-
pages: Number.POSITIVE_INFINITY,
56-
});
57-
58-
const { data: actors } = useInfiniteQuery(
59-
projectActorsQueryOptions({
60-
projectNameId,
61-
environmentNameId,
62-
includeDestroyed: false,
63-
tags: {},
64-
}),
65-
);
66-
6742
const navigate = Route.useNavigate();
6843

6944
const { mutate: deleteRoute } = useDeleteRouteMutation();
@@ -103,7 +78,6 @@ function ProjectFunctionsRoute() {
10378
<TableHeader>
10479
<TableRow>
10580
<TableHead>Route</TableHead>
106-
<TableHead>Instances</TableHead>
10781
<TableHead />
10882
</TableRow>
10983
</TableHeader>
@@ -126,20 +100,6 @@ function ProjectFunctionsRoute() {
126100
{`${route.hostname}${route.path}${route.routeSubpaths ? "/*" : ""}`}
127101
</DiscreteCopyButton>
128102
</TableCell>
129-
<TableCell>
130-
{actors?.filter((actor) =>
131-
Object.entries(
132-
route.target.actors
133-
?.selectorTags || {},
134-
).some(([key, value]) => {
135-
return (
136-
toRecord(actor.tags)[
137-
key
138-
] === value
139-
);
140-
}),
141-
).length || 0}
142-
</TableCell>
143103
<TableCell>
144104
<DropdownMenu>
145105
<DropdownMenuTrigger asChild>

0 commit comments

Comments
 (0)