From 3d3baddd235e920aaa647b41254bdcbae3a95ba9 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 2 Feb 2017 15:08:26 -0800 Subject: [PATCH] [Tables] Do not persist column configuration for non-editable objects --- platform/features/table/src/TableConfiguration.js | 4 +++- platform/features/table/test/TableConfigurationSpec.js | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/platform/features/table/src/TableConfiguration.js b/platform/features/table/src/TableConfiguration.js index 5b463ee7f1..fee22d47bc 100644 --- a/platform/features/table/src/TableConfiguration.js +++ b/platform/features/table/src/TableConfiguration.js @@ -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); } diff --git a/platform/features/table/test/TableConfigurationSpec.js b/platform/features/table/test/TableConfigurationSpec.js index db90cc1c62..dcac2a9876 100644 --- a/platform/features/table/test/TableConfigurationSpec.js +++ b/platform/features/table/test/TableConfigurationSpec.js @@ -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',