-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 ConnectorsView #21531
Merged
Merged
🪟🔧 Refactor ConnectorsView #21531
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ae0ce1f
WIP
9072c0f
WIP
57ef95e
Merge remote-tracking branch 'origin/master' into flash1293/refactor-…
79da160
wip
d3fc627
more fixes
8c99481
Merge branch 'master' into flash1293/refactor-connectorview
dbbfc23
fix test
d63b056
Merge remote-tracking branch 'origin/master' into flash1293/refactor-…
a70a3c7
remove some more styled components and improve memoization
fd91853
Merge remote-tracking branch 'origin/master' into flash1293/refactor-…
732cb59
Merge branch 'master' into flash1293/refactor-connectorview
9c74527
Merge branch 'master' into flash1293/refactor-connectorview
6b7900c
Merge remote-tracking branch 'origin/master' into flash1293/refactor-…
121d177
review comment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
airbyte-webapp/src/components/Indicator/Indicator.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@use "scss/colors"; | ||
|
||
.indicator { | ||
height: 10px; | ||
width: 10px; | ||
border-radius: 50%; | ||
background: colors.$red; | ||
} | ||
|
||
.hidden { | ||
background-color: transparent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import styled from "styled-components"; | ||
import classNames from "classnames"; | ||
|
||
export const Indicator = styled.div` | ||
height: 10px; | ||
width: 10px; | ||
border-radius: 50%; | ||
background: ${({ theme }) => theme.dangerColor}; | ||
`; | ||
import styles from "./Indicator.module.scss"; | ||
|
||
export interface IndicatorProps { | ||
/** | ||
* Set to true to render an invisible indicator so reserve the space in the UI | ||
*/ | ||
hidden?: boolean; | ||
className?: string; | ||
} | ||
|
||
export const Indicator: React.FC<IndicatorProps> = ({ hidden, className }) => ( | ||
<div className={classNames(className, styles.indicator, { [styles.hidden]: hidden })} /> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...e-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/ConnectorCell.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.iconContainer { | ||
height: 25px; | ||
} |
44 changes: 8 additions & 36 deletions
44
airbyte-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/ConnectorCell.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/ConnectorsView.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
.changeToHeader { | ||
margin-left: 200px; | ||
} | ||
|
||
.connectorsTable { | ||
td { | ||
padding-top: variables.$spacing-sm; | ||
padding-bottom: variables.$spacing-sm; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this change made? And is it intentional that this change was only made to SourcesPage and not also to DestinationsPage?
Side note: it seems like the logic in those two components is almost exactly the same, so a lot of it could be moved into the
ConnectorsView
component, with props to differentiate between the source- or destination-specific methods. What do you think? Could also be done in a separate PR if you'd prefer - just thought I'd call it out here since we are already refactoring in this PRThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to do the same change for the destination, thanks for catching this. This is done to prevent a full re-render of the table on state change of the feedback list. If onUpdateVersion changes, then renderColumns changes here
airbyte/airbyte-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/ConnectorsView.tsx
Line 124 in fd91853
which in turn means the columns object passed to the table changes here:
airbyte/airbyte-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/ConnectorsView.tsx
Line 151 in fd91853
which should be avoided (the docs say that the columns should be memoized: https://react-table-v7.tanstack.com/docs/api/useTable which means if they change reference it's pretty expensive)