From b056cad67f3283615dfb7efa6bba794fc275bd6b Mon Sep 17 00:00:00 2001 From: Micah Wylde Date: Fri, 21 Jun 2024 15:06:57 -0700 Subject: [PATCH] fixes --- crates/arroyo-api/src/udfs.rs | 2 +- webui/src/lib/data_fetching.ts | 7 +++---- webui/src/routes/pipelines/CatalogTab.tsx | 2 +- webui/src/routes/pipelines/CreatePipeline.tsx | 5 +---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/crates/arroyo-api/src/udfs.rs b/crates/arroyo-api/src/udfs.rs index a9ff96761..496d0764f 100644 --- a/crates/arroyo-api/src/udfs.rs +++ b/crates/arroyo-api/src/udfs.rs @@ -81,8 +81,8 @@ pub async fn create_udf( api_queries::execute_create_udf( &client, &pub_id, - &auth_data.user_id, &auth_data.organization_id, + &auth_data.user_id, &req.prefix, &udf_name, &req.definition, diff --git a/webui/src/lib/data_fetching.ts b/webui/src/lib/data_fetching.ts index 2a27b95a3..64a4f68d8 100644 --- a/webui/src/lib/data_fetching.ts +++ b/webui/src/lib/data_fetching.ts @@ -217,12 +217,11 @@ const connectionTablesFetcher = () => { }; }; -export const useConnectionTables = (limit: number) => { +export const useConnectionTables = (limit: number, refresh?: boolean) => { + const options = refresh ? { refreshInterval: 5000 } : {}; const { data, isLoading, mutate, size, setSize } = useSWRInfinite< schemas['ConnectionTableCollection'] - >(connectionTablesKey(limit), connectionTablesFetcher(), { - refreshInterval: 5000, - }); + >(connectionTablesKey(limit), connectionTablesFetcher(), options); return { connectionTablePages: data, diff --git a/webui/src/routes/pipelines/CatalogTab.tsx b/webui/src/routes/pipelines/CatalogTab.tsx index 4e20d4a0a..c30fbc566 100644 --- a/webui/src/routes/pipelines/CatalogTab.tsx +++ b/webui/src/routes/pipelines/CatalogTab.tsx @@ -5,7 +5,7 @@ import { ConnectionTable, useConnectionTables } from '../../lib/data_fetching'; import { Catalog } from './Catalog'; const CatalogTab: React.FC = () => { - const { connectionTablePages, connectionTablesLoading } = useConnectionTables(200); + const { connectionTablePages, connectionTablesLoading } = useConnectionTables(200, false); let connectionTables: ConnectionTable[] = []; let catalogTruncated = false; diff --git a/webui/src/routes/pipelines/CreatePipeline.tsx b/webui/src/routes/pipelines/CreatePipeline.tsx index 4c8959a71..28b088130 100644 --- a/webui/src/routes/pipelines/CreatePipeline.tsx +++ b/webui/src/routes/pipelines/CreatePipeline.tsx @@ -81,13 +81,11 @@ export function CreatePipeline() { const [operatorErrors, setOperatorErrors] = useState([]); const [queryInput, setQueryInput] = useState(''); const [queryInputToCheck, setQueryInputToCheck] = useState(undefined); - const { operatorMetricGroups } = useJobMetrics(pipelineId, job?.id); const { isOpen, onOpen, onClose } = useDisclosure(); const [options, setOptions] = useState({ parallelism: 4, checkpointMS: 5000 }); const navigate = useNavigate(); const [startError, setStartError] = useState(null); const [tabIndex, setTabIndex] = useState(0); - const { connectionTablesLoading } = useConnectionTables(50); const queryParams = useQuery(); const { pipeline: copyFrom, pipelineLoading: copyFromLoading } = usePipeline( queryParams.get('from') ?? undefined @@ -213,7 +211,7 @@ export function CreatePipeline() { }, [sidebarElement]); // Top-level loading state - if (copyFromLoading || connectionTablesLoading || !localUdfs) { + if (copyFromLoading || !localUdfs) { return ; } @@ -388,7 +386,6 @@ export function CreatePipeline() { > {}} />