railsadminteam / rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data
MIT License
7.89k stars 2.25k forks source link

Show a thumbnail of all representable Active Storage files + images #3656

Closed wvengen closed 1 month ago

wvengen commented 10 months ago

Currently, only images have a preview when using Active Storage attachments. Preview of videos (and potentially other file formats) are supported, however, but one needs to use representable instead of only previewable. This PR switches to using representable.

Tested with movie previews and images on multiple upload.

Note that we still need to look at the image mime-type, to show e.g. SVG images (which are not representable, but can still be shown directly - great that there is an automated test for this).

See also:

wvengen commented 10 months ago

It's not clear to me why one test fails (jruby-9.3, rails_6.1, active_record, mysql2, sprockets) and all the others succeed. It doesn't look like it would be related to the changes in this PR (timeout errors). (after a rebase all tests succeeded)

coveralls commented 8 months ago

Coverage Status

coverage: 95.996% (+0.1%) from 95.9% when pulling 1246376d516f7758663c184f44b983983b050956 on wvengen:activestorage-representable into af7414a98aa87cfe90d79cb0ed64962fb34c58f4 on railsadminteam:master.

mshibuya commented 1 month ago

Tests are required, but I can handle that. Thank you.

wvengen commented 1 month ago

Thank you, also for the last bits!