ahgittin commented on code in PR #335:
URL: https://github.com/apache/brooklyn-ui/pull/335#discussion_r903798111


##########
ui-modules/utils/quick-launch/quick-launch.js:
##########
@@ -122,13 +122,17 @@ export function quickLaunchDirective() {
             if ($scope.app.config) {
                 $scope.configMap = $scope.app.config.reduce((result, config) 
=> {
                     result[config.name] = config;
-                    const configValue = parseConfigValue(get(parsedPlan, 
`services[0][${BROOKLYN_CONFIG}][${config.name}]`));
+
+                    const planConfigValue = 
parseConfigValue((parsedPlan[BROOKLYN_CONFIG] || {})[config.name]);
+                    const catalogItemConfigValue = 
parseConfigValue((parsedPlan.services[0] && 
parsedPlan.services[0][BROOKLYN_CONFIG] || {})[config.name]);
+                    const configValue = planConfigValue || 
catalogItemConfigValue;

Review Comment:
   this will return the `catalogItemConfigValue` if `planConfigValue` is set to 
`0` or `false`, won't it, and i think that isn't desired.
   
   should this be:
   
   ```
   let configValue = parseConfigValue((parsedPlan[BROOKLYN_CONFIG] || 
{})[config.name]);
   if (typeof configValue == 'undefined') {
     configValue = parseConfigValue((parsedPlan.services[0] && 
parsedPlan.services[0][BROOKLYN_CONFIG] || {})
   }
   ```
   
   could also have
   
   ```
   if (typeof configValue == 'undefined') {
     configValue = parseConfigValue(get(config, 'defaultValue', null))
   }
   ```
   
   then finally (replacing section below)
   
   ```
   $scope.entityToDeploy[BROOKLYN_CONFIG][config.name] = configValue;
   ```
   
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to