Skip to content

Discrepancy, minor mistake, and inconsistency in the documentation and between similar functionnality #145

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

Closed
lionel-bijaoui opened this issue Mar 7, 2017 · 4 comments

Comments

@lionel-bijaoui
Copy link
Member

radios's radiosOptions is mandatory but flexible, and checklist is optional but strict.

While checklist support values as an array of string or an array of objects, radios only support the object format if radiosOptions is defined.
If you forget to add radiosOptions:

TypeError: this.schema.radiosOptions is undefined

What should be going on here in my opinion:

  • both radios and checklist should take simple array or array of objects as values (name for display and value for internal/model value)
  • both radios and checklist should have options (radiosOptions and checklistOptions) to define the name of each key used by the object

Also when using the object the documentation say that it should save only the id in the model, but it save everything:

// what it does
"checklistlistbox":
[
    {
        "name": "Javascript",
        "value": "Javascript-123"
    }
]
// instead of what the doc say it should do
"checklistlistbox": ["Javascript-123"]

None of this is very bad by itself, but I think core fields should be more coherent in their options and functionalities. It will help users and it will help us making unit test without headaches.

So what should be the basic behavior of these kind of fields ? ***Options mandatory to use array of object ? Basic array and array of objects (with name and value) available, and only use ***Options to customize the name of keys ?

If you have found other small problems like those, please leave a comment !
We should fix them before the v2.0.0

@icebob
Copy link
Member

icebob commented Mar 9, 2017

I think both of them should work with basic array & object arrays. And should create a checklistOptions for checklist that we can set the name of keys.

@icebob
Copy link
Member

icebob commented Mar 20, 2017

is it ready?

@lionel-bijaoui
Copy link
Member Author

I didn't had the time to check all the documentation. Some example may need an update for the v2.
From the question we got in the issues, I think we need more details about the visible/disable function parameters (#149), how to use VFG without webpack (#148), how to use the default value (#147) and how to translate the error messages (#134).
Maybe the documentation need a FAQ section ?

@icebob
Copy link
Member

icebob commented Mar 21, 2017

Good idea. For this questions would be better a FAQ.
Could you open a new issue about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants