added ability to revert (#21)

This commit is contained in:
undergroundwires
2020-07-15 19:04:56 +01:00
parent 57028987f1
commit 9c063d59de
58 changed files with 1448 additions and 265 deletions

View File

@@ -4,7 +4,7 @@ import { INode } from './SelectableTree/INode';
export function parseAllCategories(app: IApplication): INode[] | undefined {
const nodes = new Array<INode>();
for (const category of app.categories) {
for (const category of app.actions) {
const children = parseCategoryRecursively(category);
nodes.push(convertCategoryToNode(category, children));
}
@@ -23,6 +23,7 @@ export function parseSingleCategory(categoryId: number, app: IApplication): INod
export function getScriptNodeId(script: IScript): string {
return script.id;
}
export function getCategoryNodeId(category: ICategory): string {
return `Category${category.id}`;
}
@@ -53,6 +54,7 @@ function convertCategoryToNode(
text: category.name,
children,
documentationUrls: category.documentationUrls,
isReversible: false,
};
}
@@ -62,5 +64,6 @@ function convertScriptToNode(script: IScript): INode {
text: script.name,
children: undefined,
documentationUrls: script.documentationUrls,
isReversible: script.canRevert(),
};
}