[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
This commit is contained in:
Victor Woeltjen 2015-09-01 11:46:43 -07:00
parent 7562c82369
commit 01f2fab70f
2 changed files with 11 additions and 6 deletions

View File

@ -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;
})
});

View File

@ -42,7 +42,9 @@ define(
"property" + name,
[ "getDefinition", "getValue", "setValue" ]
);
mockProperty.getDefinition.andReturn({});
mockProperty.getDefinition.andReturn({
control: "textfield"
});
mockProperty.getValue.andReturn(name);
return mockProperty;
}