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

🪟🐛 Connector form: Make control reflect actual value of form field #21911

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

flash1293
Copy link
Contributor

Fixes #21910

The Control component would automatically fill in the default value if no value is set for selects, inputs and text areas. However this can hide the actual state of the form that will be persisted in the database - for unchanging specs this doesn't matter because setDefaultValues in

makes sure to set the default values in the form state itself, but when the spec is changing an an actor is edited, this can get out of sync.

This PR makes sure the actual value from the form values is reflected in the UI as well.

For an additional prop in the spec like this:

{
  title: "Additional prop",
  type: "string",
  enum: ["one", "two", "three"],
  default: "two",
}

Before:
Screenshot 2023-01-26 at 13 30 23

After:
Screenshot 2023-01-26 at 13 30 04

@flash1293 flash1293 changed the title 🪟🐛 Connector form: Make control reflect actual value of controls 🪟🐛 Connector form: Make control reflect actual value of form field Jan 26, 2023
@octavia-squidington-iv octavia-squidington-iv added the area/frontend Related to the Airbyte webapp label Jan 26, 2023
@flash1293 flash1293 marked this pull request as ready for review January 26, 2023 14:43
@flash1293 flash1293 requested a review from lmossman January 26, 2023 14:43
Copy link
Contributor

@lmossman lmossman left a comment

Choose a reason for hiding this comment

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

For all of the slack discussion, multiple github issues, and great PR description, it was hilarious to me that the actual solution was literally deleting half of a line of code 😆

Change LGTM, tested locally and it works as expected!

@flash1293
Copy link
Contributor Author

For all of the slack discussion, multiple github issues, and great PR description, it was hilarious to me that the actual solution was literally deleting half of a line of code 😆

My next PR will be 3000 LOC and a single sentence of description to make up for it 😉

@flash1293 flash1293 enabled auto-merge (squash) January 27, 2023 10:50
@flash1293 flash1293 merged commit de7881b into master Jan 27, 2023
@flash1293 flash1293 deleted the flash1293/undefined-select branch January 27, 2023 11:14
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 team/extensibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connector form: Do not pre-select value in select for undefined
3 participants