Skip to content

Commit

Permalink
🌱 Update the Task TypeScript interface (#1961)
Browse files Browse the repository at this point in the history
Update the `Task` interface, and related, to follow the current
definitions of Task REST resource[^1] on the hub.

Supports: #1955, #1956, #1957

[^1]:
https://github.com/konveyor/tackle2-hub/blob/1366d95b62ac7717826fd9f64c9e268013107008/api/task.go#L725-L748

---------

Signed-off-by: Scott J Dickerson <[email protected]>
  • Loading branch information
sjd78 authored Jun 14, 2024
1 parent c2f4f06 commit 192124b
Showing 1 changed file with 50 additions and 19 deletions.
69 changes: 50 additions & 19 deletions client/src/app/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,18 +307,62 @@ export type TaskState =

export interface Task {
id?: number;
createUser?: string;
updateUser?: string;
createTime?: string;
application: { id: number };

name: string;
kind: string;
addon: string;
extensions: string[];
state?: TaskState;
locator?: string;
priority?: number;
policy: TaskPolicy;
ttl: TTL;
data: TaskData;
error?: string;
image?: string;
application: Ref;
bucket?: Ref;
pod?: string;
retries?: number;
started?: string;
terminated?: string;
state?: TaskState;
job?: string;
report?: TaskReport;
events?: TaskEvent[];
errors?: TaskError[];
activity?: string[];
attached?: TaskAttachment[];
}

export interface TaskPolicy {
isolated?: boolean;
preemptEnabled?: boolean;
preemptExempt?: boolean;
}

export interface TTL {
created?: number;
pending?: number;
running?: number;
succeeded?: number;
failed?: number;
}

export interface TaskEvent {
kind: string;
count: number;
reason?: string;
last: string; // time
}

export interface TaskError {
severity: string;
description: string;
}

export interface TaskAttachment {
id: number;
name?: string;
activity?: number;
}

export interface TaskData {
Expand Down Expand Up @@ -355,19 +399,6 @@ export interface TaskData {
};
}

interface TaskReport {
activity: string[];
completed: number;
createTime: string;
createUser: string;
error: string;
id: number;
status: string;
task: number;
total: number;
updateUser: string;
}

export interface TaskgroupTask {
name: string;
data: any;
Expand Down

0 comments on commit 192124b

Please sign in to comment.