Skip to content
Snippets Groups Projects
Commit 6876c7c3 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Fixed display bugs for nodes without description.

parent d3e71f46
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ function NodeDetails({
name="node-name"
placeholder="Enter name"
className="bottom-space"
value={referenceData.name}
value={referenceData.name ?? ""}
onChange={(event) =>
handleDataChange("name", event.target.value)
}
......@@ -103,7 +103,7 @@ function NodeDetails({
name="node-description"
className="bottom-space"
placeholder={"Enter description"}
value={referenceData.description}
value={referenceData.description ?? ""}
onChange={(event) =>
handleDataChange("description", event.target.value)
}
......@@ -208,7 +208,7 @@ function NodeDetails({
id="node-references"
name="node-references"
className="bottom-space"
value={referenceData.references}
value={referenceData.references ?? ""}
onChange={(event) =>
handleDataChange("references", event.target.value)
}
......
......@@ -233,6 +233,10 @@ export class Editor extends React.PureComponent<any, stateTypes> {
}
private handleNodeDataChange(nodeData: NodeDataChangeRequest[]) {
if (nodeData.length == 0) {
return;
}
// Create a shallow copy of the graph object to trigger an update over setState
const graph = Object.assign(new DynamicGraph(), this.state.graph);
......@@ -260,6 +264,10 @@ export class Editor extends React.PureComponent<any, stateTypes> {
}
private handleNodeDeletion(ids: number[]) {
if (ids.length == 0) {
return;
}
const graph = Object.assign(new DynamicGraph(), this.state.graph);
ids.forEach((id) => graph.deleteNode(id));
const selectedNodes = this.state.selectedNodes.filter(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment