diff --git a/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js b/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js index 63963eb1e0d..2545c386763 100644 --- a/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js +++ b/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js @@ -36,7 +36,7 @@ import { yupResolver } from '@hookform/resolvers/yup' import { groupBy } from 'lodash-es' import { genUpdates } from '@/lib/utils' -import { providers } from '@/lib/utils/initial' +import { types, providers } from '@/lib/utils/initial' import { nameRegex, keyRegex } from '@/lib/utils/regex' import { useSearchParams } from 'next/navigation' @@ -58,7 +58,7 @@ const schema = yup.object().shape({ nameRegex, 'This field must start with a letter or underscore, and can only contain letters, numbers, and underscores' ), - type: yup.mixed().oneOf(['relational', 'fileset']).required(), + type: yup.mixed().oneOf(types).required(), provider: yup.mixed().oneOf(providerTypeValues).required(), propItems: yup.array().of( yup.object().shape({ @@ -287,6 +287,9 @@ const CreateCatalogDialog = props => { if (typeSelect === 'fileset') { setProviderTypes(providers.filter(p => p.value === 'hadoop')) setValue('provider', 'hadoop') + } else if (typeSelect === 'messaging') { + setProviderTypes(providers.filter(p => p.value === 'kafka')) + setValue('provider', 'kafka') } else { setProviderTypes(providers.filter(p => p.value !== 'hadoop')) setValue('provider', 'hive') @@ -424,8 +427,13 @@ const CreateCatalogDialog = props => { labelId='select-catalog-type' disabled={type === 'update'} > - relational - fileset + {types.map((item, index) => { + return ( + + {item} + + ) + })} )} /> diff --git a/web/src/lib/utils/initial.js b/web/src/lib/utils/initial.js index 476879b1e4b..9c51a332170 100644 --- a/web/src/lib/utils/initial.js +++ b/web/src/lib/utils/initial.js @@ -3,7 +3,21 @@ * This software is licensed under the Apache License version 2. */ +export const types = ['relational', 'fileset', 'messaging'] + export const providers = [ + { + label: 'kafka', + value: 'kafka', + defaultProps: [ + { + key: 'boostrap.servers', + value: '', + required: true, + description: 'The Kafka broker(s) to connect to, allowing for multiple brokers by comma-separating them' + } + ] + }, { label: 'hadoop', value: 'hadoop',