guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema
MIT License
484 stars 173 forks source link

Demo application link references to app based on absolute different lib #215

Open emarkovskyi opened 6 years ago

emarkovskyi commented 6 years ago

The package.json contains "angular2-schema-form": "^1.0.0-beta.7" dependencies, https://github.com/fbessou/angular2-schema-form-demo

emarkovskyi commented 6 years ago

Hmm... sorry seems 1.0... version and 2.0... versions have different package names But anyway on my end the example app does not start

WhileTrueEndWhile commented 6 years ago

In angular2-schema-form, the demo page consisted of two blank pages and a form test page with a text area for JSON input (schema) and an output of the current model (JSON). I think the author had little time and would certainly not be averse to a "community-based" solution.

ebrehault commented 6 years ago

The angular2-schema-form-demo has not been upgraded to work with ngx-schema-form 2+. But you can use the demo app as a decent demo: https://github.com/makinacorpus/ngx-schema-form/tree/master/src/app

ebrehault commented 6 years ago

I have updated the github.io branch: http://makinacorpus.github.io/ngx-schema-form/dist/ngx-schema-form/

WhileTrueEndWhile commented 6 years ago

Nice. I think it makes sense (e.g. for issues/bugs) to create a schema configuration, which can easily be added to the demo page to demonstrate a certain problem. Probably it would be exaggerated to encode the schema into the URL, but I have overlooked the possibility to change the schema overall. That's all I have to complain about - beside the array bug ;-)!

emarkovskyi commented 6 years ago

txs @ebrehault, maybe not related to the topic, but does the current state lib support validation? I have tried just "required", custom validation. I see in debugger that custom validaor is triggered but there is no any "has-errors" styles added? May I missed something?

ebrehault commented 6 years ago

@WhileTrueEndWhile maybe we could change the demo so it is able to get a schema from a Gist, then we would just need to pass the Gist url as a param.

ebrehault commented 6 years ago

@emarkovskyi yes it does support validation.

Check the demo, as mentioned in the schema, firstName is mandatory, if you empty it, you'll this error in the console log:

{code: "OBJECT_MISSING_REQUIRED_PROPERTY", params: Array(1), message: "Missing required property: firstName", path: "#/firstName", schemaId: undefined}
ebrehault commented 6 years ago

@WhileTrueEndWhile done: http://makinacorpus.github.io/ngx-schema-form/dist/ngx-schema-form/?https%3A%2F%2Fgist.githubusercontent.com%2Febrehault%2Fbf2bc43ef923978a2389f7989351e616%2Fraw%2Ff8f9782e0d2920fe28f35df35a1d970e03560fa7%2Fexample-schema.json

WhileTrueEndWhile commented 6 years ago

Looks fine so far...

https://makinacorpus.github.io/ngx-schema-form/dist/ngx-schema-form/?https%3A%2F%2Fgist.githubusercontent.com%2FWhileTrueEndWhile%2F2b1fb7688214668de60a26d1e4b08217%2Fraw%2F79b528795469aeb700310f8d788ddd2d5466ffa1%2Flistoftwotypes.schema.json

The array bug seems to be fixed too :-)