Merge pull request #1424 from nasa/open1382

[Tables] Do not persist column configuration for non-editable objects
This commit is contained in:
Pete Richards 2017-02-21 15:18:56 -08:00 committed by GitHub
commit 50c934820c
2 changed files with 12 additions and 2 deletions

View File

@ -187,7 +187,9 @@ define(
});
//Synchronize column configuration with model
if (configChanged(configuration, defaultConfig)) {
if (this.domainObject.hasCapability('editor') &&
this.domainObject.getCapability('editor').isEditContextRoot() &&
configChanged(configuration, defaultConfig)) {
this.saveColumnConfiguration(configuration);
}

View File

@ -35,10 +35,18 @@ define(
beforeEach(function () {
mockDomainObject = jasmine.createSpyObj('domainObject',
['getModel', 'useCapability', 'getCapability']
['getModel', 'useCapability', 'getCapability', 'hasCapability']
);
mockModel = {};
mockDomainObject.getModel.andReturn(mockModel);
mockDomainObject.getCapability.andCallFake(function (name) {
return name === 'editor' && {
isEditContextRoot: function () {
return true;
}
};
});
mockTelemetryFormatter = jasmine.createSpyObj('telemetryFormatter',
[
'formatDomainValue',