Files
github-local-actions/src/views/workflows/workflow.ts
Sanjula Ganepola f47327dd23 Switch to singleton act instance
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
2024-09-28 20:09:38 -04:00

25 lines
1.0 KiB
TypeScript

import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
import { Workflow } from "../../workflowsManager";
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
export default class WorkflowTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
static contextValue = 'githubLocalActions.workflow';
workflow: Workflow;
constructor(workflow: Workflow) {
super(workflow.name, workflow.error ? TreeItemCollapsibleState.None : TreeItemCollapsibleState.Collapsed);
this.workflow = workflow;
this.contextValue = WorkflowTreeItem.contextValue;
this.iconPath = new ThemeIcon('layers');
this.tooltip = `Name: ${workflow.name}\n` +
`Path: ${workflow.uri.fsPath}`;
if(workflow.error) {
this.resourceUri = Uri.parse(`${WorkflowTreeItem.contextValue}:${workflow.name}?error=${workflow.error}`, true);
}
}
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
return [];
}
}