create-item message should mark references dirty
This commit is contained in:
@@ -478,7 +478,7 @@ class ComponentManager {
|
|||||||
item.setDomainDataItem(component.url || component.uuid, responseItem.clientData, ClientDataDomain);
|
item.setDomainDataItem(component.url || component.uuid, responseItem.clientData, ClientDataDomain);
|
||||||
}
|
}
|
||||||
this.modelManager.addItem(item);
|
this.modelManager.addItem(item);
|
||||||
this.modelManager.resolveReferencesForItem(item);
|
this.modelManager.resolveReferencesForItem(item, true);
|
||||||
item.setDirty(true);
|
item.setDirty(true);
|
||||||
this.syncManager.sync("handleCreateItemMessage");
|
this.syncManager.sync("handleCreateItemMessage");
|
||||||
this.replyToMessage(component, message, {item: this.jsonForItem(item, component)})
|
this.replyToMessage(component, message, {item: this.jsonForItem(item, component)})
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ class ModelManager {
|
|||||||
this.addItems([item]);
|
this.addItems([item]);
|
||||||
}
|
}
|
||||||
|
|
||||||
resolveReferencesForItem(item) {
|
resolveReferencesForItem(item, markReferencesDirty = false) {
|
||||||
|
|
||||||
var contentObject = item.contentObject;
|
var contentObject = item.contentObject;
|
||||||
|
|
||||||
@@ -313,6 +313,10 @@ class ModelManager {
|
|||||||
if(referencedItem) {
|
if(referencedItem) {
|
||||||
item.addItemAsRelationship(referencedItem);
|
item.addItemAsRelationship(referencedItem);
|
||||||
referencedItem.addItemAsRelationship(item);
|
referencedItem.addItemAsRelationship(item);
|
||||||
|
|
||||||
|
if(markReferencesDirty) {
|
||||||
|
referencedItem.setDirty(true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// console.log("Unable to find reference:", reference.uuid, "for item:", item);
|
// console.log("Unable to find reference:", reference.uuid, "for item:", item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user