Skip to content

Commit 9b3992a

Browse files
committed
🌱 Update the Task TypeScript interface
Update the `Task` interface, and related, to follow the current definitions of Task REST resource[1] on the hub. Supports: konveyor#1955, konveyor#1956, konveyor#1957 [1] - https://github.com/konveyor/tackle2-hub/blob/1366d95b62ac7717826fd9f64c9e268013107008/api/task.go#L725-L748 Signed-off-by: Scott J Dickerson <[email protected]>
1 parent c2f4f06 commit 9b3992a

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed

client/src/app/api/models.ts

+50-19
Original file line numberDiff line numberDiff line change
@@ -307,18 +307,62 @@ export type TaskState =
307307

308308
export interface Task {
309309
id?: number;
310+
createUser?: string;
311+
updateUser?: string;
310312
createTime?: string;
311-
application: { id: number };
313+
312314
name: string;
315+
kind: string;
313316
addon: string;
317+
extensions: string[];
318+
state?: TaskState;
319+
locator?: string;
320+
priority?: number;
321+
policy: TaskPolicy;
322+
ttl: TTL;
314323
data: TaskData;
315-
error?: string;
316-
image?: string;
324+
application: Ref;
325+
bucket?: Ref;
326+
pod?: string;
327+
retries?: number;
317328
started?: string;
318329
terminated?: string;
319-
state?: TaskState;
320-
job?: string;
321-
report?: TaskReport;
330+
events?: TaskEvent[];
331+
errors?: TaskError[];
332+
activity?: string[];
333+
attached?: Attachment[];
334+
}
335+
336+
export interface TaskPolicy {
337+
isolated?: boolean;
338+
preemptEnabled?: boolean;
339+
preemptExempt?: boolean;
340+
}
341+
342+
export interface TTL {
343+
created?: number;
344+
pending?: number;
345+
running?: number;
346+
succeeded?: number;
347+
failed?: number;
348+
}
349+
350+
export interface TaskEvent {
351+
kind: string;
352+
count: number;
353+
reason?: string;
354+
last: string; // time
355+
}
356+
357+
export interface TaskError {
358+
severity: string;
359+
description: string;
360+
}
361+
362+
export interface Attachment {
363+
id: number;
364+
name?: string;
365+
activity?: number;
322366
}
323367

324368
export interface TaskData {
@@ -355,19 +399,6 @@ export interface TaskData {
355399
};
356400
}
357401

358-
interface TaskReport {
359-
activity: string[];
360-
completed: number;
361-
createTime: string;
362-
createUser: string;
363-
error: string;
364-
id: number;
365-
status: string;
366-
task: number;
367-
total: number;
368-
updateUser: string;
369-
}
370-
371402
export interface TaskgroupTask {
372403
name: string;
373404
data: any;

0 commit comments

Comments
 (0)