You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2023/06/20 02:05:06 UTC

[brooklyn-ui] 09/14: add option for showing effector tasks anywhere, enabled by default

This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git

commit a9969676c50519e774a3d3d1154b533ed7c3a7ac
Author: Alex Heneveld <al...@cloudsoft.io>
AuthorDate: Sun Jun 18 02:30:25 2023 +0100

    add option for showing effector tasks anywhere, enabled by default
---
 .../components/task-list/task-list.directive.js    | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/ui-modules/app-inspector/app/components/task-list/task-list.directive.js b/ui-modules/app-inspector/app/components/task-list/task-list.directive.js
index eaf08766..a76c11f4 100644
--- a/ui-modules/app-inspector/app/components/task-list/task-list.directive.js
+++ b/ui-modules/app-inspector/app/components/task-list/task-list.directive.js
@@ -102,9 +102,8 @@ export function taskListDirective() {
             // now update name
             const enabledCategories = _.uniq(Object.values($scope.filters.selectedFilters).map(f => f.category));
             $scope.filters.selectedDisplay = [];
-            Object.entries($scope.filters.displayNameFunctionForCategory).forEach(([category, nameFn]) => {
+            Object.entries($scope.filters.displayNameFunctionForCategory).forEach(([category, nf]) => {
                 if (!enabledCategories.includes(category)) return null;
-                let nf = $scope.filters.displayNameFunctionForCategory[category];
                 let badges = nf ? nf(Object.values($scope.filters.selectedFilters).filter(f => (f.categoryForBadges || f.category) === category)) : null;
                 badges = (badges || []).filter(x=>x);
                 if (badges.length) $scope.filters.selectedDisplay.push({ class: 'dropdown-category-'+category, badges });
@@ -169,6 +168,8 @@ export function taskListDirective() {
             } else {
                 if (!isActivityChildren) {
                     // defaults (when not in subtask view; in subtask view it is as above)
+                    selectFilter('_cross_entity');
+                    selectFilter('_all_effectors');
                     selectFilter('EFFECTOR');
                     selectFilter('WORKFLOW');
                 } else {
@@ -182,7 +183,6 @@ export function taskListDirective() {
 
             // pick other filter combos until we get some conetnt
             if ($scope.tasksFilteredByTag.length==0) {
-                selectFilter('_cross_entity');
                 selectFilter('INITIALIZATION');
             }
             if ($scope.tasksFilteredByTag.length==0) {
@@ -321,11 +321,19 @@ export function taskListDirective() {
                     // everything but first is selected, so no message (assume _top is always shown)
                     return [ 'all' ];
                 }
+                if (set.length > 1) return [ 'some' ];  // gets too big otherwise
                 return set.map(s => s.displaySummary || '');
             },
             'type-tag': set => {
                 if (!set || !set.length) return null;
                 if (set.length<=3) {
+
+                    if (scope.filters.selectedFilters['_all_effectors'] &&
+                            Object.values(scope.filters.selectedFilters).filter(f => f.category === 'nested').length==1) {
+                        // if all_effectors is the only nesting don't show '(effectors) (effector)'
+                        set = set.filter(x => x.displaySummary != 'effector');  // don't show 'effectors' and effector
+                    }
+
                     return set.map(s => (getFilterOrEmpty(s).displaySummary || '').toLowerCase()).filter(x => x);
                 } else {
                     return ['any of '+set.length+' tags'];
@@ -359,6 +367,14 @@ export function taskListDirective() {
                 onEnabledPre: clearOther('_top'),
                 onDisabledPost: enableFilterIfCategoryEmpty('_top'),
             }
+            filtersFullList['_all_effectors'] = {
+                display: 'Include non-top-level effectors',
+                displaySummary: 'effectors',
+                filter: filterForTasksWithTag('EFFECTOR'),
+                category: 'nested',
+                onEnabledPre: clearOther('_top'),
+                onDisabledPost: enableFilterIfCategoryEmpty('_top'),
+            }
         } else {
             filtersFullList['_recursive'] = {
                 display: 'Show all sub-tasks',