ahgittin commented on a change in pull request #290:
URL: https://github.com/apache/brooklyn-ui/pull/290#discussion_r710335703



##########
File path: 
ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js
##########
@@ -100,15 +101,10 @@ export function summaryController($scope, $state, 
$stateParams, $q, $http, $http
 
             // TODO: ideally move this to a $watch block
             if (vm.config && vm.configResolved && vm.configInfo) {
-                vm.configItems = Object.entries(vm.showResolvedConfig ? 
vm.configResolved : vm.config)
-                    .map(([key, value]) => ({
-                        key,
-                        value,
-                        // marking as unsafe if the field name looks sensitive
-                        // and the unresolved value does *not* come from a 
secure external source
-                        isUnsafe: isSensitiveFieldName(key.trim()) &&
-                            
!vm.config[key].toString().startsWith('$brooklyn:'),
-                    }));
+                vm.configItems = vm.showResolvedConfig ? vm.configResolved : 
vm.config;
+                vm.configItemsUnsafeMap = mapValues(vm.configItems, (value, 
key) =>
+                    isSensitiveFieldName(key.trim()) && 
!vm.config[key].toString().startsWith('$brooklyn:')

Review comment:
       ie `vm.config[key]` can be null can't it?
   
   also do we need `mapValues` ... can't we just use 
Object.keys(vm.configItems).forEach(key => ...)`?
   
   finally on reflection i think it would be cleaner to pass a function eg 
`isSensitive(key, value)` to the widget, rather than a map.
   
   if no objections i'll apply this and merge.




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