Github user tbouron commented on a diff in the pull request:

    https://github.com/apache/brooklyn-ui/pull/106#discussion_r232211854
  
    --- Diff: 
ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
 ---
    @@ -64,8 +64,44 @@ export function saveToCatalogModalDirective($rootScope, 
$uibModal, $injector, co
             $scope.buttonText = $scope.config.label || ($scope.config.itemType 
? `Update ${$scope.config.name || $scope.config.symbolicName}` : 'Add to 
catalog');
     
             $scope.activateModal = () => {
    -            // Override callback to update catalog configuration data in 
other applications
    -            $scope.config = (composerOverrides.updateCatalogConfig || 
(($scope, $element) => $scope.config))($scope, $element);
    +            function injectorGet(reference) { return 
$element.injector().get(reference); }
    +            let blueprintService = injectorGet('blueprintService');
    +
    +            let entity = blueprintService.get();
    +            let metadata = blueprintService.entityHasMetadata(entity) ? 
blueprintService.getEntityMetadata(entity) : { };
    --- End diff --
    
    `metadata` is a `Map`, not an object. So if there isn't any, it should 
return `new Map()`. It currently throws a JS exception 
    
    Also, why do you get the metadata? There is no need there as the getters 
for `version`, `icon` and `id` already return this info out of the box.


---

Reply via email to