Skip to content

Commit

Permalink
🪟 🎉 Simplify UI for non-breaking schema changes (#9271)
Browse files Browse the repository at this point in the history
  • Loading branch information
teallarson committed Oct 17, 2023
1 parent 84564eb commit 396f7f3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
}

&.nonBreaking {
color: colors.$yellow;
color: colors.$blue;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons";
import { faExclamationCircle, faInfoCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import classnames from "classnames";
import React from "react";
Expand Down Expand Up @@ -30,7 +30,7 @@ export const ChangesStatusIcon: React.FC<ChangesStatusIconProps> = ({ schemaChan
control={
<FontAwesomeIcon
className={iconStyle}
icon={faExclamationCircle}
icon={schemaChange === "breaking" ? faExclamationCircle : faInfoCircle}
size="2x"
data-testid={`changesStatusIcon-${schemaChange}`}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const StatusCell: React.FC<StatusCellProps> = ({
hasBreakingChange={hasBreakingChange}
connection={connection}
/>
{allowAutoDetectSchema && <ChangesStatusIcon schemaChange={schemaChange} />}
{allowAutoDetectSchema && hasBreakingChange && <ChangesStatusIcon schemaChange={schemaChange} />}
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const SchemaChangeMessage: React.FC<{ dirty: boolean; schemaChange: SchemaChange
if (hasNonBreakingSchemaChange) {
return (
<Message
type="warning"
type="info"
text={<FormattedMessage id="connection.schemaChange.nonBreaking" />}
actionBtnText={<FormattedMessage id="connection.schemaChange.reviewAction" />}
onAction={refreshSchema}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const ErrorMessage: React.FC = () => {
const workspaceId = useCurrentWorkspaceId();
const { connection } = useConnectionEditService();
const { lastCompletedSyncJob } = useConnectionSyncContext();
const { hasSchemaChanges, hasBreakingSchemaChange } = useSchemaChanges(connection.schemaChange);
const { hasBreakingSchemaChange } = useSchemaChanges(connection.schemaChange);
const sourceActorDefinitionVersion = useSourceDefinitionVersion(connection.sourceId);
const destinationActorDefinitionVersion = useDestinationDefinitionVersion(connection.destinationId);
const connectorBreakingChangeDeadlinesEnabled = useFeature(FeatureItem.ConnectorBreakingChangeDeadlines);
Expand Down Expand Up @@ -121,14 +121,14 @@ export const ErrorMessage: React.FC = () => {
}

// If we have schema changes, show the correct message
if (hasSchemaChanges) {
if (hasBreakingSchemaChange) {
const schemaChangeWarning = {
text: formatMessage({
id: `connection.schemaChange.${hasBreakingSchemaChange ? "breaking" : "nonBreaking"}`,
id: "connection.schemaChange.breaking",
}),
onAction: () => navigate(`../${ConnectionRoutePaths.Replication}`, { state: { triggerRefreshSchema: true } }),
actionBtnText: formatMessage({ id: "connection.schemaChange.reviewAction" }),
type: hasBreakingSchemaChange ? "error" : "warning",
type: "error",
} as const;
errorMessages.push(schemaChangeWarning);
}
Expand Down Expand Up @@ -211,7 +211,6 @@ export const ErrorMessage: React.FC = () => {
}, [
formatMessage,
hasBreakingSchemaChange,
hasSchemaChanges,
lastCompletedSyncJob,
navigate,
connection.sourceId,
Expand Down

0 comments on commit 396f7f3

Please sign in to comment.