tbouron commented on a change in pull request #255:
URL: https://github.com/apache/brooklyn-ui/pull/255#discussion_r675453518



##########
File path: ui-modules/blueprint-composer/app/views/main/main.controller.js
##########
@@ -110,8 +117,37 @@ export function MainController($scope, $element, $log, 
$state, $stateParams, brB
                 $log.error('Cannot save layers preferences: ' + ex.message);
             }
         }
+    };
+
+    // Relationship arcs and labels.
+    let isRelationshipArcsLayerActive = true;
+    let isRelationshipLabelsLayerActive = true;
+
+    // Re-apply filters when selected filters changed or graph is changed.
+    $scope.$watch('vm.layers', () => {
+        applyFilters();
+
+        let relationshipArcsLayer = vm.layers.find(l => l.id === 
PATHS_SELECTOR_ID);
+        let relationshipLabelsLayer = vm.layers.find(l => l.id === 
LABELS_SELECTOR_ID);
+
+        // Turning on labels turns on arcs.
+        if (relationshipLabelsLayer.active && 
!isRelationshipLabelsLayerActive) {
+            relationshipArcsLayer.active = true;
+        }
+
+        // Turning off arcs turns off labels.
+        if (!relationshipArcsLayer.active && isRelationshipArcsLayerActive) {
+            relationshipLabelsLayer.active = false;
+        }
+
+        // Update cached state for arc and labels.
+        isRelationshipArcsLayerActive = relationshipArcsLayer.active;
+        isRelationshipLabelsLayerActive = relationshipLabelsLayer.active;
+
     }, true);
 
+    $scope.$on('layers.filter', () => applyFilters());

Review comment:
       Aha, I see @algairim. That is a bit counter-intuitive but probably the 
best solution for now (and I wouldnt want to make you change even more stuff 
now :P)




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to