mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-06-27 04:22:05 +00:00
MINOR: fix the schema page table pagination count issue (#21915)
* fix the schema page table pagination count issue * unwanted code removal * remove the same parameter as we have same value as default arguments * fix the sonar failing due to recent changes * fix the failing test
This commit is contained in:
parent
a2154df0ec
commit
24125588dd
@ -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 }) => {
|
||||
|
@ -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');
|
||||
});
|
||||
|
@ -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(
|
||||
() => ({
|
||||
|
@ -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 = <K extends keyof TestCaseSearchParams>(
|
||||
key: K,
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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<Table>();
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
});
|
||||
|
@ -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 (
|
||||
|
@ -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,
|
||||
|
@ -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<WorkflowStatesData>();
|
||||
const [isWorkflowStatusLoading, setIsWorkflowStatusLoading] = useState(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user