Skip to content

Commit

Permalink
fix: fix data process instance preview & add state on data process in…
Browse files Browse the repository at this point in the history
…stance graphql (datahub-project#12662)
  • Loading branch information
yoonhyejin authored Feb 18, 2025
1 parent 26f111a commit ef631c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datahub-web-react/src/app/shared/time/timeUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export function formatDuration(durationMs: number): string {
const seconds = duration.seconds();

if (hours === 0 && minutes === 0) {
return `${seconds} secs`;
return seconds === 1 ? `${seconds} sec` : `${seconds} secs`;
}

if (hours === 0) {
Expand All @@ -246,7 +246,7 @@ export function formatDetailedDuration(durationMs: number): string {
parts.push(minutes === 1 ? `${minutes} min` : `${minutes} mins`);
}
if (seconds > 0) {
parts.push(`${seconds} secs`);
parts.push(seconds === 1 ? `${seconds} sec` : `${seconds} secs`);
}
return parts.join(' ');
}
10 changes: 10 additions & 0 deletions datahub-web-react/src/graphql/dataProcessInstance.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ fragment dataProcessInstanceFields on DataProcessInstance {
dataPlatformInstance {
...dataPlatformInstanceFields
}
state(startTimeMillis: null, endTimeMillis: null, limit: 1) {
status
attempt
result {
resultType
nativeResultType
}
timestampMillis
durationMillis
}
parentTemplate {
urn
type
Expand Down

0 comments on commit ef631c5

Please sign in to comment.