openmrs / openmrs-esm-form-builder

OpenMRS Form Builder microfrontend
Other
5 stars 55 forks source link

Form Builder: Allow uploading of Forms from the file system #129

Open mogoodrich opened 1 year ago

mogoodrich commented 1 year ago

To enhance the development experience of Form Schemas, we'd like to support allowing implementors to work on forms within their own IDE, but then be able to preview the form using the Form Builder.

Proposed approach: add a "Upload" button/feature above the schema editor:

2023-05-23_09-26

When clicked this would allow the user to select a file from the file system and upload it. When it's uploaded, it the "Schema Editor" contents would be replaced with the contents from the file, and the "Render Changes" action would be immediately triggered.

Note that the Upload button should be "sticky"... once a file is uploaded one, the user should have two options:

Thoughts @samuelmale @denniskigen @ibacher @mseaton (this may not be the be-al end-all for form editing, but would be an improvement, as the built-in editor is already driving me a little bit crazy... )

mogoodrich commented 1 year ago

Comments from Ian: ibacherIan Bacher added a comment - 5 minutes ago - edited A one-click option to reupload that file (for the use case when the user makes changes to the file in their IDE and wants to quickly re-upload it)

This might be a hard requirement to meet. In general, file inputs in HTML don't give full paths on the user's computer nor can we somehow compel the browser to re-read that file. However, I think if you've uploaded a file already, most browsers will store the path, so it could probably be done with two-clicks (one to open the File dialog, one to accept the default choice).

I'm happy to have an upload button. I think to be compatible with Carbon, it will probably go in the same row as the current buttons.

Edit

gracepotma commented 1 year ago

Can I ask a silly question: Why can't these folks just copy-paste?

mogoodrich commented 1 year ago

@gracepotma they can but for rapid developement that's really painful