Add settings view

Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
Sanjula Ganepola
2024-09-29 11:28:03 -04:00
parent f47327dd23
commit b30fc76de5
11 changed files with 178 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from "vscode";
import { act } from "../../extension";
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
import InputTreeItem from "./input";
export default class InputsTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
static contextValue = 'githubLocalActions.inputs';
constructor() {
super('Inputs', TreeItemCollapsibleState.Collapsed);
this.contextValue = InputsTreeItem.contextValue;
this.iconPath = new ThemeIcon('record-keys');
}
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
const workflows = await act.workflowsManager.getWorkflows();
const inputs = [...new Set(workflows.map(workflow => act.settingsManager.getInputs(workflow)).flat())];
return inputs.map(input => new InputTreeItem(input));
}
}