mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 02:39:56 +00:00
[Framework] Simplify inputs to service compositor
Accept the full component array into the service compositor; this will make it easier to add these from the registar. WTD-518.
This commit is contained in:
parent
d9f17dca83
commit
2d0d505b51
@ -42,6 +42,12 @@ define(
|
|||||||
return arguments[0];
|
return arguments[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hasType(type) {
|
||||||
|
return function (extension) {
|
||||||
|
return extension.type === type;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function makeName(category, service, index) {
|
function makeName(category, service, index) {
|
||||||
return [
|
return [
|
||||||
service,
|
service,
|
||||||
@ -148,12 +154,20 @@ define(
|
|||||||
registerLatest();
|
registerLatest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function registerCompositeServices(components) {
|
||||||
|
registerComposites(
|
||||||
|
components.filter(hasType("provider")),
|
||||||
|
components.filter(hasType("aggregator")),
|
||||||
|
components.filter(hasType("decorator"))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {Array} components extensions of type component
|
* @param {Array} components extensions of category component
|
||||||
*/
|
*/
|
||||||
registerCompositeServices: registerComposites
|
registerCompositeServices: registerCompositeServices
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user