Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2614] improve(web): Add web UI support for Kafka catalog #2757

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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({
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -424,8 +427,13 @@ const CreateCatalogDialog = props => {
labelId='select-catalog-type'
disabled={type === 'update'}
>
<MenuItem value={'relational'}>relational</MenuItem>
<MenuItem value={'fileset'}>fileset</MenuItem>
{types.map((item, index) => {
return (
<MenuItem key={item} value={item}>
{item}
</MenuItem>
)
})}
</Select>
)}
/>
Expand Down
14 changes: 14 additions & 0 deletions web/src/lib/utils/initial.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading