You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/06/21 16:51:53 UTC

[GitHub] [brooklyn-ui] algairim commented on a change in pull request #229: Added fix for issue smart-204, version not being updated in the Add ...

algairim commented on a change in pull request #229:
URL: https://github.com/apache/brooklyn-ui/pull/229#discussion_r655550852



##########
File path: ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
##########
@@ -68,6 +68,30 @@ export function saveToCatalogModalDirective($rootScope, $uibModal, $injector, $f
         }
     }
 

Review comment:
       I would not include so many custom calls from the override.
    
   Suggestion:
   
   ```
   export function saveToCatalogModalDirective($rootScope, $uibModal, $injector, $filter, composerOverrides, blueprintService) {
       let modalDirective = this;
   
       modalDirective.getConfigNameFromEntity = (entity) => {
       
       // use $scope directly
       // code omitted ...
   
       };
   
       modalDirective.getConfigBundleNameFromScope = () => {
   
       // use $scope directly
       // code omitted ...
   
       };
   
       modalDirective.getSuggestedSymbolicNameFromBlueprint = (entity, metadata) => {
   
       // use $scope directly
       // code omitted ...
   
       };
   
       modalDirective.updateCatalogConfig = (config, $element) => {
   
       // use $scope directly
       // code omitted ...
   
       }
   
       // allow downstream to configure directive and scope here
       (composerOverrides.configureCatalog || () => {})(modalDirective, $scope);
   
       return = {
   
       // code omitted ...
   ```
   
   Customize methods defined on `modalDirective` instance in the branding part and call them accessing instance of the directive `modalDirective.getConfigNameFromEntity(entity)`
   




-- 
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:
users@infra.apache.org