Skip to content

Commit

Permalink
🪟 🐛 Fix messages and improve connector log (#17344)
Browse files Browse the repository at this point in the history
* Fix messages and improve connector log

* Remove deprecated strings
  • Loading branch information
timroes committed Oct 3, 2022
1 parent 64343fd commit 06fafa8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions airbyte-webapp/src/components/JobItem/components/MainInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ const MainInfo: React.FC<MainInfoProps> = ({ job, attempts = [], isOpen, onExpan
} else if (isPartialSuccess) {
status = "partialSuccess";
} else {
return <FormattedMessage id="sources.jobStatus.unknown" />;
return <FormattedMessage id="jobs.jobStatus.unknown" />;
}
return (
<FormattedMessage
values={{ count: streamsToReset?.length || 0 }}
id={`sources.jobStatus.${jobConfigType}.${status}`}
id={`jobs.jobStatus.${jobConfigType}.${status}`}
/>
);
}, [isPartialSuccess, jobConfigType, jobStatus, streamsToReset?.length]);
Expand Down
36 changes: 17 additions & 19 deletions airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,25 +261,23 @@
"sources.emptySchema": "Schema is empty",
"sources.noSources": "Source list is empty",
"sources.sourceSettings": "Source Settings",
"sources.failed": "Failed",
"sources.completed": "Completed",
"sources.succeeded": "Succeeded",
"sources.pending": "Pending",
"sources.running": "Running",
"sources.cancelled": "Cancelled",
"sources.incomplete": "Retrying",
"sources.partialSuccess": "Partial Success",
"sources.jobStatus.reset_connection.failed": "Reset Failed ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"sources.jobStatus.reset_connection.running": "Reset Running ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"sources.jobStatus.reset_connection.succeeded": "Reset Succeeded ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"sources.jobStatus.reset_connection.cancelled": "Reset Cancelled ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"sources.jobStatus.reset_connection.partialSuccess": "Reset Partial Success ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"sources.jobStatus.sync.failed": "Sync Failed",
"sources.jobStatus.sync.running": "Sync Running",
"sources.jobStatus.sync.succeeded": "Sync Succeeded",
"sources.jobStatus.sync.cancelled": "Sync Cancelled",
"sources.jobStatus.sync.partialSuccess": "Sync Partial Success",
"sources.jobStatus.unknown": "Status Unknown",
"jobs.jobStatus.reset_connection.failed": "Reset Failed ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"jobs.jobStatus.reset_connection.running": "Reset Running ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"jobs.jobStatus.reset_connection.succeeded": "Reset Succeeded ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"jobs.jobStatus.reset_connection.cancelled": "Reset Cancelled ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"jobs.jobStatus.reset_connection.partialSuccess": "Reset Partial Success ({count, plural, =0 {0 streams} one {# stream} other {# streams}})",
"jobs.jobStatus.sync.failed": "Sync Failed",
"jobs.jobStatus.sync.running": "Sync Running",
"jobs.jobStatus.sync.succeeded": "Sync Succeeded",
"jobs.jobStatus.sync.cancelled": "Sync Cancelled",
"jobs.jobStatus.sync.partialSuccess": "Sync Partial Success",
"jobs.jobStatus.check_connection_source.failed": "Configuration check failed",
"jobs.jobStatus.check_connection_source.succeeded": "Configuration check finished",
"jobs.jobStatus.check_connection_destination.failed": "Configuration check failed",
"jobs.jobStatus.check_connection_destination.succeeded": "Configuration check finished",
"jobs.jobStatus.discover_schema.succeeded": "Discovering schema succeeded",
"jobs.jobStatus.discover_schema.failed": "Discovering schema failed",
"jobs.jobStatus.unknown": "Status Unknown",
"sources.additionLogs": " Logs",
"sources.emptyLogs": "Waiting for logs...",
"sources.hour": "{hour}h ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Connector, ConnectorT } from "core/domain/connector";
import { SynchronousJobRead } from "core/request/AirbyteClient";
import { LogsRequestError } from "core/request/LogsRequestError";
import { useAnalyticsService } from "hooks/services/Analytics";
import { useAdvancedModeSetting } from "hooks/services/useAdvancedModeSetting";
import { generateMessageFromError } from "utils/errorStatusMessage";
import { ServiceForm, ServiceFormProps, ServiceFormValues } from "views/Connector/ServiceForm";

Expand Down Expand Up @@ -44,6 +45,8 @@ export const ConnectorCard: React.FC<ConnectorCardCreateProps | ConnectorCardEdi
const [saved, setSaved] = useState(false);
const [errorStatusRequest, setErrorStatusRequest] = useState<Error | null>(null);

const [advancedMode] = useAdvancedModeSetting();

const { testConnector, isTestConnectionInProgress, onStopTesting, error, reset } = useTestConnector(props);

useEffect(() => {
Expand Down Expand Up @@ -108,7 +111,8 @@ export const ConnectorCard: React.FC<ConnectorCardCreateProps | ConnectorCardEdi
props.successMessage || (saved && props.isEditMode && <FormattedMessage id="form.changesSaved" />)
}
/>
{job && <JobItem job={job} />}
{/* Show the job log only if advanced mode is turned on or the actual job failed (not the check inside the job) */}
{job && (advancedMode || !job.succeeded) && <JobItem job={job} />}
</Card>
);
};

0 comments on commit 06fafa8

Please sign in to comment.