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 2021/08/16 09:50:24 UTC

[brooklyn-ui] 01/03: adjusted logic for identifying unique items

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 2f73970c500bd0ad99e2e42bb844e4561f7cebd1
Author: John Athanasiou <ja...@users.noreply.github.com>
AuthorDate: Mon Aug 16 10:01:15 2021 +0100

    adjusted logic for identifying unique items
---
 .../blueprint-composer/app/components/dsl-editor/dsl-editor.js     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ui-modules/blueprint-composer/app/components/dsl-editor/dsl-editor.js b/ui-modules/blueprint-composer/app/components/dsl-editor/dsl-editor.js
index 4022f2b..ec9c957 100644
--- a/ui-modules/blueprint-composer/app/components/dsl-editor/dsl-editor.js
+++ b/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 }) => {
+            if (IDs.has(id+entity.id)) return false;
+            IDs.add(id+entity.id);
             return true;
         })
     }