-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
🪟🔧 Refactor ConnectorsView #21531
Conversation
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.
A couple questions but nothing truly blocking. LGTM and seems to work well from local testing
const feedbackListRef = useRef(feedbackList); | ||
feedbackListRef.current = feedbackList; |
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 PR
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.
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
[allowUpdateConnectors, allowUploadCustomImage, onUpdateVersion] |
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
const usedDefinitionColumns = useMemo( |
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)
</Formik> | ||
</Content> | ||
</Modal> | ||
<Formik |
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.
Just curious, why did you move the Formik
outside of the Modal
?
* WIP * WIP * wip * more fixes * fix test * remove some more styled components and improve memoization * review comment
* feat: source-gitlab accept api_url w/ or w/o scheme * 🪟🔧 Refactor ConnectorsView (#21531) * WIP * WIP * wip * more fixes * fix test * remove some more styled components and improve memoization * review comment * feat: source-gitlab accept api_url w/ or w/o scheme * Revert allowedHosts missing value checks (#21923) * bump versions * update expected records * auto-bump connector version --------- Co-authored-by: Joe Reuter <joe@airbyte.io> Co-authored-by: Evan Tahler <evan@airbyte.io> Co-authored-by: Mal Hancock <mallory@archangelic.space> Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com> Co-authored-by: marcosmarxm <marcosmarxm@gmail.com> Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
* feat: source-gitlab accept api_url w/ or w/o scheme * 🪟🔧 Refactor ConnectorsView (airbytehq#21531) * WIP * WIP * wip * more fixes * fix test * remove some more styled components and improve memoization * review comment * feat: source-gitlab accept api_url w/ or w/o scheme * Revert allowedHosts missing value checks (airbytehq#21923) * bump versions * update expected records * auto-bump connector version --------- Co-authored-by: Joe Reuter <joe@airbyte.io> Co-authored-by: Evan Tahler <evan@airbyte.io> Co-authored-by: Mal Hancock <mallory@archangelic.space> Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com> Co-authored-by: marcosmarxm <marcosmarxm@gmail.com> Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
What
Fixes #20706
How
The following changes have been done: