remove types class
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
This commit is contained in:
@@ -1,4 +1,15 @@
|
|||||||
import { Component, Status } from "../types";
|
export interface Component {
|
||||||
|
name: string,
|
||||||
|
status: Status,
|
||||||
|
icon: string,
|
||||||
|
message?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum Status {
|
||||||
|
Enabled = 'Enabled',
|
||||||
|
Warning = 'Warning',
|
||||||
|
Disabled = 'Disabled'
|
||||||
|
}
|
||||||
|
|
||||||
export class ComponentManager {
|
export class ComponentManager {
|
||||||
components: Component[] = [
|
components: Component[] = [
|
||||||
21
src/types.ts
21
src/types.ts
@@ -1,21 +0,0 @@
|
|||||||
import { Uri } from "vscode"
|
|
||||||
|
|
||||||
export interface Component {
|
|
||||||
name: string,
|
|
||||||
status: Status,
|
|
||||||
icon: string,
|
|
||||||
message?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum Status {
|
|
||||||
Enabled = 'Enabled',
|
|
||||||
Warning = 'Warning',
|
|
||||||
Disabled = 'Disabled'
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Workflow {
|
|
||||||
name: string,
|
|
||||||
uri: Uri,
|
|
||||||
content?: any,
|
|
||||||
error?: string
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
|
||||||
import { Component } from "../../types";
|
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
|
import { Component } from "../../componentManager";
|
||||||
|
|
||||||
export default class ComponentTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
export default class ComponentTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
static contextValue = 'component';
|
static contextValue = 'component';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { CancellationToken, commands, EventEmitter, ExtensionContext, TreeDataProvider, TreeItem } from "vscode";
|
import { CancellationToken, commands, EventEmitter, ExtensionContext, TreeDataProvider, TreeItem } from "vscode";
|
||||||
import { ComponentManager } from "../componentManager";
|
import { ComponentManager } from "../../componentManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
import ComponentTreeItem from "./component";
|
import ComponentTreeItem from "./component";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
|
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
|
||||||
import { Workflow } from "../../types";
|
import { Workflow } from "../../workflowManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
|
|
||||||
export default class WorkflowTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
export default class WorkflowTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CancellationToken, commands, EventEmitter, ExtensionContext, TreeDataProvider, TreeItem, window, workspace } from "vscode";
|
import { CancellationToken, commands, EventEmitter, ExtensionContext, TreeDataProvider, TreeItem, window, workspace } from "vscode";
|
||||||
|
import { WorkflowManager } from "../../workflowManager";
|
||||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||||
import { WorkflowManager } from "../workflowManager";
|
|
||||||
import WorkflowTreeItem from "./workflow";
|
import WorkflowTreeItem from "./workflow";
|
||||||
|
|
||||||
export default class WorkflowsTreeDataProvider implements TreeDataProvider<GithubLocalActionsTreeItem> {
|
export default class WorkflowsTreeDataProvider implements TreeDataProvider<GithubLocalActionsTreeItem> {
|
||||||
@@ -19,6 +19,9 @@ export default class WorkflowsTreeDataProvider implements TreeDataProvider<Githu
|
|||||||
commands.registerCommand('githubLocalActions.openWorkflow', async (workflowTreeItem: WorkflowTreeItem) => {
|
commands.registerCommand('githubLocalActions.openWorkflow', async (workflowTreeItem: WorkflowTreeItem) => {
|
||||||
const document = await workspace.openTextDocument(workflowTreeItem.workflow.uri);
|
const document = await workspace.openTextDocument(workflowTreeItem.workflow.uri);
|
||||||
await window.showTextDocument(document);
|
await window.showTextDocument(document);
|
||||||
|
}),
|
||||||
|
commands.registerCommand('githubLocalActions.runWorkflow', async (workflowTreeItem: WorkflowTreeItem) => {
|
||||||
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
import * as fs from "fs/promises";
|
import * as fs from "fs/promises";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import { workspace } from "vscode";
|
import { Uri, workspace } from "vscode";
|
||||||
import * as yaml from "yaml";
|
import * as yaml from "yaml";
|
||||||
import { Workflow } from "../types";
|
|
||||||
|
export interface Workflow {
|
||||||
|
name: string,
|
||||||
|
uri: Uri,
|
||||||
|
content?: any,
|
||||||
|
error?: string
|
||||||
|
}
|
||||||
|
|
||||||
export class WorkflowManager {
|
export class WorkflowManager {
|
||||||
async getWorkflows(): Promise<Workflow[]> {
|
async getWorkflows(): Promise<Workflow[]> {
|
||||||
Reference in New Issue
Block a user