-
Notifications
You must be signed in to change notification settings - Fork 3k
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
refactor(ui): Improving Kafka UI Ingestion Form, Create Domain, Create Secret Modals #6588
refactor(ui): Improving Kafka UI Ingestion Form, Create Domain, Create Secret Modals #6588
Conversation
…oving-kafka-ui-ingest
…oving-kafka-ui-ingest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great to me! i have one question but not stopping from approval. great stuff 👍
@@ -88,7 +82,7 @@ export default function CreateDomainModal({ onClose, onCreate }: Props) { | |||
<Button onClick={onClose} type="text"> | |||
Cancel | |||
</Button> | |||
<Button id="createDomainButton" onClick={onCreateDomain} disabled={createButtonEnabled}> | |||
<Button id="createDomainButton" onClick={onCreateDomain} disabled={!createButtonEnabled}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol nice
{ min: 1, max: 50 }, | ||
{ pattern: /^[^\s\t${}\\,'"]+$/, message: 'This secret name is not allowed.' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some special characters regex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! We don't want to screw up the injection into the recipe process... We've seen this as an issue before.
@@ -79,11 +80,16 @@ function SecretFieldTooltip({ tooltipLabel }: { tooltipLabel?: string | ReactNod | |||
); | |||
} | |||
|
|||
function SecretField({ field, secrets, removeMargin, refetchSecrets }: SecretFieldProps) { | |||
const options = secrets.map((secret) => ({ value: `\${${secret.name}}`, label: secret.name })); | |||
const encodeSecret = (secretName: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
return updatedRecipe; | ||
} | ||
set(updatedRecipe, fieldPath, value); | ||
if (value === null || value === '' || value === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you find out when undefined
gets passed in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like I said before, I'm pretty sure this check was when we would pass extra values in here that shouldn't be updated but has since been refactored, so I'm pretty sure this is a safe change to make (also if it's undefined it makes sense we should clear it and its parents if they're empty as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not found any issues while testing it out locally...
@@ -25,7 +25,7 @@ | |||
"name": "kafka", | |||
"displayName": "Kafka", | |||
"docsUrl": "https://datahubproject.io/docs/generated/ingestion/sources/kafka/", | |||
"recipe": "source:\n type: kafka\n config:\n connection:\n consumer_config:\n security.protocol: \"SASL_SSL\"\n sasl.mechanism: \"PLAIN\"\n stateful_ingestion:\n enabled: true'" | |||
"recipe": "source:\n type: kafka\n config:\n connection:\n consumer_config:\n security.protocol: \"PLAINTEXT\"\n stateful_ingestion:\n enabled: false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want stateful ingestion enabled by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for kafka - it currently breaks the source - facepalm.
Summary
In this PR, we introduce various improvements to Kafka Ingestion Form, Create Domain Form, Create Secret Form, and UI ingestion more broadly.
Screen.Recording.2022-11-30.at.4.01.43.PM.mov
Checklist