Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Titles are repeated after reaching 3 levels of nesting. #177

Closed
sdesros opened this issue Sep 6, 2016 · 0 comments · Fixed by #239
Closed

Titles are repeated after reaching 3 levels of nesting. #177

sdesros opened this issue Sep 6, 2016 · 0 comments · Fixed by #239
Assignees
Labels

Comments

@sdesros
Copy link

sdesros commented Sep 6, 2016

I noticed bunsen repeating the 2nd layer of titles once I had hit three levels of nesting.

Int he following example, only one "Foo" is expected:
screen shot 2016-09-02 at 7 11 50 pm

The example's model and view:
Bunsen Model:

{
    "type": "object",
    "properties": {
      "nested": {
       "type": "object",
        "properties": {
          "foo": {
            "type": "object",
            "properties": {
              "foosValue": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }

Bunsen View:
Note: cellDefinitions was needed, otherwise the view failed to work.

{
    "type": "form",
    "version": "2.0",
    "cellDefinitions": {
    },
    "cells": [
      {
        "children": [
          {
            "label": "Main",
            "model": "nested",
            "children": [
              {
                "label": "Foo",
                "model": "foo",
                "children": [
                  {
                    "label": "value",
                    "model": "foosValue"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }

Workaround is to attempt to skip a layer of nesting by directly referencing the parent in the child:

{
    "type": "form",
    "version": "2.0",
    "cellDefinitions": {
    },
    "cells": [
      {
        "children": [
          {
            "label": "Main",
           // skip setting "model": "nested" here.
            "children": [
              {
                "label": "Foo",
                // the child can directly references the 
                // "nested.foo" instead of relying on the
                // "parent" to set the context.  Limits the 
                // nesting to two levels.
                "model": "nested.foo",
                "children": [
                  {
                    "label": "value",
                    "model": "foosValue"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants