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

🪟 🧹 Custom connectors in Cloud UI updates #21034

Merged
merged 17 commits into from
Jan 10, 2023

Conversation

teallarson
Copy link
Contributor

@teallarson teallarson commented Jan 4, 2023

What

closes airbytehq/airbyte-cloud#3753

  • Connector doc URL should not be required for custom connectors on cloud
  • More useful placeholder text
  • Update field label for docker repository name --> docker full image name
  • Check if docs URL is a valid URL for custom connectors
  • Denote which fields are required in the form
  • Docs side panel shouldn't show for custom connectors

Screenshot 2023-01-04 at 4 42 26 PM

How

  • Conditional yup schema, label, and placeholder in the modal form based on whether we are in Cloud mode.
  • Also added some better visual feedback for validation errors (unblocking submit button as soon as the form is dirty, adding input highlighting and messaging for errors)

Recommended reading order

  1. <CreateConnectorModal />
  2. everything else

@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Jan 4, 2023
@@ -117,7 +122,7 @@ const CreateConnectorModal: React.FC<IProps> = ({ onClose, onSubmit, errorMessag
}}
validateOnBlur
validateOnChange
validationSchema={validationSchema}
validationSchema={isCloudApp() === false ? standardValidationSchema : customConnectorValidationSchema}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I would use the FeatureService over isCloudApp(), but the AllowCustomImageUpload doesn't tell us if a user is on Cloud specifically. Open to a better check if someone has one!

"admin.dockerImageTag": "Docker image tag",
"admin.dockerImageTag.placeholder": "12.3",
"admin.documentationUrl": "Connector Documentation URL",
"admin.documentationUrl": "Connector documentation URL",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

casing was inconsistent with other labels

@@ -18,6 +18,10 @@ const Link = styled.a`
`;

const ImageCell: React.FC<ImageCellProps> = ({ imageName, link }) => {
if (!link || !link.length) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the cell in the tables on /settings/sources and /settings/destinations with the docker repository image name and the docs link.

dockerImageTag: yup.string().required("form.empty.error"),
dockerRepository: yup.string().required("form.empty.error"),
name: yup.string().trim().required("form.empty.error"),
documentationUrl: yup.string().trim().url("form.url.error").notRequired(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this makes this field optional for OSS as well, which also does not appear to do anything with it beyond the link on the connectors list in settings + the docs panel.

@teallarson teallarson marked this pull request as ready for review January 5, 2023 20:18
@teallarson teallarson requested a review from a team as a code owner January 5, 2023 20:18
@teallarson
Copy link
Contributor Author

Note: I have not been able to manually test the documentation panel behavior for a custom connector on cloud, however I have verified using OSS, including the behavior for a connector with no documentation URL and an external documentation URL.

Custom connectors on cloud dev environments is blocked by airbytehq/airbyte-cloud/pull/3952

There is a workaround but I feel confident having seen the behavior in OSS.

const CreateConnectorModal: React.FC<IProps> = ({ onClose, onSubmit, errorMessage }) => {
const Label: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => {
return (
<Text as="span" bold size="lg" className={styles.label}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as="span" allows us to use the built in message prop on the input to display any validation errors

Copy link
Contributor

@josephkmh josephkmh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Just left a few minor comments. I tested it locally and the form UX is much nicer ✨

Comment on lines 509 to +512
"admin.dockerRepository": "Docker repository name",
"admin.dockerFullImageName": "Docker full image name",
"admin.dockerRepository.placeholder": "airbytehq/postgres",
"admin.dockerFullImageName.placeholder": "customer-name/customer-image",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second though, I'm not sure if the distinction between OSS & cloud is very useful. I don't think customer-name/customer-image is self-explanatory - customers will need to be informed or read the docs to know exactly what to put in this field (not just e.g. xiaohan-test/xiaohan-custom-fake but rather the full path like us-central1-docker.pkg.dev/airbyte-custom-connectors/xiaohan-test/xiaohan-custom-fake). Since we have a link to the docs already, I think putting explicit instructions there is sufficient.

I would suggest we keep more or less what we had before, just changing Docker repository name to Docker image name to align with Docker image tag WDYT? Cc @xiaohansong @sophia-wiley

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, but I'll wait for those tagged to chime in before I make the change!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that using Docker image name is the best way to go!

…t/ConnectorDocumentationLayout.tsx

Co-authored-by: Joey Marshment-Howell <josephkmh@users.noreply.github.com>
@octavia-squidington-iv octavia-squidington-iv removed the area/platform issues related to the platform label Jan 9, 2023
@teallarson teallarson requested a review from josephkmh January 9, 2023 14:51
@teallarson
Copy link
Contributor Author

teallarson commented Jan 9, 2023

Ready for re-review

Copy link
Contributor

@josephkmh josephkmh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@teallarson teallarson merged commit 0b27aa5 into master Jan 10, 2023
@teallarson teallarson deleted the teal/custom-connectors-ui-cleanup branch January 10, 2023 20:34
jbfbell pushed a commit that referenced this pull request Jan 13, 2023
* check if doc url is a valid url in cloud, but don't require it

* field label and placeholder

* cleanup

* match casing for other form labels

* cleanup imports

* hide documentation panel if URL is empty

* only show documentation panel if url is from our docs

* make docs url optional, don't put a link in conncectorsview if empty

* Update airbyte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx

Co-authored-by: Joey Marshment-Howell <josephkmh@users.noreply.github.com>

* use <FormattedMessage />, cleanup from Joey's commit in review comment

* Use <Text/> component in ImageCell, get styled components out of there while I'm at it

* add "required" labels

* show validation error regardless of `touched` for documentationUrl

* use old placeholder instead

Co-authored-by: Joey Marshment-Howell <josephkmh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants