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

🪟 🎉 Prevent users from editing existing connection if they have a schema change #20276

Merged
merged 13 commits into from
Dec 16, 2022

Conversation

teallarson
Copy link
Contributor

@teallarson teallarson commented Dec 8, 2022

What

closes #20201

Screenshot 2022-12-08 at 7 33 31 PM

How

We would like this to only cover the sync catalog, not the schedule and non-breaking changes preferences dropdown. Because that requires more refactoring of this form, for now we are just blocking the entire form.

Recommended reading order

  1. <SchemaChangeBackdrop/> and its scss module
  2. <ConnectionReplicationTab />
  3. others

Testing

Have REACT_APP_AUTO_DETECT_SCHEMA_CHANGES=true when you start the frontend.
Make a breaking change to a connection, then refresh the schema and navigate away to trigger the new flow.
If you navigate back to Replication tab, you should see the overlay!

When you hit View Changes it should disappear.

When you resolve the breaking change and submit, you should not see the overlay.

@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Dec 8, 2022
@teallarson teallarson changed the title Teal/block connection form on breaking change 🪟 🎉 Prevent users from editing connection if they have a breaking change Dec 8, 2022
@teallarson teallarson changed the title 🪟 🎉 Prevent users from editing connection if they have a breaking change 🪟 🎉 Prevent users from editing existing connection if they have a breaking change Dec 8, 2022
@teallarson teallarson changed the title 🪟 🎉 Prevent users from editing existing connection if they have a breaking change 🪟 🎉 Prevent users from editing existing connection if they have a breaking schema change Dec 8, 2022
@teallarson teallarson changed the title 🪟 🎉 Prevent users from editing existing connection if they have a breaking schema change [Blocked] 🪟 🎉 Prevent users from editing existing connection if they have a breaking schema change Dec 9, 2022
@teallarson teallarson temporarily deployed to more-secrets December 13, 2022 16:36 — with GitHub Actions Inactive
@teallarson teallarson temporarily deployed to more-secrets December 13, 2022 16:36 — with GitHub Actions Inactive
/>
{status.editControlsVisible && (
<EditControls
<SchemaChangeBackdrop
Copy link
Contributor Author

Choose a reason for hiding this comment

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

only change here is wrapping this in the backdrop

@teallarson teallarson temporarily deployed to more-secrets December 13, 2022 17:00 — with GitHub Actions Inactive
@teallarson teallarson temporarily deployed to more-secrets December 13, 2022 17:01 — with GitHub Actions Inactive
@teallarson teallarson marked this pull request as ready for review December 13, 2022 17:04
@teallarson teallarson requested review from a team as code owners December 13, 2022 17:04
@teallarson teallarson changed the base branch from master to anne/update-endpoing-fixes-broken-connection December 13, 2022 17:08
@teallarson teallarson requested a review from a team as a code owner December 13, 2022 17:08
@teallarson teallarson changed the base branch from anne/update-endpoing-fixes-broken-connection to master December 13, 2022 17:09
@edmundito edmundito removed request for a team December 13, 2022 17:14
@teallarson teallarson temporarily deployed to more-secrets December 13, 2022 19:10 — with GitHub Actions Inactive
@teallarson teallarson temporarily deployed to more-secrets December 13, 2022 19:11 — with GitHub Actions Inactive
/>
{status.editControlsVisible && (
<EditControls
<SchemaChangeBackdrop>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

only change here is wrapping the form in the backdrop

@@ -5,3 +5,6 @@ $sidebar: 9999;
$panelSplitter: 0;
$dropdownMenu: 2;
$notification: 20;
$schemaChangesBackdrop: 3;
Copy link
Contributor Author

@teallarson teallarson Dec 13, 2022

Choose a reason for hiding this comment

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

explicitly set a higher z-index than the dropdown menu and the switch (1)

@@ -48,7 +48,7 @@ describe("<SchemaChangesDetected />", () => {

const { queryByTestId } = renderComponent();

expect(queryByTestId("schemaChagnesDetected")).toBeFalsy();
expect(queryByTestId("schemaChangesDetected")).toBeFalsy();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo fix

@teallarson teallarson temporarily deployed to more-secrets December 13, 2022 20:06 — with GitHub Actions Inactive

const { getByTestId } = renderComponent();

expect(getByTestId("schemaChangesBackdrop")).toMatchSnapshot();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could test the content directly here for the text, but i don't know a good way to test which .svg is rendered here aside from the snapshot. Open to ideas!

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.

Prevent the user from editing stream if there is a breaking schema change
4 participants