From 3310016264c653dbca14736e0f04e33381bcea78 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 2 Sep 2015 12:01:43 -0700 Subject: [PATCH] [Properties] Hide rows without controls Hide rows for domain object properties that do not have associated controls from the Edit Properties dialog; follow up for nasa/openmctweb#92 --- platform/commonUI/edit/src/actions/PropertiesDialog.js | 3 +++ platform/commonUI/edit/test/actions/PropertiesDialogSpec.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/commonUI/edit/src/actions/PropertiesDialog.js b/platform/commonUI/edit/src/actions/PropertiesDialog.js index 97ee1f5c0a..f461c0b8e1 100644 --- a/platform/commonUI/edit/src/actions/PropertiesDialog.js +++ b/platform/commonUI/edit/src/actions/PropertiesDialog.js @@ -54,6 +54,9 @@ define( var row = Object.create(property.getDefinition()); row.key = index; return row; + }).filter(function (row) { + // Only show properties which are editable + return row.control; }) }] }; diff --git a/platform/commonUI/edit/test/actions/PropertiesDialogSpec.js b/platform/commonUI/edit/test/actions/PropertiesDialogSpec.js index 7269ae64a3..a9077e8ec6 100644 --- a/platform/commonUI/edit/test/actions/PropertiesDialogSpec.js +++ b/platform/commonUI/edit/test/actions/PropertiesDialogSpec.js @@ -39,7 +39,7 @@ define( return { getValue: function (model) { return model[k]; }, setValue: function (model, v) { model[k] = v; }, - getDefinition: function () { return {}; } + getDefinition: function () { return { control: 'textfield '}; } }; });