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

    https://github.com/apache/brooklyn-ui/pull/106#discussion_r232209888
  
    --- 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) : { };
    +            let config = $scope.$parent.$parent.vm.saveToCatalogConfig;
    --- End diff --
    
    You should pass `saveToCatalogConfig` as a parameter for the directive 
instead of getting it from the parent. You create a link here which is brittle.


---

Reply via email to