Skip to content

Commit

Permalink
πŸͺŸ πŸŽ‰ 🏁 Jobs history page refers to clearing data instead of resets (#1…
Browse files Browse the repository at this point in the history
…1807)
  • Loading branch information
teallarson committed Mar 26, 2024
1 parent b987534 commit f6eb9aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ import { Text } from "components/ui/Text";
import { JobWithAttempts } from "area/connection/types/jobs";
import { isJobPartialSuccess, getJobAttempts, getJobStatus } from "area/connection/utils/jobs";
import { JobStatus } from "core/api/types/AirbyteClient";
import { useExperiment } from "hooks/services/Experiment";

interface JobStatusLabelProps {
jobWithAttempts: JobWithAttempts;
}

export const JobStatusLabel: React.FC<JobStatusLabelProps> = ({ jobWithAttempts }) => {
const sayClearInsteadOfReset = useExperiment("connection.clearNotReset", false);

const attempts = getJobAttempts(jobWithAttempts);
const jobStatus = getJobStatus(jobWithAttempts);
const jobIsPartialSuccess = isJobPartialSuccess(attempts);
const streamsToReset = "job" in jobWithAttempts ? jobWithAttempts.job.resetConfig?.streamsToReset : undefined;
const jobConfigType = jobWithAttempts.job.configType;
const jobConfigType =
sayClearInsteadOfReset && jobWithAttempts.job.configType === "reset_connection"
? "clear_data"
: jobWithAttempts.job.configType;

let status = "";
if (jobIsPartialSuccess) {
Expand Down
5 changes: 5 additions & 0 deletions airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@
"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.clear_data.failed": "Clearing {count, plural, =0 {0 Streams} one {Stream} other {Streams}} Failed",
"jobs.jobStatus.clear_data.running": "Clearing {count, plural, =0 {0 Streams} one {Stream} other {Streams}} Running",
"jobs.jobStatus.clear_data.succeeded": "Clearing {count, plural, =0 {0 Streams} one {Stream} other {Streams}} Succeeded",
"jobs.jobStatus.clear_data.cancelled": "Clearing {count, plural, =0 {0 Streams} one {Stream} other {Streams}} Cancelled",
"jobs.jobStatus.clear_data.partialSuccess": "Clearing {count, plural, =0 {0 Streams} one {Stream} other {Streams}} Partially Succeeded",
"jobs.jobStatus.sync.failed": "Sync Failed",
"jobs.jobStatus.sync.running": "Sync Running",
"jobs.jobStatus.sync.succeeded": "Sync Succeeded",
Expand Down

0 comments on commit f6eb9aa

Please sign in to comment.