avo
avo copied to clipboard
feature: added a preview when editing/creating images, video or audio
Description
It adds a preview when adding an image/video/audio to a "file" field.
Note: a preview already exists when the record is created, but does not automatically update when you select another file. While my code works, I don't think it's the cleanest.
Some logic is duplicated between edit_component.html.erb (file field) and grid_item_component.html.erb. grid_item_component references file_field_controller and I don't know if it's a bad practice. I also cannot think of a better way to do this as I don't use stimulus in my projects
Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
Screenshots & recording
https://github.com/avo-hq/avo/assets/377682/f6d3cc4c-cfac-4595-b4a8-d967b52f122f
Code Climate has analyzed commit fcc4c0a5 and detected 0 issues on this pull request.
View more on Code Climate.
@maxencehenneron are you able to move this past the finish line?
@maxencehenneron are you able to move this past the finish line?
Sorry I don't have much time to complete this, I don't see any simple way to achieve this without significant refactoring as we do not have a file yet when first creating the object
This PR has been marked as stale because there was no activity for the past 15 days.
Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️