mirror of
https://github.com/nasa/openmct.git
synced 2025-06-20 08:03:49 +00:00
Composition policy takes child instance
The composition policy now takes a child instance instead of the child type, as in all cases we have access to the child object. This allows new-style objects to be contained by old-style objects. Updated all composition policies to use standardized argument names instead of `context` and `candidate`; this makes it easier to understand. Updated AddActionProvider to hardcode the object types supported.
This commit is contained in:
@ -56,16 +56,16 @@ define(
|
||||
*/
|
||||
CreateWizard.prototype.getFormStructure = function (includeLocation) {
|
||||
var sections = [],
|
||||
type = this.type,
|
||||
domainObject = this.domainObject,
|
||||
policyService = this.policyService;
|
||||
|
||||
function validateLocation(locatingObject) {
|
||||
var locatingType = locatingObject &&
|
||||
locatingObject.getCapability('type');
|
||||
return locatingType && policyService.allow(
|
||||
function validateLocation(parent) {
|
||||
var parentType = parent &&
|
||||
parent.getCapability('type');
|
||||
return parentType && policyService.allow(
|
||||
"composition",
|
||||
locatingType,
|
||||
type
|
||||
parentType,
|
||||
domainObject
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user