Code Monkey home page Code Monkey logo

bunsen-core's Introduction

bunsen-core

Core libraries for bunsen.

Dependencies

NPM

Health

Travis Coveralls

You may also want to check out:

bunsen-core's People

Contributors

adamward1995 avatar agonza40 avatar agonzalez-cyan avatar cstolli avatar davidbriglio avatar ewhite613 avatar gknoy avatar job13er avatar juwara0 avatar martinheon avatar poplartoppler avatar quincyle avatar sandersky avatar sophypal avatar theotherdude avatar travis-ci-ciena avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bunsen-core's Issues

Properly handle `length` properties in values

Currently, if a value has a length property, the parent object is treated as an array in recursiveClean().

We should still treat objects as objects when they have a length property.

Coveralls.io doesn't know where source files are

Coveralls.io doesn't report coverage against source files as the code coverage is generated against files in the lib directory which doesn't exist on Github. We need to figure how to report the coverage against the files in the src directory instead.

date format validation cross browsers

Currently the validation of the date format doesn't work the same in Firefox and Chrome. Specifically, it appears that 0.5 validates in Chrome as valid and in Firefox as invalid (it should be invalid in both).

Cannot extend from a model object

This problem has to do with creating/updating a model from the view and is split in two parts

  1. When we put an extends property on an object that has a model that is an object the extends is ignored.
    image

  2. We cannot overwrite a model that already exists from a view.
    image

Supplement zSchema validation required errors for nested definitions

Currently, zSchema will only report required errors for the top-level field missing. ember-frost-bunsen relies on these messages to highlight fields that are missing. There was previous work done before to resolve this by making all required fields initialized with empty objects but that was a contradiction to the meaning of required as it allowed the form to pass validation without errors for required fields.

What needs to be done is to replace the required errors with errors targeting the child fields. This can be tricky with arrays because arrays can't be further processed without having a value. Unlike an object whose fields are statically defined, the length of an array is dynamic.

What complicates this further is a form can reference an array item without having the array item exist initially but we need to provide appropriate error messages for them as well. So we would obviously need to tap into the view schema during this processing.

conditions in bunsen-model not checking for null explicitly

I noticed that if a bunsenValue for a property is null, then this conditional covers that case:

export function ifNotUndefined (path) {
  return [
    {
      if: [
        {
          [path]: {
            notEqual: undefined
          }
        }
      ]
    }
  ]

as opposed to checking for null explicitly:

export function ifNotUndefinedAndNotNull (path) {
  return [
    {
      if: [
        {
          [path]: {
            notEqual: undefined
          },  // AND
          [path]: {
            notEqual: null
          }
        }
      ]
    }
  ]
}

Using unless, also did not suffice:

export function ifNotUndefinedAndNotNull (path) {
  return [
    {
      unless: [
        {
          [path]: {equals: undefined}
        },  // OR
        {
          [path]: {equals: null}
        }
      ]
    }
  ]
}

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.