OSC / bc_js_filepicker

A file picker for Batch Connect applications
MIT License
2 stars 6 forks source link

Filepicker demo files #176

Closed njpatter closed 1 year ago

njpatter commented 1 year ago

Could you post the files used to create the Demo gif? I've followed the steps in the Readme file, but am not able to get any of it to show up. Thanks!

johrstrom commented 1 year ago

So you've built and deployed it. I think at mimimum you need data-filepicker: true attached to the form.yml.

form:
  - input_file
attributes:
  input_file:
    label: 'Input File'
    data-filepicker: true

You can see this repo for how we use it at OSC.

https://github.com/OSC/bc_osc_codeserver

specifically here

https://github.com/OSC/bc_osc_codeserver/blob/0f4b5b1ccc29991319053dd451598eff0e465fec/form.yml.erb#L29-L34

njpatter commented 1 year ago

Thanks for the fast response. I am using the pre-built latest version of form.js.

I was structuring my form.yml file incorrectly, however, when I use a slightly modified version of the minimum you suggested:

description: |
  This is a test, only a test
form:  
  - input_file
attributes: 
  input_file:
    label: "File Picker Directory"
    data-filepicker: true 

The text input box now shows up, but there's no button underneath to launch the file explorer.

I'm sure it's user error, so thanks for the help.

njpatter commented 1 year ago

Yep, definitely user error. My memory isn't as solid as I had hoped, I was using a different version of OOD than what I thought.

Works now, thanks again!

johrstrom commented 1 year ago

Glad to hear it worked out!