Align the dependency graph plugin's dashboard interop declarations with the current dashboard contract. - import ReactNode for plugin task card rendering support - add DetailTaskTab, PluginToastType, and PluginTaskView type exports - update PluginDashboardViewContext to require workflowSteps and the expanded openTaskDetail signature - add optional renderTaskCard and addToast hooks to match dashboard expectations Files changed: .../src/dashboard-interop.d.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) Fusion-Task-Id: FN-5935 Fusion-Task-Lineage: 32313a96-1008-4de6-a7cb-e6bfbc385534
62 lines
2.5 KiB
TypeScript
62 lines
2.5 KiB
TypeScript
declare module "@fusion/dashboard/app/utils/taskStuck" {
|
|
import type { Task } from "@fusion/core";
|
|
|
|
export function isTaskStuck(task: Task, taskStuckTimeoutMs?: number, lastFetchTimeMs?: number): boolean;
|
|
}
|
|
|
|
declare module "@fusion/dashboard/app/plugins/types" {
|
|
import type { ReactNode } from "react";
|
|
import type { Task, TaskDetail, WorkflowStep } from "@fusion/core";
|
|
|
|
export type DetailTaskTab = "definition" | "logs" | "changes" | "comments" | "model" | "workflow" | "pr" | "retries";
|
|
|
|
export type PluginToastType = "success" | "error" | "warning" | "info";
|
|
|
|
export interface PluginDashboardViewContext {
|
|
projectId?: string;
|
|
tasks: Task[];
|
|
workflowSteps: WorkflowStep[];
|
|
openTaskDetail: (task: Task | TaskDetail, initialTab?: DetailTaskTab) => void;
|
|
renderTaskCard?: (task: Task | TaskDetail) => ReactNode;
|
|
addToast?: (message: string, type?: PluginToastType) => void;
|
|
}
|
|
|
|
export type PluginTaskView = `plugin:${string}:${string}`;
|
|
}
|
|
|
|
declare module "@fusion/dashboard/app/components/TaskCard" {
|
|
import type { Column, Task, TaskDetail } from "@fusion/core";
|
|
import type { ReactElement } from "react";
|
|
|
|
interface TaskCardProps {
|
|
task: Task;
|
|
projectId?: string;
|
|
onOpenDetail: (task: Task | TaskDetail) => void;
|
|
addToast: (message: string, type?: "success" | "error" | "info" | "warning") => void;
|
|
globalPaused?: boolean;
|
|
onUpdateTask?: (
|
|
id: string,
|
|
updates: { title?: string; description?: string; dependencies?: string[] }
|
|
) => Promise<Task>;
|
|
onArchiveTask?: (id: string) => Promise<Task>;
|
|
onUnarchiveTask?: (id: string) => Promise<Task>;
|
|
onDeleteTask?: (id: string, options?: { removeDependencyReferences?: boolean }) => Promise<Task>;
|
|
onRetryTask?: (id: string) => Promise<Task>;
|
|
onOpenDetailWithTab?: (task: Task | TaskDetail, initialTab: "changes") => void;
|
|
taskStuckTimeoutMs?: number;
|
|
onOpenMission?: (missionId: string) => void;
|
|
onMoveTask?: (id: string, column: Column, optionsOrPosition?: { preserveProgress?: boolean } | number) => Promise<Task>;
|
|
lastFetchTimeMs?: number;
|
|
workflowStepNameLookup?: ReadonlyMap<string, string>;
|
|
disableDrag?: boolean;
|
|
}
|
|
|
|
export function TaskCard(props: TaskCardProps): ReactElement;
|
|
}
|
|
|
|
declare module "@fusion/dashboard/app/utils/projectStorage" {
|
|
export function getScopedItem(baseKey: string, projectId?: string): string | null;
|
|
export function setScopedItem(baseKey: string, value: string, projectId?: string): void;
|
|
export function removeScopedItem(baseKey: string, projectId?: string): void;
|
|
}
|