FN-5935: fix dashboard interop plugin context types
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
This commit is contained in:
@@ -5,14 +5,23 @@ declare module "@fusion/dashboard/app/utils/taskStuck" {
|
||||
}
|
||||
|
||||
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 {
|
||||
tasks: Task[];
|
||||
projectId?: string;
|
||||
workflowSteps?: WorkflowStep[];
|
||||
openTaskDetail?: (task: Task | TaskDetail) => void;
|
||||
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" {
|
||||
|
||||
Reference in New Issue
Block a user