refactor: move from union type to object enum
This commit is contained in:
@@ -1,23 +1,17 @@
|
||||
import * as vscode from "vscode";
|
||||
import { listLocatedTasks } from "@/commands/listLocatedTasks";
|
||||
import { resolveTaskLocations } from "@/commands/resolveTaskLocations";
|
||||
import { Task, TaskStatus } from "@/model/task";
|
||||
import { Task } from "@/model/task";
|
||||
import { LocatedTask, TaskLocation } from "@/model/taskLocation";
|
||||
import { IConfigProvider, ITaskRepository } from "@/ports";
|
||||
import {
|
||||
TASK_SCOPE_LABELS,
|
||||
TASK_STATUS_LABELS,
|
||||
TASK_STATUS_META,
|
||||
TASK_STATUS_ORDER,
|
||||
} from "@/ui/taskLabels";
|
||||
type TaskStatus,
|
||||
} from "@/model/taskStatus";
|
||||
import { IConfigProvider, ITaskRepository } from "@/ports";
|
||||
import { TASK_SCOPE_LABELS, TASK_STATUS_LABELS } from "@/ui/taskLabels";
|
||||
import { TaskTreeItem } from "./taskTreeItem";
|
||||
|
||||
const STATUS_ICONS: Record<TaskStatus, vscode.ThemeIcon> = {
|
||||
todo: new vscode.ThemeIcon("circle-outline"),
|
||||
"in-progress": new vscode.ThemeIcon("sync"),
|
||||
done: new vscode.ThemeIcon("check"),
|
||||
cancelled: new vscode.ThemeIcon("close"),
|
||||
};
|
||||
|
||||
class ScopeTreeItem extends vscode.TreeItem {
|
||||
readonly location: TaskLocation;
|
||||
readonly locatedTasks: LocatedTask[];
|
||||
@@ -53,7 +47,7 @@ class TaskGroupTreeItem extends vscode.TreeItem {
|
||||
this.description = `(${tasks.length})`;
|
||||
this.id = `group-${location.scope}-${status}`;
|
||||
this.contextValue = "taskGroup";
|
||||
this.iconPath = STATUS_ICONS[status];
|
||||
this.iconPath = new vscode.ThemeIcon(TASK_STATUS_META[status].icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user