From 20ecf168f238b9a4b2341508650f4b573bfd4f0b Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 19 May 2016 15:00:12 -0700 Subject: [PATCH 1/3] [Timeline] Change ordering in mct-representation ...such that the configuration property is available in scope when a view is first instantiated. #908 --- platform/representation/src/MCTRepresentation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/representation/src/MCTRepresentation.js b/platform/representation/src/MCTRepresentation.js index bcaa90e4e7..1e775b87be 100644 --- a/platform/representation/src/MCTRepresentation.js +++ b/platform/representation/src/MCTRepresentation.js @@ -180,10 +180,6 @@ define( // representation to store local variables into. $scope.representation = {}; - // Change templates (passing in undefined to clear - // if we don't have enough info to show a template.) - changeTemplate(canRepresent ? representation : undefined); - // Any existing representers are no longer valid; release them. destroyRepresenters(); @@ -230,6 +226,10 @@ define( // next change object/key pair changes toClear = uses.concat(['model']); } + + // Change templates (passing in undefined to clear + // if we don't have enough info to show a template.) + changeTemplate(canRepresent ? representation : undefined); } // Update the representation when the key changes (e.g. if a From b5229d7786506b17a189a19b7334b97c4764cbf4 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 19 May 2016 15:06:06 -0700 Subject: [PATCH 2/3] [Timeline] Commit changes on toggle #908 --- .../timeline/res/templates/tabular-swimlane-cols-tree.html | 2 +- platform/features/timeline/res/templates/timeline.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/features/timeline/res/templates/tabular-swimlane-cols-tree.html b/platform/features/timeline/res/templates/tabular-swimlane-cols-tree.html index e5ca69e15c..22c4a84229 100644 --- a/platform/features/timeline/res/templates/tabular-swimlane-cols-tree.html +++ b/platform/features/timeline/res/templates/tabular-swimlane-cols-tree.html @@ -29,7 +29,7 @@ }">
From 2a4004fd5bcddc8249c8911606d14dad8303d14b Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 19 May 2016 15:09:52 -0700 Subject: [PATCH 3/3] [Timeline] Test mct-representation ordering Verify that a configuration object has been added to scope before changing templates. #908 --- .../representation/test/MCTRepresentationSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/platform/representation/test/MCTRepresentationSpec.js b/platform/representation/test/MCTRepresentationSpec.js index 52d6c70d55..d3ccd61a7b 100644 --- a/platform/representation/test/MCTRepresentationSpec.js +++ b/platform/representation/test/MCTRepresentationSpec.js @@ -194,6 +194,21 @@ define( .toHaveBeenCalledWith(testViews[1]); }); + it("exposes configuration before changing templates", function () { + var observedConfiguration; + + mockChangeTemplate.andCallFake(function () { + observedConfiguration = mockScope.configuration; + }); + + mockScope.key = "xyz"; + mockScope.domainObject = mockDomainObject; + fireWatch('key', mockScope.key); + fireWatch('domainObject', mockDomainObject); + + expect(observedConfiguration).toBeDefined(); + }); + it("does not load templates until there is an object", function () { mockScope.key = "xyz";