Kinto / kinto-admin

Kinto Web Administration Console
http://kinto.github.io/kinto-admin/
185 stars 35 forks source link

Custom widgets/validation? #388

Open Osmose opened 7 years ago

Osmose commented 7 years ago

Copied from kinto/kinto#1083.

You can specify a schema for your data, and a uiSchema for how to build the form for it. I'd like to be able to add a custom type for a field (specifically, a JEXL expression) that has custom validation, and potentially a UI widget that helps in writing that custom type.

But that custom type doesn't seem like a thing I should, say, land in Kinto itself. I'd like to be able to write something like a plugin for Kinto that adds support for my new custom type to a Kinto instance. I dunno if that's already possible or how hard it would be to add, though.

Thanks!

n1k0 commented 7 years ago

This is an interesting use case, as we don't have anything to extend forms capabilities in the kinto admin just yet. Forms are powered by react-jsonschema-form, which supports custom fields, widgets and validators.

The idea here I think would be to extend the current admin plugin API to support registering custom fields, widgets and validators, and allow leveraging them through collections uiSchemas.