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

App: uploading a file without extension breaks interface #10475

Closed
3 tasks done
joselcvarela opened this issue Dec 13, 2021 · 2 comments · Fixed by #12692
Closed
3 tasks done

App: uploading a file without extension breaks interface #10475

joselcvarela opened this issue Dec 13, 2021 · 2 comments · Fixed by #12692
Labels

Comments

@joselcvarela
Copy link
Member

Preflight Checklist

Describe the Bug

After uploading a file without file extension the image interface does not appear properly.
Can't click on buttons, but I was able to override image by clicking on Clear Value.

image

Possible solutions:

  • API: Deny uploads without file extension (Nope, I believe)
  • API: Try to guess file extension using some technique like file magic numbers (could be helpful in some use cases)
  • App: Show some placeholder / warning (easier to implement)

To Reproduce

In my use case:

  1. Create an image field on some collection
  2. Upload an image without file extension using that interface

Errors Shown

No errors, just ugly and unusable UI.

What version of Directus are you using?

9.2.2 (73faf14)

What version of Node.js are you using?

v16.13.0

What database are you using?

What browser are you using?

Edge

What operating system are you using?

macOS

How are you deploying Directus?

Locally

@rijkvanzanten
Copy link
Member

rijkvanzanten commented Dec 13, 2021

App: Show some placeholder / warning (easier to implement)

I think this is the way to go. The same applies for any other image error that happens actually. We should add a on error handler to the element that's used to render the preview, and gracefully fallback to a placeholder.

@azrikahar
Copy link
Contributor

Just a note for reference: although #11898 is technically a different component (<file-preview> rather than <file-image> for this issue), perhaps we can reuse the placeholder design here once it gets finalized over there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants