init workflows view
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
25
src/views/workflows/workflow.ts
Normal file
25
src/views/workflows/workflow.ts
Normal 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 [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user