You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by tbouron <gi...@git.apache.org> on 2018/08/20 15:14:02 UTC

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

GitHub user tbouron opened a pull request:

    https://github.com/apache/brooklyn-ui/pull/63

    Fix bug with the DSL editor/viewer

    This fixes 2 bugs:
    1. When adding a DSL for an entity spec, The DSL editor "Done" button was not redirecting to the spec editor. This was due to the previous param object being modified later on by the `ui-router`. Creating a deep copy of the object avoid this
    2. The DSL viewer was throwing an error while getting the name of the entity for DSL like `$brooklyn:self()` or `$brooklyn:parent()`. This is fixed by looking up directly for the relationships if the DSL are of that form

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tbouron/brooklyn-ui fix/dsl-editor

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-ui/pull/63.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #63
    
----
commit 39f8dbb94f1293b0a0c3f4001c81ac7195b93c68
Author: Thomas Bouron <th...@...>
Date:   2018-08-20T15:10:15Z

    Fix bug with the DSL editor/viewer

----


---

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

Posted by tbouron <gi...@git.apache.org>.
Github user tbouron commented on a diff in the pull request:

    https://github.com/apache/brooklyn-ui/pull/63#discussion_r211312453
  
    --- 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 --
    
    Ah good point, forgot to remove this, I'll do right now


---

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

Posted by ahgittin <gi...@git.apache.org>.
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?


---

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

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-ui/pull/63


---

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

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-ui/pull/63
  
    good fixes.  minor comment, good to merge with or without it.


---