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



##########
File path: ui-modules/blueprint-composer/app/components/dsl-editor/dsl-editor.js
##########
@@ -305,9 +305,10 @@ export function dslEditorDirective($rootScope, $filter, 
$log, brUtilsGeneral, bl
     function uniqueItems(items) {
         const IDs = new Set();
 
-        return items.filter(({ id }) => {
-            if (IDs.has(id)) return false;
-            IDs.add(id);
+        // filtering with both own and parent's ID in case we have same-type 
child nodes
+        return items.filter(({ id, entity }) => {

Review comment:
       makes sense.  for readability and in case entity.id is null and for 
clean demarcation between id and entity.id i'd do this as:
   
   ```
   let marker = id + ':' + (entity.id || '-');
   if (IDs.has(marker)) {
     return false;
   } else {
     IDs.add(marker);
     return true;
   }
   ```




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