OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] brooklyn-ui pull request #63: Fix bug with the DSL editor/viewer


Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-ui/pull/63#discussion_r211311711
  
    --- Diff: ui-modules/blueprint-composer/app/components/dsl-viewer/dsl-viewer.js ---
    @@ -51,7 +51,16 @@ export function dslViewerDirective() {
                 return [KIND.STRING, KIND.NUMBER].includes(dsl.kind);
             };
             scope.getRelatedEntity = () => {
    -            return scope.dsl.getRoot().relationships.find(entity => entity.id === scope.dsl.params[0].name);
    +            if (scope.dsl.params.length > 0) {
    +                // If the DSL is looking at an entity ID
    +                return scope.dsl.getRoot().relationships.find(entity => scope.dsl.params.length > 0 && entity.id === scope.dsl.params[0].name)
    --- End diff --
    
    no need to check `scope.dsl.params.length > 0` again in 56 after doing it in 54 is there?


---