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

🪟 🎨 Auto-detect schema changes UI fixes #20070

Merged
merged 3 commits into from
Dec 6, 2022
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
4 changes: 2 additions & 2 deletions airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@
"connection.linkedJobNotFound": "Job not found",
"connection.returnToSyncHistory": "Return to Sync History",

"connection.schemaChange.breaking": "Breaking schema updates detected.",
"connection.schemaChange.nonBreaking": "Non-breaking schema updates detected.",
"connection.schemaChange.breaking": "Breaking schema updates detected",
"connection.schemaChange.nonBreaking": "Non-breaking schema updates detected",
"connection.schemaChange.reviewAction": "Review changes",

"form.frequency": "Replication frequency*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
color: colors.$grey-300;
display: inline-block;
text-align: left;
cursor: pointer;

&:not(.disabled) {
cursor: pointer;
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import classNames from "classnames";
import React from "react";
import { FormattedMessage } from "react-intl";
import { useAsyncFn } from "react-use";
Expand Down Expand Up @@ -48,13 +49,18 @@ export const EnabledControl: React.FC<EnabledControlProps> = ({ disabled }) => {
updateConnection,
]);

const isSwitchDisabled = disabled || connectionUpdating;

return (
<div className={styles.container} data-testid="enabledControl">
<label htmlFor="toggle-enabled-source" className={styles.label}>
<label
htmlFor="toggle-enabled-source"
className={classNames(styles.label, { [styles.disabled]: isSwitchDisabled })}
>
<FormattedMessage id={connection.status === ConnectionStatus.active ? "tables.enabled" : "tables.disabled"} />
</label>
<Switch
disabled={disabled || connectionUpdating}
disabled={isSwitchDisabled}
onChange={onChangeStatus}
checked={connection.status === ConnectionStatus.active}
loading={loading}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const SchemaChangesDetected: React.FC = () => {
<Text size="lg">
<FormattedMessage id={`connection.schemaChange.${hasBreakingSchemaChange ? "breaking" : "nonBreaking"}`} />
</Text>
<Button onClick={onReviewActionButtonClick} isLoading={schemaRefreshing}>
<Button variant="dark" onClick={onReviewActionButtonClick} isLoading={schemaRefreshing}>
<FormattedMessage id="connection.schemaChange.reviewAction" />
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

&:hover {
background-color: colors.$grey-50;

&.breaking {
background-color: colors.$red-100;
}

&.nonBreaking {
background-color: colors.$yellow-100;
}
}
}

Expand Down