mirror of
https://github.com/nasa/openmct.git
synced 2025-05-02 08:43:17 +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",
|
"navigationService",
|
||||||
"policyService",
|
"policyService",
|
||||||
"dialogService",
|
"dialogService",
|
||||||
"creationService"
|
"creationService",
|
||||||
|
"copyService"
|
||||||
],
|
],
|
||||||
"priority": "mandatory"
|
"priority": "mandatory"
|
||||||
},
|
},
|
||||||
|
@ -132,6 +132,11 @@ define(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cancelEditingAfterClone(clonedObject) {
|
||||||
|
return domainObject.getCapability("editor").cancel()
|
||||||
|
.then(resolveWith(clonedObject));
|
||||||
|
}
|
||||||
|
|
||||||
// Invoke any save behavior introduced by the editor capability;
|
// Invoke any save behavior introduced by the editor capability;
|
||||||
// this is introduced by EditableDomainObject which is
|
// this is introduced by EditableDomainObject which is
|
||||||
// used to insulate underlying objects from changes made
|
// used to insulate underlying objects from changes made
|
||||||
@ -142,10 +147,9 @@ define(
|
|||||||
if (!domainObject.getModel().persisted){
|
if (!domainObject.getModel().persisted){
|
||||||
return getParent(domainObject)
|
return getParent(domainObject)
|
||||||
.then(doWizardSave)
|
.then(doWizardSave)
|
||||||
.then(copyService.perform.bind(
|
.then(getParent)
|
||||||
copyService,
|
.then(copyService.perform.bind(copyService, domainObject))
|
||||||
[ domainObject ]
|
.then(cancelEditingAfterClone)
|
||||||
))
|
|
||||||
.catch(doNothing);
|
.catch(doNothing);
|
||||||
} else {
|
} else {
|
||||||
return domainObject.getCapability("editor").save()
|
return domainObject.getCapability("editor").save()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user