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 b8daa4ec8eaec3e1b733afca194f82d8511a271c Author: Mykola Mandra <[email protected]> AuthorDate: Wed Jun 23 13:02:42 2021 +0100 Add relationship labels for config keys of type Object (other) Signed-off-by: Mykola Mandra <[email protected]> --- .../components/providers/blueprint-service.provider.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js b/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js index 1f000bb..20aa730 100644 --- a/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js +++ b/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js @@ -55,7 +55,8 @@ function BlueprintService($log, $q, $sce, paletteApi, iconGenerator, dslService, if (config instanceof Dsl) { config.relationships.forEach((entity) => { if (entity !== null) { - set.add(entity); + // TODO: set the right name of the relationship + set.add({entity: entity, name: null}); } }); } @@ -63,9 +64,10 @@ function BlueprintService($log, $q, $sce, paletteApi, iconGenerator, dslService, config .filter(conf => conf instanceof Dsl) .reduce((set, config)=> { - config.relationships.forEach((entity)=> { + config.relationships.forEach((entity) => { if (entity !== null) { - set.add(entity); + // TODO: set the right name of the relationship + set.add({entity: entity, name: null}); } }); return set; @@ -74,10 +76,10 @@ function BlueprintService($log, $q, $sce, paletteApi, iconGenerator, dslService, if (config instanceof Object) { Object.keys(config) .filter(key => config[key] instanceof Dsl) - .reduce((set, key)=> { + .reduce((set, key) => { config[key].relationships.forEach((entity)=> { if (entity !== null) { - set.add(entity); + set.add({entity: entity, name: key}); } }); return set; @@ -89,7 +91,8 @@ function BlueprintService($log, $q, $sce, paletteApi, iconGenerator, dslService, return Array.from(set).map((relation) => { return { source: entity, - target: relation + target: relation.entity, + label: relation.name }; }); }
