diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Table.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Table.spec.ts index 98ac4de8c44..9b3304eca0d 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Table.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Table.spec.ts @@ -62,7 +62,7 @@ test.describe('Table pagination sorting search scenarios ', () => { await page.getByTestId('next').click(); - expect(await page.locator('.ant-table-row').count()).toBe(10); + expect(await page.locator('.ant-table-row').count()).toBe(15); }); test('Table search with sorting should works', async ({ page }) => { diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/SchemaTable.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/SchemaTable.spec.ts index c8b1f0ae3ea..5887e9ba4f7 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/SchemaTable.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/SchemaTable.spec.ts @@ -10,7 +10,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Page } from '@playwright/test'; +import { expect, Page } from '@playwright/test'; import { test } from '../fixtures/pages'; import { EntityTypeEndpoint } from '../../support/entity/Entity.interface'; @@ -104,7 +104,7 @@ const crudColumnDisplayName = async ( ); }; -// will update this tests sepratly +// will update this tests separately test.fixme( 'schema table test', async ({ dataStewardPage, ownerPage, page }) => { @@ -127,3 +127,32 @@ test.fixme( } } ); + +test('Schema Table Pagination should work Properly', async ({ page }) => { + const tableResponse = page.waitForResponse(`/api/v1/tables?limit=15**`); + + await page.goto('/databaseSchema/sample_data.ecommerce_db.shopify'); + await tableResponse; + + await expect(page.getByTestId('page-size-selection-dropdown')).toHaveText( + '15 / Page' + ); + + await expect(page.getByTestId('previous')).toBeDisabled(); + + await expect(page.getByTestId('next')).not.toBeDisabled(); + + const tableResponse2 = page.waitForResponse(`/api/v1/tables?**limit=15**`); + await page.getByTestId('next').click(); + await tableResponse2; + + await expect(page.getByTestId('previous')).not.toBeDisabled(); + + await expect(page.getByTestId('page-indicator')).toContainText('2'); + + const tableResponse3 = page.waitForResponse(`/api/v1/tables?**limit=15**`); + await page.getByTestId('previous').click(); + await tableResponse3; + + await expect(page.getByTestId('page-indicator')).toContainText('1'); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertDetails/AlertRecentEventsTab/AlertRecentEventsTab.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertDetails/AlertRecentEventsTab/AlertRecentEventsTab.tsx index 4de8dba1ddb..2be6f4489f4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertDetails/AlertRecentEventsTab/AlertRecentEventsTab.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertDetails/AlertRecentEventsTab/AlertRecentEventsTab.tsx @@ -27,7 +27,6 @@ import { MenuInfo } from 'rc-menu/lib/interface'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { ReactComponent as FilterIcon } from '../../../../assets/svg/ic-feeds-filter.svg'; -import { PAGE_SIZE_BASE } from '../../../../constants/constants'; import { AlertRecentEventFilters } from '../../../../enums/Alerts.enum'; import { CSMode } from '../../../../enums/codemirror.enum'; import { ERROR_PLACEHOLDER_TYPE } from '../../../../enums/common.enum'; @@ -76,7 +75,7 @@ function AlertRecentEventsTab({ alertDetails }: AlertRecentEventsTabProps) { handlePageSizeChange, showPagination, handlePagingChange, - } = usePaging(PAGE_SIZE_BASE); + } = usePaging(); const { id, alertName } = useMemo( () => ({ diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.component.tsx index 1abbb106653..d4956c4dce5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.component.tsx @@ -41,7 +41,6 @@ import { useHistory } from 'react-router-dom'; import { WILD_CARD_CHAR } from '../../../constants/char.constants'; import { INITIAL_PAGING_VALUE, - PAGE_SIZE, PAGE_SIZE_BASE, PAGE_SIZE_LARGE, TIER_CATEGORY, @@ -128,7 +127,7 @@ export const TestCases = () => { paging, handlePagingChange, showPagination, - } = usePaging(PAGE_SIZE); + } = usePaging(); const handleSearchParam = ( key: K, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.test.tsx index 6c3a71b7626..5d0f20fff0a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestCases/TestCases.test.tsx @@ -147,7 +147,7 @@ describe('TestCases component', () => { expect(mockGetListTestCase).toHaveBeenCalledWith({ fields: ['testCaseResult', 'testSuite', 'incidentId'], includeAllTests: true, - limit: 10, + limit: 15, offset: 0, q: undefined, testCaseStatus: undefined, @@ -165,7 +165,7 @@ describe('TestCases component', () => { expect(mockSearchQuery).toHaveBeenCalledWith({ fields: ['testCaseResult', 'testSuite', 'incidentId'], includeAllTests: true, - limit: 10, + limit: 15, offset: 0, q: '*sale*', testCaseStatus: undefined, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx index 13edc9f1be4..ac142e5a3bd 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx @@ -19,7 +19,6 @@ import QueryString from 'qs'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useHistory } from 'react-router-dom'; -import { PAGE_SIZE_BASE } from '../../../../constants/constants'; import { useAirflowStatus } from '../../../../context/AirflowStatusProvider/AirflowStatusProvider'; import { usePermissionProvider } from '../../../../context/PermissionProvider/PermissionProvider'; import { ResourceEntity } from '../../../../context/PermissionProvider/PermissionProvider.interface'; @@ -62,7 +61,7 @@ const TestSuitePipelineTab = ({ const testSuiteFQN = testSuite?.fullyQualifiedName ?? testSuite?.name ?? ''; const { permissions } = usePermissionProvider(); - const pipelinePaging = usePaging(PAGE_SIZE_BASE); + const pipelinePaging = usePaging(); const { pageSize, handlePagingChange } = pipelinePaging; const history = useHistory(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/TableProfilerProvider.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/TableProfilerProvider.tsx index 47f88dc2020..a8c3b283823 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/TableProfilerProvider.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/TableProfilerProvider.tsx @@ -24,7 +24,6 @@ import React, { useState, } from 'react'; import { useTranslation } from 'react-i18next'; -import { PAGE_SIZE_BASE } from '../../../../constants/constants'; import { mockDatasetData } from '../../../../constants/mockTourData.constants'; import { DEFAULT_RANGE_DATA, @@ -72,7 +71,7 @@ export const TableProfilerProvider = ({ const { t } = useTranslation(); const { fqn: datasetFQN } = useFqn(); const { isTourOpen } = useTourProvider(); - const testCasePaging = usePaging(PAGE_SIZE_BASE); + const testCasePaging = usePaging(); const location = useCustomLocation(); // profiler has its own api but sent's the data in Table type const [tableProfiler, setTableProfiler] = useState(); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/APICollectionPage/APICollectionVersionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/APICollectionPage/APICollectionVersionPage.tsx index d56cbe83ea5..2c69d7ae8da 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/APICollectionPage/APICollectionVersionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/APICollectionPage/APICollectionVersionPage.tsx @@ -31,7 +31,6 @@ import EntityVersionTimeLine from '../../components/Entity/EntityVersionTimeLine import PageLayoutV1 from '../../components/PageLayoutV1/PageLayoutV1'; import TagsContainerV2 from '../../components/Tag/TagsContainerV2/TagsContainerV2'; import { DisplayType } from '../../components/Tag/TagsViewer/TagsViewer.interface'; -import { PAGE_SIZE } from '../../constants/constants'; import { usePermissionProvider } from '../../context/PermissionProvider/PermissionProvider'; import { OperationPermission, @@ -82,7 +81,7 @@ const APICollectionVersionPage = () => { const { fqn: decodedEntityFQN } = useFqn(); - const pagingInfo = usePaging(PAGE_SIZE); + const pagingInfo = usePaging(); const { paging, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/APICollectionPage/APIEndpointsTab.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/APICollectionPage/APIEndpointsTab.tsx index ec554c04683..e2e77f2d4f8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/APICollectionPage/APIEndpointsTab.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/APICollectionPage/APIEndpointsTab.tsx @@ -23,7 +23,7 @@ import RichTextEditorPreviewerNew from '../../components/common/RichTextEditor/R import TableAntd from '../../components/common/Table/Table'; import { useGenericContext } from '../../components/Customization/GenericProvider/GenericProvider'; import { API_COLLECTION_API_ENDPOINTS } from '../../constants/APICollection.constants'; -import { NO_DATA, PAGE_SIZE } from '../../constants/constants'; +import { NO_DATA } from '../../constants/constants'; import { COMMON_STATIC_TABLE_VISIBLE_COLUMNS, DEFAULT_API_ENDPOINT_TAB_VISIBLE_COLUMNS, @@ -68,7 +68,7 @@ function APIEndpointsTab({ pageSize, handlePagingChange, handlePageSizeChange, - } = usePaging(PAGE_SIZE); + } = usePaging(); const { filters, setFilters } = useTableFilters({ showDeletedEndpoints: false, }); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/SchemaTablesTab.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/SchemaTablesTab.tsx index cc178cb5d89..59f61405b39 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/SchemaTablesTab.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaPage/SchemaTablesTab.tsx @@ -28,7 +28,6 @@ import { EntityName } from '../../components/Modals/EntityNameModal/EntityNameMo import { INITIAL_PAGING_VALUE, INITIAL_TABLE_FILTERS, - PAGE_SIZE, } from '../../constants/constants'; import { DUMMY_DATABASE_SCHEMA_TABLES_DETAILS } from '../../constants/Database.constants'; import { TABLE_SCROLL_VALUE } from '../../constants/Table.constants'; @@ -92,7 +91,7 @@ function SchemaTablesTab({ handlePageSizeChange, handlePageChange, pagingCursor, - } = usePaging(PAGE_SIZE); + } = usePaging(); const allowEditDisplayNamePermission = useMemo(() => { return ( diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx index c14e9e13510..11ed9a6bdf4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.tsx @@ -29,7 +29,6 @@ import DataProductsContainer from '../../components/DataProducts/DataProductsCon import EntityVersionTimeLine from '../../components/Entity/EntityVersionTimeLine/EntityVersionTimeLine'; import TagsContainerV2 from '../../components/Tag/TagsContainerV2/TagsContainerV2'; import { DisplayType } from '../../components/Tag/TagsViewer/TagsViewer.interface'; -import { PAGE_SIZE } from '../../constants/constants'; import { usePermissionProvider } from '../../context/PermissionProvider/PermissionProvider'; import { OperationPermission, @@ -70,7 +69,7 @@ function DatabaseSchemaVersionPage() { }>(); const { fqn: decodedEntityFQN } = useFqn(); - const pagingInfo = usePaging(PAGE_SIZE); + const pagingInfo = usePaging(); const { paging, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx index 716f537830b..f16afc8aacf 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ServiceDetailsPage/ServiceDetailsPage.tsx @@ -46,7 +46,6 @@ import ServiceConnectionDetails from '../../components/Settings/Services/Service import { AIRFLOW_HYBRID, INITIAL_PAGING_VALUE, - PAGE_SIZE_BASE, pagingObject, ROUTES, } from '../../constants/constants'; @@ -170,9 +169,9 @@ const ServiceDetailsPage: FunctionComponent = () => { const { getEntityPermissionByFqn } = usePermissionProvider(); const history = useHistory(); const { isAdminUser } = useAuth(); - const ingestionPagingInfo = usePaging(PAGE_SIZE_BASE); - const collateAgentPagingInfo = usePaging(PAGE_SIZE_BASE); - const pagingInfo = usePaging(PAGE_SIZE_BASE); + const ingestionPagingInfo = usePaging(); + const collateAgentPagingInfo = usePaging(); + const pagingInfo = usePaging(); const [workflowStatesData, setWorkflowStatesData] = useState(); const [isWorkflowStatusLoading, setIsWorkflowStatusLoading] = useState(true);