From 9e4611bcfd14f14537960cf9af37fd2196ed7ead Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 7 Apr 2015 21:03:36 -0700 Subject: [PATCH] [Containment] Fix bundle Fix dependencies in containment bundle to allow loading, WTD-962. --- platform/containment/bundle.json | 2 +- platform/containment/src/ComposeActionPolicy.js | 2 ++ platform/containment/src/CompositionPolicy.js | 13 ++++++++++--- platform/features/layout/bundle.json | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/platform/containment/bundle.json b/platform/containment/bundle.json index c5e99c837f..a31eb60c4a 100644 --- a/platform/containment/bundle.json +++ b/platform/containment/bundle.json @@ -4,7 +4,7 @@ { "category": "composition", "implementation": "CompositionPolicy.js", - "depends": [ "typeService", "capabilityService" ], + "depends": [ "$injector" ], "message": "Objects of this type cannot contain objects of that type." }, { diff --git a/platform/containment/src/ComposeActionPolicy.js b/platform/containment/src/ComposeActionPolicy.js index 4317c4c7be..50c36ea0c5 100644 --- a/platform/containment/src/ComposeActionPolicy.js +++ b/platform/containment/src/ComposeActionPolicy.js @@ -53,5 +53,7 @@ define( }; } + return ComposeActionPolicy; + } ); \ No newline at end of file diff --git a/platform/containment/src/CompositionPolicy.js b/platform/containment/src/CompositionPolicy.js index b052df0a4f..4e8b358627 100644 --- a/platform/containment/src/CompositionPolicy.js +++ b/platform/containment/src/CompositionPolicy.js @@ -8,10 +8,17 @@ define( /** * Defines composition policy as driven by type metadata. */ - function CompositionPolicy(typeService, capabilityService) { + function CompositionPolicy($injector) { // We're really just wrapping the containment table and rephrasing // it as a policy decision. - var table = new ContainmentTable(typeService, capabilityService); + var table; + + function getTable() { + return (table = table || new ContainmentTable( + $injector.get('typeService'), + $injector.get('capabilityService') + )); + } return { /** @@ -19,7 +26,7 @@ define( * contain the type described by the context? */ allow: function (candidate, context) { - return table.canContain(candidate, context); + return getTable().canContain(candidate, context); } }; } diff --git a/platform/features/layout/bundle.json b/platform/features/layout/bundle.json index f5d753c7ac..0df6413ed0 100644 --- a/platform/features/layout/bundle.json +++ b/platform/features/layout/bundle.json @@ -231,6 +231,7 @@ "description": "A panel for collecting telemetry elements.", "delegates": [ "telemetry" ], "features": "creation", + "contains": [ { "has": "telemetry" } ], "model": { "composition": [] }, "properties": [ {