Add settings view
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from "vscode";
|
||||
import { act } from "../../extension";
|
||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||
import VariableTreeItem from "./variable";
|
||||
|
||||
export default class VariablesTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||
static contextValue = 'githubLocalActions.variables';
|
||||
@@ -11,6 +13,8 @@ export default class VariablesTreeItem extends TreeItem implements GithubLocalAc
|
||||
}
|
||||
|
||||
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
||||
return [];
|
||||
const workflows = await act.workflowsManager.getWorkflows();
|
||||
const variables = [...new Set(workflows.map(workflow => act.settingsManager.getVariables(workflow)).flat())];
|
||||
return variables.map(variable => new VariableTreeItem(variable));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user