mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 16:49:42 +00:00
TCR fixes 2 (#2286)
* prevent default on dragover in dropHint, to allow drop event to fire * add notebook snapshot to preview * fix for preview image overlay * pin fast-sass-loader version to 1.4.6 * fix saveAs in plot image export * fix elements search in inspector * fix current Search error * fix anonymous render error in layout * navigate and edit on create * remove domainObjects from composition when deleting frames and containers, and also fix a bug whereby a user can add domainObject via drag and drop(composition) but because of the lack of containers, it will not be added to the flexible layout * fix index undefined error when reordering containers * throw an error when user cancels instead of returning false * fixes for toolbar not updating on selection change * fix errors when objects without context are returned by the search aggregator * prompt user before cancelling edit * check transactions before prompting user * add save and continue editing option to save menu * prompt user if in edit mode and is navigating away
This commit is contained in:
committed by
Andrew Henry
parent
1c8f23dea1
commit
402062110d
@ -92,16 +92,7 @@ function (
|
||||
* @memberof platform/commonUI/edit.SaveAction#
|
||||
*/
|
||||
SaveAsAction.prototype.perform = function () {
|
||||
// Discard the current root view (which will be the editing
|
||||
// UI, which will have been pushed atop the Browse UI.)
|
||||
function returnToBrowse(object) {
|
||||
if (object) {
|
||||
object.getCapability("action").perform("navigate");
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
return this.save().then(returnToBrowse);
|
||||
return this.save();
|
||||
};
|
||||
|
||||
/**
|
||||
@ -192,7 +183,7 @@ function (
|
||||
if (reason !== "user canceled") {
|
||||
self.notificationService.error("Save Failed");
|
||||
}
|
||||
return false;
|
||||
throw reason;
|
||||
}
|
||||
|
||||
return getParent(domainObject)
|
||||
|
@ -67,20 +67,29 @@ define(
|
||||
openmct = this.openmct,
|
||||
newObject;
|
||||
|
||||
function onSave() {
|
||||
// openmct.editor.save();
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
openmct.editor.cancel();
|
||||
}
|
||||
|
||||
function navigateAndEdit(object) {
|
||||
let objectPath = object.getCapability('context').getPath(),
|
||||
url = '#/browse/' + objectPath
|
||||
.map(function (o) {
|
||||
return o && openmct.objects.makeKeyString(o.getId())
|
||||
})
|
||||
.join('/');
|
||||
|
||||
window.location.href = url;
|
||||
|
||||
openmct.editor.edit();
|
||||
}
|
||||
|
||||
newModel.type = this.type.getKey();
|
||||
newModel.location = this.parent.getId();
|
||||
newObject = this.parent.useCapability('instantiation', newModel);
|
||||
|
||||
openmct.editor.edit();
|
||||
newObject.getCapability("action").perform("save-as").then(onSave, onCancel);
|
||||
newObject.getCapability("action").perform("save-as").then(navigateAndEdit, onCancel);
|
||||
// TODO: support editing object without saving object first.
|
||||
// Which means we have to toggle createwizard afterwards. For now,
|
||||
// We will disable this.
|
||||
|
Reference in New Issue
Block a user