From a74726581355bf8dfa748f340e0632993e2328ed Mon Sep 17 00:00:00 2001 From: Bob Gallagher Date: Thu, 30 Mar 2017 10:52:13 -0400 Subject: [PATCH] =?utf8?q?RIFT-15944=20-=20editing=20an=20=E2=80=98id?= =?utf8?q?=E2=80=99=20field=20is=20troublesome=20as=20focus=20is=20lost=20?= =?utf8?q?on=20each=20char=20typed=20-=20fixed=20use=20of=20id=20as=20html?= =?utf8?q?=20element=20id=20-=20bit=20of=20code=20clean=20up=20-=20made=20?= =?utf8?q?use=20of=20knowing=20when=20a=20=E2=80=98key=E2=80=99=20on=20a?= =?utf8?q?=20component=20needs=20to=20be=20unique=20(only=20amongst=20sibl?= =?utf8?q?ings)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: If90de3090b77341a8857ea80630c539430e6498b Signed-off-by: Bob Gallagher --- .../EditDescriptorModelProperties.js | 200 ++++++++++++------ 1 file changed, 135 insertions(+), 65 deletions(-) diff --git a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js index 2615c6e8e..f3b2c7a73 100644 --- a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js +++ b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js @@ -175,11 +175,11 @@ export default function EditDescriptorModelProperties(props) { } } - function buildField(container, property, path, value, fieldKey) { + function buildField(container, property, path, value, fieldId) { let cds = CatalogDataStore; let catalogs = cds.getTransientCatalogs(); - const name = path.join('.'); + const pathToProperty = path.join('.'); const isEditable = true; const isGuid = Property.isGuid(property); const isBoolean = Property.isBoolean(property); @@ -197,81 +197,139 @@ export default function EditDescriptorModelProperties(props) { // so we categorically ignore them // https://trello.com/c/uzEwVx6W/230-bug-enum-should-not-use-index-only-name //return ; - return ; + return ; }); const isValueSet = enumeration.filter(d => d.isSelected).length > 0; if (!isValueSet || property.cardinality === '0..1') { const noValueDisplayText = changeCase.title(property.name); - options.unshift(); + options.unshift(); } - return ; + return ( + + ); } if (isLeafRef) { - let fullFieldKey = _isArray(fieldKey) ? fieldKey.join(':') : fieldKey; + let fullPathString = container.key + ':' + path.join(':'); let containerRef = container; while (containerRef.parent) { - fullFieldKey = containerRef.parent.key + ':' + fullFieldKey; + fullPathString = containerRef.parent.key + ':' + fullPathString; containerRef = containerRef.parent; } - const leafRefPathValues = Property.getLeafRef(property, path, value, fullFieldKey, catalogs, container); + const leafRefPathValues = Property.getLeafRef(property, path, value, fullPathString, catalogs, container); const options = leafRefPathValues && leafRefPathValues.map((d, i) => { - return ; + return ; }); const isValueSet = leafRefPathValues.filter(d => d.isSelected).length > 0; if (!isValueSet || property.cardinality === '0..1') { const noValueDisplayText = changeCase.title(property.name); - options.unshift(); + options.unshift(); } - return ; + return ( + + ); } if (isBoolean) { - let fullFieldKey = _isArray(fieldKey) ? fieldKey.join(':') : fieldKey; - let containerRef = container; - while (containerRef.parent) { - fullFieldKey = containerRef.parent.key + ':' + fullFieldKey; - containerRef = containerRef.parent; - } - const options = [ - , - + , + ] // if (!isValueSet) { const noValueDisplayText = changeCase.title(property.name); - options.unshift(); + options.unshift(); // } let val = value; if(typeof(val) == 'number') { val = value ? "TRUE" : "FALSE" } const isValueSet = (val != '' && val) - return ; + return ( + + ); } if (property['preserve-line-breaks']) { - return