GEN-1160 Minor: migrate to test case search api from test case api (#17902)

* Minor: migrate to test case search api from test case api

* fix: testSuites search client update

* style: ran java linting

---------

Co-authored-by: Teddy Crepineau <teddy.crepineau@gmail.com>
This commit is contained in:
Shailesh Parmar 2024-09-25 10:10:30 +05:30 committed by GitHub
parent ad920cf0ef
commit 8dd6a84d1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 25 deletions

View File

@ -747,6 +747,11 @@ public class SearchRepository {
Map<String, Object> doc = JsonUtils.getMap(entity);
fieldAddParams.put("newPipelineStatus", doc.get("pipelineStatus"));
}
if (fieldChange.getName().equalsIgnoreCase("testSuites")) {
scriptTxt.append("ctx._source.testSuites = params.testSuites;");
Map<String, Object> doc = JsonUtils.getMap(entity);
fieldAddParams.put("testSuites", doc.get("testSuites"));
}
}
return scriptTxt.toString();
}

View File

@ -42,7 +42,7 @@ import {
} from '../../../../interface/FormUtils.interface';
import testCaseClassBase from '../../../../pages/IncidentManager/IncidentManagerDetailPage/TestCaseClassBase';
import {
getListTestCase,
getListTestCaseBySearch,
getListTestDefinitions,
} from '../../../../rest/testAPI';
import {
@ -133,7 +133,7 @@ const TestCaseForm: React.FC<TestCaseFormProps> = ({
};
const fetchAllTestCases = async () => {
try {
const { data } = await getListTestCase({
const { data } = await getListTestCaseBySearch({
limit: PAGE_SIZE_LARGE,
entityLink: generateEntityLink(
isColumnFqn ? `${decodedEntityFQN}.${columnName}` : decodedEntityFQN,

View File

@ -47,7 +47,7 @@ import {
import LimitWrapper from '../../../../../hoc/LimitWrapper';
import useCustomLocation from '../../../../../hooks/useCustomLocation/useCustomLocation';
import { useFqn } from '../../../../../hooks/useFqn';
import { getListTestCase } from '../../../../../rest/testAPI';
import { getListTestCaseBySearch } from '../../../../../rest/testAPI';
import { formatNumberWithComma } from '../../../../../utils/CommonUtils';
import {
getEntityName,
@ -359,7 +359,7 @@ const ColumnProfileTable = () => {
const fetchColumnTestCase = async (activeColumnFqn: string) => {
setIsTestCaseLoading(true);
try {
const { data } = await getListTestCase({
const { data } = await getListTestCaseBySearch({
fields: TabSpecificField.TEST_CASE_RESULT,
entityLink: generateEntityLink(activeColumnFqn),
limit: PAGE_SIZE_LARGE,

View File

@ -47,9 +47,9 @@ import { useFqn } from '../../hooks/useFqn';
import { DataQualityPageTabs } from '../../pages/DataQuality/DataQualityPage.interface';
import {
addTestCaseToLogicalTestSuite,
getListTestCase,
getListTestCaseBySearch,
getTestSuiteByName,
ListTestCaseParams,
ListTestCaseParamsBySearch,
updateTestSuiteById,
} from '../../rest/testAPI';
import { getEntityName } from '../../utils/EntityUtils';
@ -141,10 +141,10 @@ const TestSuiteDetailsPage = () => {
}
};
const fetchTestCases = async (param?: ListTestCaseParams) => {
const fetchTestCases = async (param?: ListTestCaseParamsBySearch) => {
setIsTestCaseLoading(true);
try {
const response = await getListTestCase({
const response = await getListTestCaseBySearch({
fields: [
TabSpecificField.TEST_CASE_RESULT,
TabSpecificField.TEST_DEFINITION,
@ -272,14 +272,11 @@ const TestSuiteDetailsPage = () => {
}
};
const handleTestCasePaging = ({
cursorType,
currentPage,
}: PagingHandlerParams) => {
if (cursorType) {
const handleTestCasePaging = ({ currentPage }: PagingHandlerParams) => {
if (currentPage) {
handlePageChange(currentPage);
fetchTestCases({
[cursorType]: paging[cursorType],
offset: (currentPage - 1) * pageSize,
});
}
};
@ -312,6 +309,7 @@ const TestSuiteDetailsPage = () => {
const pagingData: NextPreviousProps = useMemo(
() => ({
isNumberBased: true,
currentPage,
pageSize,
paging,

View File

@ -111,17 +111,6 @@ const testSuiteUrl = '/dataQuality/testSuites';
const testDefinitionUrl = '/dataQuality/testDefinitions';
// testCase section
export const getListTestCase = async (params?: ListTestCaseParams) => {
const response = await APIClient.get<PagingResponse<TestCase[]>>(
testCaseUrl,
{
params,
}
);
return response.data;
};
export const getListTestCaseBySearch = async (
params?: ListTestCaseParamsBySearch
) => {