This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-0-test by this push:
     new 68dc8a7ca34 [v3-0-test] Add pagination to providers list (#49902) 
(#49903)
68dc8a7ca34 is described below

commit 68dc8a7ca34c03474b265bf11b44fd965f19b11e
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Apr 28 12:25:03 2025 -0400

    [v3-0-test] Add pagination to providers list (#49902) (#49903)
    
    (cherry picked from commit b69fc0033a9de337a588499b4284afb7941909fb)
    
    Co-authored-by: Pierre Jeambrun <[email protected]>
---
 airflow-core/src/airflow/ui/src/pages/Providers.tsx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/airflow-core/src/airflow/ui/src/pages/Providers.tsx 
b/airflow-core/src/airflow/ui/src/pages/Providers.tsx
index b0a6cd5523b..85f11d3d12c 100644
--- a/airflow-core/src/airflow/ui/src/pages/Providers.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Providers.tsx
@@ -22,6 +22,7 @@ import type { ColumnDef } from "@tanstack/react-table";
 import { useProviderServiceGetProviders } from "openapi/queries";
 import type { ProviderResponse } from "openapi/requests/types.gen";
 import { DataTable } from "src/components/DataTable";
+import { useTableURLState } from "src/components/DataTable/useTableUrlState";
 import { ErrorAlert } from "src/components/ErrorAlert";
 import { urlRegex } from "src/constants/urlRegex";
 
@@ -70,7 +71,14 @@ const columns: Array<ColumnDef<ProviderResponse>> = [
 ];
 
 export const Providers = () => {
-  const { data, error } = useProviderServiceGetProviders();
+  const { setTableURLState, tableURLState } = useTableURLState();
+
+  const { pagination } = tableURLState;
+
+  const { data, error } = useProviderServiceGetProviders({
+    limit: pagination.pageSize,
+    offset: pagination.pageIndex * pagination.pageSize,
+  });
 
   return (
     <Box p={2}>
@@ -79,7 +87,9 @@ export const Providers = () => {
         columns={columns}
         data={data?.providers ?? []}
         errorMessage={<ErrorAlert error={error} />}
+        initialState={tableURLState}
         modelName="Provider"
+        onStateChange={setTableURLState}
         total={data?.total_entries}
       />
     </Box>

Reply via email to