-
Notifications
You must be signed in to change notification settings - Fork 194
Fancy image uploads #44
Comments
@wanderingstan I'll take a stab at this. |
@wanderingstan Are Aure's designs publicly available, so I can get a better idea of how these flows work together? |
@nikkwong doesn't look like they are, and I can't publish them. FWIW, the link is here: BUT, I can just upload the image: The idea is that this would be a step in between entering the details and just before preview. For how it would work, I think we can just propegate the jsonschema-form to the next component, and hide everything. (Or store the form data in state, and add images to it there.) Not totally sure. |
@nikkwong Oh crap, just realized that image was already in this issue. I'll get Aure's entire flow to post here. |
@wanderingstan got it. Yeah, it starts getting a wee-bit hacky because you don't want to remove the I think we should do a small bit of refactoring to make the ListingCreate component more robust and able to handle potential future extensions. First, I think we should remove the submit handler from the continue button here:
Instead, we should have a handler which can read from the state and decide where to go next based on the state, so, ex:
This would thereby enable us to in the future add more field types not supported by jsonschema-form if need be. The A couple things to note, though:
If you guys like this proposal, I'll go ahead and implement! |
Thanks Nikk! Again, sorry for the delay--this came in midst of a ton of pull requests and just as the website repo was needed a ton of attention. Feel free to ping me on slack too.
I feel a
Yes, this seems exactly the way to do it!
The schema json needs to best represent the data being stored, and shouldn't bend to UI considerations. My early thought on this was to use css to hide the image field on EDIT: I think we might actually be saying the same thing -- leave the schema json alone, but hide the
I'll also get you access to the full Zeplin graphic of Aure's flow design. |
@nikkwong thanks for the thorough research / game plan on this one. Are you still planning to implement it? |
This should handle adding AND removing one image at a time in both the listing creation form and the messaging form. |
This should also handle re-ordering the images, probably via drag-and-drop or something. The natural ordering (without incremental additions) is determined by the current sort setting of the native file select dialog, which may or may not be "by name". |
This is mostly resolved by #731, but we would need to pull images out into its own step to make it work like Aure's designs. I'm thinking we should close this ticket and create a new one if/when we decide to do that... |
Aure's design calls for images to be uploaded via a slick UI with thumbnails:
We're using react-json-schema-form, which does only old-school style file uploads. (Click a button to open native OS file selector.)
So there are multiple ways to go:
listing-create.js
. (One idea would be to use the same react-json-schema-form, but hide the image part when entering details, and hide everything BUT the image step when uploading photos.)FileReader()
to do the upload, and inject the results into the react-json-schema-form. (Docs)The text was updated successfully, but these errors were encountered: