From f5f29640f36760b9017238bc0485214129ec649c Mon Sep 17 00:00:00 2001 From: Charlie Park Date: Mon, 9 Sep 2024 14:43:41 -0700 Subject: [PATCH] Update limit values to 1000 --- app/forms/firewall-rules-common.tsx | 5 ++--- app/forms/firewall-rules-create.tsx | 11 +++-------- app/forms/firewall-rules-edit.tsx | 9 +++------ 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/app/forms/firewall-rules-common.tsx b/app/forms/firewall-rules-common.tsx index dc94295a1..3c9906ace 100644 --- a/app/forms/firewall-rules-common.tsx +++ b/app/forms/firewall-rules-common.tsx @@ -28,7 +28,6 @@ import { RadioField } from '~/components/form/fields/RadioField' import { TextField, TextFieldInner } from '~/components/form/fields/TextField' import { useVpcSelector } from '~/hooks' import { useForm } from '~/hooks/use-form' -import { PAGE_SIZE } from '~/table/QueryTable' import { Badge } from '~/ui/lib/Badge' import { Button } from '~/ui/lib/Button' import { FormDivider } from '~/ui/lib/Divider' @@ -270,12 +269,12 @@ export const CommonFields = ({ control, nameTaken, error }: CommonFieldsProps) = const { data: { items: instances }, } = usePrefetchedApiQuery('instanceList', { - query: { project, limit: PAGE_SIZE }, + query: { project, limit: 1000 }, }) const { data: { items: vpcs }, } = usePrefetchedApiQuery('vpcList', { - query: { project, limit: PAGE_SIZE }, + query: { project, limit: 1000 }, }) const { data: { items: vpcSubnets }, diff --git a/app/forms/firewall-rules-create.tsx b/app/forms/firewall-rules-create.tsx index 78cb97ed4..167021448 100644 --- a/app/forms/firewall-rules-create.tsx +++ b/app/forms/firewall-rules-create.tsx @@ -21,7 +21,6 @@ import { import { SideModalForm } from '~/components/form/SideModalForm' import { getVpcSelector, useForm, useVpcSelector } from '~/hooks' import { addToast } from '~/stores/toast' -import { PAGE_SIZE } from '~/table/QueryTable' import { pb } from '~/util/path-builder' import { CommonFields } from './firewall-rules-common' @@ -58,13 +57,9 @@ const ruleToValues = (rule: VpcFirewallRule): FirewallRuleValues => ({ CreateFirewallRuleForm.loader = async ({ params }: LoaderFunctionArgs) => { const { project, vpc } = getVpcSelector(params) await Promise.all([ - apiQueryClient.prefetchQuery('vpcFirewallRulesView', { - query: getVpcSelector(params), - }), - apiQueryClient.prefetchQuery('instanceList', { - query: { project, limit: PAGE_SIZE }, - }), - apiQueryClient.prefetchQuery('vpcList', { query: { project, limit: PAGE_SIZE } }), + apiQueryClient.prefetchQuery('vpcFirewallRulesView', { query: { project, vpc } }), + apiQueryClient.prefetchQuery('instanceList', { query: { project, limit: 1000 } }), + apiQueryClient.prefetchQuery('vpcList', { query: { project, limit: 1000 } }), apiQueryClient.prefetchQuery('vpcSubnetList', { query: { project, vpc } }), ]) diff --git a/app/forms/firewall-rules-edit.tsx b/app/forms/firewall-rules-edit.tsx index 90d311d8f..9d99ea874 100644 --- a/app/forms/firewall-rules-edit.tsx +++ b/app/forms/firewall-rules-edit.tsx @@ -23,7 +23,6 @@ import { useForm, useVpcSelector, } from '~/hooks' -import { PAGE_SIZE } from '~/table/QueryTable' import { invariant } from '~/util/invariant' import { pb } from '~/util/path-builder' @@ -34,11 +33,9 @@ EditFirewallRuleForm.loader = async ({ params }: LoaderFunctionArgs) => { const { project, vpc, rule } = getFirewallRuleSelector(params) const [firewallRules] = await Promise.all([ - apiQueryClient.fetchQuery('vpcFirewallRulesView', { - query: { project, vpc }, - }), - apiQueryClient.prefetchQuery('instanceList', { query: { project, limit: PAGE_SIZE } }), - apiQueryClient.prefetchQuery('vpcList', { query: { project, limit: PAGE_SIZE } }), + apiQueryClient.fetchQuery('vpcFirewallRulesView', { query: { project, vpc } }), + apiQueryClient.prefetchQuery('instanceList', { query: { project, limit: 1000 } }), + apiQueryClient.prefetchQuery('vpcList', { query: { project, limit: 1000 } }), apiQueryClient.prefetchQuery('vpcSubnetList', { query: { project, vpc } }), ])