Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c03aad4
Standardize UI pagination: 15/25/50 for lists, 12/24/48 for card grids
sweta1308 Oct 13, 2026
de9cb26
Reset Connections to page 1 when the layout changes scale; fix checks…
sweta1308 Oct 13, 2026
97473a0
Merge origin/main into ui-standardize-pagination-page-sizes
sweta1308 Oct 13, 2026
bd83735
Re-expand metric groups after a view switch; fix Sonar issues
sweta1308 Oct 13, 2026
db3481b
Merge remote-tracking branch 'origin/main' into ui-standardize-pagina…
sweta1308 Oct 13, 2026
8a64931
chore(playwright): auto-refresh impact-map.generated.json
github-actions[bot] Oct 13, 2026
0be431b
Page Settings Services cards at 12/24/48; keep stale sizes out of use…
sweta1308 Oct 13, 2026
64b9e09
Keep the App Live Indexing pager visible on a single page
sweta1308 Oct 14, 2026
e6616ec
Remember page size per scale; grid sizes on every card grid
sweta1308 Oct 14, 2026
e9fd6bb
Merge origin/main into ui-standardize-pagination-page-sizes
sweta1308 Oct 14, 2026
7140131
Merge remote-tracking branch 'origin/main' into ui-standardize-pagina…
sweta1308 Oct 14, 2026
6ad0b4c
Hide the pager when a list has no data
sweta1308 Oct 15, 2026
163c81a
Start every paged view from the saved page size
sweta1308 Oct 15, 2026
a58a31d
Merge remote-tracking branch 'origin/main' into ui-standardize-pagina…
sweta1308 Oct 16, 2026
51ed4a5
Keep the pager on an empty later page; fix Sonar issues
sweta1308 Oct 16, 2026
81225c3
Merge branch 'main' into ui-standardize-pagination-page-sizes
sweta1308 Oct 16, 2026
49f8359
Address review: KPI pager, view-scale URL sizes, hash size checks
sweta1308 Oct 16, 2026
82b5ba8
Drop a link's page size when a page switches between table and cards
sweta1308 Oct 16, 2026
62f45c9
Memoize fetchKpiList so the KPI refetch effect has complete deps
sweta1308 Oct 16, 2026
6636e78
Open an off-scale page-size link on page 1
sweta1308 Oct 16, 2026
6f4c0d9
Drop changes unrelated to page sizes
sweta1308 Oct 16, 2026
791d686
Hide the pager on an empty list at a non-default page size
sweta1308 Oct 16, 2026
2205482
Merge remote-tracking branch 'origin/main' into ui-standardize-pagina…
sweta1308 Oct 16, 2026
c50ff73
chore(playwright): auto-refresh impact-map.generated.json
github-actions[bot] Oct 16, 2026
270c742
Add the page-size picker to the glossary terms pager
sweta1308 Oct 16, 2026
b3017a6
Address review: old listing links, Services paging test, constants file
sweta1308 Oct 16, 2026
9e29646
Reset an off-scale listing URL only from the visible route
sweta1308 Oct 16, 2026
1e0d2ff
Fix Sonar issues in files the PR touches
sweta1308 Oct 16, 2026
f290b7b
Drop the redundant optional on TableV2's pagination prop
sweta1308 Oct 17, 2026
af9b1c4
Merge remote-tracking branch 'origin/main' into ui-standardize-pagina…
sweta1308 Oct 17, 2026
bc6455c
Address review: old usePaging links and Memories page on a size change
sweta1308 Oct 17, 2026
44e1332
Merge branch 'main' into ui-standardize-pagination-page-sizes
sweta1308 Oct 17, 2026
c3ac046
Reset stale pages on a saved-size change; trim comments; update the ADR
sweta1308 Oct 17, 2026
179fe04
Address review: stable page setter, keep the page of a URL size
sweta1308 Oct 18, 2026
ed6ba52
Count only a valid URL page size as an override
sweta1308 Oct 18, 2026
843afc7
Merge remote-tracking branch 'origin/main' into ui-standardize-pagina…
sweta1308 Oct 18, 2026
1a96caa
chore(playwright): auto-refresh impact-map.generated.json
github-actions[bot] Oct 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/playwright/impact-map.generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -3328,6 +3328,7 @@
"playwright/e2e/Features/AdvancedSearch.spec.ts",
"playwright/e2e/Features/ContextCenterDashboard.spec.ts",
"playwright/e2e/Features/DataQuality/IncidentManagerSqlQuery.spec.ts",
"playwright/e2e/Features/DataQuality/ProfilerIngestionForm.spec.ts",
"playwright/e2e/Features/DataQuality/TableTestCaseExportFilters.spec.ts",
"playwright/e2e/Features/DomainFilterQueryFilter.spec.ts",
"playwright/e2e/Features/LandingPageWidgets/LandingPageContextCenter.spec.ts",
Expand Down Expand Up @@ -8669,6 +8670,7 @@
"openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/AddIngestion/AddIngestion.component.tsx"
],
"specs": [
"playwright/e2e/Features/DataQuality/ProfilerIngestionForm.spec.ts",
"playwright/e2e/Features/StorageMetadataAgentForm.spec.ts"
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Paged UI lists step 15/25/50 and paged card grids step 12/24/48

- **Status:** Accepted
- **Revisions:** v1 2026-10-13 (initial)
- **Deciders:** Sweta Agarwalla
- **Guard:** `PaginationUtils.test.ts` (`view page sizes` describe block)
- **Related:** —

## Context
Page sizes had drifted page by page: 10, 9, 20 and 5 sat beside the app-wide 15/25/50, a card grid
offered 15/25/50 (rows that never fill), and one list offered 12/24/48. The core-components
`PaginationCardWithControls` defaulted to 10 with 10/25/50, so any page that did not pass its own
options showed a scale no other page used. The `pageSize` URL param and the `globalPageSize`
preference are shared across pages, so a size from one scale could land in a picker with no
matching entry.

## Decision
- A paged **list or table** defaults to 15 and offers 15/25/50 (`LIST_PAGE_SIZE_OPTIONS`,
`PAGE_SIZE_BASE` in `src/constants/constants.ts`).
- A paged **card grid** defaults to 12 and offers 12/24/48 (`GRID_PAGE_SIZE_OPTIONS`,
`GRID_PAGE_SIZE_BASE`), so rows of 2, 3 or 4 cards fill evenly.
- A page with a table/card toggle takes its scale from the view it is in
(`getViewPageSizeOptions` / `getViewPageSize` in `utils/PaginationUtils.ts`)
and returns to page 1 when the view changes.
- A grid page passes `GRID_PAGE_SIZE_OPTIONS` to `usePaging` so a list-scale size from the shared
URL is reconciled to its own scale.
- The size the user picks is remembered per scale (`useSavedPageSize`): list sizes in
`globalPageSize`, grid sizes in `globalGridPageSize`. A page that switches views comes back to
the size last picked in each, and a grid size never lands in a list picker.
- Every paged view starts from that saved size; no page sets a fixed starting size of its own.
This includes views with no size picker (Metrics, KPIs, Domains, Data Products, reindex
failures, Context Center memories). A size carried in the URL (`pageSize` param or settings
hash) still wins, so a shared link opens at its own size, but only for the view it was opened
in: a table/card switch drops it from the URL, and the new view (and any later switch back)
starts at the saved size for its scale. A size the current view does not offer is ignored, and
so are the page and cursor counted at it: the view opens on page 1 at its saved size and drops
the link's paging from the URL or hash. Only the visible route rewrites the URL, since app mode
keeps hidden routes mounted on it. When the saved size changes while a view stays mounted, its
page returns to 1 before the next request, unless the URL carries its own size: that page, such
as one restored by browser Back, is kept. Fixed
fetch batches that are not a paged view (e.g. loading all glossary terms, approval tasks) are
out of scope.
- `usePaging` treats a caller that declares no options as on the list scale, so a grid size left
in the shared URL param, or an off-scale size an older build stored in the preference, never
reaches a 15/25/50 picker.
- Shared defaults (core `PaginationCardWithControls`, `TableV2` client paging, the atoms listing
hooks) are 15.
- Out of scope: fetch limits that are not a paged view — typeahead/suggestion searches, tree-select
batches, count-only queries, bulk fetches, and "show more" previews.

## Consequences
A new paged view picks one of the two scales instead of inventing a size. The two scales share no
value, so switching a page between list and grid changes its size to the one last picked on the
new scale (its first step until the user picks one). Playwright specs that wait on a list request's `limit`/`size` must use the scale of the page
they open. Adding a third scale, or a page size outside these, means amending this record.
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ interface PaginationCardWithControlsProps extends PaginationProps {
export const PaginationCardWithControls = ({
page = 1,
total = 10,
pageSize = 10,
pageSizeOptions = [10, 25, 50],
pageSize = 15,
pageSizeOptions = [15, 25, 50],
className,
minimal = false,
onPageChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const ButtonGroup: StoryObj = {
export const CardWithControls: StoryObj = {
render: () => {
const [page, setPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [pageSize, setPageSize] = useState(15);
const totalPages = Math.max(Math.ceil(TOTAL_ITEMS / pageSize), 1);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ test.describe('App Stop Run Modal', () => {
});

const appsResponse = page.waitForResponse(
`**/api/v1/apps?limit=15&include=non-deleted`
`**/api/v1/apps?limit=12&include=non-deleted`
);
await settingClick(page, GlobalSettingOptions.APPLICATIONS);
await appsResponse;
Expand Down Expand Up @@ -141,7 +141,7 @@ test.describe('App Stop Run Modal', () => {
});

const appsResponse = page.waitForResponse(
`**/api/v1/apps?limit=15&include=non-deleted`
`**/api/v1/apps?limit=12&include=non-deleted`
);
await settingClick(page, GlobalSettingOptions.APPLICATIONS);
await appsResponse;
Expand Down Expand Up @@ -195,7 +195,7 @@ test.describe('App Stop Run Modal', () => {
});

const appsResponse = page.waitForResponse(
`**/api/v1/apps?limit=15&include=non-deleted`
`**/api/v1/apps?limit=12&include=non-deleted`
);
await settingClick(page, GlobalSettingOptions.APPLICATIONS);
await appsResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test.describe.serial('Data Insight Report Application', () => {
await redirectToHomePage(page);

const appsResponse = page.waitForResponse(
`/api/v1/apps?limit=15&include=non-deleted`
`/api/v1/apps?limit=12&include=non-deleted`
);

await settingClick(page, GlobalSettingOptions.APPLICATIONS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test.describe.serial(
await redirectToHomePage(page);

const appsResponse = page.waitForResponse(
`/api/v1/apps?limit=15&include=non-deleted`
`/api/v1/apps?limit=12&include=non-deleted`
);

await settingClick(page, GlobalSettingOptions.APPLICATIONS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
{ data: { type: 'appMode', config: { value: 'classic' } } }
);
expect(preference.ok()).toBeTruthy();
const page = await browser.newPage();

Check warning on line 122 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Domains.spec.ts

View workflow job for this annotation

GitHub Actions / checkstyle

Prefer the `page` fixture (test.use({ storageState })) over browser.newPage() + manual login for single-user admin tests. For multi-user tests that need a second non-admin page, this warning is expected — no action needed
try {
await isolatedUser.signIn(page);
await setPage(page);
Expand All @@ -128,7 +128,7 @@
}
},
userPage: async ({ browser }, setPage) => {
const page = await browser.newPage();

Check warning on line 131 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Domains.spec.ts

View workflow job for this annotation

GitHub Actions / checkstyle

Prefer the `page` fixture (test.use({ storageState })) over browser.newPage() + manual login for single-user admin tests. For multi-user tests that need a second non-admin page, this warning is expected — no action needed
await user.signIn(page);
await setPage(page);
await page.close();
Expand Down Expand Up @@ -583,7 +583,7 @@
await Promise.all([
createSubDomain(page, subDomain.data),
page.waitForResponse(
'/api/v1/search/query?q=&index=domain&from=0&size=9&deleted=false*'
'/api/v1/search/query?q=&index=domain&from=0&size=15&deleted=false*'
),
]);

Expand Down Expand Up @@ -631,7 +631,7 @@
await selectDomain(page, domain.data);

const subDomainApiRes1 = page.waitForResponse(
'/api/v1/search/query?q=&index=domain&from=0&size=9&deleted=false*'
'/api/v1/search/query?q=&index=domain&from=0&size=15&deleted=false*'
);

// Create new sub domain under the existing sub domain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface AppRunRecordResponse {
*/
const installSearchIndexApplication = async (page: Page) => {
const getMarketPlaceResponse = page.waitForResponse(
'/api/v1/apps/marketplace?limit=15'
'/api/v1/apps/marketplace?limit=12'
);
await page.click('[data-testid="add-application"]');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test.use({ storageState: 'playwright/.auth/admin.json' });
const domain = new Domain();
const subDomains: SubDomain[] = [];
const SUBDOMAIN_COUNT = 60;
const PAGE_SIZE = 9;
const PAGE_SIZE = 15;

test.describe('SubDomain Pagination', PLAYWRIGHT_BASIC_TEST_TAG_OBJ, () => {
test.beforeAll('Setup domain and subdomains', async ({ browser }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import AlertRecentEventsTab from './AlertRecentEventsTab';
// Only useCurrentUserPreferences is stubbed: the real usePaging hook, its
// useTableFilters URL-write path, and the real NextPreviousWithOffset
// component are all exercised under MemoryRouter.
// The preference must be a size on the list scale (15/25/50): usePaging replaces any other value.
const mockSetPreference = jest.fn();

jest.mock('../../../../hooks/currentUserStore/useCurrentUserStore', () => ({
useCurrentUserPreferences: () => ({
preferences: { globalPageSize: 5 },
preferences: { globalPageSize: 25 },
setPreference: mockSetPreference,
}),
}));
Expand Down Expand Up @@ -105,34 +106,34 @@ describe('AlertRecentEventsTab pagination/filter reset (real usePaging + real Ne
it('resets currentPage to 1 on filter change and keeps Next navigation contiguous', async () => {
await renderWithRouter();

expect(indicator()).toHaveTextContent('1/20');
expect(indicator()).toHaveTextContent('1/4');

await clickNext();

expect(indicator()).toHaveTextContent('2/20');
expect(indicator()).toHaveTextContent('2/4');

await clickNext();

expect(indicator()).toHaveTextContent('3/20');
expect(lastCallParams().paginationOffset).toBe(10);
expect(indicator()).toHaveTextContent('3/4');
expect(lastCallParams().paginationOffset).toBe(50);

await selectFilter('label.successful');

expect(await screen.findByTestId('applied-filter-text')).toHaveTextContent(
': label.successful'
);
expect(indicator()).toHaveTextContent('1/20');
expect(indicator()).toHaveTextContent('1/4');
expect(lastCallParams().paginationOffset).toBe(0);
expect(lastCallParams().status).toBe(AlertRecentEventFilters.SUCCESSFUL);

await clickNext();

expect(indicator()).toHaveTextContent('2/20');
expect(lastCallParams().paginationOffset).toBe(5);
expect(indicator()).toHaveTextContent('2/4');
expect(lastCallParams().paginationOffset).toBe(25);

await clickPrevious();

expect(indicator()).toHaveTextContent('1/20');
expect(indicator()).toHaveTextContent('1/4');
expect(lastCallParams().paginationOffset).toBe(0);
});

Expand Down Expand Up @@ -161,16 +162,16 @@ describe('AlertRecentEventsTab pagination/filter reset (real usePaging + real Ne
it('loads a URL-restored currentPage and resets it on the next filter interaction', async () => {
await renderWithRouter('/alert?currentPage=3');

expect(indicator()).toHaveTextContent('3/20');
expect(lastCallParams().paginationOffset).toBe(10);
expect(indicator()).toHaveTextContent('3/4');
expect(lastCallParams().paginationOffset).toBe(50);

// Changing the filter resets the page to 1 and rewrites the URL.
await selectFilter('label.successful');

expect(await screen.findByTestId('applied-filter-text')).toHaveTextContent(
': label.successful'
);
expect(indicator()).toHaveTextContent('1/20');
expect(indicator()).toHaveTextContent('1/4');
expect(lastCallParams().paginationOffset).toBe(0);
expect(lastCallParams().status).toBe(AlertRecentEventFilters.SUCCESSFUL);
expect(screen.getByTestId('location-search').textContent).toContain(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import { EntityTags, TagFilterOptions } from 'Models';
import { lazy, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { PAGE_SIZE_LARGE } from '../../../../../constants/constants';
import {
COMMON_STATIC_TABLE_VISIBLE_COLUMNS,
DEFAULT_DASHBOARD_DATA_MODEL_VISIBLE_COLUMNS,
Expand Down Expand Up @@ -91,7 +90,7 @@
showPagination,
paging,
handlePagingChange,
} = usePaging(PAGE_SIZE_LARGE);
} = usePaging();

const { data: dataModel, permissions } =
useGenericContext<DashboardDataModel>();
Expand Down Expand Up @@ -165,7 +164,7 @@

handlePageChange(currentPage);
},
[paging, fetchPaginatedColumns, searchText, handlePageChange]

Check warning on line 167 in openmetadata-ui/src/main/resources/ui/src/components/Dashboard/DataModel/DataModels/ModelTab/ModelTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback has an unnecessary dependency: 'paging'. Either exclude it or remove the dependency array
);

const { deleted } = useMemo(
Expand Down Expand Up @@ -221,7 +220,7 @@
setDisplayedColumns(paginatedColumns);
}, [paginatedColumns, setDisplayedColumns]);

const updateColumnDetails = async (

Check warning on line 223 in openmetadata-ui/src/main/resources/ui/src/components/Dashboard/DataModel/DataModels/ModelTab/ModelTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

The 'updateColumnDetails' function makes the dependencies of useCallback Hook (at line 269) change on every render. To fix this, wrap the definition of 'updateColumnDetails' in its own useCallback() Hook

Check warning on line 223 in openmetadata-ui/src/main/resources/ui/src/components/Dashboard/DataModel/DataModels/ModelTab/ModelTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

The 'updateColumnDetails' function makes the dependencies of useCallback Hook (at line 252) change on every render. To fix this, wrap the definition of 'updateColumnDetails' in its own useCallback() Hook
columnFqn: string,
column: Partial<Column>,
field: keyof Column
Expand Down Expand Up @@ -451,7 +450,7 @@
),
},
],
[

Check warning on line 453 in openmetadata-ui/src/main/resources/ui/src/components/Dashboard/DataModel/DataModels/ModelTab/ModelTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array
entityFqn,
isReadOnly,
tagFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import { Key, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { FQN_SEPARATOR_CHAR } from '../../../constants/char.constants';
import {
NO_DATA_PLACEHOLDER,
PAGE_SIZE_MEDIUM,
} from '../../../constants/constants';
import { NO_DATA_PLACEHOLDER } from '../../../constants/constants';
import { TABLE_COLUMNS_KEYS } from '../../../constants/TableKeys.constants';
import {
EntityType,
Expand Down Expand Up @@ -97,7 +94,7 @@
handlePageSizeChange,
handlePagingChange,
showPagination,
} = usePaging(PAGE_SIZE_MEDIUM);
} = usePaging();
const handleChangeTable = useCallback(
(selectedRowKeys: Key[]) => {
setSelectedKeys(selectedRowKeys as string[]);
Expand Down Expand Up @@ -155,7 +152,7 @@
default:
return [];
}
}, [selectedSchema, entityData]);

Check warning on line 155 in openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useMemo has a missing dependency: 'entityType'. Either include it or remove the dependency array

const fetchTableColumns = useCallback(
async (page = 1) => {
Expand Down Expand Up @@ -196,7 +193,7 @@
}
setIsLoading(false);
},
[tableFqn, pageSize, selectedSchema, oldRemovedColumns, setAllColumnsData]

Check warning on line 196 in openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array
);

const fetchDashboardDataModalColumns = useCallback(
Expand Down Expand Up @@ -238,7 +235,7 @@
}
setIsLoading(false);
},
[fqn, pageSize, handlePagingChange]

Check warning on line 238 in openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback has missing dependencies: 'oldRemovedColumns' and 'selectedSchema'. Either include them or remove the dependency array. If 'setAllColumnsData' needs the current value of 'selectedSchema', you can also switch to useReducer instead of useState and read 'selectedSchema' in the reducer
);

const fetchTopicColumns = useCallback(async () => {
Expand Down Expand Up @@ -266,9 +263,9 @@
setAllColumnsData([]);
}
setIsLoading(false);
}, [fqn]);

Check warning on line 266 in openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback has missing dependencies: 'oldRemovedColumns' and 'selectedSchema'. Either include them or remove the dependency array. If 'setAllColumnsData' needs the current value of 'selectedSchema', you can also switch to useReducer instead of useState and read 'selectedSchema' in the reducer

const fetchApiEndPointColumns = async () => {

Check warning on line 268 in openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

The 'fetchApiEndPointColumns' function makes the dependencies of useCallback Hook (at line 324) change on every render. Move it inside the useCallback callback. Alternatively, wrap the definition of 'fetchApiEndPointColumns' in its own useCallback() Hook
try {
const response = await getApiEndPointByFQN(fqn, {
fields: TabSpecificField.TAGS,
Expand Down Expand Up @@ -490,7 +487,7 @@
]
: []),
],
[entityType, tableFqn]

Check warning on line 490 in openmetadata-ui/src/main/resources/ui/src/components/DataContract/ContractSchemaFormTab/ContractScehmaFormTab.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array
);

const handleExpandedRowsChange = useCallback((keys: readonly Key[]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ import { VIEW_MODE_PAGE } from '../../constants/platform/personaAppLayout.consta
import { usePermissionProvider } from '../../context/PermissionProvider/PermissionProvider';
import { DataProduct } from '../../generated/entity/domains/dataProduct';
import { PageViewMode } from '../../generated/type/personaPreferences';
import { useSavedPageSize } from '../../hooks/paging/useSavedPageSize';
import { usePersonaViewMode } from '../../hooks/platform/usePersonaViewMode';
import { useIsAiMode } from '../../hooks/useAppMode';
import { useMarketplaceStore } from '../../hooks/useMarketplaceStore';
import dataProductClassBase from '../../utils/DataProduct/DataProductClassBase';
import { getEntityName } from '../../utils/EntityNameUtils';
import { getEntityAvatarProps } from '../../utils/IconUtils';
import { getViewPageSizeOptions } from '../../utils/PaginationUtils';
import { renderBreakableTooltip } from '../../utils/TooltipUtils';
import { useDelete } from '../common/atoms/actions/useDelete';
import {
Expand Down Expand Up @@ -153,7 +155,26 @@ const DataProductListPage = ({
const { isMarketplace, dataProductBasePath } = useMarketplaceStore();
const { t } = useTranslation();
const isAiMode = useIsAiMode();
const dataProductListing = useDataProductListingData({ enableNlq: isAiMode });
const personaView = usePersonaViewMode(VIEW_MODE_PAGE.DataProducts);
const [selectedView, setView] = useState<PageViewMode>();
const view = selectedView ?? personaView;
const listingPageSizeOptions = getViewPageSizeOptions(view);
const { savedPageSize: listingPageSize } = useSavedPageSize(
listingPageSizeOptions
);
const dataProductListing = useDataProductListingData({
enableNlq: isAiMode,
pageSize: listingPageSize,
pageSizeOptions: listingPageSizeOptions,
});
const { resetPaging } = dataProductListing;
const handleViewChange = useCallback(
(nextView: PageViewMode) => {
setView(nextView);
resetPaging?.();
},
[resetPaging]
);
const { permissions } = usePermissionProvider();
const { quickFilters, defaultFilters } = useDataProductFilters({
aggregations: dataProductListing.aggregations || undefined,
Expand Down Expand Up @@ -233,9 +254,6 @@ const DataProductListPage = ({
loading: dataProductListing.loading,
});

const personaView = usePersonaViewMode(VIEW_MODE_PAGE.DataProducts);
const [selectedView, setView] = useState<PageViewMode>();
const view = selectedView ?? personaView;
const { renderDataProductCard } = useDomainCardTemplates();

const extraColumns = dataProductClassBase.getListingExtraColumns();
Expand Down Expand Up @@ -457,7 +475,7 @@ const DataProductListPage = ({
)}
{quickFilters}
<Box className="tw:ml-auto" />
<ViewToggle value={view} onChange={setView} />
<ViewToggle value={view} onChange={handleViewChange} />
{deleteIconButton}
</Box>
{filterSelectionDisplay}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import { Avatar, Typography } from '@openmetadata/ui-core-components';
import { useCallback, useMemo } from 'react';
import { TABLE_CARD_PAGE_SIZE } from '../../../constants/constants';
import { PAGE_SIZE_BASE } from '../../../constants/constants';
import { SearchIndex } from '../../../enums/search.enum';
import { DataProduct } from '../../../generated/entity/domains/dataProduct';
import { useMarketplaceStore } from '../../../hooks/useMarketplaceStore';
Expand All @@ -33,7 +33,13 @@ import {

export const useDataProductListingData = ({
enableNlq,
}: { enableNlq?: boolean } = {}): ListingData<DataProduct> => {
pageSize = PAGE_SIZE_BASE,
pageSizeOptions,
}: {
enableNlq?: boolean;
pageSize?: number;
pageSizeOptions?: number[];
} = {}): ListingData<DataProduct> => {
const { dataProductBasePath } = useMarketplaceStore();
// Memoized because a ClassBase override may build these per call, and
// `filterConfigs` feeds a useMemo dep list down in useUrlState.
Expand Down Expand Up @@ -117,7 +123,8 @@ export const useDataProductListingData = ({
const listingData = useListingData<DataProduct>({
searchIndex: SearchIndex.DATA_PRODUCT,
baseFilter: '', // No parent filter for data products
pageSize: TABLE_CARD_PAGE_SIZE,
pageSize,
pageSizeOptions,
filterKeys,
filterConfigs,
columns,
Expand Down
Loading
Loading