From edc15e4214c8221e269831500a2b03f08f816c86 Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Wed, 18 Dec 2024 15:25:20 +0530 Subject: [PATCH 1/6] Fix the ingestion success screen text overflow issue --- .../ui/src/components/common/SuccessScreen/SuccessScreen.tsx | 2 +- .../src/main/resources/ui/src/utils/IngestionUtils.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/SuccessScreen/SuccessScreen.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/SuccessScreen/SuccessScreen.tsx index 3f9bc9ce950a..884ed5e69de2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/SuccessScreen/SuccessScreen.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/SuccessScreen/SuccessScreen.tsx @@ -104,7 +104,7 @@ const SuccessScreen = ({ + ellipsis={{ rows: 7 }}> {isUndefined(successMessage) ? ( diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/IngestionUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/IngestionUtils.tsx index 9e50c736e007..86b84c97da2e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/IngestionUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/IngestionUtils.tsx @@ -359,7 +359,7 @@ export const getSuccessMessage = ( return ( - {`"${ingestionName}"`} + {`"${ingestionName}"`} {status === FormSubmitType.ADD ? createMessage : updateMessage} From 012d68f5fa9872e2ed5aed51d63da12d51f0a1a4 Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Wed, 18 Dec 2024 15:27:18 +0530 Subject: [PATCH 2/6] Fix the icon alignment issue in the in the entity header --- .../Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx index cc1f0df695b3..34fba24d6c80 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx @@ -55,7 +55,7 @@ const EntityHeaderTitle = ({ data-testid={`${serviceName}-${name}`} gutter={12} wrap={false}> - {icon && {icon}} + {icon && {icon}} Date: Wed, 18 Dec 2024 15:29:25 +0530 Subject: [PATCH 3/6] Fix the permissions API calls for the ingestion pipelines to use fqn instead of names --- .../IngestionListTable.test.tsx | 38 ++++++++++++++++++- .../IngestionListTable/IngestionListTable.tsx | 5 ++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.test.tsx index 1bdc4beecc71..231edeec4fef 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.test.tsx @@ -15,11 +15,18 @@ import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { mockIngestionListTableProps } from '../../../../../mocks/IngestionListTable.mock'; +import { usePermissionProvider } from '../../../../../context/PermissionProvider/PermissionProvider'; +import { mockIngestionData } from '../../../../../mocks/Ingestion.mock'; +import { + mockESIngestionData, + mockIngestionListTableProps, +} from '../../../../../mocks/IngestionListTable.mock'; import { ENTITY_PERMISSIONS } from '../../../../../mocks/Permissions.mock'; import { deleteIngestionPipelineById } from '../../../../../rest/ingestionPipelineAPI'; import IngestionListTable from './IngestionListTable'; +const mockGetEntityPermissionByFqn = jest.fn(); + jest.mock('../../../../../hooks/useApplicationStore', () => ({ useApplicationStore: jest.fn(() => ({ theme: { primaryColor: '#fff' }, @@ -260,4 +267,33 @@ describe('Ingestion', () => { expect(deleteIngestionPipelineById).toHaveBeenCalledWith('id'); }); + + it('should fetch the permissions for all the ingestion pipelines', async () => { + (usePermissionProvider as jest.Mock).mockImplementation(() => ({ + getEntityPermissionByFqn: mockGetEntityPermissionByFqn, + })); + + await act(async () => { + render( + , + { + wrapper: MemoryRouter, + } + ); + }); + + expect(mockGetEntityPermissionByFqn).toHaveBeenNthCalledWith( + 1, + 'ingestionPipeline', + mockESIngestionData.fullyQualifiedName + ); + expect(mockGetEntityPermissionByFqn).toHaveBeenNthCalledWith( + 2, + 'ingestionPipeline', + mockIngestionData.fullyQualifiedName + ); + }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.tsx index 86738d11dc52..c26a0064b373 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.tsx @@ -157,7 +157,10 @@ function IngestionListTable({ const fetchIngestionPipelinesPermission = useCallback(async () => { try { const promises = ingestionData.map((item) => - getEntityPermissionByFqn(ResourceEntity.INGESTION_PIPELINE, item.name) + getEntityPermissionByFqn( + ResourceEntity.INGESTION_PIPELINE, + item.fullyQualifiedName ?? '' + ) ); const response = await Promise.allSettled(promises); From 4a4cb29cc722d875968444d04679243dfb22b214 Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Wed, 18 Dec 2024 15:33:09 +0530 Subject: [PATCH 4/6] Introduce the moreActionButtonProps in the PipelineActions component --- .../PipelineActions.interface.ts | 10 +++++---- .../PipelineActions/PipelineActions.tsx | 4 +++- .../PipelineActionsDropdown.interface.ts | 2 ++ .../PipelineActionsDropdown.test.tsx | 22 +++++++++++++++++++ .../PipelineActionsDropdown.tsx | 2 ++ .../ui/src/mocks/IngestionListTable.mock.ts | 2 +- 6 files changed, 36 insertions(+), 6 deletions(-) rename openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/{ => IngestionListTable/PipelineActions}/PipelineActions.interface.ts (72%) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/PipelineActions.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActions.interface.ts similarity index 72% rename from openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/PipelineActions.interface.ts rename to openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActions.interface.ts index 0ea302cd0061..075361568eec 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/PipelineActions.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActions.interface.ts @@ -11,10 +11,11 @@ * limitations under the License. */ -import { IngestionServicePermission } from '../../../../context/PermissionProvider/PermissionProvider.interface'; -import { ServiceCategory } from '../../../../enums/service.enum'; -import { IngestionPipeline } from '../../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; -import { SelectedRowDetails } from './ingestion.interface'; +import { ButtonProps } from 'antd'; +import { IngestionServicePermission } from '../../../../../../context/PermissionProvider/PermissionProvider.interface'; +import { ServiceCategory } from '../../../../../../enums/service.enum'; +import { IngestionPipeline } from '../../../../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; +import { SelectedRowDetails } from '../../ingestion.interface'; export interface PipelineActionsProps { pipeline: IngestionPipeline; @@ -28,4 +29,5 @@ export interface PipelineActionsProps { handleEnableDisableIngestion?: (id: string) => Promise; handleIsConfirmationModalOpen: (value: boolean) => void; onIngestionWorkflowsUpdate?: () => void; + moreActionButtonProps?: ButtonProps; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActions.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActions.tsx index 90651e429845..2aab18773b56 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActions.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActions.tsx @@ -22,8 +22,8 @@ import { Operation } from '../../../../../../generated/entity/policies/accessCon import { PipelineType } from '../../../../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; import { getLoadingStatus } from '../../../../../../utils/CommonUtils'; import { getLogsViewerPath } from '../../../../../../utils/RouterUtils'; -import { PipelineActionsProps } from '../../PipelineActions.interface'; import './pipeline-actions.less'; +import { PipelineActionsProps } from './PipelineActions.interface'; import PipelineActionsDropdown from './PipelineActionsDropdown'; function PipelineActions({ @@ -38,6 +38,7 @@ function PipelineActions({ handleIsConfirmationModalOpen, onIngestionWorkflowsUpdate, handleEditClick, + moreActionButtonProps, }: Readonly) { const history = useHistory(); const { t } = useTranslation(); @@ -168,6 +169,7 @@ function PipelineActions({ handleIsConfirmationModalOpen={handleIsConfirmationModalOpen} ingestion={pipeline} ingestionPipelinePermissions={ingestionPipelinePermissions} + moreActionButtonProps={moreActionButtonProps} serviceCategory={serviceCategory} serviceName={serviceName} triggerIngestion={triggerIngestion} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.interface.ts index a572a7b4c3c5..b38d19a6ba8a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.interface.ts @@ -11,6 +11,7 @@ * limitations under the License. */ +import { ButtonProps } from 'antd'; import { IngestionServicePermission } from '../../../../../../context/PermissionProvider/PermissionProvider.interface'; import { IngestionPipeline } from '../../../../../../generated/entity/services/ingestionPipelines/ingestionPipeline'; import { SelectedRowDetails } from '../../ingestion.interface'; @@ -26,4 +27,5 @@ export interface PipelineActionsDropdownProps { handleDeleteSelection: (row: SelectedRowDetails) => void; handleIsConfirmationModalOpen: (value: boolean) => void; onIngestionWorkflowsUpdate?: () => void; + moreActionButtonProps?: ButtonProps; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.test.tsx index 708d91ae94db..93834477741a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.test.tsx @@ -324,4 +324,26 @@ describe('PipelineActionsDropdown', () => { expect(screen.queryByText('KillIngestionPipelineModal')).toBeNull(); }); + + it('should pass the moreActionButtonProps to the more action button', async () => { + const mockOnClick = jest.fn(); + + await act(async () => { + render( + , + { + wrapper: MemoryRouter, + } + ); + }); + + await clickOnMoreActions(); + + expect(mockOnClick).toHaveBeenCalled(); + }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.tsx index 61baee49f856..a6b5db9165ec 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.tsx @@ -50,6 +50,7 @@ function PipelineActionsDropdown({ handleIsConfirmationModalOpen, onIngestionWorkflowsUpdate, ingestionPipelinePermissions, + moreActionButtonProps, }: Readonly) { const history = useHistory(); const { t } = useTranslation(); @@ -270,6 +271,7 @@ function PipelineActionsDropdown({ icon={} type="link" onClick={() => setIsOpen((value) => !value)} + {...moreActionButtonProps} /> {isKillModalOpen && selectedPipeline && id === selectedPipeline?.id && ( diff --git a/openmetadata-ui/src/main/resources/ui/src/mocks/IngestionListTable.mock.ts b/openmetadata-ui/src/main/resources/ui/src/mocks/IngestionListTable.mock.ts index e0ae76f1857f..9e3a3865f529 100644 --- a/openmetadata-ui/src/main/resources/ui/src/mocks/IngestionListTable.mock.ts +++ b/openmetadata-ui/src/main/resources/ui/src/mocks/IngestionListTable.mock.ts @@ -13,8 +13,8 @@ import { AddIngestionButtonProps } from '../components/Settings/Services/Ingestion/AddIngestionButton.interface'; import { IngestionListTableProps } from '../components/Settings/Services/Ingestion/IngestionListTable/IngestionListTable.interface'; +import { PipelineActionsProps } from '../components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActions.interface'; import { PipelineActionsDropdownProps } from '../components/Settings/Services/Ingestion/IngestionListTable/PipelineActions/PipelineActionsDropdown.interface'; -import { PipelineActionsProps } from '../components/Settings/Services/Ingestion/PipelineActions.interface'; import { ServiceCategory } from '../enums/service.enum'; import { DatabaseServiceType } from '../generated/entity/data/database'; import { ConfigType } from '../generated/entity/services/databaseService'; From 3c4b29cad9d0a5e6d66af25f5a3c51f42fef056a Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Wed, 18 Dec 2024 15:38:02 +0530 Subject: [PATCH 5/6] Add the "Database" field in the advanced search for the "Database Schema" asset. Change the fields listing behavior in the advanced search modal, to show the common fields for the multiple assets instead of union of the fields. Change the search index for the "Name" and "Display Name" field suggestions to use the selected data assets instead of the all "Data Assets" index. --- .../src/utils/AdvancedSearchClassBase.test.ts | 136 +++++++++++++++++- .../ui/src/utils/AdvancedSearchClassBase.ts | 49 ++++++- 2 files changed, 179 insertions(+), 6 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.test.ts b/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.test.ts index f9fee0938250..28f31633bc5e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.test.ts @@ -11,7 +11,10 @@ * limitations under the License. */ import { EntityFields } from '../enums/AdvancedSearch.enum'; -import { AdvancedSearchClassBase } from './AdvancedSearchClassBase'; +import { SearchIndex } from '../enums/search.enum'; +import advancedSearchClassBase, { + AdvancedSearchClassBase, +} from './AdvancedSearchClassBase'; jest.mock('../rest/miscAPI', () => ({ getAggregateFieldOptions: jest.fn().mockImplementation(() => @@ -50,3 +53,134 @@ describe('AdvancedSearchClassBase', () => { ]); }); }); + +describe('getEntitySpecificQueryBuilderFields', () => { + it('should return table specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.TABLE, + ]); + + expect(Object.keys(result)).toEqual([ + EntityFields.DATABASE, + EntityFields.DATABASE_SCHEMA, + EntityFields.TABLE_TYPE, + EntityFields.COLUMN_DESCRIPTION_STATUS, + ]); + }); + + it('should return pipeline specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.PIPELINE, + ]); + + expect(Object.keys(result)).toEqual([EntityFields.TASK]); + }); + + it('should return dashboard specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.DASHBOARD, + ]); + + expect(Object.keys(result)).toEqual([ + EntityFields.DATA_MODEL, + EntityFields.CHART, + EntityFields.PROJECT, + ]); + }); + + it('should return topic specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.TOPIC, + ]); + + expect(Object.keys(result)).toEqual([EntityFields.SCHEMA_FIELD]); + }); + + it('should return mlModel specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.MLMODEL, + ]); + + expect(Object.keys(result)).toEqual([EntityFields.FEATURE]); + }); + + it('should return container specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.CONTAINER, + ]); + + expect(Object.keys(result)).toEqual([EntityFields.CONTAINER_COLUMN]); + }); + + it('should return searchIndex specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.SEARCH_INDEX, + ]); + + expect(Object.keys(result)).toEqual([EntityFields.FIELD]); + }); + + it('should return dataModel specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.DASHBOARD_DATA_MODEL, + ]); + + expect(Object.keys(result)).toEqual([ + EntityFields.DATA_MODEL_TYPE, + EntityFields.PROJECT, + ]); + }); + + it('should return apiEndpoint specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.API_ENDPOINT_INDEX, + ]); + + expect(Object.keys(result)).toEqual([ + EntityFields.REQUEST_SCHEMA_FIELD, + EntityFields.RESPONSE_SCHEMA_FIELD, + ]); + }); + + it('should return glossary specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.GLOSSARY_TERM, + ]); + + expect(Object.keys(result)).toEqual([EntityFields.GLOSSARY_TERM_STATUS]); + }); + + it('should return databaseSchema specific fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.DATABASE_SCHEMA, + ]); + + expect(Object.keys(result)).toEqual([EntityFields.DATABASE]); + }); + + it('should return empty fields for multiple indices with no common fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.TABLE, + SearchIndex.PIPELINE, + ]); + + expect(Object.keys(result)).toEqual([]); + }); + + it('should return combined fields for multiple indices with common fields', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + SearchIndex.TABLE, + SearchIndex.DATABASE_SCHEMA, + ]); + + expect(Object.keys(result)).toEqual([EntityFields.DATABASE]); + }); + + it('should return empty object for unknown index', () => { + const result = advancedSearchClassBase.getEntitySpecificQueryBuilderFields([ + 'UNKNOWN_INDEX' as SearchIndex, + ]); + + expect(Object.keys(result)).toEqual([]); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts index 05da5daaffd5..cc87cc631433 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts @@ -143,6 +143,24 @@ class AdvancedSearchClassBase { }; }; + /** + * Fields specific to database schema + */ + databaseSchemaQueryBuilderFields: Fields = { + [EntityFields.DATABASE]: { + label: t('label.database'), + type: 'select', + mainWidgetProps: this.mainWidgetProps, + fieldSettings: { + asyncFetch: this.autocomplete({ + searchIndex: SearchIndex.DATABASE_SCHEMA, + entityField: EntityFields.DATABASE, + }), + useAsyncSearch: true, + }, + }, + }; + /** * Fields specific to tables */ @@ -477,7 +495,7 @@ class AdvancedSearchClassBase { mainWidgetProps: this.mainWidgetProps, fieldSettings: { asyncFetch: this.autocomplete({ - searchIndex: SearchIndex.DATA_ASSET, + searchIndex: entitySearchIndex, entityField: EntityFields.DISPLAY_NAME_KEYWORD, }), useAsyncSearch: true, @@ -498,7 +516,7 @@ class AdvancedSearchClassBase { mainWidgetProps: this.mainWidgetProps, fieldSettings: { asyncFetch: this.autocomplete({ - searchIndex: SearchIndex.DATA_ASSET, + searchIndex: entitySearchIndex, entityField: EntityFields.NAME_KEYWORD, }), useAsyncSearch: true, @@ -674,6 +692,7 @@ class AdvancedSearchClassBase { [SearchIndex.DASHBOARD_DATA_MODEL]: this.dataModelQueryBuilderFields, [SearchIndex.API_ENDPOINT_INDEX]: this.apiEndpointQueryBuilderFields, [SearchIndex.GLOSSARY_TERM]: this.glossaryQueryBuilderFields, + [SearchIndex.DATABASE_SCHEMA]: this.databaseSchemaQueryBuilderFields, [SearchIndex.ALL]: { ...this.tableQueryBuilderFields, ...this.pipelineQueryBuilderFields, @@ -699,9 +718,29 @@ class AdvancedSearchClassBase { }, }; - entitySearchIndex.forEach((index) => { - configs = { ...configs, ...(configIndexMapping[index] ?? {}) }; - }); + // Find out the common fields between the selected indices + if (!isEmpty(entitySearchIndex)) { + const firstIndex = entitySearchIndex[0]; + + // Fields config for the first index + configs = { ...configIndexMapping[firstIndex] }; + + // Iterate over the rest of the indices to see the common fields + entitySearchIndex.slice(1).forEach((index) => { + // Get the current config for the current iteration index + const currentConfig = configIndexMapping[index] ?? {}; + + // Filter out the fields that are not common between the current and previous configs + configs = Object.keys(configs).reduce((acc, key) => { + // If the key exists in the current config, add it to the accumulator + if (currentConfig[key]) { + acc[key] = configs[key]; + } + + return acc; + }, {} as Fields); + }); + } return configs; } From 4ff442033a508d821cc0305d0d0a1e882d9e59cc Mon Sep 17 00:00:00 2001 From: Aniket Katkar Date: Thu, 19 Dec 2024 13:50:11 +0530 Subject: [PATCH 6/6] Remove the unnecessary ellipsis prop --- .../ui/src/components/common/SuccessScreen/SuccessScreen.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/SuccessScreen/SuccessScreen.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/SuccessScreen/SuccessScreen.tsx index 884ed5e69de2..d5c554a45dcb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/SuccessScreen/SuccessScreen.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/SuccessScreen/SuccessScreen.tsx @@ -101,10 +101,7 @@ const SuccessScreen = ({ - + {isUndefined(successMessage) ? (