mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-29 17:49:14 +00:00 
			
		
		
		
	Hide incremental metadata extraction config in the UI (#21294)
(cherry picked from commit 9ecc1c27816f0278f71592ae2609bbfbd9ab6a4b)
This commit is contained in:
		
							parent
							
								
									f5fc2ee3e5
								
							
						
					
					
						commit
						0ac97e35da
					
				| @ -270,6 +270,10 @@ export const servicesDisplayName: { [key: string]: string } = { | |||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export const DEF_UI_SCHEMA = { | export const DEF_UI_SCHEMA = { | ||||||
|  |   supportsIncrementalMetadataExtraction: { | ||||||
|  |     'ui:widget': 'hidden', | ||||||
|  |     'ui:hideError': true, | ||||||
|  |   }, | ||||||
|   supportsMetadataExtraction: { 'ui:widget': 'hidden', 'ui:hideError': true }, |   supportsMetadataExtraction: { 'ui:widget': 'hidden', 'ui:hideError': true }, | ||||||
|   supportsSystemProfile: { 'ui:widget': 'hidden', 'ui:hideError': true }, |   supportsSystemProfile: { 'ui:widget': 'hidden', 'ui:hideError': true }, | ||||||
|   supportsDataDiff: { 'ui:widget': 'hidden', 'ui:hideError': true }, |   supportsDataDiff: { 'ui:widget': 'hidden', 'ui:hideError': true }, | ||||||
|  | |||||||
| @ -11,8 +11,18 @@ | |||||||
|  *  limitations under the License. |  *  limitations under the License. | ||||||
|  */ |  */ | ||||||
| import React from 'react'; | import React from 'react'; | ||||||
|  | import { COMMON_UI_SCHEMA } from '../constants/Services.constant'; | ||||||
| import { OperationPermission } from '../context/PermissionProvider/PermissionProvider.interface'; | import { OperationPermission } from '../context/PermissionProvider/PermissionProvider.interface'; | ||||||
| import { ExtraDatabaseServiceDropdownOptions } from './DatabaseServiceUtils'; | import { DatabaseServiceType } from '../generated/entity/services/databaseService'; | ||||||
|  | import bigQueryConnection from '../jsons/connectionSchemas/connections/database/bigQueryConnection.json'; | ||||||
|  | import customDatabaseConnection from '../jsons/connectionSchemas/connections/database/customDatabaseConnection.json'; | ||||||
|  | import mysqlConnection from '../jsons/connectionSchemas/connections/database/mysqlConnection.json'; | ||||||
|  | import postgresConnection from '../jsons/connectionSchemas/connections/database/postgresConnection.json'; | ||||||
|  | import snowflakeConnection from '../jsons/connectionSchemas/connections/database/snowflakeConnection.json'; | ||||||
|  | import { | ||||||
|  |   ExtraDatabaseServiceDropdownOptions, | ||||||
|  |   getDatabaseConfig, | ||||||
|  | } from './DatabaseServiceUtils'; | ||||||
| 
 | 
 | ||||||
| jest.mock( | jest.mock( | ||||||
|   '../components/Entity/EntityExportModalProvider/EntityExportModalProvider.component', |   '../components/Entity/EntityExportModalProvider/EntityExportModalProvider.component', | ||||||
| @ -114,3 +124,59 @@ describe('ExtraDatabaseServiceDropdownOptions', () => { | |||||||
|     expect(result).toStrictEqual([]); |     expect(result).toStrictEqual([]); | ||||||
|   }); |   }); | ||||||
| }); | }); | ||||||
|  | 
 | ||||||
|  | describe('getDatabaseConfig', () => { | ||||||
|  |   it('should return correct schema and UI schema for MySQL', () => { | ||||||
|  |     const result = getDatabaseConfig(DatabaseServiceType.Mysql); | ||||||
|  | 
 | ||||||
|  |     expect(result).toHaveProperty('schema'); | ||||||
|  |     expect(result).toHaveProperty('uiSchema'); | ||||||
|  |     expect(result.schema).toStrictEqual(mysqlConnection); | ||||||
|  |     expect(result.uiSchema).toEqual(COMMON_UI_SCHEMA); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('should return correct schema and UI schema for Postgres', () => { | ||||||
|  |     const result = getDatabaseConfig(DatabaseServiceType.Postgres); | ||||||
|  | 
 | ||||||
|  |     expect(result).toHaveProperty('schema'); | ||||||
|  |     expect(result).toHaveProperty('uiSchema'); | ||||||
|  |     expect(result.schema).toStrictEqual(postgresConnection); | ||||||
|  |     expect(result.uiSchema).toEqual(COMMON_UI_SCHEMA); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('should return correct schema and UI schema for Snowflake', () => { | ||||||
|  |     const result = getDatabaseConfig(DatabaseServiceType.Snowflake); | ||||||
|  | 
 | ||||||
|  |     expect(result).toHaveProperty('schema'); | ||||||
|  |     expect(result).toHaveProperty('uiSchema'); | ||||||
|  |     expect(result.schema).toStrictEqual(snowflakeConnection); | ||||||
|  |     expect(result.uiSchema).toEqual(COMMON_UI_SCHEMA); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('should return correct schema and UI schema for BigQuery', () => { | ||||||
|  |     const result = getDatabaseConfig(DatabaseServiceType.BigQuery); | ||||||
|  | 
 | ||||||
|  |     expect(result).toHaveProperty('schema'); | ||||||
|  |     expect(result).toHaveProperty('uiSchema'); | ||||||
|  |     expect(result.schema).toStrictEqual(bigQueryConnection); | ||||||
|  |     expect(result.uiSchema).toEqual(COMMON_UI_SCHEMA); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('should return correct schema and UI schema for CustomDatabase', () => { | ||||||
|  |     const result = getDatabaseConfig(DatabaseServiceType.CustomDatabase); | ||||||
|  | 
 | ||||||
|  |     expect(result).toHaveProperty('schema'); | ||||||
|  |     expect(result).toHaveProperty('uiSchema'); | ||||||
|  |     expect(result.schema).toStrictEqual(customDatabaseConnection); | ||||||
|  |     expect(result.uiSchema).toEqual(COMMON_UI_SCHEMA); | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|  |   it('should return empty schema and default UI schema for unknown database type', () => { | ||||||
|  |     const result = getDatabaseConfig('UnknownType' as DatabaseServiceType); | ||||||
|  | 
 | ||||||
|  |     expect(result).toHaveProperty('schema'); | ||||||
|  |     expect(result).toHaveProperty('uiSchema'); | ||||||
|  |     expect(result.schema).toEqual({}); | ||||||
|  |     expect(result.uiSchema).toEqual(COMMON_UI_SCHEMA); | ||||||
|  |   }); | ||||||
|  | }); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Aniket Katkar
						Aniket Katkar