mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[Create] Avoid navigation warning
...when navigating to a clone created via Save As.
This commit is contained in:
parent
5604120d55
commit
8c602025d4
@ -163,7 +163,8 @@ define([
|
||||
"navigationService",
|
||||
"policyService",
|
||||
"dialogService",
|
||||
"creationService"
|
||||
"creationService",
|
||||
"copyService"
|
||||
],
|
||||
"priority": "mandatory"
|
||||
},
|
||||
|
@ -132,6 +132,11 @@ define(
|
||||
return false;
|
||||
}
|
||||
|
||||
function cancelEditingAfterClone(clonedObject) {
|
||||
return domainObject.getCapability("editor").cancel()
|
||||
.then(resolveWith(clonedObject));
|
||||
}
|
||||
|
||||
// Invoke any save behavior introduced by the editor capability;
|
||||
// this is introduced by EditableDomainObject which is
|
||||
// used to insulate underlying objects from changes made
|
||||
@ -142,10 +147,9 @@ define(
|
||||
if (!domainObject.getModel().persisted){
|
||||
return getParent(domainObject)
|
||||
.then(doWizardSave)
|
||||
.then(copyService.perform.bind(
|
||||
copyService,
|
||||
[ domainObject ]
|
||||
))
|
||||
.then(getParent)
|
||||
.then(copyService.perform.bind(copyService, domainObject))
|
||||
.then(cancelEditingAfterClone)
|
||||
.catch(doNothing);
|
||||
} else {
|
||||
return domainObject.getCapability("editor").save()
|
||||
|
Loading…
x
Reference in New Issue
Block a user