Uppy: Is there a way to add custom forms to Dashboard?

Created on 12 Feb 2018  路  4Comments  路  Source: transloadit/uppy

Hi, I really like Uppy and would like to use custom fields in the metadata editing UI in the Dashboard plugin.

For example, I want to add a maps field so that user can select a location.

  1. Is there a way to set a custom form with custom field types with the Dashboard?
  2. If that doesn't work, is there a way to override the edit button call for each image? That way, I can open my own form or a modal when the user wants to edit the meta data.

Thanks for the help.

Dashboard Improvement

Most helpful comment

There's no way to do this right now; there was a similar issue about checkboxes earlier: https://github.com/transloadit/uppy/issues/454

I think having some way of adding arbitrary elements as fields would be best, so we don't have to maintain all possible kinds of field types in Uppy itself. Not sure what a good API would be. Maybe extending the metaFields option with a render method?

uppy.use(Dashboard, {
  metaFields: [
    {
      id: 'location',
      name: 'Location',
      render() { return <Map /> })
    }
  ]
})

All 4 comments

There's no way to do this right now; there was a similar issue about checkboxes earlier: https://github.com/transloadit/uppy/issues/454

I think having some way of adding arbitrary elements as fields would be best, so we don't have to maintain all possible kinds of field types in Uppy itself. Not sure what a good API would be. Maybe extending the metaFields option with a render method?

uppy.use(Dashboard, {
  metaFields: [
    {
      id: 'location',
      name: 'Location',
      render() { return <Map /> })
    }
  ]
})

I think another way can be having the ability to bind a function to the image edit button. That way, we can show the form or even open a modal. And with the fileID passed from Uppy, it can set the meta for that file using existing Uppy API.

There鈥檚 also a request for meta validation by @milanpatel-parkstreet :

MetaData Field set validation as required or enter only numeric value etc.

My reply:

This is a good idea, but requires a bit complex solution, I鈥檓 afraid. We鈥檇 need to allow for custom validation functions for each field.

Right now we have requests for boolean options, selects, and even custom thing like map #617 #454. Still trying to think how this could all better work together.

Hey there, we really like the idea of allowing custom form fields in meta editing in the dashboard via jsx rendering. We've added this idea to our backlog and will hence close this issue until we get a chance to work on it (then we'll re-open). Of course, if someone in the community wants to offer a PR, we'd be very happy!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewhartstonge picture matthewhartstonge  路  3Comments

rrjanbiah picture rrjanbiah  路  3Comments

ameft picture ameft  路  4Comments

hikurangi picture hikurangi  路  4Comments

yaegor picture yaegor  路  3Comments