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

Implement "FILE" type input – show all files in Review page file explorer #8220

Open
rikukissa opened this issue Dec 16, 2024 · 0 comments
Labels

Comments

@rikukissa
Copy link
Member

rikukissa commented Dec 16, 2024

Description

Let's try to keep the API as close to the HTML Native file input as we can but adapted to our TS environment

Image
const File = BaseField.extend({
  type: z.literal('FILE'),
  options: z
    .object({
      accept: z.array(z.string()).optional().default([]),
      maxSize: z.number().optional()
    })
    .default({})
    .optional()
}).describe('File upload')

The file input shall emit

{
  name: string;
  type: string; /* the MIME media type of the data */
  size: number; /* in bytes */
  uri: string; /* either http url or a base64 uri "data:image/png;base64..." */
}

At this point we don't have to yet worry at all about how the data gets ultimately stored in the database or if there's an initial phase where the file is sent to Minio – all of that will come in later tasks

Future ideas

The following component is a separate component from this but internally uses this same Input component
Image
It could also be that we create input types like "GROUP" that contains multiple inputs, select and file in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

1 participant