Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC]: Adapt scaffold to support new Byte format instead of [object object] rendering #10288

Open
1 task
matbgn opened this issue Mar 24, 2024 · 2 comments
Open
1 task
Labels
bug/needs-info More information is needed for reproduction topic/cli topic/forms

Comments

@matbgn
Copy link

matbgn commented Mar 24, 2024

Summary

Take into consideration that Bytes are now supported and should be treated accordingly on Form generated by scaffold like on the screenshot below:

image

The aim is that yarn rw g scaffold <...> will deal with a really basic mechanic of downloading and uploading bytes files instead of [object object] rendering.

Motivation

Based on feedback from @dthyresson I submit this RFC

https://community.redwoodjs.com/t/redwood-v7-0-0-upgrade-guide/5713/6

Detailed proposal

Basically, I would propose to adapt the scaffold CLI to use FileField instead of TextField within the CRUD Form for the uploading part.

For the rendering part, I would just say that a direct download is totally acceptable for a first step or maybe display it’s Base64/Raw equivalent like the dbStudio does.

Are you interested in working on this?

  • I'm interested in working on this
@dthyresson
Copy link
Contributor

Hi @matbgn and thanks for the RFC.

Have you tried to eject the scaffold generators via https://redwoodjs.com/docs/cli-commands#generate-scaffold to see if the template can simply be changed? Or might a new mapping for type and input component be needed here:

If so, could you provide either some sample markup or a sample small app to reproduce and check that the form submits properly.

Question: on the view scaffolds, how should the Byte content be represented?

@dthyresson dthyresson added topic/forms bug/needs-info More information is needed for reproduction topic/cli labels Mar 25, 2024
@matbgn
Copy link
Author

matbgn commented Apr 20, 2024

I wasn't able to eject it properly, possibly due to misuse. Anyway, I suggest just downloading the byte and not trying to display it. This means that the contents of the byte must be displayed with a download logo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction topic/cli topic/forms
Projects
None yet
Development

No branches or pull requests

2 participants