diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java index 0090127d904..028f7483c4d 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java @@ -747,6 +747,11 @@ public class SearchRepository { Map doc = JsonUtils.getMap(entity); fieldAddParams.put("newPipelineStatus", doc.get("pipelineStatus")); } + if (fieldChange.getName().equalsIgnoreCase("testSuites")) { + scriptTxt.append("ctx._source.testSuites = params.testSuites;"); + Map doc = JsonUtils.getMap(entity); + fieldAddParams.put("testSuites", doc.get("testSuites")); + } } return scriptTxt.toString(); } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseForm.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseForm.tsx index bdfda10fbc1..f75d2b0d7f2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseForm.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/components/TestCaseForm.tsx @@ -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 = ({ }; const fetchAllTestCases = async () => { try { - const { data } = await getListTestCase({ + const { data } = await getListTestCaseBySearch({ limit: PAGE_SIZE_LARGE, entityLink: generateEntityLink( isColumnFqn ? `${decodedEntityFQN}.${columnName}` : decodedEntityFQN, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/ColumnProfileTable/ColumnProfileTable.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/ColumnProfileTable/ColumnProfileTable.tsx index be00653236c..b4ed285ffc5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/ColumnProfileTable/ColumnProfileTable.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/ColumnProfileTable/ColumnProfileTable.tsx @@ -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, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx index 6e3aad58959..29628e1e2c0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/TestSuiteDetailsPage.component.tsx @@ -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, diff --git a/openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts b/openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts index 916af57207d..f8ba6b79a44 100644 --- a/openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts +++ b/openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts @@ -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>( - testCaseUrl, - { - params, - } - ); - - return response.data; -}; - export const getListTestCaseBySearch = async ( params?: ListTestCaseParamsBySearch ) => {