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

🪟 🎨 Show Schema Update Errors to User #18008

Merged
merged 8 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const SchemaError = ({ schemaError }: { schemaError: SchemaErrorType }) =
const { refreshSchema } = useConnectionFormService();
return (
<Card>
<TryAfterErrorBlock onClick={refreshSchema} />
<TryAfterErrorBlock onClick={refreshSchema} message={schemaError?.message} />
{job && <JobItem job={job} />}
</Card>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,25 @@ import { Text } from "components/ui/Text";
import styles from "./TryAfterErrorBlock.module.scss";

interface TryAfterErrorBlockProps {
message?: React.ReactNode;
message?: string;
onClick: () => void;
}

export const TryAfterErrorBlock: React.FC<TryAfterErrorBlockProps> = ({ message, onClick }) => (
<div className={styles.container}>
<StatusIcon big />
<Text as="p" size="lg" centered className={styles.message}>
{message || <FormattedMessage id="form.schemaFailed" />}
</Text>
<Button className={styles.retryButton} onClick={onClick} variant="danger">
<FormattedMessage id="form.tryAgain" />
</Button>
</div>
);
export const TryAfterErrorBlock: React.FC<TryAfterErrorBlockProps> = ({ message, onClick }) => {
return (
<div className={styles.container}>
<StatusIcon big />
<Text as="p" size="lg" centered className={styles.message}>
<FormattedMessage id="form.schemaFailed" />
</Text>
{message && (
<Text as="p" size="lg" centered className={styles.message}>
<FormattedMessage id="form.error" values={{ message }} />
</Text>
)}
<Button className={styles.retryButton} onClick={onClick} variant="danger">
<FormattedMessage id="form.tryAgain" />
</Button>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,11 @@ exports[`CreateConnectionForm should render with an error 1`] = `
>
Failed to fetch schema. Please try again
</p>
<p
class="<removed-for-snapshot-test>"
>
Error: {value}
</p>
<button
class="<removed-for-snapshot-test>"
>
Expand Down
1 change: 1 addition & 0 deletions airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"sidebar.recipes": "Tutorials - Use cases",

"form.continue": "Continue",
"form.error": "Error: {value}",
"form.yourEmail": "Your email",
"form.email.placeholder": "[email protected]",
"form.email.error": "Enter a valid email",
Expand Down