init workflows view

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-09-26 20:06:17 -04:00
parent 1b1af97923
commit 003d2c39b4
10 changed files with 179 additions and 43 deletions

View File

@@ -0,0 +1,25 @@
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
import { Workflow } from "../../types";
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
export default class WorkflowTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
static contextValue = 'workflow';
workflow: Workflow;
constructor(workflow: Workflow) {
super(workflow.content.name || 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.path}`;
if(workflow.error) {
this.resourceUri = Uri.parse(`${WorkflowTreeItem.contextValue}:${workflow.name}?error=${workflow.error}`, true);
}
}
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
return [];
}
}