mirror of
https://github.com/nasa/openmct.git
synced 2025-06-20 08:03:49 +00:00
save object before triggering mutate (#2336)
This commit is contained in:
committed by
Andrew Henry
parent
994f6be535
commit
327782835e
@ -162,9 +162,6 @@ function (
|
|||||||
function saveAfterClone(clonedObject) {
|
function saveAfterClone(clonedObject) {
|
||||||
return this.openmct.editor.save().then(() => {
|
return this.openmct.editor.save().then(() => {
|
||||||
// Force mutation for search indexing
|
// Force mutation for search indexing
|
||||||
clonedObject.useCapability('mutation', (model) => {
|
|
||||||
return model;
|
|
||||||
});
|
|
||||||
return clonedObject;
|
return clonedObject;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -173,6 +170,14 @@ function (
|
|||||||
return fetchObject(clonedObject.getId())
|
return fetchObject(clonedObject.getId())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function indexForSearch(savedObject) {
|
||||||
|
savedObject.useCapability('mutation', (model) => {
|
||||||
|
return model;
|
||||||
|
});
|
||||||
|
|
||||||
|
return savedObject;
|
||||||
|
}
|
||||||
|
|
||||||
function onSuccess(object) {
|
function onSuccess(object) {
|
||||||
self.notificationService.info("Save Succeeded");
|
self.notificationService.info("Save Succeeded");
|
||||||
return object;
|
return object;
|
||||||
@ -194,6 +199,7 @@ function (
|
|||||||
.then(undirtyOriginals)
|
.then(undirtyOriginals)
|
||||||
.then(saveAfterClone)
|
.then(saveAfterClone)
|
||||||
.then(finishEditing)
|
.then(finishEditing)
|
||||||
|
.then(indexForSearch)
|
||||||
.then(hideBlockingDialog)
|
.then(hideBlockingDialog)
|
||||||
.then(onSuccess)
|
.then(onSuccess)
|
||||||
.catch(onFailure);
|
.catch(onFailure);
|
||||||
|
Reference in New Issue
Block a user