Refactor to use workspace folders
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from "vscode";
|
||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, WorkspaceFolder } from "vscode";
|
||||
import { act } from "../../extension";
|
||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||
import InputTreeItem from "./input";
|
||||
@@ -6,15 +6,15 @@ import InputTreeItem from "./input";
|
||||
export default class InputsTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||
static contextValue = 'githubLocalActions.inputs';
|
||||
|
||||
constructor() {
|
||||
constructor(public workspaceFolder: WorkspaceFolder) {
|
||||
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 workflows = await act.workflowsManager.getWorkflows(this.workspaceFolder);
|
||||
const inputs = [...new Set(workflows.map(workflow => act.settingsManager.getInputs(workflow)).flat())];
|
||||
return inputs.map(input => new InputTreeItem(input));
|
||||
return inputs.map(input => new InputTreeItem(this.workspaceFolder, input));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user