Open leplatrem opened 3 weeks ago
This would allow users to store relatively small files as attributes on records instead of using attachments.
Typical use-case is to store the thumbnail of the file that is attached on the record.
In order to do this, we will need:
<input type="file">
The record schema would be:
properties: thumbnail: type: string
And the collection UI schema:
uiSchema: thumbnail: ui:widget: base64input
Then instead of contributing a new widget in the rjsf upstream project, we can follow the pattern that we currently have for our local JSON editor, and inject it ourselves during form instantiation:
https://github.com/Kinto/kinto-admin/blob/349a3748553324cd1ee14cf2a110895e68c189f7/src/components/JSONEditor.tsx#L12-L33
https://github.com/Kinto/kinto-admin/blob/349a3748553324cd1ee14cf2a110895e68c189f7/src/components/group/GroupForm.tsx#L44-L48
In this case we would replace occurrences of base64input by instances of our base64 widget.
base64input
See also:
Thanks @leplatrem - feel free to assign me and I'll take a stab at it
This would allow users to store relatively small files as attributes on records instead of using attachments.
Typical use-case is to store the thumbnail of the file that is attached on the record.
In order to do this, we will need:
<input type="file">
into base64The record schema would be:
And the collection UI schema:
Then instead of contributing a new widget in the rjsf upstream project, we can follow the pattern that we currently have for our local JSON editor, and inject it ourselves during form instantiation:
https://github.com/Kinto/kinto-admin/blob/349a3748553324cd1ee14cf2a110895e68c189f7/src/components/JSONEditor.tsx#L12-L33
https://github.com/Kinto/kinto-admin/blob/349a3748553324cd1ee14cf2a110895e68c189f7/src/components/group/GroupForm.tsx#L44-L48
In this case we would replace occurrences of
base64input
by instances of our base64 widget.See also: