mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 17:08:57 +00:00
[API] composition providers receive new-style objects
Ensure that composition providers get new-style objects (with id included) so that they can properly check for applicability.
This commit is contained in:
@ -53,10 +53,10 @@ define(
|
||||
*/
|
||||
function CoreCapabilityProvider(capabilities, $log) {
|
||||
// Filter by invoking the capability's appliesTo method
|
||||
function filterCapabilities(model) {
|
||||
function filterCapabilities(model, id) {
|
||||
return capabilities.filter(function (capability) {
|
||||
return capability.appliesTo ?
|
||||
capability.appliesTo(model) :
|
||||
capability.appliesTo(model, id) :
|
||||
true;
|
||||
});
|
||||
}
|
||||
@ -75,8 +75,8 @@ define(
|
||||
return result;
|
||||
}
|
||||
|
||||
function getCapabilities(model) {
|
||||
return packageCapabilities(filterCapabilities(model));
|
||||
function getCapabilities(model, id) {
|
||||
return packageCapabilities(filterCapabilities(model, id));
|
||||
}
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user