Skip to content

Commit

Permalink
Fix subtree css and name
Browse files Browse the repository at this point in the history
  • Loading branch information
javizqh committed Oct 20, 2024
1 parent c95de9f commit 969296b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/src/components/tree_editor/DiagramVisualizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const DiagramVisualizer = memo(
view,
changeView,
setGoBack,
subTreeName
}: {
modelJson: any;
setResultJson: Function;
Expand All @@ -86,6 +87,7 @@ const DiagramVisualizer = memo(
view: any;
changeView: any;
setGoBack: Function;
subTreeName:string;
}) => {
// Initialize the model and the engine
const model = useRef(new DiagramModel());
Expand Down Expand Up @@ -135,6 +137,7 @@ const DiagramVisualizer = memo(
view={view}
changeView={changeView}
setGoBack={setGoBack}
subTreeName={subTreeName}
/>
{engine.current && (
<CanvasWidget className="canvas" engine={engine.current} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ const MainTreeEditorContainer = ({
view={view}
changeView={changeView}
setSubTreeName={setSubTreeName}
subTreeName={subTreeName}
setGoBack={setGoBack}
/>
) : (
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/tree_editor/NodeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const NodeMenu = ({
view,
changeView,
setGoBack,
subTreeName
}: {
projectName: string;
onAddNode: Function;
Expand All @@ -87,6 +88,7 @@ const NodeMenu = ({
view: TreeViewType;
changeView: Function;
setGoBack: Function;
subTreeName:string;
}) => {
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
const [menuLabel, setMenuLabel] = useState<string>("");
Expand Down Expand Up @@ -251,7 +253,7 @@ const NodeMenu = ({
<ReturnIcon className="header-icon" fill={"var(--icon)"} />
</button>
</div>
<h3 className="subtree-name">Placeholder for subtree name</h3>
<h2 className="subtree-name">{subTreeName}</h2>
</div>
);
};
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/components/tree_editor/TreeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const TreeEditor = memo(
view,
changeView,
setSubTreeName,
subTreeName,
setGoBack,
}: {
modelJson: any;
Expand All @@ -58,6 +59,7 @@ const TreeEditor = memo(
view: TreeViewType;
changeView: Function;
setSubTreeName: Function;
subTreeName:string;
setGoBack: Function;
}) => {
const settings = React.useContext(OptionsContext);
Expand Down Expand Up @@ -134,6 +136,7 @@ const TreeEditor = memo(
view={view}
changeView={changeView}
setGoBack={setGoBack}
subTreeName={subTreeName}
/>
) : (
<DiagramEditor
Expand All @@ -151,6 +154,7 @@ const TreeEditor = memo(
setEditTagModalOpen={setEditTagModalOpen}
setCurrentNode={setCurrentNode}
setGoBack={setGoBack}
subTreeName={subTreeName}
/>
)}
<button className="bt-order-indicator" title={"BT Order: " + btOrder}>
Expand Down Expand Up @@ -203,6 +207,7 @@ const DiagramEditor = memo(
setEditTagModalOpen,
setCurrentNode,
setGoBack,
subTreeName
}: {
modelJson: any;
setResultJson: Function;
Expand All @@ -218,6 +223,7 @@ const DiagramEditor = memo(
setEditTagModalOpen: Function;
setCurrentNode: Function;
setGoBack: Function;
subTreeName:string;
}) => {
// VARS

Expand Down Expand Up @@ -534,6 +540,7 @@ const DiagramEditor = memo(
view={view}
changeView={changeView}
setGoBack={setGoBack}
subTreeName={subTreeName}
/>
{engine.current && (
<CanvasWidget className="canvas" engine={engine.current} />
Expand Down

0 comments on commit 969296b

Please sign in to comment.