Merge pull request #942 from nasa/persist-graph-toggles-908

[Timeline] Persist resource graph toggles
This commit is contained in:
Andrew Henry 2016-05-20 13:27:41 -07:00
commit 6fb36374f6
4 changed files with 21 additions and 5 deletions

View File

@ -29,7 +29,7 @@
}">
<div class="l-cols">
<span class="l-col l-col-icon l-plot-resource"
ng-click="ngModel.toggleGraph()"
ng-click="ngModel.toggleGraph(); parameters.commit()"
title="Click to enable or disable inclusion in Resource Graphing">
<span class="ui-symbol"
ng-show="ngModel.graph()"

View File

@ -43,6 +43,7 @@
<div class="t-swimlanes-holder l-swimlanes-holder"
mct-scroll-y="scroll.y">
<mct-include key="'timeline-tabular-swimlane-cols-tree'"
parameters="{ commit: commit }"
ng-repeat="swimlane in timelineController.swimlanes()"
ng-model="swimlane">
</mct-include>

View File

@ -177,10 +177,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();
@ -226,6 +222,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

View File

@ -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";