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

refactor(ui): Improving Kafka UI Ingestion Form, Create Domain, Create Secret Modals #6588

Merged

Conversation

jjoyce0510
Copy link
Collaborator

@jjoyce0510 jjoyce0510 commented Dec 1, 2022

Summary

In this PR, we introduce various improvements to Kafka Ingestion Form, Create Domain Form, Create Secret Form, and UI ingestion more broadly.

  • Support Form Fields changing the value of the form.. (by passing the FormInstance object as a prop)
  • Support required / optional Form Fields
  • Support clearing Form Field selects
  • AutoPopulate Input Fields once secrets are created (see video below)
  • Refactor Create Domain Form to correctly support suggested names, and to correctly display 'Create' button
  • Refactor Create Secret Form to remove use of state, migrate to using Ant forms. Correctly display 'Create' button
  • Fix: Make secret names more restrictive in type. Exclude special characters.
  • Fix: Fix Kafka default ingestion source bug (extra ' )
  • Fix: Improve the copy for tooltips in Kafka source.
  • Fix: Support PLAINTEXT, SSL security modes in Kafka source.
  • Migrate Create Domain, Create Secret description inputs to be Input.TextArea.

Screen Shot 2022-11-30 at 4 10 35 PM

Screen.Recording.2022-11-30.at.4.01.43.PM.mov

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Dec 1, 2022
@github-actions
Copy link

github-actions bot commented Dec 1, 2022

Unit Test Results (build & test)

621 tests  ±0   617 ✔️ ±0   15m 45s ⏱️ ±0s
157 suites ±0       4 💤 ±0 
157 files   ±0       0 ±0 

Results for commit 8fdefb6. ± Comparison against base commit 4ca3327.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a 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}>
Copy link
Collaborator

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.' },
Copy link
Collaborator

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?

Copy link
Collaborator Author

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) => {
Copy link
Collaborator

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) {
Copy link
Collaborator

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?

Copy link
Collaborator

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)

Copy link
Collaborator Author

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"
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@jjoyce0510 jjoyce0510 merged commit df96e89 into datahub-project:master Dec 1, 2022
cccs-Dustin pushed a commit to CybercentreCanada/datahub that referenced this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants