mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-26 15:10:05 +00:00
fix(ui): service should list based on pagesize (#13243)
* fix(ui): service should list based on pagesize * fix service verssion page cypress * revert spec patter for cypress config
This commit is contained in:
parent
bcdb5e9cf7
commit
902541f612
@ -14,7 +14,6 @@
|
||||
// eslint-disable-next-line spaced-comment
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { isEmpty } from 'lodash';
|
||||
import {
|
||||
CUSTOM_PROPERTY_INVALID_NAMES,
|
||||
CUSTOM_PROPERTY_NAME_VALIDATION_ERROR,
|
||||
@ -1211,36 +1210,16 @@ export const deleteEntity = (
|
||||
toastNotification(`${successMessageEntityName} deleted successfully!`, false);
|
||||
};
|
||||
|
||||
const navigateToService = (serviceName, serviceCategory) => {
|
||||
cy.get('[data-testid="services-container"]').then(($body) => {
|
||||
// Find if the service name is present in the list
|
||||
const serviceTitle = $body.find(
|
||||
`[data-testid="service-name-${serviceName}"]`
|
||||
);
|
||||
// If the service is not present
|
||||
if (isEmpty(serviceTitle)) {
|
||||
interceptURL(
|
||||
'GET',
|
||||
`/api/v1/services/${serviceCategory}*`,
|
||||
'getServices'
|
||||
);
|
||||
|
||||
cy.get('[data-testid="next"]').click();
|
||||
|
||||
verifyResponseStatusCode('@getServices', 200);
|
||||
|
||||
navigateToService(serviceName);
|
||||
} else {
|
||||
cy.get(`[data-testid="service-name-${serviceName}"]`).click();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const visitServiceDetailsPage = (
|
||||
settingsMenuId,
|
||||
serviceCategory,
|
||||
serviceName
|
||||
) => {
|
||||
interceptURL(
|
||||
'GET',
|
||||
'api/v1/search/query?q=*&from=0&size=15&index=*',
|
||||
'searchService'
|
||||
);
|
||||
interceptURL('GET', '/api/v1/teams/name/*', 'getOrganization');
|
||||
|
||||
cy.get('[data-testid="app-bar-item-settings"]').click();
|
||||
@ -1259,7 +1238,11 @@ export const visitServiceDetailsPage = (
|
||||
'getServiceDetails'
|
||||
);
|
||||
|
||||
navigateToService(serviceName, serviceCategory);
|
||||
cy.get('[data-testid="searchbar"]').type(serviceName);
|
||||
|
||||
verifyResponseStatusCode('@searchService', 200);
|
||||
|
||||
cy.get(`[data-testid="service-name-${serviceName}"]`).click();
|
||||
|
||||
verifyResponseStatusCode('@getServiceDetails', 200);
|
||||
};
|
||||
|
||||
@ -205,7 +205,7 @@ const BotListV1 = ({
|
||||
setBotUsers([]);
|
||||
setSearchedData([]);
|
||||
fetchBots(showDeleted);
|
||||
}, [showDeleted]);
|
||||
}, [showDeleted, pageSize]);
|
||||
|
||||
const addBotLabel = t('label.add-entity', { entity: t('label.bot') });
|
||||
|
||||
|
||||
@ -21,11 +21,7 @@ import { OwnerLabel } from 'components/common/OwnerLabel/OwnerLabel.component';
|
||||
import RichTextEditorPreviewer from 'components/common/rich-text-editor/RichTextEditorPreviewer';
|
||||
import { ListView } from 'components/ListView/ListView.component';
|
||||
import { ColumnFilter } from 'components/Table/ColumnFilter/ColumnFilter.component';
|
||||
import {
|
||||
getServiceDetailsPath,
|
||||
PAGE_SIZE,
|
||||
pagingObject,
|
||||
} from 'constants/constants';
|
||||
import { getServiceDetailsPath, pagingObject } from 'constants/constants';
|
||||
import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
|
||||
import { SearchIndex } from 'enums/search.enum';
|
||||
import { EntityReference } from 'generated/entity/type';
|
||||
@ -116,6 +112,7 @@ const Services = ({ serviceName }: ServicesProps) => {
|
||||
after,
|
||||
before,
|
||||
filters,
|
||||
limit,
|
||||
}: {
|
||||
search?: string;
|
||||
limit?: number;
|
||||
@ -133,7 +130,7 @@ const Services = ({ serviceName }: ServicesProps) => {
|
||||
} = await searchService({
|
||||
search,
|
||||
searchIndex,
|
||||
limit: pageSize,
|
||||
limit: limit ?? pageSize,
|
||||
currentPage,
|
||||
filters,
|
||||
});
|
||||
@ -145,7 +142,7 @@ const Services = ({ serviceName }: ServicesProps) => {
|
||||
} else {
|
||||
const { data, paging } = await getServices({
|
||||
serviceName,
|
||||
limit: pageSize,
|
||||
limit: limit ?? pageSize,
|
||||
after,
|
||||
before,
|
||||
});
|
||||
@ -466,7 +463,7 @@ const Services = ({ serviceName }: ServicesProps) => {
|
||||
{showPagination(paging) && (
|
||||
<NextPrevious
|
||||
currentPage={currentPage}
|
||||
pageSize={PAGE_SIZE}
|
||||
pageSize={pageSize}
|
||||
paging={paging}
|
||||
pagingHandler={handleServicePageChange}
|
||||
onShowSizeChange={handlePageSizeChange}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user