ahgittin commented on a change in pull request #129: UI for defining parameters
URL: https://github.com/apache/brooklyn-ui/pull/129#discussion_r270942802
 
 

 ##########
 File path: 
ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
 ##########
 @@ -449,13 +527,25 @@ export function specEditorDirective($rootScope, 
$templateCache, $injector, $sani
 
             // if type isn't set then infer
             if (value instanceof Array) {
-                definition.widgetMode = 'array';
+                item.widgetMode = 'array';
             } else if (value instanceof Object) {
-                definition.widgetMode = 'map';
+                item.widgetMode = 'map';
             } else {
-                definition.widgetMode = 'unknown';
+                item.widgetMode = 'unknown';
             }
-        }
+            return item.widgetMode;
+        };
+        specEditor.getParameterWidgetMode = (item) => {
+            let type = item.type || item.typeName;
+
+            if (type === 'java.lang.Boolean') type = 'boolean';
+            else if (type === 'java.util.Map') type = 'map';
+            else if (type === 'java.util.Set' || type === 'java.util.List' || 
type === 'java.util.Collection' || type.startsWith('List<')) type = 'array';
+
+            if (type.startsWith('AWS::')) type = 'unknown';
 
 Review comment:
   quite right, this shouldn't be here!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to