Skip to content

🪟 [Multi Cloud] Geography Dropdown Component #18543

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

Closed
wants to merge 22 commits into from

Conversation

natalyjazzviolin
Copy link
Contributor

What

Closes https://github.com/airbytehq/airbyte-cloud/issues/3283

  • This creates a dropdown component with mock data for the Geography API as a first step in the Multi Cloud project.
  • The component has a storybook file and currently does not affect production.

Screen Shot 2022-10-27 at 9 26 28 AM

Recommended reading order

  1. airbyte-webapp/src/components/GeographyDropdown/GeographyDropdown.tsx
  2. airbyte-webapp/src/components/GeographyDropdown/GeographyDropdown.module.scss
  3. airbyte-webapp/src/components/GeographyDropdown/index.stories.tsx

🚨 User Impact 🚨

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@natalyjazzviolin natalyjazzviolin requested a review from a team as a code owner October 27, 2022 13:28
@github-actions github-actions bot added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Oct 27, 2022
Copy link
Contributor

@joeykmh joeykmh left a comment

Choose a reason for hiding this comment

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

Good start! I spun it up locally but the styling is not looking quite right:

image

It looks like some of your styles are being overridden by react-select default styles:

image

Copy link
Contributor

@joeykmh joeykmh left a comment

Choose a reason for hiding this comment

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

Left a few more comments, let me know if anything is unclear!

@natalyjazzviolin
Copy link
Contributor Author

natalyjazzviolin commented Nov 1, 2022

@josephkmh thank you for the review! I apologize for missing silly details, I was struggling with types and trying to get this ready ASAP - will make sure to be more attentive next time!!

I am still looking into how to set the isFocused styles correctly - for now I've altered the code so the dropdown options are accessible. The selected option background color does not persist, so I am wondering if it's best to set it outside of that style block somehow. I'm actively looking into it, but if you've got any advice - please let me know! Thank you for your time!


const customStyles: StylesConfig<GeographySelectOption> = {
option: (base, state) => {
let backgroundColor = theme.white;
Copy link
Contributor

Choose a reason for hiding this comment

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

The theme files are going to go away, since they are only used for our legacy styled-components system. We should not use them in new code anymore. Instead if you need to get access in TS to colors, you should explicitally export them from your own SCSS file, e.g. see https://github.com/airbytehq/airbyte/blob/master/airbyte-webapp/src/components/ui/StatusIcon/CircleLoader.module.scss#L21-L25

Ideally though whenever possible you should prefer setting className instead and have all styling in the SCSS file (but there are legit cases when that's not necessarily possible, I'm not sure if this place here might support className actually?).

Copy link
Contributor

Choose a reason for hiding this comment

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

I advised to import from scss/export.module.scss here, but seems like re-exporting is the preferred method. Sorry for the bad advice @natalyjazzviolin!

FWIW I think you could do all this styling in GeographyDropdown.module.scss. You can beat react-select's CSS specificity by using something like :global(.reactSelect__option--is-focused).option { ... }. Note that :global() is special CSS modules syntax that lets you reference a non-scoped "normal" CSS class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@josephkmh react-select's specificity was trumping the GeographyDropdown.module.scss styles, but this is really helpful, thank you! I'll get right on it!

@joeykmh
Copy link
Contributor

joeykmh commented Nov 3, 2022

@natalyjazzviolin could we move this component to src/components/common folder? We are doing a bit of a folder restructure and I think that's the best place for this component to live.

@natalyjazzviolin natalyjazzviolin requested review from a team as code owners November 3, 2022 18:26
@natalyjazzviolin natalyjazzviolin requested a review from a team November 3, 2022 18:26
@CLAassistant
Copy link

CLAassistant commented Nov 3, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/api Related to the api area/connectors Connector related issues area/documentation Improvements or additions to documentation area/protocol area/server area/worker Related to worker CDK Connector Development Kit kubernetes labels Nov 3, 2022
@timroes
Copy link
Contributor

timroes commented Nov 16, 2022

CLosing this for now, since we first want to continue work on ListBox and then rebuild this on top of ListBox.

@timroes timroes closed this Nov 16, 2022
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 area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants