mirror of
https://github.com/nasa/openmct.git
synced 2025-06-20 08:03:49 +00:00
Elements pool and drag drop (#2196)
* Implemented drag-and-drop composition * Added composition policy for tables * Reimplemented elements pool in Vue * No need to resolve all objects on the navigated path * Only show elements pool in edit mode * Remove old elements pool * Updated legacy code to use composition policy API * Keep object in sync when mutated
This commit is contained in:
committed by
Pete Richards
parent
a296bc2b81
commit
cbcfd44016
@ -34,13 +34,13 @@ define(
|
||||
* @memberof platform/commonUI/browse
|
||||
* @constructor
|
||||
*/
|
||||
function CreateWizard(domainObject, parent, policyService) {
|
||||
function CreateWizard(domainObject, parent, openmct) {
|
||||
this.type = domainObject.getCapability('type');
|
||||
this.model = domainObject.getModel();
|
||||
this.domainObject = domainObject;
|
||||
this.properties = this.type.getProperties();
|
||||
this.parent = parent;
|
||||
this.policyService = policyService;
|
||||
this.openmct = openmct;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,15 +56,10 @@ define(
|
||||
*/
|
||||
CreateWizard.prototype.getFormStructure = function (includeLocation) {
|
||||
var sections = [],
|
||||
domainObject = this.domainObject,
|
||||
policyService = this.policyService;
|
||||
domainObject = this.domainObject;
|
||||
|
||||
function validateLocation(parent) {
|
||||
return parent && policyService.allow(
|
||||
"composition",
|
||||
parent,
|
||||
domainObject
|
||||
);
|
||||
return parent && this.openmct.composition.checkPolicy(parent.useCapability('adapter'), domainObject.useCapability('adapter'));
|
||||
}
|
||||
|
||||
sections.push({
|
||||
@ -93,7 +88,7 @@ define(
|
||||
rows: [{
|
||||
name: "Save In",
|
||||
control: "locator",
|
||||
validate: validateLocation,
|
||||
validate: validateLocation.bind(this),
|
||||
key: "createParent"
|
||||
}]
|
||||
});
|
||||
|
Reference in New Issue
Block a user