Skip to content

Commit 4826578

Browse files
harshithmullapudiTim Roes
and
Tim Roes
authored
fix: shows partialSuccess icon for all attempts instead of individual status (#10263)
* fix: shows partialSuccess icon for all attempts instead of individual status * feat: add last attempt text to attempt details * Update airbyte-webapp/src/components/JobItem/components/JobLogs.tsx Co-authored-by: Tim Roes <[email protected]> * fix: added text to i18n Co-authored-by: Tim Roes <[email protected]>
1 parent 5795d13 commit 4826578

File tree

5 files changed

+35
-13
lines changed

5 files changed

+35
-13
lines changed

airbyte-webapp/src/components/JobItem/JobItem.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ const JobItem: React.FC<IProps> = ({ shortInfo, ...props }) => {
9595
>
9696
{isOpen ? (
9797
isJobEntity(props) ? (
98-
<JobLogs
99-
id={jobMeta.id}
100-
jobIsFailed={isFailed}
101-
isPartialSuccess={isPartialSuccess}
102-
/>
98+
<JobLogs id={jobMeta.id} jobIsFailed={isFailed} />
10399
) : (
104100
<JobCurrentLogs
105101
id={jobMeta.id}

airbyte-webapp/src/components/JobItem/components/JobLogs.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@ import { FormattedMessage } from "react-intl";
44
import Status from "core/statuses";
55
import { useGetJob, useGetDebugInfoJob } from "services/job/JobService";
66

7+
import { Attempt } from "core/domain/job/Job";
8+
79
import Logs from "./Logs";
810
import Tabs from "./Tabs";
911
import { LogsDetails } from "./LogsDetails";
1012

1113
type IProps = {
1214
id: number | string;
1315
jobIsFailed?: boolean;
14-
isPartialSuccess?: boolean;
1516
};
1617

17-
const JobLogs: React.FC<IProps> = ({ id, jobIsFailed, isPartialSuccess }) => {
18+
const isPartialSuccess = (attempt: Attempt) => {
19+
return !!attempt.failureSummary?.partialSuccess;
20+
};
21+
22+
const JobLogs: React.FC<IProps> = ({ id, jobIsFailed }) => {
1823
const job = useGetJob(id);
1924
const debugInfo = useGetDebugInfoJob(id);
2025

@@ -32,7 +37,7 @@ const JobLogs: React.FC<IProps> = ({ id, jobIsFailed, isPartialSuccess }) => {
3237

3338
const attemptsTabs = job.attempts.map((item, index) => ({
3439
id: index.toString(),
35-
isPartialSuccess,
40+
isPartialSuccess: isPartialSuccess(item.attempt),
3641
status:
3742
item.attempt.status === Status.FAILED ||
3843
item.attempt.status === Status.SUCCEEDED

airbyte-webapp/src/components/JobItem/components/LogsDetails.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const CenteredDetails = styled.div`
1515
color: ${({ theme }) => theme.greyColor40};
1616
position: relative;
1717
`;
18+
const AttemptDetailsSection = styled.div`
19+
padding-left: 10px;
20+
padding-top: 10px;
21+
`;
1822

1923
const LogsDetails: React.FC<{
2024
id: number | string;
@@ -24,7 +28,11 @@ const LogsDetails: React.FC<{
2428
jobDebugInfo?: JobDebugInfoMeta;
2529
}> = ({ path, logs, id, currentAttempt, jobDebugInfo }) => (
2630
<>
27-
{currentAttempt && <AttemptDetails attempt={currentAttempt} />}
31+
{currentAttempt && (
32+
<AttemptDetailsSection>
33+
<AttemptDetails attempt={currentAttempt} />
34+
</AttemptDetailsSection>
35+
)}
2836
<CenteredDetails>
2937
<div>{path}</div>
3038
{logs?.logLines && (

airbyte-webapp/src/components/JobItem/components/MainInfo.tsx

+16-4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ const Arrow = styled.div<{
8181
opacity: 1;
8282
}
8383
`;
84+
const Text = styled.div`
85+
font-size: 12px;
86+
font-weight: bold;
87+
color: ${({ theme }) => theme.greyColor40};
88+
`;
8489

8590
type IProps = {
8691
job: JobApiItem | JobInfo;
@@ -135,10 +140,17 @@ const MainInfo: React.FC<IProps> = ({
135140
{jobStatus}
136141
{shortInfo ? <FormattedMessage id="sources.additionLogs" /> : null}
137142
{attempts.length && !shortInfo ? (
138-
<AttemptDetails
139-
attempt={attempts[attempts.length - 1]}
140-
configType={job.configType}
141-
/>
143+
<div>
144+
{attempts.length > 1 && (
145+
<Text>
146+
<FormattedMessage id="sources.lastAttempt" />
147+
</Text>
148+
)}
149+
<AttemptDetails
150+
attempt={attempts[attempts.length - 1]}
151+
configType={job.configType}
152+
/>
153+
</div>
142154
) : null}
143155
</Title>
144156
</InfoCell>

airbyte-webapp/src/locales/en.json

+1
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
"sources.copied": "Copied",
275275
"sources.failureOrigin": "Failure Origin",
276276
"sources.message": "Message",
277+
"sources.lastAttempt": "Last attempt:",
277278

278279
"destination.destinationSettings": "Destination Settings",
279280
"destination.newDestination": "+ new destination",

0 commit comments

Comments
 (0)