mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 23:28:14 +00:00
[Core] Complete spec for capailities
Complete specs for capabilities introduced in platform/core, part of ongoing transition of this bundle. WTD-573.
This commit is contained in:
@ -18,7 +18,7 @@ define(
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function CoreCapabilityProvider(capabilities) {
|
||||
function CoreCapabilityProvider(capabilities, $log) {
|
||||
// Filter by invoking the capability's appliesTo method
|
||||
function filterCapabilities(model) {
|
||||
return capabilities.filter(function (capability) {
|
||||
@ -32,7 +32,11 @@ define(
|
||||
function packageCapabilities(capabilities) {
|
||||
var result = {};
|
||||
capabilities.forEach(function (capability) {
|
||||
result[capability.key] = capability;
|
||||
if (capability.key) {
|
||||
result[capability.key] = capability;
|
||||
} else {
|
||||
$log.warn("No key defined for capability; skipping.");
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*global define,Promise*/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* Module defining DelegationCapability. Created by vwoeltje on 11/18/14.
|
||||
@ -27,7 +27,7 @@ define(
|
||||
* @param domainObject
|
||||
* @constructor
|
||||
*/
|
||||
function DelegationCapability(domainObject) {
|
||||
function DelegationCapability($q, domainObject) {
|
||||
var delegateCapabilities = {},
|
||||
type = domainObject.getCapability("type");
|
||||
|
||||
@ -52,7 +52,7 @@ define(
|
||||
promiseChildren().then(
|
||||
filterObjectsWithCapability(capability)
|
||||
) :
|
||||
[];
|
||||
$q.when([]);
|
||||
}
|
||||
|
||||
// Generate set for easy lookup of capability delegation
|
||||
|
Reference in New Issue
Block a user