patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

FileUpload - Expose Dropzone Error Types

Open andrewballantyne opened this issue 1 year ago • 4 comments

Is this a new component or an extension of an existing one? Existing component: FileUpload

Describe the feature Hey! Is there anyway to get access to Dropzone’s ErrorCode enum in TypeScript for when it rejects a drag and drop and you want to look for a specific error?

Eg. Using the FileUpload Component & providing this prop:

dropzoneProps={{
  onDropRejected: (rejections) => {
    const error = rejections[0].errors[0];
    if (error.code === ErrorCode.FileTooLarge) {
...

Are there visuals for this feature? If applicable, please include examples for each state and for varying widths N/A

Any other information?

Exposing internals of dropzone but making it difficult to write app layers against it feels like a bug more than a feature request -- but I figured this is at min a valid feature request.

andrewballantyne avatar Jun 04 '24 14:06 andrewballantyne

@andrewballantyne when do you need this feature by?

tlabaj avatar Jun 04 '24 20:06 tlabaj

I've inspected the types and just copied the underlying value -- I'd like it before Dropzone changes their implementation / types obviously... but I guess that's up to you. The sooner you do it the sooner I can close my tech debt to convert over to the proper type 🙂

Please don't put it into the trash can by any means haha ... but I don't know the effort to expose such a type inside your world.

andrewballantyne avatar Jun 04 '24 20:06 andrewballantyne

This issue has been automatically marked as stale because it has not had recent activity.

github-actions[bot] avatar Aug 05 '24 11:08 github-actions[bot]

@tlabaj is this issue no longer a plan for PF? The issue is stale as of yesterday, is this a way to prune issues that don't have strict deadlines?

andrewballantyne avatar Aug 06 '24 17:08 andrewballantyne

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Oct 25 '24 11:10 github-actions[bot]

@andrewballantyne we will add this to our q4 milestone. Is this something you need in V5?

tlabaj avatar Oct 25 '24 17:10 tlabaj

Nope, v6 is fine.

andrewballantyne avatar Oct 25 '24 17:10 andrewballantyne