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 refresh schema logic to handle confirmation modal and other edge cases #19131

Merged
merged 3 commits into from
Nov 29, 2022

Conversation

edmundito
Copy link
Contributor

@edmundito edmundito commented Nov 8, 2022

What

This change ensures that:

  • The "discard changes" confirmation modal appears after the schema has been refreshed.
  • The updated schema and catalogId are discarded when the user cancels or navigates away from the page
  • The catalog diff modal appears only if the connection diff has changed
  • The connection is now patched only with the changes that were sent

Some of this functionality was lost during the refactor in #15603

How

The connection sync catalog and the schema are stored when the hook is initialized so that they can be reset if the user cancels or navigates away from the tab. These are only updated when the syncCatalog is updated.

Additionally, I updated the tests to check for diffs and added additional interfaces to track references of hook usage better.

Recommended reading order

airbyte-webapp/src/hooks/services/ConnectionEdit/ConnectionEditService.tsx
airbyte-webapp/src/hooks/services/ConnectionEdit/ConnectionEditService.test.tsx
Rest of code

@edmundito edmundito added team/platform-move area/frontend Related to the Airbyte webapp labels Nov 8, 2022
@edmundito edmundito requested a review from a team as a code owner November 8, 2022 16:42
@github-actions github-actions bot added the area/platform issues related to the platform label Nov 8, 2022
@krishnaglick krishnaglick self-requested a review November 8, 2022 17:48
@edmundito edmundito self-assigned this Nov 8, 2022
@edmundito edmundito force-pushed the edmundito/refresh-discard-confirmation branch from 47df903 to 24b22d9 Compare November 14, 2022 23:19
@edmundito edmundito changed the title Update refresh schema logic to handle confirmation modal 🪟 🐛 Update refresh schema logic to handle confirmation modal and other edge cases Nov 14, 2022
@edmundito edmundito requested review from krishnaglick and a team November 14, 2022 23:31
* Update the refresh schema separately
* Only mark as refreshed if the syncCatalog has changed
* Add option to clear refreshed schema
* Update tests
* ConnectionEditService now marks schema as refreshed only if the catalog has changed, clears refresh after schema update
* Add mockCatalog diff and add refresh schema tests to connection edit service
* Add interfaces to useConnectionEdit and useConnectionForm to better track references
* Remove clearRefreshedSchema from ConnectionReplicationTab form submit
* Update useConfirmCatalogDiff to only show if the diff has changed, instead of the whole connection
@edmundito edmundito force-pushed the edmundito/refresh-discard-confirmation branch from 8c3565c to fe85b9f Compare November 29, 2022 14:36
@edmundito edmundito merged commit 2c9d099 into master Nov 29, 2022
@edmundito edmundito deleted the edmundito/refresh-discard-confirmation branch November 29, 2022 16:30
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 team/platform-move
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants