Fix link and group without labels
This commit is contained in:
@@ -32,7 +32,7 @@ class EditorGroup extends EditorEntryBase {
|
||||
return super.serialize({
|
||||
type: 'group',
|
||||
label: this.getLabel(),
|
||||
labelObj: this.getLabelObj().serialize(),
|
||||
labelObj: this.getLabelObj() ? this.getLabelObj().serialize() : null,
|
||||
members: this.nodes_.serialize(EditorNode),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class EditorLink extends EditorEntryBase {
|
||||
return super.serialize({
|
||||
type: 'link',
|
||||
label: this.getLabel(),
|
||||
labelObj: this.getLabelObj().serialize(),
|
||||
labelObj: this.getLabelObj() ? this.getLabelObj().serialize() : null,
|
||||
from: this.getFrom().serialize(),
|
||||
to: this.getTo().serialize(),
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ class GraphGroup {
|
||||
let group = new GraphGroup();
|
||||
group.id = item.id;
|
||||
group.label = item.label;
|
||||
group.labelId = item.labelObj.id;
|
||||
group.labelId = item.labelObj ? item.labelObj.id : null;
|
||||
group.nodeLabels = new Set();
|
||||
for (let member of item.members) {
|
||||
if (member.label == '') {
|
||||
|
||||
@@ -33,7 +33,7 @@ class GraphLink {
|
||||
let link = new GraphLink();
|
||||
link.id = item.id;
|
||||
link.label = item.label;
|
||||
link.labelId = item.labelObj.id;
|
||||
link.labelId = item.labelObj ? item.labelObj.id : null;
|
||||
link.fromLabel = item.from.label;
|
||||
link.toLabel = item.to.label;
|
||||
if (link.fromLabel == '' || link.toLabel == '') {
|
||||
|
||||
Reference in New Issue
Block a user