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

🪟 🐛 Fix non-breaking schema changes preference issues #20625

Merged
merged 2 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
"connectionForm.nonBreakingChangesPreference.label": "Non-breaking schema updates detected*",
"connectionForm.nonBreakingChangesPreference.message": "Set how Airbyte handles syncs when it detects a non-breaking schema change in the source",
"connectionForm.nonBreakingChangesPreference.ignore": "Ignore",
"connectionForm.nonBreakingChangesPreference.disable": "Disable connection",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this "Disable connection" instead of "Pause sync" as shown in the design because we don't really have a concept of pausing in the UI and this is what will actually happen - @andyjih thoughts?

"connectionForm.schemaChangesBackdrop.message": "Please review the schema updates before making changes to the connection",

"connectionForm.modal.destinationNamespace.title": "Destination namespace",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
gap: variables.$spacing-md;
}

.connectorLabel {
max-width: 328px;
margin-right: variables.$spacing-xl;
vertical-align: top;
}
Comment on lines -12 to -16
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably copied from the Schedule field. That also needs to be cleaned up but I omitted it here because of the scope of the PR.


.leftFieldCol {
flex: 1;
max-width: 640px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import { useConnectionFormService } from "hooks/services/ConnectionForm/Connecti

import styles from "./NonBreakingChangesPreferenceField.module.scss";

const SUPPORTED_PREFERENCES = [NonBreakingChangesPreference.ignore, NonBreakingChangesPreference.disable];
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 may add more options in the future that may not have an i18n string or may need to wait on the backend, so they need to be supported manually.


export const NonBreakingChangesPreferenceField: React.FC<FieldProps<string>> = ({ field, form }) => {
const { formatMessage } = useIntl();

const preferenceOptions = useMemo(() => {
const values = Object.values(NonBreakingChangesPreference);
return values.map((value) => ({
return SUPPORTED_PREFERENCES.map((value) => ({
value,
label: formatMessage({ id: `connectionForm.nonBreakingChangesPreference.${value}` }),
testId: `nonBreakingChangesPreference-${value}`,
Expand All @@ -29,7 +30,6 @@ export const NonBreakingChangesPreferenceField: React.FC<FieldProps<string>> = (
<div className={styles.flexRow}>
<div className={styles.leftFieldCol}>
<ControlLabels
className={styles.connectorLabel}
nextLine
label={formatMessage({
id: "connectionForm.nonBreakingChangesPreference.label",
Expand Down