tbouron commented on a change in pull request #164: auto-set a name for the app 
in quick-launch, and
URL: https://github.com/apache/brooklyn-ui/pull/164#discussion_r366235828
 
 

 ##########
 File path: ui-modules/home/app/views/main/main.controller.js
 ##########
 @@ -41,20 +41,29 @@ export const mainState = {
             return brooklynUiModulesApi.getUiModules();
         }],
         catalogApps: ['catalogApi', (catalogApi) => {
-            return catalogApi.getTypes({params: {supertype: 
'org.apache.brooklyn.api.entity.Application'}}).then(applications => {
-                // optionally tag things with 'catalog_quick_launch': if any 
apps are so tagged, 
-                // then only apps with such tags will be shown;
-                // in all cases only show those marked as templates
-                var appsWithTag = applications.filter(application => 
application.tags && application.tags.indexOf("catalog_quick_launch")>=0);
-                if (appsWithTag.length) {
-                    applications = appsWithTag;
-                }
-                return applications.filter(application => 
application.template);
-            });
+            return catalogApi.getTypes({params: {supertype: 
'org.apache.brooklyn.api.entity.Application'}}).then(
+                applications => 
filterCatalogQuickLaunch(applications.filter(application => 
application.template))
+            );
         }]
     }
 };
 
+export function filterCatalogQuickLaunch(list, callbackForFiltered) {
 
 Review comment:
   Should be added as a filter so that any part of the app can get it through 
dependency injection instead of calling it directly (which introduce some 
duplication in the generated code)

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


With regards,
Apache Git Services

Reply via email to