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

 ##########
 File path: 
ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.directive.js
 ##########
 @@ -601,36 +738,37 @@ export function specEditorDirective($rootScope, 
$templateCache, $injector, $sani
                 }
             }
             widgetMetadata.enabled = newval;
-        }
+        };
         specEditor.getCustomConfigWidgetModeTitle = (item) => {
-            var widgetMetadata = 
scope.state.config.customConfigWidgetMetadata[item.name];
+            let widgetMetadata = 
scope.state.config.customConfigWidgetMetadata[item.name];
             if (!widgetMetadata) {
                 // shouldn't be visible
                 return "(custom widget not available)";
             }
             return widgetMetadata.enabled ? "Use standard widget" : "Use 
custom widget";
         };
         specEditor.getCustomConfigWidgetTemplate = (item) => {
-            var widgetMetadata = 
scope.state.config.customConfigWidgetMetadata[item.name];
-            var widgetName = $sanitize(widgetMetadata.widget || 
'--no-widget--');
-            var templateName = 'custom-config-widget-'+widgetName;
+            let widgetMetadata = 
scope.state.config.customConfigWidgetMetadata[item.name];
+            let widgetName = $sanitize(widgetMetadata.widget || 
'--no-widget--');
+            let templateName = 'custom-config-widget-' + widgetName;
             if (!$templateCache.get(templateName)) {
-                var widgetDirective = widgetName.replace(/(-[a-z])/g, 
function($1){return $1[1].toUpperCase();})+'Directive';
+                let widgetDirective = widgetName.replace(/(-[a-z])/g, function 
($1) {
+                    return $1[1].toUpperCase();
+                }) + 'Directive';
                 if ($injector.has(widgetDirective)) {
-                    $templateCache.put(templateName, '<'+widgetName+' 
item="item" params="state.config.customConfigWidgetMetadata[item.name]" 
config="config" model="model"/>');
+                    $templateCache.put(templateName, '<' + widgetName + ' 
item="item" params="state.config.customConfigWidgetMetadata[item.name]" 
config="config" model="model"/>');
                 } else {
-                    $log.error('Missing directive '+widgetDirective+' for 
custom widget for '+item.name+'; falling back to default widget');
+                    $log.error('Missing directive ' + widgetDirective + ' for 
custom widget for ' + item.name + '; falling back to default widget');
                     
scope.state.config.customConfigWidgetMetadata[item.name].error = "Missing 
directive";
                     templateName = "error-" + templateName;
-                    $templateCache.put(templateName, '<i>Widget '+widgetName+' 
missing</i>');
+                    $templateCache.put(templateName, '<i>Widget ' + widgetName 
+ ' missing</i>');
                 }
             }
             return templateName;
         };
-
         specEditor.isDsl = (key, index) => {
             let val = scope.model.config.get(key);
-            if (specEditor.defined(val) && specEditor.defined(index) && 
index!=null) val = val[index];
+            if (specEditor.defined(val) && specEditor.defined(index) && index 
!= null) val = val[index];
 
 Review comment:
   ```suggestion
               if (specEditor.defined(val) && specEditor.defined(index) && 
index !== null) val = val[index];
   ```

----------------------------------------------------------------
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