ahgittin commented on a change in pull request #210:
URL: https://github.com/apache/brooklyn-ui/pull/210#discussion_r643768761



##########
File path: ui-modules/blueprint-composer/app/components/util/d3-blueprint.js
##########
@@ -670,6 +685,46 @@ export function D3Blueprint(container, options) {
             .attr('transform', 'scale(0)')
             .remove();
         appendElement(adjunctData.enter(), 'rect', 
_configHolder.nodes.adjunct.rect);
+
+        let annotationElement = nodeGroup.append('g')
+            .attr('class', 'node-annotation');
+        let annotationData = nodeData.select('g.node-annotation')
+            .selectAll('foreignObject.node-annotation')
+            .data((d)=>{
+                let tags = d.data.metadata && 
d.data.metadata.get("brooklyn.tags");
+                if (tags) {
+                    let annotations = tags.map(tag => typeof tag === "object" 
&& Object.keys(tag) && Object.keys(tag).length === 1 && 
tag["ui-composer-annotation"]).filter(x => x);

Review comment:
       the `map` changes the array to contain the _values_ of the 
`ui-composer-annotation` key
   
   the `filter(x=>x)` is an idiomatic (if ugly) way to remove `false` and 
`null` items in set




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


Reply via email to