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

🪟 🐛 Update connection name - fix minor issues #13550

Merged
merged 31 commits into from
Jul 8, 2022

Conversation

dizel852
Copy link
Contributor

@dizel852 dizel852 commented Jun 7, 2022

What

Closes #13416

How

  • Fix the case when a user wasn't able to remove the last char in the connection name
  • Remove the whole connection name by "selecting all" keyboard shortcut
  • Do not allow the user to save an empty name - revert to the name set before the edit action.

CPT2206071129-1179x336

Recommended reading order

  1. Input.tsx - there was an issue in the base Input component. With extra props drilling which caused firing 'onChange' twice
  2. ConnectionName.tsx
  3. the rest

- unable to delete last chart in input
- delete the whole name by 'select all' command
- trim entered names
- don't allow to save empty names
…sues

# Conflicts:
#	airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/components/ConnectionName.tsx
#	airbyte-webapp/src/utils/addEnterEscFuncForInput.tsx
@github-actions github-actions bot added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Jun 7, 2022
@@ -102,7 +102,7 @@ const Input: React.FC<InputProps> = (props) => {
}, [inputRef, defaultFocus]);

return (
<InputContainer {...props} className={focused ? "input-container--focused" : undefined}>
<InputContainer className={focused ? "input-container--focused" : undefined}>
<InputComponent
{...props}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@edmundito need your advice. Here we pass the props to InputContainer and InputComponent. Which causes firing onChange twice. Do we really need to rethrow props to InputContainer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Great that you figured out why onChange was firing twice. No, we do not need it. All we need is disabled for the theme to work correctly.

@dizel852 dizel852 marked this pull request as ready for review June 7, 2022 16:08
@dizel852 dizel852 requested a review from a team as a code owner June 7, 2022 16:08
Copy link
Contributor

@teallarson teallarson left a comment

Choose a reason for hiding this comment

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

Nice fixes. I did notice that we are able to edit the Connection name when the Connection is in the middle of a Sync. When you do so, unfocusing the field doesn't reflect the "new" name (you have to refresh the page to see it). I wonder if we should be able to edit the name during a sync or not. If so, we should probably tidy that up!

@dizel852
Copy link
Contributor Author

if we should be able to edit the name during a sync or not.

@tealjulia Good question! Need to polish this feature as much as we can 🔥
@timroes @edmundito @andyjih any thoughts?

@andyjih
Copy link
Contributor

andyjih commented Jun 10, 2022

I think editing the name of a connection is unrelated to sync jobs that might be in-progress, so I don't think of that as an issue.

@dizel852
Copy link
Contributor Author

A little bit polished the feature and pushed some updates:

  • fixed e2e tests
  • replaces styled components with scss using color/size variables(thanks @edmundito, that just awesome 👍 🎉)
  • fixed props: any with types
  • added eslint-plugin-css-modules. And since we already have some issues with scss I switched the rules to "warning" mode, at least for a transition period.

Screenshot at Jun 16 18-54-07

- turn on eslint css modules rule as error
- remove unused styles
airbyte-webapp/src/scss/_variables.scss Show resolved Hide resolved
@@ -102,7 +102,7 @@ const Input: React.FC<InputProps> = (props) => {
}, [inputRef, defaultFocus]);

return (
<InputContainer {...props} className={focused ? "input-container--focused" : undefined}>
<InputContainer className={focused ? "input-container--focused" : undefined}>
<InputComponent
{...props}
Copy link
Contributor

Choose a reason for hiding this comment

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

Great that you figured out why onChange was firing twice. No, we do not need it. All we need is disabled for the theme to work correctly.

airbyte-webapp/.eslintrc Outdated Show resolved Hide resolved
airbyte-webapp/src/utils/withKeystrokeHandler.tsx Outdated Show resolved Hide resolved
…sues

# Conflicts:
#	airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/components/ConnectionName.tsx
@dizel852 dizel852 changed the title Update connection name - fix minor issues 🪟 🔧 Update connection name - fix minor issues Jun 21, 2022
@edmundito edmundito changed the title 🪟 🔧 Update connection name - fix minor issues 🪟 🐛 Update connection name - fix minor issues Jul 8, 2022
@dizel852 dizel852 merged commit 1e808ec into master Jul 8, 2022
@dizel852 dizel852 deleted the vlad/13416-connections-rename-fix-minor-issues branch July 8, 2022 18:11
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.

Renaming connection name: couple of issues
4 participants