From 01f2fab70ff3c39476fa2703d50f12e599adc687 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 1 Sep 2015 11:46:43 -0700 Subject: [PATCH] [Create] Filter out control-less properties When properties have no control defined, don't show them in the create dialog (but do show them in metadata, e.g. info bubble.) For nasa/openmctweb#92 --- platform/commonUI/browse/src/creation/CreateWizard.js | 11 +++++++---- .../commonUI/browse/test/creation/CreateWizardSpec.js | 6 ++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/platform/commonUI/browse/src/creation/CreateWizard.js b/platform/commonUI/browse/src/creation/CreateWizard.js index 4073ed7e90..e902301977 100644 --- a/platform/commonUI/browse/src/creation/CreateWizard.js +++ b/platform/commonUI/browse/src/creation/CreateWizard.js @@ -59,10 +59,10 @@ define( var locatingType = locatingObject && locatingObject.getCapability('type'); return locatingType && policyService.allow( - "composition", - locatingType, - type - ); + "composition", + locatingType, + type + ); } sections.push({ @@ -77,6 +77,9 @@ define( row.key = index; return row; + }).filter(function (row) { + // Only show rows which have defined controls + return row && row.control; }) }); diff --git a/platform/commonUI/browse/test/creation/CreateWizardSpec.js b/platform/commonUI/browse/test/creation/CreateWizardSpec.js index 7cd78e5178..c4453e7432 100644 --- a/platform/commonUI/browse/test/creation/CreateWizardSpec.js +++ b/platform/commonUI/browse/test/creation/CreateWizardSpec.js @@ -42,7 +42,9 @@ define( "property" + name, [ "getDefinition", "getValue", "setValue" ] ); - mockProperty.getDefinition.andReturn({}); + mockProperty.getDefinition.andReturn({ + control: "textfield" + }); mockProperty.getValue.andReturn(name); return mockProperty; } @@ -157,4 +159,4 @@ define( }); } -); \ No newline at end of file +);