mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 15:02:23 +00:00
[Timelines] #677 Applied fix to prevent editing of timelines in browse mode
Fixed failing test
This commit is contained in:
parent
42ce2aa7cf
commit
53c60ee64f
@ -44,7 +44,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="holder l-flex-col flex-elem grows l-object-wrapper">
|
||||
<div class="holder l-flex-col flex-elem grows l-object-wrapper-inner">
|
||||
<div ng-if="isEditable" class="holder l-flex-col flex-elem grows l-object-wrapper-inner">
|
||||
<!-- Toolbar and Save/Cancel buttons -->
|
||||
<div class="l-edit-controls flex-elem l-flex-row flex-align-end">
|
||||
<mct-toolbar name="mctToolbar"
|
||||
@ -63,6 +63,20 @@
|
||||
class="abs flex-elem grows object-holder-main scroll"
|
||||
toolbar="toolbar">
|
||||
</mct-representation>
|
||||
</div><!--/ l-object-wrapper-inner -->
|
||||
</div>
|
||||
<div ng-if="!isEditable" class="holder l-flex-col flex-elem grows l-object-wrapper-inner">
|
||||
<!-- Toolbar and Save/Cancel buttons -->
|
||||
<div class="l-edit-controls flex-elem l-flex-row flex-align-end">
|
||||
<mct-representation key="'edit-action-buttons'"
|
||||
mct-object="domainObject"
|
||||
class='flex-elem conclude-editing'>
|
||||
</mct-representation>
|
||||
|
||||
</div>
|
||||
<mct-representation key="representation.selected.key"
|
||||
mct-object="representation.selected.key && domainObject"
|
||||
class="abs flex-elem grows object-holder-main scroll">
|
||||
</mct-representation>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -109,6 +109,8 @@ define(
|
||||
// Track the represented object
|
||||
this.domainObject = representedObject;
|
||||
|
||||
this.scope.isEditable = representedObject.getCapability('status').get('editing');
|
||||
|
||||
// Ensure existing watches are released
|
||||
this.destroy();
|
||||
};
|
||||
|
@ -33,6 +33,8 @@ define(
|
||||
testRepresentation,
|
||||
mockDomainObject,
|
||||
mockPersistence,
|
||||
mockCapabilities,
|
||||
mockStatusCapability,
|
||||
representer;
|
||||
|
||||
function mockPromise(value) {
|
||||
@ -57,11 +59,20 @@ define(
|
||||
]);
|
||||
mockPersistence =
|
||||
jasmine.createSpyObj("persistence", ["persist"]);
|
||||
mockStatusCapability =
|
||||
jasmine.createSpyObj("status", ["get"]);
|
||||
mockStatusCapability.get.andReturn(false);
|
||||
mockCapabilities = {
|
||||
'persistence': mockPersistence,
|
||||
'status': mockStatusCapability
|
||||
};
|
||||
|
||||
mockDomainObject.getModel.andReturn({});
|
||||
mockDomainObject.hasCapability.andReturn(true);
|
||||
mockDomainObject.useCapability.andReturn(true);
|
||||
mockDomainObject.getCapability.andReturn(mockPersistence);
|
||||
mockDomainObject.getCapability.andCallFake(function(capability){
|
||||
return mockCapabilities[capability];
|
||||
});
|
||||
|
||||
representer = new EditRepresenter(mockQ, mockLog, mockScope);
|
||||
representer.represent(testRepresentation, mockDomainObject);
|
||||
|
Loading…
Reference in New Issue
Block a user