Code Monkey home page Code Monkey logo

ember-frost-bunsen's People

Contributors

adamward1995 avatar agonza40 avatar agonzalez-cyan avatar chrisstoll avatar cstolli avatar d-ashfield avatar dafortin avatar ember-tomster avatar ewhite613 avatar gknoy avatar helrac avatar job13er avatar jscharf avatar juwara0 avatar laflower avatar notmessenger avatar poplartoppler avatar psbanka avatar quincyle avatar rox163 avatar sandersky avatar sglanzer avatar sophypal avatar sushant1245 avatar theotherdude avatar travis-ci-ciena avatar vesper2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-frost-bunsen's Issues

Improve handling of array indices

We need to figure out the desired behavior when given the following model:

{
  "properties": {
    "foo": {
      "items": {
        "properties": {
          "bar": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    }
  },
  "type": "object"
}

paired with the following views:

View 1

{
  "cells": [
    {
      "model": "foo.0"
    }
  ],
  "type": "form",
  "version": "2.0"
}

Currently renders nothing.

Referencing object in view without children

Model

{
  "properties": {
    "foo": {
      "properties": {
        "bar": {
          "type": "string"
        },
        "baz": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}

View

{
  "cells": [
    {
      "model": "foo"
    }
  ],
  "type": "form",
  "version": "2.0"
}

Value

{
  "foo": {
    "bar": "test",
    "baz": "test2"
  }
}

Currently renders nothing.

I'd expect this to actually render the inputs for all sub-properties of foo since children isn't present.

multi-select is unusable

It appears to work in the demo until you select something and an error message appears.

Seems that you must put type: 'string' in the model. But the resulting value is an array. type: 'array' in the model causes an internal failure.

Furthermore, you cannot set the initial value.

add label formatting feature and advanced filtering spec to 'select' renderer

Having implemented the new select renderer in Bunsen, it's clear there are two advanced features that would be really nice:

  1. A label format feature that allows the schema author to compose a label, consisting of the following going into the view spec:
'labelFormat': '${someAttr} - ${someOtherAttr}'

This would accommodate the networkFunction (session) use case currently in Forch.

  1. An advanced filter treatment feature:
'filter': {
  'client': true //override to client-side filtering, useful for APIs that don't a
  'attribute': 'someAttrName' // the property to filter on
}

This would accommodate the node drop-down use case in Forch, where the filtering is done on a deep property, not supported by the orchestrate API, and would support the resource-provider drop-down in the Domain create screen, where the API does not support p or q filtering.

Multi-select documentation and demo missing details

There is a bug in the demo that causes an error to display when any item is checked. It is probably wrong to put type: 'string' in the model.

It would be nice to get more of an explanation about what value you get in the bunsen form value and what you pass in to have some items selected initially. Also, is it possible to have a display name and internal value for each enum entry? In frost-core you can see that multi-select supports this.

Submit and cancel buttons not implemented

There are fields set up to allow for submit and cancel buttons. But this feature is not implemented. Seems that it was left in a half-done state after the last framework conversion. Most of the infrastructure is there but there are some typos in the templates. The buttons in the form template should also use frost-button.

Rename attributes

We should rename the following attributes so they don't sound like Ember/Ember Data properties and reduce confusion.

  • model should be renamed to bunsenModel
  • store should be renamed to bunsenStore
  • view should be renamed to bunsenView

Add File Renderer

Not sure how difficult this one will be with the added complexity up attached files for upload.

Add blueprint for generating new custom renderer

It would be super-useful to include a blueprint that generates a new custom-renderer along with setting up the integration test so that the component receives what it will receive when a part of a bunsen form or detail component.

Smarter required text

Model

{
  "properties": {
    "foo": {
      "properties": {
        "bar": {
          "properties": {
            "spam": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "baz": {
          "type": "string"
        }
      },
        "required": ["baz"],
      "type": "object"
    }
  },
  "type": "object"
}

View

{
  "cells": [
    {
      "children": [
        {
          "model": "bar.spam"
        }
      ],
      "label": "Foo",
      "model": "foo"
    }
  ],
  "type": "form",
  "version": "2.0"
}

Currently the Required text shows up under the label Foo because foo.baz is required even though we aren't rendering an input for baz.

Instead of blindly using the model attribute we should determine if any of the children are required when deciding whether or not a parent cell is required.

deal with a cancel click and not show validation errors

open a dialog and the first input gets focus. when you dismiss the dialog, via cancel button, that triggers the validation because the Input loses focus, which then shows the error message for a fraction of a second before the dialog transitions out. It should not show the validation error if the dialog is being cancelled. Maybe bunsen should accept some kind of flag from the app, indicating that the dialog is being cancelled so don't run the validations.

Make Examples Filterable in a More Meaningful Way

An idea @gknoy and I came up with is to revamp the examples page to have filters that can be applied to find an example for whatever it is you are trying to do. For example we might present a multi-select filter for choosing a set of renderers that must be included in the example we desire. This would mean adding a bunch more information to the Ember Data models and Mirage mocks as well as updating the examples UI to present the filters. I'm sure we can come up with more meaningful filters beyond types of renderers as well.

Empty strings no longer in formValue passed to onChange handler

I have a form with some text boxes. Previously (6.6.1) the value passed to the onChange handler would have a key for every field in the form with an empty string for empty text inputs. In 6.6.5 those fields are completely missing from the formValue. This change is not documented. Is it intentional?

Validators get old value

The form value given to the validator is one step two old. For example that value might be missing the last character typed in a text input.

Problem happened on upgrading from 4.1.14 to 5.0.3. It seems to not happen in 5.0.1 but those versions have other issues.

Double label

The following model and view causes a double label to appear in bunsen 7.1.0.

Model:

{
  "properties": {
    "foo": {
      "properties": {
        "bar": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}

View:

{
  "cellDefinitions": {
    "main": {
      "label": "Test",
      "children": [
        {
          "model": "bar"
        }
      ]
    }
  },
  "cells": [
    {
      "children": [
        {
          "extends": "main",
          "model": "foo"
        }
      ]
    }
  ],
  "type": "form",
  "version": "2.0"
}

Checkbox compliance

The text/label for a checkbox should be to the right of the checkbox, not the left.

A field is set to a default value that should show another input with condition and it's not working

I have a select input or a button-group that has a default value that should trigger a condition to show another input and it's not working.

I have the following code:

type: 'object',
      properties: {
        resolvedCosMapping: {
          type: 'string',
          default: 'fixed',
          enum: ['fixed', 'device default']
        },
        untaggedFrames: {
          type: 'boolean',
          default: true
        },
        untaggedVlan: {
          type: 'number',
          default: 10,
          minimum: 1,
          maximum: 4095,
          conditions: [
            {
              if: [
                {
                  untaggedFrames: {
                    equals: true
                  }
                }
              ]
            }
          ]
        },
        ...
    }

Modifying items twice in one render

Ever since consuming 4.x bunsen, I've been getting the following type of DEPRECATION warnings (lots of them):

DEPRECATION: You modified (mut errors) twice in a single render. This was unreliable in Ember 1.x and will be removed in Ember 3.0 [deprecation id: ember-views.render-double-modify]
        at HANDLERS.(anonymous function) (http://localhost:4200/automation/assets/vendor.js:15791:7)
        at raiseOnDeprecation (http://localhost:4200/automation/assets/vendor.js:15699:12)
        at HANDLERS.(anonymous function) (http://localhost:4200/automation/assets/vendor.js:15791:7)
        at invoke (http://localhost:4200/automation/assets/vendor.js:15807:7)
        at deprecate (http://localhost:4200/automation/assets/vendor.js:15760:32)
        at Object.deprecate (http://localhost:4200/automation/assets/vendor.js:25799:37)
        at exports.default._emberMetalMixin.Mixin.create._Mixin$create.scheduleRevalidate (http://localhost:4200/automation/assets/vendor.js:53062:26)
        at http://localhost:4200/automation/assets/vendor.js:23312:32
        at Object.BasicStream.notifySubscribers (http://localhost:4200/automation/assets/vendor.js:31712:11)

The what that was modified seems to be more than just mut errors it has also been:

  • mut value
  • mut errorMessage
  • mut renderValue

On a large, rather complex bunsen form, I get > 400 of these messages when it renders (with some default values), this makes finding any other messages in the midst of all that quite difficult. Not to mention the fact that bunsen appears to be doing something that is unreliable and will be removed :(

Allow Ember component template names to be used as renderer

If I have a component that can be consumed via {{foo-bar โ€ฆ}} then I want to be able to specify "renderer": "foo-bar" without having to specify the renderer in the mapping passed into the renderers property of the detail/form component.

Add password renderer

Add a new password renderer and update the text renderer to provide deprecation warnings when using it to generate password inputs.

Titles are repeated after reaching 3 levels of nesting.

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"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }

Add Model Documentation to Demo

We really need to document what a model is in our demo app. We do not support all features of JSON Schema and we also have our own meaningful properties outside the scope of JSON Schema, so it'd be nice to convey this information to our consumers.

cellDefinitions is needed in view when dealing with nested values.

This may be related with the 3 levels of nesting bug.

When nesting values in more then 2 layers, it appears bunsen requires a cellDefinitions in the view (even if it's empty)

Example model:

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

The following view fails:

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

But this one with an empty cell definitions renders:

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

Default value not set on field shown by condition

I have a input that is triggering a condition to show another input. The other input has a default value. The default value is not set on the triggering of the condition. So I'm able to see the field but the default value is not set.

type: 'object',
      properties: {
        description: {
          type: 'string'
        },
        continuityCheck8021ag: {
          type: 'boolean'
        },
        slmY1731: {
          type: 'boolean',
          default: true,
          conditions: [
            {
              if: [
                {
                  continuityCheck8021ag: {
                    equals: true
                  }
                }
              ]
            }
          ]
        },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.