Skip to content

Commit

Permalink
Change order and Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
javizqh committed Nov 1, 2024
1 parent db0461f commit 2dbf4a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
9 changes: 8 additions & 1 deletion backend/filesystem/library_demo/config.json
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
{"name": "library_demo", "config": {"editorShowAccentColors": true, "theme": "dark", "btOrder": "bottom-to-top"}}
{
"name": "library_demo",
"config": {
"editorShowAccentColors": true,
"theme": "dark",
"btOrder": "top-to-bottom"
}
}
22 changes: 11 additions & 11 deletions frontend/src/components/tree_editor/DiagramVisualizer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import React, { useRef, memo, useState } from "react";
import createEngine, { DiagramModel, NodeModel, NodeModelGenerics } from "@projectstorm/react-diagrams";
import createEngine, {
DiagramModel,
NodeModel,
NodeModelGenerics,
} from "@projectstorm/react-diagrams";
import { CanvasWidget } from "@projectstorm/react-canvas-core";

import "./DiagramEditor.css";
Expand Down Expand Up @@ -104,16 +108,16 @@ const updateBlackboardValues = (
const blackboardRegex = /^\{[^}]*\}/i;
let tags = model.getNodes().filter(function (node) {
return node instanceof TagNodeModel && blackboardRegex.test(node.getName());
})
});

console.log(tags);
let notFoundTags:NodeModel<NodeModelGenerics>[] = []
let notFoundTags: NodeModel<NodeModelGenerics>[] = [];

Object.entries(blackboard).forEach(element => {
console.log(element)
Object.entries(blackboard).forEach((element) => {
console.log(element);
for (let index = 0; index < tags.length; index++) {
const tag = tags[index] as TagNodeModel;
let tagSplit = tag.getName().split(" = ")
let tagSplit = tag.getName().split(" = ");
const tagStr = tagSplit[0].slice(1, -1); // Remove {}
if (tagStr === element[0]) {
tag.setName(`{${tagStr}} = ${element[1]}`);
Expand Down Expand Up @@ -171,11 +175,7 @@ const DiagramVisualizer = memo(
treeStructure,
subTreeStructure,
);
updateBlackboardValues(
model.current,
engine.current,
updateBlackboard
)
updateBlackboardValues(model.current, engine.current, updateBlackboard);
}
};

Expand Down

0 comments on commit 2dbf4a0

Please sign in to comment.